UDP header

stokersoft
Posts: 7
Joined: Thu Jun 23, 2016 5:12 pm

UDP header

Postby stokersoft » Thu Jun 23, 2016 5:19 pm

Hi,

I am new to this forum, i hope this is the right place to ask this question.

We use the ESP8266 on a controller board, and control it with AT commands over the uart.

It works as a server on a single UDP port and requests are send to the controller board from Android apps, we can have several apps communicating simultaneously. This works perfectly, and we are very satisfied.

However we have one problem, it seems we cannot fix. Right now each client/app appends its ipaddress and port to the request, we need to do that to be able to tell where to respond. However, if the device is behind a NAT router, this will not work. If we could see the udp header, and thus the ip address and port number for each request, then we could respond back to the correct ip address/port, and NAT will work.

So my question is basically, how do i, with AT commands, get the UDP header of an incoming request to determine the ip address and port to respond back to? I know that if i have only one device communicating, then it will automatically set the ip address and port, but with simultaneous devices communication, we cannot rely on that.

Thank you in advance. If its not possible, what is our next step? Should we build a custom firmware etc?

Regards Jens

Her Mary
Posts: 453
Joined: Mon Oct 27, 2014 11:09 am

Re: UDP header

Postby Her Mary » Mon Jul 11, 2016 10:21 am

Hi,
Command “AT+CIPSTATUS” can get the information of remote IP and port.
Command "AT+CIPSEND=[<link ID>,]<length>[,<remote IP>,<remote port>]" can send UDP data to the target remote IP and port.

stokersoft
Posts: 7
Joined: Thu Jun 23, 2016 5:12 pm

Re: UDP header

Postby stokersoft » Mon Aug 15, 2016 8:19 pm

Thank you so much - but also this command
AT+CIPDINFO=1

Enables the IP and port for each incomming packet, just what we need.

Thanks.

Who is online

Users browsing this forum: No registered users and 3 guests