UC GEE
UC GEE
DIIDevHeads IoT Integration Server
Created by Daniel kalu on 10/18/2024 in #edge-networking
Optimizing MQTT Stability on ESP32 with Keep-Alive Tuning or Reconnection Strategy
Hey @Daniel kalu To address your challenges with MQTT on your ESP32 project,Try to consider implementing a robust reconnection strategy rather than solely fine-tuning the keep-alive.Reasons is because, frequent disconnections often stem from unstable network conditions, so enhancing your reconnection logic can help you to maintain a stable MQTT connection during network drops. And secondly, try to have thorough check on your WiFi connectivity and use a watchdog timer to handle hangs during reconnections. Additionally,ensure you're regularly calling client.loop() to keep the connection alive and process incoming messages effectively.
3 replies