The connection with Azure IoT Hub is lost and it does not recover.

Hi, All.
The information obtained using Node-RED is sent to Azure via Azure IoT Hub.


After connecting, there is no problem for a while.
The connection will be disconnected in tens of minutes if it is fast and in days if it is slow.

When I check it with Azure Log Analytics, I get the following error:

404104 DeviceConnectionClosedRemotely

If this error occurs, the connection will not be restored unless you restart the flow, deploy, or restart the browser.
You can't do that every time...

First of all, I would like to establish a method to prevent disconnection and a method to reconnect even if disconnection occurs.
However, I can't find it by searching the literature.

Can someone give me a hint.

Thanks.

Hi,

I cant help you to reconnect but i believe i can help you to disconnect less.

Azure iot hub allows only 1 single connection from a single device id. So it disconnecta you if you try to connect from 2 different places at the same time

Hi,

Thank you for reply.
I only connect to one Raspberry Pi and Azure IoT Hub.

Probably not the condition you told me.
Does anyone know how to automatically recover if the connection is lost?

Thanks.

some additional info for understanding :

You can also use http to send message to iot hub, if you find mqtt to complex. You can do it with a regular http request node.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.