From 52258298cf415a498fdc0c500bd84c27195847c1 Mon Sep 17 00:00:00 2001 From: Qrome Date: Tue, 29 Mar 2022 17:50:18 -0700 Subject: [PATCH] updated to 4.0 to prepare for ESP8266 Core 3.0.2 --- printermonitor/printermonitor.ino | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/printermonitor/printermonitor.ino b/printermonitor/printermonitor.ino index 8849850..9b97340 100644 --- a/printermonitor/printermonitor.ino +++ b/printermonitor/printermonitor.ino @@ -30,7 +30,7 @@ SOFTWARE. #include "Settings.h" -#define VERSION "3.0" +#define VERSION "4.0" #define HOSTNAME "PrintMon-" #define CONFIG "/conf.txt" @@ -307,6 +307,7 @@ void setup() { server.on("/updateweatherconfig", handleUpdateWeather); server.on("/configure", handleConfigure); server.on("/configureweather", handleWeatherConfigure); + server.on("/resetadmin", handleResetAdmin); server.onNotFound(redirectHome); serverUpdater.setup(&server, "/update", www_username, www_password); // Start the server @@ -430,6 +431,18 @@ boolean authentication() { return true; // Authentication not required } +//ONLY USED in Special Build +void handleResetAdmin() { + Serial.println("Reset System Configuration"); + if (SPIFFS.remove(CONFIG)) { + Serial.println("Config settings removed..."); + } + redirectHome(); + WiFiManager wifiManager; + wifiManager.resetSettings(); + ESP.restart(); +} + void handleSystemReset() { if (!authentication()) { return server.requestAuthentication();