-->
Page 1 of 1

Request for UDP-protocol

PostPosted: Fri Jan 29, 2016 9:59 am
by luc VdV
I don't know if it is possible to implement the sending and receiving packets with UDP-protocol instead of TCPIP.
With the AT-commands, this can be done very easy.
It creates a complete different way to communicate with the module, not depending on the compatibility of the web-browsers anymore but giving the user the freedom to decide exactly what data to send and/or receive.
Again, just asking....
I am gratefull for your efforts so far, as the interpreter is a handy tool for small projects.

Re: Request for UDP-protocol

PostPosted: Fri Jan 29, 2016 3:31 pm
by AcmeUK
Try this http://www.esp8266.com/viewtopic.php?f=29&t=2451

For a simple Python Listener I used this code :-
Code: Select allimport socket
import time

UDP_IP = "IP of your listener"
UDP_PORT = 5005

sock = socket.socket(socket.AF_INET, # Internet
                     socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))

while True:
    data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes
    print "received message:", data
time.sleep(5)