diff --git a/platformio.ini b/platformio.ini
index 3127af3..1a21c07 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -19,4 +19,4 @@ lib_deps =
knolleary/PubSubClient@^2.8
tobiasschuerg/ESP8266 Influxdb@^3.12.1
monitor_speed = 115200
-;upload_port = COM3
\ No newline at end of file
+;upload_port = 192.168.2.157
\ No newline at end of file
diff --git a/src/main.cpp b/src/main.cpp
index 5d6b2fb..7cda8ec 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -102,7 +102,7 @@ void setHtml(){
} else {
htmltext += "
Server 2 ist offline
";
}
-
+ htmltext += "
";
}
String SendHTML(String addtext){
@@ -110,7 +110,7 @@ String SendHTML(String addtext){
ptr += "\n";
ptr += "\n";
ptr += "\n";
- ptr += "Gaszaehler Webserver\n";
+ ptr += "ServerWatch Webserver\n";
ptr += "\n";
ptr += "\n";
ptr += "\n";
@@ -160,6 +160,9 @@ void printStatus(){
display.drawString(0,0,"IP: "+WiFi.localIP().toString()+" ;)");
long rssi = WiFi.RSSI();
char rssiStr[255];
+ if (rssi == 0){
+ ESP.restart();
+ }
sprintf(rssiStr,"RSSID: %d dBm",rssi);
display.drawString(0,11,rssiStr);
time(&now); // read the current time
@@ -226,6 +229,11 @@ void pw2off(){
server.send(303);
}
+void restart(){
+ server.sendHeader("Location","/");
+ server.send(200, "text/html", SendHTML("Boot"));
+ ESP.restart();
+}
void setup() {
Serial.begin(115200);
Serial.println("Booting");
@@ -256,6 +264,7 @@ void setup() {
server.on("/auto2/off",auto2off);
server.on("/pw2/on",pw2on);
server.on("/pw2/off",pw2off);
+ server.on("/restart",restart);
server.begin();