tjhowse / modbus4mqtt

Modbus TCP <-> MQTT glue. YAML configuration. Robust.
Other
75 stars 33 forks source link

Change unit to slave in modbus_interfaces #49

Open nestor-alonso opened 9 months ago

nestor-alonso commented 9 months ago

Hello!

I've been using a modified version of modbus4mqtt (applied the modbus RTU patches and added some custom debugging). When running on Debian 12 (Bookworm) the modbus client wasn´t answering at all, so after some low-level debugging, the solution was to change in modbus_interfaces.py all ocurrences of unit=slave for slave=slave.

It seems that Pymodbus completed the transition from unit to slave.

I apologize for not providing a proper patch.

Best regards!

pki791 commented 9 months ago

You should install pymodbus 2.5.x, not 3.x

nestor-alonso commented 9 months ago

Yep.... Now I see that listed in the requirement.txt. Then (question for myself) how the version 3.5.2 was installed in that system?

pki791 commented 9 months ago

I think that should be updated in the requirements.txt, there are more changes needed for 3.x as some procedure names also changed.