diff --git a/src/Homie/Boot/BootNormal.cpp b/src/Homie/Boot/BootNormal.cpp index c8b6db47..ed64ab31 100644 --- a/src/Homie/Boot/BootNormal.cpp +++ b/src/Homie/Boot/BootNormal.cpp @@ -387,12 +387,16 @@ void BootNormal::_onWifiDisconnected(const WiFiEventStationModeDisconnected& eve Interface::get().event.wifiReason = event.reason; Interface::get().eventHandler(Interface::get().event); - _wifiConnect(); + //_wifiConnect(); } #endif // ESP32 void BootNormal::_mqttConnect() { - if (!Interface::get().disable) { + bool fence = !Interface::get().disable;; + #if defined(ESP8266) + fence &= WiFi.isConnected(); + #endif // ESP32 + if (fence) { if (Interface::get().led.enabled) Interface::get().getBlinker().start(LED_MQTT_DELAY); _mqttConnectNotified = false; Interface::get().getLogger() << F("↕ Attempting to connect to MQTT...") << endl;