Hi all, I am trying to connect to a device using UDP socket. I successfully send packet to the device, but I am not able to get the device answer. (The device send the answer packet correctly, since I checked this using a UDP terminal tool)
Code: ( using AT firmware ver. 1.4.0. - SDK Ver. 2.1.0)
AT+CIPSTART=4,"UDP","192.168.1.1","51000,CR,LF
AT+CIPSEND=4,"12",CR,LF
"RAP15000Z11" + LF
Delay waiting for device unswer (10 seconds)
AT+CIPCLOSE=4,CR,LF
Answer:
SEND OK
AT+CIPCLOSE=4AT+CIPSTART=4,"UDP","192.168.1.1","51000,CR,LF
4,CLOSED
Where the answer packet should be: ("RA151[s11=+21.5]+[s12=+20.2]+[s13=+20.3]45")
Can somebody tell me how to open an UDP server? Or what have I to do to get the UDP answer?
Thank you for the help
Alberto
Edited.
Ok found where I have mistaken! The AT command (AT+CIPSTART=4,"UDP","192.168.1.1","51000,CR,LF) should be written this way (AT+CIPSTART=4,"UDP","192.168.1.1",51000,51000,0,CR,LF)
With this correction implemented in my code, I do receive the device packet as an answer to my querry.
Good to know! (Also for other user)
Alberto
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.