davem
(Dave McI)
9 September 2023 17:32
1
I have been using Modbus TCP without issue until I updated to EmonHub ver 2.5.8.
Now on starting emonhub I get the following error
2023-09-09 18:30:23,712 ERROR MainThread Unable to create ‘ModbusTCP’ interfacer: cannot import name ‘ModbusTcpClient’ from ‘pymodbus.client’ (/usr/local/lib/python3.7/dist-packages/pymodbus/client/init .py)
I have not changed the config files though I have checked the format and dont see any changes that would need making.
Can anyone shed any light on this error please.
borpin
(Brian Orpin)
11 September 2023 05:54
2
Before disappearing down any rabbit holes;
Is this a standard install of emoncms?
How did you update?
Any errors in the update log?
[edit]
Can you SSH in and run the command
pip show pymodbus
And paste the output (Use Ctl-E to format correctly).
davem
(Dave McI)
11 September 2023 11:20
3
Hi Brian,
Its a standard emonbase install (oldschool jeelab classic firmware RFM69Pi) updated using the admin update option from the web interface.
No errors showing in the update.
pi@emonpi:~ $ pip3 show pymodbus
Name: pymodbus
Version: 2.5.3
Summary: A fully featured modbus protocol stack in python
Home-page: https://github.com/riptideio/pymodbus/
Author: Galen Collins
Author-email: [email protected]
License: BSD-3-Clause
Location: /usr/local/lib/python3.7/dist-packages
Requires: pyserial, six
Required-by: sdm-modbus
pip not found, pip3 works though…
Dave
borpin
(Brian Orpin)
11 September 2023 12:20
4
Is this a fairly old base install?
I suspect some dependency has changed, so you may need to upgrade to a new base image. Trying to work out what has changed will be tricky.
https://docs.openenergymonitor.org/emoncms/import.html#update-sd-card-and-import-using-an-usb-sd-card-reader
Just be warned, emonhub config doesn’t always come across correctly. I’ll be interested if it does.
This won’t impact the firmware on the RFM Module.
davem
(Dave McI)
11 September 2023 12:59
5
Hi Brian, thanks for that,
The base is s a few years old now, and I modded the MinimalModBus Interfacer to support the Rayleigh Instuments meters about a year ago so have not been updating EmonHub for a while.
I was planning to move everything over the the latest Firmware with an RFM69SPI and the LPL radio format in the next few days anyway so I could do these at the same time if it makes sense or should I do it step by step ?
Dave
borpin
(Brian Orpin)
11 September 2023 13:29
6
I’d do it step by step, new image first, import data and check it is all running.
If you have modified the
Then you will need to copy that across. Was it just the configuration, or the actual python file you modified?
If you cannot remember try
git -C /opt/openenergymonitor/emonhub/ status
davem
(Dave McI)
12 September 2023 07:54
7
That worked, ModbusTCP now working again.
Everything seems to have been imported except for a background image file on the dashboard and the custom ModbusRTU interfacer- but I was expecting that so not a problem.
If I find anything else missing from the import I’ll let you know.
2 Likes