You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm using the latest docker image (3.3) on a Raspberry Pi 4. When starting the container using a modbus connector, I'm getting this error:
ImportError: cannot import name 'Defaults' from 'pymodbus.constants'
I found this post on a forum complaining about the same issue, and the only answer there suggested a workaround that worked for me. Apparently, the newer version of pymodbus isn't exporting the Defaults class, so I downgraded pymodbus to 3.4.0 version
This solved my issue for now but I'd need to manually do it to many of my gateways so it's not really scalable. That should be fixed in the docker image itself
Connector name (If bug in the some connector):
Modbus Connector
Error traceback
""2023-08-05 17:19:17" - |DEBUG| - [tb_loader.py] - tb_loader - import_module - 59 - ModuleSpec(name='GrpcModbusConnector', loader=<_frozen_importlib_external.SourceFileLoader object at 0xf58ab160>, origin='/thingsboard_gateway/grpc_connectors/modbus/modbus_connector.py')"
""2023-08-05 17:19:17" - |ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - cannot import name 'Defaults' from 'pymodbus.constants' (/root/.local/lib/python3.10/site-packages/pymodbus/constants.py)"
Traceback (most recent call last):
File "/thingsboard_gateway/tb_utility/tb_loader.py", line 65, in import_module
module_spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/thingsboard_gateway/grpc_connectors/modbus/modbus_connector.py", line 31, in <module>
from thingsboard_gateway.grpc_connectors.modbus.slave import Slave
File "/thingsboard_gateway/grpc_connectors/modbus/slave.py", line 18, in <module>
from pymodbus.constants import Defaults
ImportError: cannot import name 'Defaults' from 'pymodbus.constants' (/root/.local/lib/python3.10/site-packages/pymodbus/constants.py)
Versions:
OS: Linux Debian 11.7; Docker 24.0.5
Thingsboard IoT Gateway version: 3.3
Python version: 3.10.12
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm using the latest docker image (3.3) on a Raspberry Pi 4. When starting the container using a modbus connector, I'm getting this error:
I found this post on a forum complaining about the same issue, and the only answer there suggested a workaround that worked for me. Apparently, the newer version of
pymodbus
isn't exporting theDefaults
class, so I downgradedpymodbus
to 3.4.0 versionThis solved my issue for now but I'd need to manually do it to many of my gateways so it's not really scalable. That should be fixed in the docker image itself
Connector name (If bug in the some connector):
Modbus Connector
Error traceback
Versions:
The text was updated successfully, but these errors were encountered: