diff --git a/platformio.ini b/platformio.ini index 9530ec0..47ac5a1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -23,7 +23,7 @@ lib_deps = arkhipenko/TaskScheduler@^3.4.0 adafruit/Adafruit Unified Sensor @ ^1.1.4 adafruit/Adafruit BMP280 Library@^2.5.0 -build_flags = -D IR=1 +build_flags = -D IR=1 -D WIFI_ALWAYS_ON=1 [env:laptop_home] diff --git a/src/esp_clock.cpp b/src/esp_clock.cpp index b0221b1..292aab5 100644 --- a/src/esp_clock.cpp +++ b/src/esp_clock.cpp @@ -47,7 +47,9 @@ void onWifiConnected() { Serial.println("Wifi connected event"); Wifi::printStatus(); Ota::tLoop.enable(); +#if !WIFI_ALWAYS_ON if (!Ir::avrOn) tCheckWifi.restartDelayed(); +#endif Mqtt::client.connect(); if (time_t newTime = Ntp::updateTime()) { Serial.println(asctime(localtime(&newTime)));