kasbert / epsolar-tracer

Tools for EPsolar Tracer BN solar charge controller
Apache License 2.0
121 stars 76 forks source link

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

Closed vrosca closed 1 year ago

vrosca commented 7 years ago

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 commented 7 years ago

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 commented 6 years ago

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)

dmdelorme commented 6 years ago

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)

hoangv commented 3 years ago

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.

kasbert commented 1 year ago

Current version is changed to use pymodbus 3.2