-
Notifications
You must be signed in to change notification settings - Fork 638
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 sometimes does not notice broker shutdown #1759
Comments
I believe this is related to the marvinroger/async-mqtt-client#105 |
Bug description
When MQTT broker server is physically disconnected from the network (for example, network cable is removed), device still thinks that connection is OK. Neither onDisconnect or onTimeout firing for MQTT module.
mqtt.info shows state as connected, mqtt.reset finally resets it
While this seems like a bug in async mqtt client / asynctcp, still recording it here as it may be important "feature" to know. And it may be fixed by manual keep-alive, tracking last successful mqttSend() call
Steps to reproduce
mqttQoS=1
,mqttKeep=300
,hbInterval 5
reset, wait until mqtt is connected on the deviceAdditional context
Using async-mqtt-client master (or v0.8.1, same thing), Core 2.3.0 & 2.5.2 lwip2
Network is Linux server, Router that is directly wired to the server and ESP connected to the Router's AP. Both on the same LAN network bridged together.
I waited for about 10 min and reconnected the cable, after which MQTT reconnection finally happened.
tcpdump on the router shows that device is still sending data, but it does look like it just tries to retransmit not acked data:
Small patch to the dev tree enables lwip debugging and shows that pcb is still ESTABLISHED
dev...mcspr:lwip/pcb-debug
One would expect that keep-alive would sort this out, but it does not.
(and as quick google search answers suggest, regarding lwip tcp /app keepalive)
Device information
The text was updated successfully, but these errors were encountered: