The use of the ESP8266 in the world of IoT

User avatar
By CheapB
#1378 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!
User avatar
By rudi
#1430
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
;-)
User avatar
By CheapB
#1439 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?
User avatar
By villTech
#1454 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.