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] High CPU usage because of while loop in mqtt_firmware_client.py #670

Closed gohm-tech closed 2 years ago

gohm-tech commented 2 years ago

Hi, We are using the mqtt_firmware_client.py code for the OTA updates. But when we used this code, we realized that our device was using a high CPU. Afterward, we investigated this and changed the code as follows.

mqtt_firmware_client.txt

Screenshot from 2021-12-31 10-27-04 Screenshot from 2021-12-31 10-28-49

Client Environment OS: Linux(Ubuntu) Browser: Chrome, Firefox Version Ubuntu Version 20.04

Connector name MQTT Connector

Versions: OS: Raspbian GNU/Linux 10 (buster) Thingsboard IoT Gateway version [e.g. 2.7] Python version 3.7.3

Best Regards, Gohm Team

samson0v commented 2 years ago

Hi @gohm-tech, this bug doesn't relate to Gateway. Create an issue in thingsboard-python-client-sdk.

samson0v commented 2 years ago

@gohm-tech This bug was fixed via the commit. The file from documentation will change to a new version soon. Thanks for your interest in ThingsBoard.