Problem with struct.error: unpack requires a buffer of 4 bytes #1614
-
Hello, My setup: RPi3 with 32-bit raspbian OS running PyModMon (https://github.com/transistorgrab/PyModMon) to pull data from an SMC solar inverter. PyModMon is using pymodbus. Now I want to move to RPi4 with 64-bit OS and just running the same setup. But I do get this error, just when calling exactly the same command:
File "/usr/local/lib/python3.9/dist-packages/pymodbus/payload.py", line 382, in decode_32bit_uint Is this a bug in pymodbus, or what do I do wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
What are you trying to do ? that method is not meant for external use. But the problem is clear, the message contains only 16bit not 32, probably because you only read 1 register (32 bit is 2 registers). |
Beta Was this translation helpful? Give feedback.
-
Apart from that if you are using pyModMon and not the newer pyModMon_3 you will probably encounter a number of problems. I looked into the pyModMon_3 code, and the problem you experience is in their code, not our code, so please ask them to solve it. |
Beta Was this translation helpful? Give feedback.
What are you trying to do ?
that method is not meant for external use. But the problem is clear, the message contains only 16bit not 32, probably because you only read 1 register (32 bit is 2 registers).