meltaxa / solariot

Leverage your IoT enabled Solar PV Inverter to stream your solar energy usage data to a real time dashboard.
https://solariot.live
MIT License
207 stars 70 forks source link

python 3.9.2 issues? #55

Closed shannondpasto closed 2 years ago

shannondpasto commented 3 years ago

Hi.

I recently setup a new debian 11 server and I've been having issues with running this. On my old server (pi4/python 3.7.2) it executes successfully first time, every time. Running the same version (and even a new clone of the repor) on debian 11 it takes 1 or 2 scrapes before it successfully runs. I get the following error...

WARNING:root:Modbus connection failed WARNING:root:Failed to scrape inverter, sleeping until next scan ERROR:pymodbus.factory:Unable to decode response Modbus Error: Unknown response 0 ERROR:pymodbus.transaction:Modbus Error: [Input/Output] Unable to decode request Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/pymodbus/transaction.py", line 190, in execute self.client.framer.processIncomingPacket(response, File "/usr/local/lib/python3.9/dist-packages/pymodbus/framer/socket_framer.py", line 165, in processIncomingPacket self._process(callback, error=True) File "/usr/local/lib/python3.9/dist-packages/pymodbus/framer/socket_framer.py", line 175, in _process raise ModbusIOException("Unable to decode request") pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request WARNING:root:Modbus connection failed WARNING:root:Failed to scrape inverter, sleeping until next scan

The pi does have pymodbus 2.5.1 installed. I tried this version and v2.4.0 with a clean git pull and the issue continues. Ultimately it does successfully scrape but as I run the project as --one-shot in cron it generates an email at every execution.

The only difference so far is the version of python. Any thoughts?

Cheers

shannondpasto commented 3 years ago

So I found the issue. It was to do with the version of SungrowModbusTcpClient. The Pi has v0.1.2 but the requirements calls for >=0.1.5. Installing the older version has resolved the issue. Not sure if it's worth your time to investigate the issue further but unless there's other reasons why I should upgrade to with 0.1.5 then I'm happy to leave this.