Skip to content

Commit 38b7d18

Browse files
committed
Fix low FPS if not connected to wi-fi & internet.
Only update timeClient if connected.
1 parent bf42538 commit 38b7d18

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

esp8266-fastled-webserver.ino

+4-3
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,6 @@ void loop() {
584584
webServer.handleClient();
585585
MDNS.update();
586586

587-
timeClient.update();
588-
589587
static bool hasConnected = false;
590588
EVERY_N_SECONDS(1) {
591589
if (WiFi.status() != WL_CONNECTED) {
@@ -604,6 +602,9 @@ void loop() {
604602
Serial.print(nameString);
605603
Serial.println(".local in your browser");
606604
}
605+
else {
606+
timeClient.update();
607+
}
607608
}
608609

609610
checkPingTimer();
@@ -897,7 +898,7 @@ void readSettings()
897898
{
898899
// check for "magic number" so we know settings have been written to EEPROM
899900
// and it's not just full of random bytes
900-
901+
901902
if (EEPROM.read(511) != 55) {
902903
return;
903904
}

0 commit comments

Comments
 (0)