0
votes

I have an azure IoT hub with 10 IoT devices on it. For some strange reason, all devices keep getting offline. After some hours(or shorter) being connected, they suddenly get disconnected. When a device is manually restarted it starts again sending data and things seem to be solved, but the device quickly gets disconnected again:

Error: Time:Fri Jun 14 11:50:35 2019 File:/usr/sdk/src/c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2230 mqtt_client timed out waiting for CONNACK
Error: Time:Fri Jun 14 11:50:35 2019 File:/usr/sdk/src/c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2230 mqtt_client timed out waiting for CONNACK
Error: Time:Fri Jun 14 11:50:35 2019 File:/usr/sdk/src/c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2230 mqtt_client timed out waiting for CONNACK
Error: Time:Fri Jun 14 11:50:35 2019 File:/usr/sdk/src/c/iothub_client/src/iothubtransport_mqtt_common.c Func:InitializeConnection Line:2230 mqtt_client timed out waiting for CONNACK

Because the devices are spread over physical different locations I assume it cannot be an internet connection problem. Even my device simulator in NodeJS running at home is disconnected after an hour or so.

The IoT hub is a B1 with 2 hub units configured. According to the IoT specs for B1 it should be able to handle 400.000 messages per day with a max size of 4KB each. Since the messages are less than a 1 KB and are only sent every 10 minutes, the message count must be far below 2 times 400.000.

Does anyone have an idea what could be the problem here?

Am I correct in my assumption that other Azure resources (e.g. the Database, Web App or Azure Function that are running as well) cannot overconsume CPU/memory such that the IoT hub gets throttled?

Extra details: The devices on the IoT hub use MQTT to send data. In order to read data from the IoT hub an Azure function is used (no errors are visible here).

1
Looking at your output log with the very rapid succession of CONNACK timeouts I would suspect you are using an older version of the C SDK. There was a bug in that area that has been addressed whereupon during reconnect the SDK was not waiting the specified 30 seconds to reconnect. Not related to your issue but, if you are running an older version, I recommend that you acquire a later version.Mark Radbourne

1 Answers

1
votes

it seems to be a general problem because I experienced exactly the same issue with my 50 devices. It started on Friday. My IoTHub is in Western Europe. I thought my devices are the problem but with different tests I found out that it must be a problem of the servicing endpoint.

It seems that the problem is fixed because my devices work like always since the beginning of the day.