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 847 forks source link

[HELP] CONNECT event frequency #1125

Closed devaskim closed 1 year ago

devaskim commented 1 year ago

Describe the issue First of all, sorry, for asking here instead of at the thingsboard-python-cliend-sdk project. But my question is about gateway API so I decided it put here.

Here is official example how to listen to shared attributes updates. And there said that it is obligatory to send connect event for a target device (in our case it is a LoRa sensor).

    # without device connection it is impossible to get any messages
    gateway.gw_connect_device("ImageTest")

We do that in our C project on ESP board. But we noticed that after some time server "forgets" about our ESP gateway or about a target device, thus the gateway doesn't receive updates of shared attributes of a target device. There is no session errors, no reconnections and moreover the gateway pushes every minute its own telemetry and each hour the telemetry of a target device.

So my question is how often the gateway should send connect event to a server about a target device?

samson0v commented 1 year ago

Hi @devaskim, thanks for your interest in ThingsBoard IoT Gateway! Try to use this solution.