If the esp module loses connection to the router, then the disconnect is called.
If the router loses connection to the rest of the internet by removing the ethernet cord, then neither the wifi event handler nor the mqtt even handler indicates the connection has been lost.
ESP-MQTT does not disconnect when router loses internet
-
- Posts: 30
- Joined: Mon Sep 17, 2018 6:39 am
Re: ESP-MQTT does not disconnect when router loses internet
Make sure you have keepalive turned on. This will result in a ping being sent periodically and if the ping is not received the client will disconnect.
Re: ESP-MQTT does not disconnect when router loses internet
Best to put timeouts on your sockets in case the internet connection is down or packets lost. Or.. ^ what he said.
John A
John A
Who is online
Users browsing this forum: Corand and 88 guests