thingsboard / thingsboard-gateway

Open-source IoT Gateway - integrates devices connected to legacy and third-party systems with ThingsBoard IoT Platform using Modbus, CAN bus, BACnet, BLE, OPC-UA, MQTT, ODBC and REST protocols
https://thingsboard.io/docs/iot-gateway/what-is-iot-gateway/
Apache License 2.0
1.74k stars 844 forks source link

[HELP] ERROR - [modbus_connector.py] - modbus_connector - 185 - Connection lost! Reconnecting..." gateway #537

Closed redasdasd closed 2 years ago

redasdasd commented 3 years ago

thingsboard: 3.2.1 gateway: 2.3 if i writed "timeseriesPollPeriod": 120000 in Modbus.json. No error occurred if i writed "timeseriesPollPeriod": 600000 in Modbus.json. An error occurred: ERROR - [modbus_connector.py] - modbus_connector - 185 - Connection lost! Reconnecting...

thingsboard: 3.2.1 gateway: 2.6 if i writed "timeseriesPollPeriod": 120000 in Modbus.json. No error occurred if i writed "timeseriesPollPeriod": 600000 in Modbus.json. An error occurred: ERROR - [bytes_modbus_uplink_converter.py] - bytes_modbus_uplink_converter - 82 - Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message receiv raspberrypi python3[10516]: NoneType: None

Why does this error occur? How can i fix this error?

imbeacon commented 3 years ago

Hi @redasdasd ,

It looks like your Modbus server returns wrong data or disconnects the gateway by timeout. We have added parameters retryOnInvalid and retryOnError - please try to use the version from the master branch and let us know about the results.

redasdasd commented 3 years ago

Hello, where are the thingsboard_gateway/connectors/modbus/modbus_connector.py and thingsboard_gateway/connectors/modbus/modbus_connector.py. My thingsboard-gateway is installed in Raspberry Pi 4. I can only find /etc/thingsboard_gateway/config/modbus.json

imbeacon commented 3 years ago

Hi,

Usually the gateway source code located in /usr/local/lib/python3.X/dist-packages or in /usr/lib/python3.X/dist-packages/, where X - subversion of your python. We are going to publish release on Monday, so you can just wait and update it after this weekends.

redasdasd commented 3 years ago

I have checked these documents last week. The file I found is as shown below: raspberrypi4:/usr/lib/python3/dist-packages/thingsboard_gateway/connectors/modbus $ ls bytes_modbus_downlink_converter.py bytes_modbus_uplink_converter.py init.py modbus_connector.py modbus_converter.py pycache

imbeacon commented 3 years ago

Hi @redasdasd ,

The new version of the gateway is available, please update your instance and try again.