From 04f5bdb84336062cf4e41db0e7d222f1a39147dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Kristan?= Date: Mon, 10 Jan 2022 13:53:11 +0100 Subject: [PATCH] Fix for NTP sync on millis() rollover. AP mode delay on boot (#2242). --- wled00/wled.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 55fd9595..f8153480 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -193,6 +193,7 @@ void WLED::loop() if (lastMqttReconnectAttempt > millis()) { rolloverMillis++; lastMqttReconnectAttempt = 0; + ntpLastSyncTime = 0; strip.restartRuntime(); } if (millis() - lastMqttReconnectAttempt > 30000) { @@ -683,8 +684,10 @@ void WLED::handleConnection() if (now < 2000 && (!WLED_WIFI_CONFIGURED || apBehavior == AP_BEHAVIOR_ALWAYS)) return; - if (lastReconnectAttempt == 0) + if (lastReconnectAttempt == 0) { initConnection(); + return; + } // reconnect WiFi to clear stale allocations if heap gets too low if (now - heapTime > 5000) {