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.72k stars 829 forks source link

[BUG] Example mqtt.json config file is missing attributeRequests section #543

Closed pbrkr closed 3 years ago

pbrkr commented 3 years ago

The example MQTT configuration in thingsboard_gateway/config/mqtt.json is missing the attributeRequests section required by the MQTT Connector.

imbeacon commented 3 years ago

Hi @pbrkr ,

Thank you for your interest in ThingsBoard IoT gateway. attributeRequest section was presented in the configuration at the very beginning of the project development, at the moment it is renamed to attributeUpdates. But it was left in the code to keep the backward compatibility.

pbrkr commented 3 years ago

@zbeacon please re-open this issue.

The code in thingsboard_gateway/connectors/mqtt/mqtt_connector.py still requires attributeRequests to be present in the config. If it is not present, an error is printed (see call to load_handlers() on line 73, error logged on line 135 of current master). If this section is just kept for backwards compatibility then no error should be printed if the attributeRequests section is missing. Perhaps load_handlers() needs an optional flag?

imbeacon commented 3 years ago

I agree with you, we will remove the error logging in this case.

samson0v commented 3 years ago

Hi @pbrkr, fixed your issue, please, update your gateway to the latest version via the master branch.