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?
Why does the server disconnect during secondary ADU processing?
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.
- When the processing time exceeds approximately 6 minutes, the MQTT connection will be disconnected from IoTHUB.
- 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.