Modbus communication between Raspberry Pi and ESP32 over RS485/UART

Job ID: 34105490

Budget: $25 – $50 AUD

We have a Raspberry Pi Modbus client (Raspberry Pi OS Lite (released on 2022-04-04)) that needs to communicate with 30 ESP32 Modbus servers over RS485/UART.

On the Raspberry Pi we are using the Node.js library "modbus-serial" (with some modifications to test software flow control).
We have also tested the communication with "modbus_tk" in Python and are getting the same behaviour.

The current status is:
- Hardware flow control does not seem to work on the Raspberry Pi.
- Using a USB-UART adapter, the communication is working in both directions (only tested with a single ESP32).
- Using RS485, we got the Raspberry Pi sending when controlling the RTS pin from the library. The ESP32 is responding as expected. We managed to measure a response on the Raspberry Pi pin, but the Modbus libraries (Node.js as well as Python) are not receiving any data.

We need to get communication working in both directions asap, ideally with hardware flow control and alternatively with software flow control (preferably Node.js, optionally Python).
Related categories: Python Linux Node.js Raspberry Pi