-
Notifications
You must be signed in to change notification settings - Fork 3.1k
mqtt keep alive timer is not correct #1553
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
Comments
I experience the same and I link this to the method used in #1555 to determine if a MQTT connection is present before trying to publish a message. |
From looking at the code, it appears that the timeout handling is missing. After the keepalive time it sends the PINGREQ -- which should the cause the server to send PINGRESP. The client is supposed to wait for up to keepalive time for the PINGRESP and abort the connection if nothing is received. However, I can't see the code that does this... |
If somebody can try this fix #1557 in their test environment, that would be great. It appeared to work with a simple test case.... |
@pjsg, I have 3 units in the field connected via 3G that experience MQTT disconnects due to the connection. I will test on the units. Unfortunately can only get to them in a few days to upload new build. |
Sounds vaguely familiar...For some reason the Docker image doesn't work for you? I'll send you an email with firmware of the PR. |
Expected behavior
When the esp8266 loses wifi communication it should activate the m:on("offline" ... after 120 Seconds (according to the following example)
Actual behavior
The offline event activates randomly and after 10-15 minutes
Test code
NodeMCU version
master
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)
Hardware
esp8266-12e
The text was updated successfully, but these errors were encountered: