updated to 4.0 to prepare for ESP8266 Core 3.0.2

4.0
Qrome 2022-03-29 17:50:18 -07:00
parent bf0edc197f
commit 52258298cf
1 changed files with 14 additions and 1 deletions

View File

@ -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();