openenergymonitor / emonhub

Python service linking and decoding input to MQTT & Emoncms
90 stars 83 forks source link

pymodbus3 possible breaking changes #182

Closed alexandrecuer closed 6 months ago

alexandrecuer commented 2 years ago

pymodbus 3 has been released

basically :

from pymodbus.client.sync import ModbusTcpClient as ModbusClient

becomes

from pymodbus.client import ModbusTcpClient as ModbusClient

and

self.rVal = self._con.read_holding_registers(register - 1, qty, unit=unitId)

becomes

self.rVal = self._con.read_holding_registers(register - 1, qty, slave=unitId)

as emonhub uses the apt packet to install pymodbus, there is no problem anyway, but if the apt packet gets updated, the code of emonhub interfacers using pymodbus should be updated

alexandrecuer commented 1 year ago

the pip package sdm_modbus now requires pymodbus >= 3.0.0

https://github.com/nmakel/sdm_modbus/blob/8b80589443f2cb18fc0d342ed0c01e90fc6ea3f8/setup.cfg#L28

when calling pip install sdm_modbus, it should remove the pymodbus version coming from apt and install a version > 3

So I think that on new or updated installs, the following interfacers should be broken :

If it is confirmed, I can make a PR....but as I dont use these tools, a confirmation should be welcome