I'm trying to implement Modbus reading on Jetson Nano (Linux - Ubuntu operation system).System include 3 part:
-MODBUS device which I would like to achieve input registers. --> Krohne Signal Converter-IFC050
-USB converter --> RS485 to USB(UART) reading. I can see the CH340 driver on Jetson Nano.
-Jetson Nano --> NVIDIA's development board. I'm using SSH connection to connect Jetson Nano.
I'm using pyModbus library on python which like:
from pymodbus.client.sync import ModbusSerialClient
client = ModbusSerialClient (
method = 'rtu' ,
port = 'dev/ttyUSB0',
baudrate = 9600 ,
timeout = 3 ,
parity = 'N',
stopbits = 1 ,
bytesize = 8 )
for address in range()
if client.connect():
res = client.read_input_registers(address = 30000 , count = 20 , unit = 1 )
if not res.isError():
print(res.Registers)
else:
print(res)
else:
print('Can not connect to the Modbus Slave/Server')
I'm sure about configuration which is 9600 baudrate , 8 byte , 1 stopbit , etc...
When I try to run the program it always return false which says 'Can not connect to the Modbus Slave/Server'.
What could be the problem about this matter? I can see CH340 driver(USB converter driver) on Jetson Nano as ttyUSB0.