updated to 4.0 to prepare for ESP8266 Core 3.0.2
parent
bf0edc197f
commit
52258298cf
|
|
@ -30,7 +30,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
#define VERSION "3.0"
|
#define VERSION "4.0"
|
||||||
|
|
||||||
#define HOSTNAME "PrintMon-"
|
#define HOSTNAME "PrintMon-"
|
||||||
#define CONFIG "/conf.txt"
|
#define CONFIG "/conf.txt"
|
||||||
|
|
@ -307,6 +307,7 @@ void setup() {
|
||||||
server.on("/updateweatherconfig", handleUpdateWeather);
|
server.on("/updateweatherconfig", handleUpdateWeather);
|
||||||
server.on("/configure", handleConfigure);
|
server.on("/configure", handleConfigure);
|
||||||
server.on("/configureweather", handleWeatherConfigure);
|
server.on("/configureweather", handleWeatherConfigure);
|
||||||
|
server.on("/resetadmin", handleResetAdmin);
|
||||||
server.onNotFound(redirectHome);
|
server.onNotFound(redirectHome);
|
||||||
serverUpdater.setup(&server, "/update", www_username, www_password);
|
serverUpdater.setup(&server, "/update", www_username, www_password);
|
||||||
// Start the server
|
// Start the server
|
||||||
|
|
@ -430,6 +431,18 @@ boolean authentication() {
|
||||||
return true; // Authentication not required
|
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() {
|
void handleSystemReset() {
|
||||||
if (!authentication()) {
|
if (!authentication()) {
|
||||||
return server.requestAuthentication();
|
return server.requestAuthentication();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue