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.76k stars 845 forks source link

[HELP] I got the error while using the Thingsboared-gateway with Docker compose. #1480

Open khwansilakha opened 3 months ago

khwansilakha commented 3 months ago

Describe the issue

I got the error while using the Thingsboared-gateway with Docker compose. I used the settings that provided from the modbus connector template and got the error like this

Configuration (Attach your configuration file) Notate: Remove Access token from file if you want to attach a tb_gateway.yaml

This is the JSON Modbus connector settings. { "master": { "slaves": [ { "host": "192.168.1.100", "port": 502, "type": "tcp", "method": "socket", "timeout": 35, "byteOrder": "BIG", "wordOrder": "BIG", "retries": true, "retryOnEmpty": true, "retryOnInvalid": true, "pollPeriod": 5000, "unitId": 1, "deviceName": "Test Modbus", "sendDataOnlyOnChange": true, "connectAttemptTimeMs": 5000, "connectAttemptCount": 5, "waitAfterFailedAttemptsMs": 15000, "attributes": [ { "tag": "string_read", "type": "string", "functionCode": 4, "objectsCount": 4, "address": 1 }, { "tag": "bits_read", "type": "bits", "functionCode": 4, "objectsCount": 1, "address": 5 }, { "tag": "8int_read", "type": "8int", "functionCode": 4, "objectsCount": 1, "address": 6 }, { "tag": "16int_read", "type": "16int", "functionCode": 4, "objectsCount": 1, "address": 7 }, { "tag": "32int_read_divider", "type": "32int", "functionCode": 4, "objectsCount": 2, "address": 8, "divider": 10 }, { "tag": "8int_read_multiplier", "type": "8int", "functionCode": 4, "objectsCount": 1, "address": 10, "multiplier": 10 }, { "tag": "32int_read", "type": "32int", "functionCode": 4, "objectsCount": 2, "address": 11 } ], "timeseries": [ { "tag": "8uint_read", "type": "8uint", "functionCode": 4, "objectsCount": 1, "address": 17 }, { "tag": "16uint_read", "type": "16uint", "functionCode": 4, "objectsCount": 2, "address": 18 }, { "tag": "32uint_read", "type": "32uint", "functionCode": 4, "objectsCount": 4, "address": 20 }, { "tag": "16float_read", "type": "16float", "functionCode": 4, "objectsCount": 1, "address": 25 }, { "tag": "32float_read", "type": "32float", "functionCode": 4, "objectsCount": 2, "address": 26 } ], "attributeUpdates": [ { "tag": "shared_attribute_write", "type": "32int", "functionCode": 6, "objectsCount": 2, "address": 29 } ], "rpc": [ { "tag": "setValue", "type": "bits", "functionCode": 5, "objectsCount": 1, "address": 31 }, { "tag": "getValue", "type": "bits", "functionCode": 1, "objectsCount": 1, "address": 31 }, { "tag": "setCPUFanSpeed", "type": "32int", "functionCode": 16, "objectsCount": 2, "address": 33 }, { "tag": "getCPULoad", "type": "32int", "functionCode": 4, "objectsCount": 2, "address": 35 } ] } ] }, "logLevel": "INFO", "name": "testModbus", "enableRemoteLogging": false, "id": "1ca2b0a6-a24e-47e0-b185-046b3b944e4f" }

Connector name (If you need help with some connector/converter): I use Modbus Connector

Error traceback (If it was raised):


This is the error message.
tb-gateway  | 2024-07-31 07:07:32 - |ERROR| - [tb_logger.py] - tb_logger - exception - 127 - index out of range
tb-gateway  | Traceback (most recent call last):
tb-gateway  |   File "/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 678, in server_side_rpc_handler
tb-gateway  |     self.__process_request(server_rpc_request, rpc_command_config)
tb-gateway  |   File "/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 705, in __process_request
tb-gateway  |     rpc_command_config[PAYLOAD_PARAMETER] = converted_data[0]
tb-gateway  |                                                                                    ~~~~~~~~~~~~~~^^^
tb-gateway  | IndexError: index out of range

**Versions (please complete the following information):**
 - Docker compose
 - Thingsboard IoT Gateway 3.5.1