Skip to content

Commit

Permalink
Saving WiFi Status
Browse files Browse the repository at this point in the history
Saving last WiFi status (on or off) to LittleFS.
  • Loading branch information
Montecri authored Nov 16, 2024
1 parent c0ece72 commit 26a374b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,8 @@ void processKeyHold()
else
statusWifi = 1;

writeData("/statusWifi", String(statusWifi)); // Save last WiFi status so it can be restored on next boot

processWifi();
DEBUG_PRINTLN(F("BUTTON HOLD PROCESSED!"));
}
Expand Down Expand Up @@ -1753,6 +1755,7 @@ void setup()
delay(1000);

u8g2log.print("Start WiFi process...");
statusWifi = atoi(readData("/statusWifi").c_str()); // Restore last WiFi state
processWifi();
u8g2log.print("Done\n");
delay(1000);
Expand Down

0 comments on commit 26a374b

Please sign in to comment.