-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modification of the EmonTCPModbusInterfacer to work with Pymodbus 1.4.0 #52
Conversation
remove instruction with reference to the variable pymodbus_found pymodbus_found was deleted on a previous commit : openenergymonitor@dc9be27#diff-25d902c24283ab8cfbac54dfa101ad31
With pymodbus 1.4.0 BinaryPayloadDecoder.fromRegisters does not accept argument 'endian' but arguments byteorder and wordorder see http://pymodbus.readthedocs.io/en/v1.4.0/source/example/modbus_payload.html?highlight=BinaryPayloadDecoder.fromRegisters
Thanks @alexandrecuer, what do you think would be the best way to catch the case where pymodbus is not installed? I got the following error when testing your changes:
If I move the imports to within init, this avoids the error on systems where an EmonModbusTcpInterfacer configuration is not present, but it might be better to do a bit more error catching than this.. any suggestions welcome
|
PS: thankyou for removing the lines:
I missed these and have been trying to remove all module specific code from emonhub.py |
We could test this with a Victron battery system and will be in a position to test this soon with a SolarEdge inverter. Let me know if needed. |
@TrystanLea : Indeed I see.... sorry in the rush I forgot the case pymodbus was not present @beaylott : good if you can test - if you have pymodbus installed, it should work |
@TrystanLea : I've amended my pull request so that it is not producing anymore any error when pymodbus is not present... |
Thansks! @TrystanLea can this be merged now? Sorry for the delay. |
…for modbus devices cf the following issue opened by pb66 in dec 2017 : openenergymonitor#43 with the update : - the user will not have to enter nReg, rType and datacode(s) but only datacode(s) in the node section - the user will not have to enter rNames and names but only names in the node section TODO : reimplement the decode_string process (only used for debug purposes) adapt the interfacers so it can encode topics with different nodes (one node per unitId ? possibility to use the decode_string process to create the nodename ?)
@TrystanLea @glynhudson @pb66 Configuration in emonhub.conf is realised as follow : Sample interfacer config within emonhub.conf
Sample Node declaration
hope all that is compatible with emonhub policy of code.... regards |
Thanks, very sorry too so long to merge 👍 |
Tested on a Modbus TCP master SOFREL S500