ClassicDIY / ClassicMQTT

Modbus to MQTT publisher for the Midnite Solar Classic Charge Controller
Apache License 2.0
24 stars 13 forks source link

Fail to start in Standalone: No module named pymodbus.client.sync #35

Open alexbahder opened 1 year ago

alexbahder commented 1 year ago

I'm getting a failure trying to run this for testing... when I run it, I'm getting ModuleNotFoundError: No module named 'pymodbus.client.sync'.

I have already tried re-running 'pip install pymodbus', and it claims the requirement is already satisfied.

Any idea as to what I'm doing wrong?

mcsarge commented 1 year ago

I saw this when I searched for pymodbus.client.sync:

Looks like the new version of pymodbus is to blame.

The older version of Pymodbus used the syntax: from Pymodbus.client.sync import ModbusTcpClient whereas now on the current version the Docs suggest that the sync has been dropped and the correct syntax is: from Pymodbus.client import ModbusTcpClient

Also, change the "unit=" to "slave=" in classic_modbusdecoder.py

Please try that and let me know.

eode commented 10 months ago

Hey-oh, just ran into this today. I've made the changes locally, so I may as well pass 'em on. I'll make a PR shortly.

eode commented 10 months ago

Still compatible with pymodbus 2.x.x.