-
Notifications
You must be signed in to change notification settings - Fork 170
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
MQTT_ProcessLoop() producing 1 s Pings even with 40s KeepAlive time. (CA-334) #219
Comments
Based on my experience, it takes some time (a number of seconds) for the system to detect the loss in Internet access and return a failure code. Your information about ReceiveLoop and Ping calls is interesting. I have only used the ProcessLoop call at this point. |
Problem was in core_mqtt.c , line 1356
pContext->lastPacketRxTime; this is not updated ever and causes ping at whatever rate you are calling MQTT_ProcessLoop(). I see the newer versions of core_mqtt.c handles it in the main branch. No new releases with that yet. Another thing to be aware of is that the defaults for these limit your KeepAlive time to 30s, |
Server drops you typically 1.5x KeepAlive sent to it during MQTT_Init(). I can see MQTT_ProcessLoop() return error in 4 calls at 700mS interval. |
Thanks for the info. Your investigation has value.
…________________________________
From: SCgenie ***@***.***>
Sent: Friday, May 17, 2024 11:12 PM
To: espressif/esp-aws-iot ***@***.***>
Cc: keith ssledlighting.com ***@***.***>; Comment ***@***.***>
Subject: Re: [espressif/esp-aws-iot] MQTT_ProcessLoop() producing 1 s Pings even with 40s KeepAlive time. (CA-334) (Issue #219)
Based on my experience, it takes some time (a number of seconds) for the system to detect the loss in Internet access and return a failure code.
Server drops you typically 1.5x KeepAlive sent to it during MQTT_Init(). I can see MQTT_ProcessLoop() return error in 4 calls at 700mS interval.
—
Reply to this email directly, view it on GitHub<#219 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGGOKE7DS3IHQFGBJJ3D2Q3ZCYM6TAVCNFSM6AAAAABHWHXDNOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJXHAYTOOBTHE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Hi,
MQTT_ProcessLoop() producing 1s Pings every time it is called. Anyone know how to avoid it. I am providing correct milli second time callback.
A workaround is using MQTT_ReceiveLoop() and self managed MQTT_Ping() at keepalive interval. This works great, however, these two functions return SUCCESS even when I pull the WAN cable. So I cannot detect a MQTT broker/server disconnect.
Any suggestions?
Thanks
The text was updated successfully, but these errors were encountered: