diff --git a/src/espmega_iot_core.cpp b/src/espmega_iot_core.cpp index bb1001b..50bf3c7 100644 --- a/src/espmega_iot_core.cpp +++ b/src/espmega_iot_core.cpp @@ -247,12 +247,12 @@ void ota_begin() otaserver.on("/", HTTP_GET, []() { otaserver.sendHeader("Connection", "close"); - String otabuffer = ota_part1+HOSTNAME+ota_part2+IP.toString()+ota_part3+ESPMEGA_REV+ota_part4+MQTT_SERVER.toString()+ota_part5+String(MQTT_BASE_TOPIC)+ota_part6; + String otabuffer = ota_part1+HOSTNAME+ota_part2+IP.toString()+ota_part3+ETH.macAddress()+ota_part4+ESPMEGA_REV+ota_part5+MQTT_SERVER.toString()+ota_part6+String(MQTT_BASE_TOPIC)+ota_part7; if(standalone) otabuffer+=String("No"); else otabuffer+=String("Yes"); - otabuffer+=ota_part7; + otabuffer+=ota_part8; otaserver.send(200, "text/html", otabuffer); }); otaserver.on( "/update", HTTP_POST, []() @@ -265,9 +265,13 @@ void ota_begin() HTTPUpload &upload = otaserver.upload(); if (upload.status == UPLOAD_FILE_START) { + lcd_send_command("page ota"); + String otafiletxt = "Downloading File : " + upload.filename; + panel.writeStr("otatxt.txt",otafiletxt); Serial.printf("Update: %s\n", upload.filename.c_str()); if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { + panel.writeStr("otatxt.txt","Update Failed, Rebooting . . ."); Update.printError(Serial); } } @@ -275,6 +279,7 @@ void ota_begin() { if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) { + panel.writeStr("otatxt.txt","Update Failed, Rebooting . . ."); Update.printError(Serial); } } @@ -282,10 +287,12 @@ void ota_begin() { if (Update.end(true)) { + panel.writeStr("otatxt.txt","Update Completed, Rebooting . . ."); Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize); } else { + panel.writeStr("otatxt.txt","Update Failed, Rebooting . . ."); Update.printError(Serial); } } diff --git a/src/espmega_iot_ota.cpp b/src/espmega_iot_ota.cpp index 20444fa..282ffd5 100644 --- a/src/espmega_iot_ota.cpp +++ b/src/espmega_iot_ota.cpp @@ -20,4 +20,7 @@ const String ota_part6 = { }; const String ota_part7 = { #include "ota_html/ota-part7.html" +}; +const String ota_part8 = { +#include "ota_html/ota-part8.html" }; \ No newline at end of file diff --git a/src/espmega_iot_ota.hpp b/src/espmega_iot_ota.hpp index 6147e2e..8ca414b 100644 --- a/src/espmega_iot_ota.hpp +++ b/src/espmega_iot_ota.hpp @@ -6,4 +6,5 @@ extern const String ota_part3; extern const String ota_part4; extern const String ota_part5; extern const String ota_part6; -extern const String ota_part7; \ No newline at end of file +extern const String ota_part7; +extern const String ota_part8; \ No newline at end of file diff --git a/src/ota_html/ota-part1.html b/src/ota_html/ota-part1.html index 70f5d26..a63d855 100644 --- a/src/ota_html/ota-part1.html +++ b/src/ota_html/ota-part1.html @@ -1,7 +1,7 @@ R"=====(
- -)=====" \ No newline at end of file ++ Centrally Managed + )=====" \ No newline at end of file diff --git a/src/ota_html/ota-part8.html b/src/ota_html/ota-part8.html new file mode 100644 index 0000000..4f94bee --- /dev/null +++ b/src/ota_html/ota-part8.html @@ -0,0 +1,125 @@ +R"=====( +
+ + + +