epsolar-tracer icon indicating copy to clipboard operation
epsolar-tracer copied to clipboard

Kernel 4.9 (raspberry pi) hangs on client.read_device_info()

Open vrosca opened this issue 8 years ago • 4 comments

Haven't had time to dive deeper into the root cause - when trying to make a transaction on a Pi Zero W with kernel 4.9, the kernel immediately crashes. It doesn't even write a kernel panic to stdout or logs - hangs for a few seconds and then restarts. Has anyone else experienced this? With kernel 4.4 I had 100% CPU usage during the modbus transactions for the full 1+ second of delay between successive calls (tried setting timeout to a lower value, didn't help).

vrosca avatar Sep 08 '17 13:09 vrosca

Update 2: device is a Raspberry Pi Zero, problem occurs on both Arch an Raspbian (same kernel) when the dwc2 dtoverlay is enabled (for g_ether - gadget-mode USB). With dwc2/g_ether disabled, there are no issues

vrosca avatar Sep 10 '17 09:09 vrosca

Update 3: in case anyone else runs into this problem - if you comment out the modprobe -r / modprobe commands for usbserial the issue does not seem to occur at all, even when configured with the dwc2 overlay + g_ether. It seems however to then take a few seconds after the insmod before the first values can be read (attempting to read 5-10 seconds after the insmod results in a 'None' response for all registers)

vrosca avatar Sep 14 '17 22:09 vrosca

I found the interface flaky when I had a loose wire on any part of the system and time out needs to be about .2 serialclient = ModbusClient(method = 'rtu', port = '/dev/ttyXRUSB0', baudrate = 115200, timeout=0.2)

dmdelorme avatar Dec 23 '17 15:12 dmdelorme

Got this to work in 2021 after some headache. This will probably help someone else. I resolved this (pymodbus read_device_info, timeout errors) by downgrading pymodbus to 1.2.0.

hoangv avatar Mar 13 '21 23:03 hoangv

Current version is changed to use pymodbus 3.2

kasbert avatar Mar 20 '23 18:03 kasbert