-->
Page 1 of 2

UDP to Serial bridge

PostPosted: Tue Oct 07, 2014 11:15 am
by CheapB
I need to build an UDP to serial bridge without any need for an external MCU or other hardware. The UDP server is listening for a message on a specific port and when it receives it, it will pass it on to the serial port.

Anyone who has a sample source code that i can use as a basis/inspiration?

Thanks!

Re: UDP to Serial bridge

PostPosted: Wed Oct 08, 2014 12:51 pm
by rudi
CheapB wrote:I need to build an UDP to serial bridge without any need for an external MCU or other hardware. The UDP server is listening for a message on a specific port and when it receives it, it will pass it on to the serial port.

Anyone who has a sample source code that i can use as a basis/inspiration?

Thanks!


hi,

the SoC is the UDP Server and will listen to a Port and will forward / pass to the serial port UART?
start AT Firmware
start a multi line
AT+CIPMUX=1
set your server to listen example port 20000
AT+CIPSERVER=1,20000
set TimeOut at the Server Connect
AT+CIPSTO=IN SEC example AT+CIPSTO=120
Return to single line
AT+CIPMUX=0
connect your "UDP Client" to the IP + Port
send data to this
receive it at UART
did you mean this?
or other?
if you want a microcontroller at UART
so you must program like the same shema.
the mikrocontroller send's AT Command
if you want a standalone like this

viewtopic.php?f=12&t=307

so you must create custom firmware.
is this what you want?
so let me know - how you will get on in this
best wishes
rudi
;-)

Re: UDP to Serial bridge

PostPosted: Wed Oct 08, 2014 4:13 pm
by CheapB
Rudi,
Thanks for the the detailed response. If i understand you correctly this setup would delay anything that is received by the UPD server to the serial port?

I followed your example in your response and I cant seem to have the UDP message relayed to the serial port.

This i what I have for testing:
ESP8266 setup as a UDP server on 10.0.1.58 port 40002
ESP8266 is connected to my serial port on my PC to 1) configure the server (putty) and 2) monitor if the UDP message in fact is relayed to the serial port (device monitoring Studio)

AT+RST
AT+CWJAP="my ssid","my password"
AT+CIFSR (confirming the correct IP address)
AT+CIPMUX=1
AT+CIPSERVER=1,40002
AT+CIPSTO=120
AT+CIPMUX=0

I am using UDP test tool to send an UDP message to 10.0.1.58:40002, but noting is happening on the serial side.

Does this not work with UDP or what am i missing here?

Re: UDP to Serial bridge

PostPosted: Thu Oct 09, 2014 12:04 am
by villTech
i checked with my esp8266 server, it was able to receive udp data. i also test it with udp test tool for ipad.
what i did not use in my AT commands is the AT+CIPMUX=0.