ModBus RS485 communication not working

Hi, I’ve been trying to connect the Jetson Nano to a modbus motor driver and I can’t figure it out why the communication between them it’s not working. I am using the latest JetPack SDK and pymodbus python library (I’ve also tried with minimalmodbus, serial and modbus library for C++).
I can see a new device under /dev/tttyUSB0 each time I plug the USB in and the CH341 driver is present - I checked the logs with dmesg.
The code that I am running is working perfectly fine on both Raspberry Pi 4 and Windows. I tried everything - changing the kernel, trying to use TX/RX instead of USB and nothing.
Can you please give some suggestions or some other things I can try?

  1. Is your USB-RS485 guaranteed to work? Is it tested on a PC? Try a different one, preferrably one with a genuine(!) FTDI chip (FT232RL is often a fake, newer ones like FT232H or FT230X are not known to have clones). Personally I just trust these WCH chips not as much as I trust genuine FTDI chips.
    The USB-RS485 chip also needs to be configured for RS485 operation. Each chip manifacturer has got configuration utilities that can activate the proper signals (TXEN as Driver Enable,…).

  2. Use a logic analyzer to record the activity on the TX, RX, and DE signals on the RS485 transceiver. The transceiver is usually an SO08 package with TX=DI pin 4, RO=RX pin 1, DE(Driver Enable) pin 3, GND pin 5. If you don’t have a logic analyzer then just buy one. There are lots of offers on Amazon and Ebay for 24 MHz/8 CH Saleae clones for 10…20$ that will do the job just fine. This method shows you what really happens on the line, and this is the only method for you to verify timings. A digital oscilloscope would also be fine if you have one, but its much more expensive it you don’t have one at hand. With an ooscilloscope you also could monitor the RS485 pair directly, which is not possibly with these cheap logic analyzers unless you put a RS485 transceiver chip in front of the logic analyzer.

  3. Is the bus terminated properly? Do you have failsafe resistors installed? Is the bus line a twisted pair?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.