-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Condition for telemetry message resend #2499
Comments
Timeout is documented in the below link. Please post your device logs. https://github.com/Azure/azure-iot-sdk-c/blob/main/doc/connection_and_messaging_reliability.md |
Thanks for you reply but I think that my questions regarding timeout management for PUBACK in MQTT is not answered in the documentation you are referring to. I can't find anything related to timeout waiting for PUBACK when using MQTT. OPTION_MESSAGE_TIMEOUT is marked as deprecated In the code, there is two timeouts define in ProcessPendingTelemetryMessages. Here is a log where I get duplication of telemetry messages Number in parentheses is millisec from start I am just trying to understand why this happens! As telemetry messages are DELIVER_AT_LEAST_ONCE, it could happen that there are duplicates but I can't find an explanation when this will happen. |
You have removed pertinent information from the SDK logs for us to debug your situation. |
|
There are no service logs with a device ID of a584297f-a9eb-4eab-9fdc-d392fa863dc4. What hub is this on? What are the UTC timestamp of these messages?
|
Do you suspect that this is invalid behavior or can it really happen under certain circumstances ? I am using 1.11.0 of the azure-iot-sdk-c on an ESP32 WROVER-IE in a wifi mesh network with NAT (might impact delays in the network). I will not be able to provide a more detailed log until after my vacation, starting today. Back in 4 weeks. |
This could happen if your clocks drift and there is a significant time jump when updating NTP. The ESP32 internal oscillator is not very good. The message callback should have status on what is going on. |
OK, so how much is a significant time jump ? |
greater than the message timeout. |
So, I guess we are back to my original question: How long is the timeout for PUBACK of an MQTT message ? |
The max timeout wait for PUBACK is 2 minutes.
|
Problem I have is not related to the 2 minute timeout, I have checked that there is no time jump that could explain the 2 minute timeout to expire. |
You need to trace thru the code to debug it. |
Environment:
Wifi connection over mesh network (NAT)
ESP32
MQTT protocol
I have noticed that some telemetry messages sent from user level will actually be sent twice to the IoT hub .
Enabling Trace on the SDK stack shows a resend of the message, both will later get PUBACK response but only after the message is sent twice.
This happens only for some messages and not for all. At first I thought it was related to size of the payload but it is not consistent.
I have tried executing the IoTHubDeviceClient_LL_DoWork with different period but it is also not clear even though it seems to be less frequent with longer period (changed from 40 to 100 ms).
How long is the PUBACK timeout ?
I have understood that there is no time set by the MQTT standard , even though I have seen 60s mentioned. In my case the retransmission happens within less than a second.
The environment with wifi connection and possible delays might be a reason for this to happen but I do not understand why the retransmission occurs so fast after first message being sent.
Any other explanation that come to mind ?
The text was updated successfully, but these errors were encountered: