Ethernet RS232 / 485

For general Flowcode discussion that does not belong in the other sections.
RGV250
Posts: 264
http://meble-kuchenne.info.pl
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Ethernet RS232 / 485

Post by RGV250 »

Hi,
I am not sure if this should be here or in Feature request.
I have a couple of Lantronix UDS2100, it says "Universal Device Server" but I think they are just Ethernet to RS232 or 485 converters. Also a Lantronix XPress DR which I think is similar but only one port. Looking through the user manuals they may be way more than I need so could end getting one of these which might be simpler.
https://thepihut.com/products/2-channel ... gIsFvD_BwE

Anyway, the question I have, is there a component and if so where is it / what is it called.

Regards,
Bob

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Ethernet RS232 / 485

Post by chipfryer27 »

Hi Bob

That looks like a nice little gadget.

I've not really had a chance to search for datasheets but from the description on Pi-Hut it seems quite straight forward in that the front end is done automatically and provides two independent transparent TTL channels. It may even work straight out of the box if connected to your router and chip UART. Caveat...... I have only read the description, not the datasheet :)

May I ask what the goal is? What exactly is it you want it to do?

Regards

EDIT
Still under above caveat, it looks as though it is just a module that provides the physical interface, in this case LAN. You could probably think on it like an ESP866 in that both give your target chip internet access via a router. Any web serving or such like would most likely still need to be done on your target chip. Of course I could be very wrong :)

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Ethernet RS232 / 485

Post by RGV250 »

Hi,
I am trying to monitor temperature and humidity (mainly in the cellar) but also around the house. I have several of these sensors
https://www.ebay.co.uk/itm/252785547313 ... gJx_fD_BwE
I have a wired network around the house so rather than run another Modbus cable everywhere I can have local Ethernet modules gathering the data.
I did have an ESP32 working with one device but also needed a MAX485 converter where I should not need that as it is built in with these.

Bob

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Ethernet RS232 / 485

Post by chipfryer27 »

Hi

Makes sense to use existing cable where possible.

Only using my phone just now so I can't really follow links too well, but perhaps it means that it's using modbus as the protocol, run over extended distances using 485? Just a guess as I can't access much in the way of datasheets.

Guessing you don't need two microcontrollers (or whatever) connected so it's just acting as a 485 interface? If so you could probably get a TTL UART to 485 interface for about a pound from the usual market places. Using the Modbus component it will use the chip UART/232 to communicate with the 485 adapter and then to your sensor.

Sorry if I'm completely off track.

Regards

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Ethernet RS232 / 485

Post by RGV250 »

Hi,
I used the TTL/485 converter with the ESP32, the idea is there are 4 floors. The Pi which will have the FC program is on the bottom so I would have 3 of the ethernet RS485 units on the floors.

Bob

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Ethernet RS232 / 485

Post by chipfryer27 »

Hi Bob

I think we are on the same page.

A sensor on each floor talking to your RPi (guessed it would be one of them :) ) could be done by either assigning one of the many UART ports on your RPi to each sensor (via 485 adapter), or creating a multipoint bus on a single port (again via adapter). You will be best placed to decide which option is best for you.

Not sure I see the need for your 2-to-1 TTL adapter though as I see it's strength as allowing two microcontrollers to access the same LAN.

Regards

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Ethernet RS232 / 485

Post by RGV250 »

Hi,
The 2-1 adaptor would not need 2 microcontrollers, it would just allow 2 RS485 circuits. If placed at the correct place 1 device can cover 2 floors with much simpler wiring.
I may not have any option as I have hit a snag with the single channel ones, the Ethernet port is corroded so i thought I could replace it but it is a MagJack and seems to have non standard connections:-(
Also I have them so they are free where I would have to buy the Pi Hut ones.

Bob

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Ethernet RS232 / 485

Post by chipfryer27 »

Hi

Gotcha. I see what your doing now.

When configured each UART port will have an associated IP address so could you not use the existing FC components to connect etc?

Regards

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Ethernet RS232 / 485

Post by RGV250 »

Hi,
That is what I am wondering, I looked at all the comms components but couldn't see a TCP/IP / serial.

Bob

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Ethernet RS232 / 485

Post by chipfryer27 »

Hi Bob

I can't try / test at present but I think you could just use the RPi TCP/IP component.

Initialise
Open a socket
Connect to address/port (this would be the assigned IP of each TTL port on your gadget)
Send / Receive

I might have forgotten a step or so but I think that's roughly how to do it. You can test by getting the RPi TCP/IP component to connect to anything. If you have one of the adapters, then configure each port and put on your LAN. You can simulate FC to attempt a connection to each address in turn.

Regards

Post Reply