goburrow / modbus

Fault-tolerant implementation of modbus protocol in Go (golang)
BSD 3-Clause "New" or "Revised" License
936 stars 366 forks source link

Serial Timeout after certain request fails #56

Open JoyG42 opened 4 years ago

JoyG42 commented 4 years ago

When I use got timeout very frequent but didn't have any issue with modbuspoll

Please correct me if I'm doing any mistake, FOR MODBUSPOLL: /data/modpoll/modpoll/linux_arm-eabihf/modpoll -b 115200 -p none -m rtu -a 1 -r 618 -c 13 -t 3 -o 0.1 -l 200 /dev/ttyUSB_HRT

FOR GOBURROW=> MODBUS_RTU handler1 := modbus.NewRTUClientHandler("/dev/ttyUSB_HRT") handler1.BaudRate = 115200 handler1.DataBits = 8 handler1.Parity = "N" handler1.StopBits = 1 handler1.SlaveId = 1 handler1.Timeout = 100 * time.Millisecond

Result While Status Reading Register 334 :=== [0 0 0 0] Result While Status Reading Register 335 :=== [0 0 0 0] Result While Status Reading Register 336 :=== [0 0 0 0] Result While Status Reading Register 337 :=== [0 0 0 0] Result While Status Reading Register 338 :=== [0 0 0 0] Result While Status Reading Register 339 :=== [0 0 0 0] Result While Status Reading Register 340 :=== [0 0 0 0] Result While Status Reading Register 341 :=== [0 0 0 0] Result While Status Reading Register 342 :=== [0 0 0 0] Result While Status Reading Register 343 :=== [0 0 0 0] Result While Status Reading Register 344 :=== [0 0 0 0] Error While Status Reading Register 345 :== serial: timeout Error While Status Reading Register 346 :== serial: timeout Error While Status Reading Register 347 :== modbus: exception '2' (illegal data address), function '6'

nimahkh commented 3 years ago

Same here

ermisp commented 3 years ago

hello, can you post your "sudo dmesg" so we can see if the kernel has any weird behaviour related to this?