immediately reconnect to mqtt server on wifi reconnect

This commit is contained in:
Kevin Hester
2021-08-17 19:59:56 -07:00
parent 472e880280
commit 52d7a6b8e4
4 changed files with 51 additions and 46 deletions

View File

@@ -338,7 +338,7 @@ void setup()
#endif
bool forceSoftAP = 0;
#ifdef BUTTON_PIN
#ifndef NO_ESP32
@@ -537,6 +537,10 @@ void setup()
}
#endif
#if defined(PORTDUINO) || defined(HAS_WIFI)
mqttInit();
#endif
// Initialize Wifi
initWifi(forceSoftAP);
@@ -549,10 +553,6 @@ void setup()
initApiServer();
#endif
#if defined(PORTDUINO) || defined(HAS_WIFI)
mqttInit();
#endif
// Start airtime logger thread.
airTime = new AirTime();