gavinying / modpoll

A New Command-line Tool for Modbus and MQTT
https://gavinying.github.io/modpoll
MIT License
84 stars 17 forks source link

Consider update dependency of `pymodbus` to v3.5.2 #22

Closed cfreire closed 1 year ago

cfreire commented 1 year ago

Hello Shaodong, I'm using modpoll for some time on a 24x7 server and have an issue, that after about 3 days of continues readings and if the modbus PLC fails communication for more than about 10 times the async pymodbus v3.4.1 call crash and aborts the task, because it does not re-raise the exception.

log example

2023-09-06 23:03:40,083 WARNING  iomodbus.modbus_poll           Reading device: ETAR                 func_code:03 start_address:001901 size:004 ... FAILED
2023-09-06 23:03:40,087 INFO     iomodbus.modbus_poll           Reading device: AZOTO                func_code:03 start_address:000001 size:016 ... SUCCESS
2023-09-06 23:03:43,023 INFO     iomodbus.modbus_poll           Reading device: QE2.2-VALUES         func_code:03 start_address:050514 size:060 ... SUCCESS
(...)
2023-09-06 23:03:45,846 INFO     iomodbus.modbus_poll           Reading device: QE2.2-
2023-09-06 23:04:12,857 ERROR    iomodbus.modbus_poll           CanceledError on task modpoll
2023-09-06 23:04:12,858 CRITICAL iomodbus.modbus_poll           Aborting iomodbus!

The problem was solved using pymodbus v3.5.0 https://github.com/pymodbus-dev/pymodbus/blob/dev/CHANGELOG.rst

There are some minor fixes in modpoll with (Endian.LITTLE, Endian.BIG)

Best regards,

gavinying commented 1 year ago

Hi @cfreire , happy to know that modpoll is actually used in your projects, thanks for sharing! Just updated pymodbus dependency to v3.5.2, feel free to try the latest version.

Shaodong