Festo-se / festo-edcon

festo-edcon is a python package which bundles modules to facilitate operation of Festo electric drives (currently via EtherNet/IP and Modbus) using PROFIDRIVE
MIT License
9 stars 1 forks source link

Pymodbus 3.7 Error #6

Closed roechele closed 2 weeks ago

roechele commented 3 weeks ago

I get an error when importing Edcon ComModbus: from edcon.edrive.com_modbus import ComModbus

Traceback (most recent call last):
  File "/home/pi/festo_drives_http/test.py", line 3, in <module>
    from edcon.edrive.com_modbus import ComModbus
  File "/home/pi/festo_drives_http/env/lib/python3.9/site-packages/edcon/edrive/com_modbus.py", line 12, in <module>
    from pymodbus.mei_message import ReadDeviceInformationRequest
ModuleNotFoundError: No module named 'pymodbus.mei_message'

solution is to switch to an older version of pymodbus:

pip uninstall pymodbus
pip install pymodbus==3.6.9

Seems like ymodbus 3.7 just came out two weeks ago and breaks festo-edcon. Figgured you might want to look into that.

drsurfer commented 2 weeks ago

I'm a total novice both on Festo drives and python, but I believe you can fix this updating in com_modbus.py the row

from pymodbus.mei_message import ReadDeviceInformationRequest

to

from pymodbus.pdu.mei_message import ReadDeviceInformationRequest

Let me know if this works for you, too.

elrosch commented 2 weeks ago

Yeah I guess pymodbus introduced a breaking change with a minor version increment. I'll have a look

elrosch commented 2 weeks ago

Fixed