MODBUS with MAX-485 TTL to RS-485 converter module

Hi,

I’m can’t find how to start use MAX-485 TTL to RS-485 converter module

TTL_RS485

with Raspberry and HA use python script or exist other way?

p.s. find one link about this
https://circuitdigest.com/microcontroller-projects/rs485-serial-communication-between-arduino-and-raspberry-pi

If you are trying to interface with an arduino, the usual way to do that with home assistant is https://www.home-assistant.io/integrations/arduino/

Otherwise, it is just a serial port and https://www.home-assistant.io/integrations/serial/

I’m want connect interface to Raspberry GPIO and question is how to setup this serial port, because see some solutions with USB ir TCP/IP Modbus

Well perhaps you missed this

Instructions for setting the device as a serial port, you already posted.

I’m think see this bus any information howto connect serial port to RASBI GPIO and how to setup PINS

Perhaps https://elinux.org/RPi_Serial_Connection#Connections_and_signal_levels (although it is very hard to understand what you are actually seeking)

I’m think hard understand when not have expirance :frowning:
how to do this in Home Assistant

Hi,

I am looking for the same solution and as per my finding the issue is that Modbus integration in HA is focused on serial communication. RS485 uses RE (Receive enable) and DE (Data enable) pins which are not covered in serial implementation in HA.

So the solution would be to implement a Full duplex communication like was suggested above.
In this way you would need 4 TTL-RS485 adapters. Two of them in the master (HA) with Raspberry TX pin connected to DI (data input) for the first converter, and RX pin to RO (Receive output) of th second converter. Also the same in every slave.

I am testing it right now so I cannot confirm it works.

What I know is that ArduinoModbus library covers this scenario and enable/disable the pins RE/DE while sending/receving because it is designed for RS485.

HA Modbus integration is designed for serial TTL not for RS485.

See here: https://proyectoarduino.com/comunicaciones-con-rs485/
Regards.

1 Like

By the way, I believe that if you use the USB-RS485 adapter it will work with HA Modbus integration because you don’t need to enable/disable the RE/DE bits.