Why does the server disconnect during secondary ADU processing?

yoji sato 281 Reputation points
2024-02-01T01:08:22.68+00:00

We are building a system based on AzureRTOS and implementing update processing using ADU for secondary devices. Due to memory capacity constraints in this system, the ADU download process to the secondary device is divided into parts, but the process may be disconnected from the server side during the process.

Since the ADU agent driver is called each time a packet is received, we have implemented it so that the data is stored in an internal buffer, and when the buffer is full, it performs the transfer process to the secondary device. As a result, when the buffer becomes full, the ADU agent driver takes longer to process, resulting in disconnections like the one below.

  1. When the processing time exceeds approximately 6 minutes, the MQTT connection will be disconnected from IoTHUB.
  2. When the processing time is less than the above (approximately 30 seconds to several minutes), the HTTP connection is disconnected from the ADU server.

Furthermore, it seems that 2) disconnection also occurs after 1).

What is the reason for the above disconnection? Also, is there a way to prevent such disconnections from occurring?

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.
324 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bo Chen 596 Reputation points Microsoft Employee
    2024-02-18T03:15:30.48+00:00

    Hi @yoji sato MQTT and ADU agent uses one thread, and MQTT keep-alive timeout is 240 seconds, if driver take long time to process the packet, the MQTT thread will be blocked, then the MQTT connection will be disconnected. Could you improve the driver logic to avoid taking long time to process the packet or add new thread in driver to process/flash the buffer?