logo elektroda
logo elektroda
X
logo elektroda

TCP-IP / RS485 ESP8266 converter

dktr 


Simple TCPIP / RS485 converter.
The device allows you to create a remote port rs232 / rs485 in linux and windows systems and allows communication with devices via lan / internet. The project is based on UARTtransparentbridge code, but MAX485 support has been added to it. ESP8266 programmed in ArduinoIDE, source code and "schematic" attached.
On linux, after booting the device, just use 'socat':
Code: Text
Log in, to see the code

When this command is issued, a virtual UART will be created in / dev / espS0.

Tested on the ORNO OR-WE-504 indicator.


About Author
dktr
dktr wrote 858 posts with rating 632 , helped 42 times. Live in city Ostróda. Been with us since 2003 year.

Comments

george2002 25 Nov 2017 04:10

Is it something like esp-link? https://hackaday.io/page/1304-virtual-serial-port-tunnel-to-use-with-esp-link because esp-link has a lot of options, only the RS485 support is probably not implemented... [Read more]

dktr 25 Nov 2017 11:02

Yes, it will be the same as ESPlink, in 1200,2400,9600 it works fine but requires changes in the code - serial.begin () I have nothing else with rs485 except this orno indicator, I polled the counter all... [Read more]

jajen 26 Nov 2017 21:28

Does this converter work at 3.3v with esp? It shouldn't because they're at 5v. [Read more]

levy^ 26 Nov 2017 22:15

it should work, but at much shorter distances [Read more]

george2002 26 Nov 2017 23:06

It is enough to replace it with the MAX3485 and everything in accordance with the art and ranges ;) [Read more]

ditomek 27 Nov 2017 08:41

On what basis do you calculate the time needed to control the RE / DE signal? Doesn't cut anything with longer thongs? [Read more]

byrrt 27 Nov 2017 08:57

Not supporting RS485 (DE signal) is not a problem: https://obrazki.elektroda.pl/5164797400_1511769306_thumb.jpg Proven - works, also in many production devices. Added after 1 [minutes]: ... [Read more]

ditomek 27 Nov 2017 11:21

on the first post, re_de is controlled from the ESP pin, so the diagram you pasted later does not make sense. By the way, I use a similar one myself in my projects. I am asking this because in arduino... [Read more]

piterek-23 27 Nov 2017 21:32

And how to select elements when UART works at the 3V3 level? MAX485 to MAX3485, what about the rest? [Read more]

byrrt 28 Nov 2017 13:06

what about the rest? stays the same ... [Read more]

piterek-23 28 Nov 2017 13:24

I meant the transistor and resistors because the entire power supply will change from 5V to 3V3. If nothing needs to be changed that's great, but I preferred to ask. Thanks, I'll be testing soon... [Read more]

uzi18 17 Jan 2018 19:14

There is an esp-link latka with rs485 support, you have to look at repo / issue [Read more]

piterek-23 10 Feb 2018 23:07

Gentlemen, everything works great, but ... but there is a small problem ... If, for example, I reset the router, ESP loses the connection and can not reconnect - just do ESP reset and everything is OK... [Read more]

uzi18 11 Feb 2018 02:02

Are you talking about the software from 1 post? [Read more]

piterek-23 11 Feb 2018 05:10

Yes. [Read more]

dktr 12 Feb 2018 21:00

I made a fix, after breaking the wifi connection, the program waits for reconnection and resumes work. [Read more]

jajen 15 Feb 2018 12:06

Hello, I also use this converter. I get an error compiling this new version es-rs485: 19: error:'earchwifi 'was not declared in this scope How can I fix it? [Read more]

dktr 15 Feb 2018 20:04

I think I broke something and I didn't attach this file, but the one from this attachment compiles without error. Another thing is that ESP itself will reconnect to the network and will work, but... [Read more]

jajen 15 Feb 2018 20:37

Already ok. New version of arduin ide helped. Thanks [Read more]