UDP CONNECTION

Alberto
Posts: 13
Joined: Wed Sep 02, 2015 12:30 am

UDP CONNECTION

Postby Alberto » Tue Apr 10, 2018 7:25 pm

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

Who is online

Users browsing this forum: No registered users and 141 guests