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.68k stars 817 forks source link

[BUG] Do we have to send sensor connection requests from the gateway to connect between different gateway and sensor connected to another gateway? #662

Open gohm-tech opened 2 years ago

gohm-tech commented 2 years ago

We are working on RPC capabilities.

How The second gateway can receive this incoming RPC?

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

Connector name MQTT Connector

Configuration mqtt.txt

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

Best Regards, Gohm Team

gohm-tech commented 2 years ago

Hi @zbeacon,

We think we don't need to send connectRequests. Screenshot from 2021-12-23 16-47-33

Best Regards, Gohm Team

imbeacon commented 2 years ago

Hi @gohm-tech ,

Actually the gateway sends connect request on the very first message with telemetry/attributes from device. Connect request in your case is not required, it was developed for case when you want to create the device and process it on ThingsBoard, but the data will be sent later. In order to solve the issue with RPC we have to change the logic in ThingsBoard. Because at the moment ThingsBoard sends RPC to the gateway, that created the device, not to the latest connected gateway.

imbeacon commented 2 years ago

In order to send RPC to another gateway - Please try to send disconnect request to old gateway and connect to the new one, then device session will be assigned to the new gateway.

gohm-tech commented 2 years ago

Hi @zbeacon, Thanks for your interest. If the first gateway is not working and The device connects to the second gateway, We can not send a disconnect request from the first gateway. We tried to send a disconnect request using mosquito_pub, But it is not working.

So How can we do that from another device (computer or server) as if sending the first gateway disconnect message? Can we do that using python rest apı? Screenshot from 2021-12-31 09-25-38 Screenshot from 2021-12-31 09-23-51

Any work on this issue? When will you solve this issue? Best Regards, Gohm Team

gohm-tech commented 2 years ago

Hi @zbeacon,

Is there any progress to solve this problem?

Best Regards, Gohm Team