How can I prevent the connection with IoTHUB from being disconnected after 65 minutes?

yoji sato 281 Reputation points
2024-01-26T10:31:33.8166667+00:00

Currently, we are building a system that connects to IoTHUB via DPS to send telemetry and perform ADU. The system disconnects from IoTHUB every 65 minutes, so we have built in a process to reconnect each time. I am also trying to perform ADU on the secondary device using that system, but for large files, it takes more than 65 minutes because it takes time to communicate with the secondary device. As a result, IoTHUB disconnects in the middle of the download, causing the system to interrupt the update process on the secondary device. As a countermeasure, we are considering making it possible to continue downloading even if there is a disconnection from IoTHUB during downloading, but this is not an easy solution as the internal processing is complex. Therefore, as another countermeasure, we are considering extending the disconnection time from IoTHUB. Related information is available at the URL below, which states that you can extend the time until disconnection by increasing the value of "NX_AZURE_IOT_HUB_CLIENT_TOKEN_CONNECTION_TIMEOUT". https://learn.microsoft.com/en-us/answers/questions/816894/

Are the above measures effective in solving our problems? In that case, are there any restrictions on the value that can be set for "NX_AZURE_IOT_HUB_CLIENT_TOKEN_CONNECTION_TIMEOUT", such as the maximum value or increments? Best regards, Yoji Sato
Grape Systems Inc.

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
329 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,153 questions
0 comments No comments
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 13,956 Reputation points
    2024-01-26T22:21:49.2466667+00:00

    Hi @yoji sato Thank you for posting the question here.

    While it is not possible for the device to download the file when disconnected, as per the implementation of Azure device update, the download of the update file should resume one the device reconnects to the IoT Hub within 24 hours of disconnect. After 24 hours, the download will need to be reinitiated by the user. Assuming that the device disconnects are momentary, the download should resume itself. Have you given few minutes after the device reconnects and observe if the upload resumes?

    I do not see any hard limitation on the property NX_AZURE_IOT_HUB_CLIENT_TOKEN_CONNECTION_TIMEOUT Increasing this value would help keeping the connection active for a longer duration. However, please note that, this property only has an effect on devices connected IoT Hub using NetX Duo. If the device is connected to the IoT Hub through any other device SDK, the default reconnection pattern Exponential back-off with jitter takes effect. Please look into the Retry patterns for more information on this.

    You may also be interested to note that Device Update is also supported for disconnected devices that are operated behind gateways. This feature is currently in preview. Here is an article on Understand support for disconnected device updates for your reference. Hope this helps. Please let us know if you have any additional questions or need further clarification.


    If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful