-->
Page 1 of 1

Using ESP8266 as gateway to RS232 data collection system?

PostPosted: Mon Apr 03, 2017 12:47 pm
by BobAGI
I am a complete newbie with ESP8266, but by what I have seen it should be able to help me get rid of the cables to my data collection system...

I need to make the ESP8266 do the following:
- Run as a softAP unit with WPA authentication for connections (SSID & Passphrase)
- Listen to TCP port #2001 for connection (only one client allowed at a time)
- When data arrves on port #2001 send all bytes out through the physical serial port
- When data arrives from the physical serial port send all bytes out on the TCP port #2001
- It must NOT try to interpret any data in the communications, everything must be transferred as is!

The RS232 line operates at 38400 baud.

How can this be done?
Is it already done by someone who can share the needed code?
Maybe there are links to some on-line description?

Re: Using ESP8266 as gateway to RS232 data collection system

PostPosted: Tue Apr 04, 2017 2:14 pm
by daniel_ezsbc
By accident I found this code earlier today. https://github.com/jeelabs/esp-link
It is what you want or close to it.

Re: Using ESP8266 as gateway to RS232 data collection system

PostPosted: Tue Apr 04, 2017 5:50 pm
by gbafamily1
If you want to write your own code, the following is a simple UART to TCP socket example. The program uses the name Telnet but I see no indication it implements the Telnet protocol. It just uses a TCP socket as-is. Which is, I think, what you want.

https://github.com/esp8266/Arduino/blob ... Serial.ino