Closed jkjaer closed 6 months ago
I have already fixed the problem on a new branch on a local copy of the emonhub repository. However, I do not have access rights to push this fix to here. Is there a procedure for getting such access rights or do you prefer to apply the fix yourself?
@jkjaer : the procedure is to make a pull request, you fork the repo into your github account, then make the mods and then open a PR.
there is also other small things to correct :
read_holding_registers(register - 1, qty, unit=unitId)
should be read_holding_registers(register - 1, qty, slave=unitId)
since pymodbus3
cf https://github.com/openenergymonitor/emonhub/issues/182
tell me if you are OK for the PR, otherwise I will do it
@alexandrecuer Thanks for the clarification. I will implement the two fixes and open a PR.
@jkjaer : thanks for the PR 👍
No problem. Glad to contribute :)
In https://github.com/pymodbus-dev/pymodbus/pull/1743, pymodbus changed constants.Endian into being an enumeration, resulting in that Endian.Big was changed into Endian.BIG. Unfortunately, this change has broken the EmonModbusTcpInterfacer class which uses Endian.Big for both the byte and word order when calling BinaryPayloadDecoder.fromRegisters (also from pymodbus).
To fix the problem, Endian.Big should be changed to Endian.BIG in EmonModbusTcpInterfacer.py.