3cky / mbusd

Open-source Modbus TCP to Modbus RTU (RS-232/485) gateway.
BSD 3-Clause "New" or "Revised" License
575 stars 219 forks source link

Tty response timing out #72

Closed b0czek closed 3 years ago

b0czek commented 3 years ago

Hello. I wanted to use your gateway with a motor driver on raspberry pi, but I have encountered a problem, that the tty response always times out which would suggest that the driver does not even respond to requests. When I try to connect with it via RCU on Windows machine it works flawlessly. I use the same transmission parameters as on the Windows machine and I tried to tinker with timeout and wait times but it didn't help either. The one thing that caught my attention was 'Station No.' which is, i suppose, slave selection and it was set to 1. I don't really know much about RS-485 and I haven't really looked into the code but I wonder if this might be a problem. I've attached logs of the program where i try to connect. mbusd.log

3cky commented 3 years ago

Looks like your TCP master sends requests to the RTU device with Slave ID set to FF:

01 Mar 2021 11:03:30 conn[192.168.1.53]: request: [ff][03][03][00][00][01]

Make sure your RTU slave has the same Unit/Slave ID. If not, change its value either on master or slave device.

b0czek commented 3 years ago

Thank you for responding, I don't have the hardware at hand anymore unfortunately, so I can't verify that but it seems that it is the case. Thank you for help.

hACKrus commented 1 year ago

Hello. I have similar problem. Slave ID is 31. Program tries to connect but gives timeout error. mbus.conf have only changed setting to 8n2.

docker run -ti -v /dev/ttyRS485-1:/dev/serial --p rivileged -v /etc/mbusd.conf:/opt/mbusd.conf -p 1502:502 --name=mbusd quenorha/mbusd -v9

mbusd.txt