ESP32 Long Time Working Problem

If the MQTT connection has an issue, the ESP32 will reset its self, as per my code. That has happened 3 or 4 times, when I reset the MQTT Broker, over the last 8 months.

When the MQTT client gets a connection to the broker a token is generated that is held by the client. If the MQTT Broker is reset then all the tokens become invalid. So the network connection and the MQTT connection will show good but the MQTT Broker will refuse the connection because the token is invalid.

So when I reset the MQTT Broker, all the ESP32's I have setup will reset themselves, and get a new token. That way I don't have to climb into my attic, or climb the pole in the backyard, to reset the ESP32's.

1 Like