diff --git a/tools/esp8266/ahoywifi.cpp b/tools/esp8266/ahoywifi.cpp
index af1729fa..b3feb43c 100644
--- a/tools/esp8266/ahoywifi.cpp
+++ b/tools/esp8266/ahoywifi.cpp
@@ -54,7 +54,7 @@ void ahoywifi::setup(uint32_t timeout, bool settingValid) {
if(mApActive)
DBGPRINTLN(F("192.168.1.1"));
else
- DBGPRINTLN(WiFi.localIP());
+ DBGPRINTLN(WiFi.localIP().toString());
DPRINTLN(DBG_INFO, F("to configure your device"));
DPRINTLN(DBG_INFO, F("----------------------------------------\n"));
}
diff --git a/tools/esp8266/config.h b/tools/esp8266/config.h
index bfbfeb86..26ff32c5 100644
--- a/tools/esp8266/config.h
+++ b/tools/esp8266/config.h
@@ -108,9 +108,6 @@
// default MQTT topic
#define DEF_MQTT_TOPIC "inverter"
-// changes the style of "/setup" page, visualized = nicer
-#define LIVEDATA_VISUALIZED
-
#if __has_include("config_override.h")
#include "config_override.h"
#endif
diff --git a/tools/esp8266/dbg.cpp b/tools/esp8266/dbg.cpp
new file mode 100644
index 00000000..9f7c9fd3
--- /dev/null
+++ b/tools/esp8266/dbg.cpp
@@ -0,0 +1,3 @@
+#include "dbg.h"
+
+DBG_CB mCb = NULL;
diff --git a/tools/esp8266/html/api.js b/tools/esp8266/html/api.js
index f8b002a9..d21a653a 100644
--- a/tools/esp8266/html/api.js
+++ b/tools/esp8266/html/api.js
@@ -16,8 +16,10 @@ function getAjax(url, ptr) {
http.send(null);
}
function p() {
- if(http.readyState == 4)
- ptr(JSON.parse(http.responseText));
+ if(http.readyState == 4) {
+ if(null != http.responseText)
+ ptr(JSON.parse(http.responseText));
+ }
}
}
@@ -60,6 +62,13 @@ function sel(name, opt, selId) {
function div(cl) {
e = document.createElement('div');
- e.classList.add(cl);
+ e.classList.add(...cl);
+ return e;
+}
+
+function span(val, cl) {
+ e = document.createElement('span');
+ e.innerHTML = val;
+ e.classList.add(...cl);
return e;
}
diff --git a/tools/esp8266/html/convert.py b/tools/esp8266/html/convert.py
index 62f831e4..36877dec 100755
--- a/tools/esp8266/html/convert.py
+++ b/tools/esp8266/html/convert.py
@@ -64,7 +64,8 @@ def convert2Header(inFile, compress):
convert2Header("index.html", True)
convert2Header("setup.html", True)
-convert2Header("visualization.html", False)
-convert2Header("update.html", False)
+convert2Header("visualization.html", True)
+convert2Header("update.html", True)
+convert2Header("serial.html", True)
convert2Header("style.css", True)
convert2Header("api.js", True)
diff --git a/tools/esp8266/html/index.html b/tools/esp8266/html/index.html
index 627b3b03..f9c8814f 100644
--- a/tools/esp8266/html/index.html
+++ b/tools/esp8266/html/index.html
@@ -10,9 +10,10 @@
- Visualization
+ Visualization
Setup
+ Serial Console
Uptime:
ESP-Time:
@@ -80,8 +81,10 @@
html += "producing\n";
if(false == i["is_avail"]) {
- var date = new Date(i["ts_last_success"] * 1000);
- html += "-> last successful transmission: " + date.toLocaleString('de-DE', {timeZone: 'UTC'});
+ if(i["ts_last_success"] > 0) {
+ var date = new Date(i["ts_last_success"] * 1000);
+ html += "-> last successful transmission: " + date.toLocaleString('de-DE', {timeZone: 'UTC'});
+ }
}
}
@@ -100,13 +103,19 @@
}
function parse(obj) {
- parseSys(obj["system"]);
- parseStat(obj["statistics"]);
- parseIv(obj["inverter"]);
- parseWarnInfo(obj["warnings"], obj["infos"]);
- document.getElementById("refresh").innerHTML = obj["refresh_interval"];
- if(false == intervalSet)
- window.setInterval("getAjax('/api/index', parse)", obj["refresh_interval"] * 1000);
+ if(null != obj) {
+ parseSys(obj["system"]);
+ parseStat(obj["statistics"]);
+ parseIv(obj["inverter"]);
+ parseWarnInfo(obj["warnings"], obj["infos"]);
+ document.getElementById("refresh").innerHTML = obj["refresh_interval"];
+ if(false == intervalSet) {
+ window.setInterval("getAjax('/api/index', parse)", obj["refresh_interval"] * 1000);
+ intervalSet = true;
+ }
+ }
+ else
+ document.getElementById("refresh").innerHTML = "n/a";
}
getAjax("/api/index", parse);
diff --git a/tools/esp8266/html/serial.html b/tools/esp8266/html/serial.html
new file mode 100644
index 00000000..e8433437
--- /dev/null
+++ b/tools/esp8266/html/serial.html
@@ -0,0 +1,50 @@
+
+
+
+
Serial Console
+
+
+
+
+
+
Serial Console
+
+
+
+
+
+
+
diff --git a/tools/esp8266/html/setup.html b/tools/esp8266/html/setup.html
index e0e6d9a4..6460fae7 100644
--- a/tools/esp8266/html/setup.html
+++ b/tools/esp8266/html/setup.html
@@ -262,13 +262,15 @@
}
function parse(root) {
- parseSys(root["system"]);
- parseIv(root["inverter"]);
- parseMqtt(root["mqtt"]);
- parseNtp(root["ntp"]);
- parsePinout(root["pinout"]);
- parseRadio(root["radio"]);
- parseSerial(root["serial"]);
+ if(null != root) {
+ parseSys(root["system"]);
+ parseIv(root["inverter"]);
+ parseMqtt(root["mqtt"]);
+ parseNtp(root["ntp"]);
+ parsePinout(root["pinout"]);
+ parseRadio(root["radio"]);
+ parseSerial(root["serial"]);
+ }
}
getAjax("/api/setup", parse);
diff --git a/tools/esp8266/html/update.html b/tools/esp8266/html/update.html
index 4da28459..b7644a21 100644
--- a/tools/esp8266/html/update.html
+++ b/tools/esp8266/html/update.html
@@ -4,7 +4,7 @@
Update
- {#HEAD}
+
Update
@@ -13,13 +13,21 @@
Make sure that you have noted all or settings before starting an update. New versions maybe changed their memory layout which remains in default settings.