ESP-MQTT does not disconnect when router loses internet

jollytopper
Posts: 30
Joined: Mon Sep 17, 2018 6:39 am

ESP-MQTT does not disconnect when router loses internet

Postby jollytopper » Tue Oct 23, 2018 3:30 am

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.

vonnieda
Posts: 145
Joined: Tue Nov 07, 2017 3:42 pm

Re: ESP-MQTT does not disconnect when router loses internet

Postby vonnieda » Tue Oct 23, 2018 12:01 pm

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.

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: ESP-MQTT does not disconnect when router loses internet

Postby fly135 » Tue Oct 23, 2018 5:27 pm

Best to put timeouts on your sockets in case the internet connection is down or packets lost. Or.. ^ what he said. :)

John A

Who is online

Users browsing this forum: Google [Bot] and 97 guests