From 35ae292f1ddc2936845befb1781f17101cdd2ed8 Mon Sep 17 00:00:00 2001 From: Larry Bernstone Date: Sun, 5 Nov 2023 14:55:19 -1000 Subject: [PATCH 1/4] Update/upgrade OTAWebUpdater.ino example --- .../examples/OTAWebUpdater/OTAWebUpdater.ino | 169 ------------------ .../examples/OTAWebUpdater/.skip.esp32h2 | 0 .../examples/OTAWebUpdater/OTAWebUpdater.ino | 102 +++++++++++ .../Update/examples/OTAWebUpdater/html.h | 110 ++++++++++++ 4 files changed, 212 insertions(+), 169 deletions(-) delete mode 100644 libraries/ArduinoOTA/examples/OTAWebUpdater/OTAWebUpdater.ino rename libraries/{ArduinoOTA => Update}/examples/OTAWebUpdater/.skip.esp32h2 (100%) create mode 100644 libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino create mode 100644 libraries/Update/examples/OTAWebUpdater/html.h diff --git a/libraries/ArduinoOTA/examples/OTAWebUpdater/OTAWebUpdater.ino b/libraries/ArduinoOTA/examples/OTAWebUpdater/OTAWebUpdater.ino deleted file mode 100644 index 4c4adc7fe87..00000000000 --- a/libraries/ArduinoOTA/examples/OTAWebUpdater/OTAWebUpdater.ino +++ /dev/null @@ -1,169 +0,0 @@ -#include -#include -#include -#include -#include - -const char* host = "esp32"; -const char* ssid = "xxx"; -const char* password = "xxxx"; - -WebServer server(80); - -/* - * Login page - */ - -const char* loginIndex = - "
" - "" - "" - "" - "
" - "
" - "" - "" - "" - "" - "" - "
" - "
" - "" - "" - "" - "
" - "
" - "" - "" - "" - "" - "
" - "
ESP32 Login Page
" - "
" - "
Username:
Password:
" -"
" -""; - -/* - * Server Index Page - */ - -const char* serverIndex = -"" -"
" - "" - "" - "
" - "
progress: 0%
" - ""; - -/* - * setup function - */ -void setup(void) { - Serial.begin(115200); - - // Connect to WiFi network - WiFi.begin(ssid, password); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - /*use mdns for host name resolution*/ - if (!MDNS.begin(host)) { //http://esp32.local - Serial.println("Error setting up MDNS responder!"); - while (1) { - delay(1000); - } - } - Serial.println("mDNS responder started"); - /*return index page which is stored in serverIndex */ - server.on("/", HTTP_GET, []() { - server.sendHeader("Connection", "close"); - server.send(200, "text/html", loginIndex); - }); - server.on("/serverIndex", HTTP_GET, []() { - server.sendHeader("Connection", "close"); - server.send(200, "text/html", serverIndex); - }); - /*handling uploading firmware file */ - server.on("/update", HTTP_POST, []() { - server.sendHeader("Connection", "close"); - server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK"); - ESP.restart(); - }, []() { - HTTPUpload& upload = server.upload(); - if (upload.status == UPLOAD_FILE_START) { - Serial.printf("Update: %s\n", upload.filename.c_str()); - if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { //start with max available size - Update.printError(Serial); - } - } else if (upload.status == UPLOAD_FILE_WRITE) { - /* flashing firmware to ESP*/ - if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) { - Update.printError(Serial); - } - } else if (upload.status == UPLOAD_FILE_END) { - if (Update.end(true)) { //true to set the size to the current progress - Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize); - } else { - Update.printError(Serial); - } - } - }); - server.begin(); -} - -void loop(void) { - server.handleClient(); - delay(1); -} diff --git a/libraries/ArduinoOTA/examples/OTAWebUpdater/.skip.esp32h2 b/libraries/Update/examples/OTAWebUpdater/.skip.esp32h2 similarity index 100% rename from libraries/ArduinoOTA/examples/OTAWebUpdater/.skip.esp32h2 rename to libraries/Update/examples/OTAWebUpdater/.skip.esp32h2 diff --git a/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino b/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino new file mode 100644 index 00000000000..e3edff67108 --- /dev/null +++ b/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino @@ -0,0 +1,102 @@ +#include +#include +#include +#include +#include +#include "html.h" + +#define SSID_FORMAT "ESP32-%06X" // 12 chars total +//#define PASSWORD "test123456" // generate if remarked + +WebServer server(80); +Ticker tkSecond; +uint8_t otaDone = 0; + +const char* alphanum = "0123456789!@#$%^&*abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; +String generatePass(uint8_t str_len) { + String buff; + for(int i = 0; i < str_len; i++) + buff += alphanum[random(strlen(alphanum)-1)]; + return buff; +} + +void apMode() { + WiFi.mode(WIFI_AP); + char ssid[13]; + char passwd[11]; + uint32_t espmac = ESP.getEfuseMac() & 0xFFFFFF; + snprintf(ssid, 13, SSID_FORMAT, espmac); +#ifdef PASSWORD + snprintf(passwd, 11, PASSWORD); +#else + snprintf(passwd, 11, "%s", generatePass(10).c_str()); +#endif + WiFi.softAP(ssid, passwd); // Set up the SoftAP + MDNS.begin("esp32"); + Serial.printf("AP: %s, PASS: %s\n", ssid, passwd); +} + +void handleUpdateEnd() { + server.sendHeader("Connection", "close"); + if (Update.hasError()) { + server.send(502, "text/plain", Update.errorString()); + } else { + server.sendHeader("Refresh", "10"); + server.sendHeader("Location","/"); + server.send(307); + ESP.restart(); + } +} + +void handleUpdate() { + size_t fsize = UPDATE_SIZE_UNKNOWN; + if (server.hasArg("size")) fsize = server.arg("size").toInt(); + HTTPUpload& upload = server.upload(); + if (upload.status == UPLOAD_FILE_START) { + Serial.printf("Receiving Update: %s, Size: %d\n", upload.filename.c_str(), fsize); + if (!Update.begin(fsize)) { + otaDone = 0; + Update.printError(Serial); + } + } else if (upload.status == UPLOAD_FILE_WRITE) { + if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) { + Update.printError(Serial); + } else { + otaDone = 100 * Update.progress() / Update.size(); + } + } else if (upload.status == UPLOAD_FILE_END) { + if (Update.end(true)) { + Serial.printf("Update Success: %u bytes\nRebooting...\n", upload.totalSize); + } else { + Serial.printf("%s\n", Update.errorString()); + otaDone = 0; + } + } +} + +void webServerInit() { + server.on("/update", HTTP_POST, [](){handleUpdateEnd();}, [](){handleUpdate();}); + server.on("/favicon.ico", HTTP_GET, [](){ + server.sendHeader("Content-Encoding", "gzip"); + server.send_P(200, "image/x-icon", favicon_ico_gz, favicon_ico_gz_len); + }); + server.onNotFound([]() {server.send(200, "text/html", indexHtml);}); + server.begin(); + Serial.printf("Web Server ready at http://esp32.local or http://%s\n", WiFi.softAPIP().toString()); +} + +void everySecond() { + if (otaDone > 1) Serial.printf("ota: %d%%\n", otaDone); +} + +void setup() { + Serial.begin(115200); + apMode(); + webServerInit(); + tkSecond.attach(1, everySecond); +} + +void loop() { + delay(150); + server.handleClient(); +} diff --git a/libraries/Update/examples/OTAWebUpdater/html.h b/libraries/Update/examples/OTAWebUpdater/html.h new file mode 100644 index 00000000000..9a100e69357 --- /dev/null +++ b/libraries/Update/examples/OTAWebUpdater/html.h @@ -0,0 +1,110 @@ +// Literal string +const char* indexHtml = R"literal( + + + +

ESP Firmware Update

+
+ + +
+
+
0%
+ + +)literal"; + +// Compressed gzip in C include file style +// listing was created using `xxd -i favicon.ico.gz` +const char favicon_ico_gz[] = { + 0x1f, 0x8b, 0x08, 0x08, 0x13, 0xb6, 0xa5, 0x62, 0x00, 0x03, 0x66, 0x61, + 0x76, 0x69, 0x63, 0x6f, 0x6e, 0x2e, 0x69, 0x63, 0x6f, 0x00, 0xa5, 0x53, + 0x69, 0x48, 0x54, 0x51, 0x14, 0x7e, 0x41, 0x99, 0x4b, 0xa0, 0x15, 0x24, + 0xb4, 0x99, 0x8e, 0x1b, 0x25, 0xa8, 0x54, 0xb4, 0x19, 0x56, 0x62, 0x41, + 0xab, 0x14, 0x45, 0x61, 0x51, 0x62, 0x86, 0x69, 0x1a, 0xd4, 0x60, 0xda, + 0xa2, 0x99, 0x4b, 0x69, 0x1b, 0x42, 0x26, 0x5a, 0x09, 0x59, 0xd8, 0xfe, + 0xab, 0x88, 0xa0, 0x82, 0xe8, 0x4f, 0x90, 0xa5, 0x14, 0x68, 0x0b, 0x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0xe4, 0xc4, 0xc7, 0x4f, 0x1e, 0xcc, 0x25, 0x0e, 0x84, 0x25, + 0x04, 0x39, 0xb9, 0x25, 0xd7, 0x88, 0xfc, 0x12, 0x33, 0xa2, 0x93, 0xd5, + 0xc8, 0x2b, 0x32, 0xe1, 0xc4, 0x69, 0x01, 0xcd, 0xad, 0x76, 0xf4, 0xf6, + 0x79, 0xe4, 0xff, 0xe0, 0xa9, 0xaf, 0xb2, 0x42, 0x40, 0x53, 0xb3, 0x0d, + 0x43, 0x2e, 0xe2, 0x04, 0xed, 0x34, 0x74, 0x0c, 0x7f, 0xe2, 0x11, 0x9b, + 0x4e, 0x79, 0xe5, 0xd5, 0x22, 0xb2, 0x88, 0x1b, 0xcf, 0x5f, 0xba, 0xe5, + 0x39, 0x25, 0x11, 0x09, 0xab, 0x07, 0x34, 0xef, 0x41, 0xda, 0xfb, 0x3d, + 0xea, 0xeb, 0x72, 0x07, 0x70, 0xf5, 0xba, 0x0d, 0x33, 0x92, 0xd5, 0xbf, + 0xf3, 0x8f, 0xb8, 0x34, 0x7f, 0xb1, 0x16, 0x89, 0x2b, 0x79, 0x64, 0x6c, + 0x1a, 0x44, 0x53, 0x9b, 0x1d, 0x65, 0x55, 0x22, 0x76, 0x12, 0xce, 0x35, + 0x0d, 0x22, 0x3e, 0xf4, 0x78, 0xd0, 0xfd, 0xd9, 0x43, 0x5c, 0x14, 0x30, + 0x23, 0xe9, 0x1f, 0xfc, 0x27, 0x9b, 0x54, 0x87, 0xf8, 0x28, 0xff, 0xdb, + 0x94, 0xf9, 0x2a, 0x24, 0x10, 0x4f, 0xf3, 0x68, 0xae, 0x8d, 0xf4, 0x1e, + 0xe6, 0x11, 0x3f, 0x24, 0x7b, 0x78, 0xe2, 0xaf, 0x5c, 0xfc, 0xf1, 0x06, + 0xff, 0x12, 0x69, 0xbf, 0x53, 0x68, 0x47, 0x21, 0x84, 0x91, 0xa4, 0x4f, + 0xf4, 0x8d, 0xbd, 0x63, 0x2f, 0xf7, 0x9f, 0xe7, 0x27, 0x40, 0xbb, 0x5a, + 0x53, 0x7e, 0x04, 0x00, 0x00 +}; +const int favicon_ico_gz_len = 821; From 8430373427f3c34818105b5886e44b6232c546c0 Mon Sep 17 00:00:00 2001 From: Larry Bernstone Date: Mon, 6 Nov 2023 09:59:51 -1000 Subject: [PATCH 2/4] Wrong side of the MAC address in ssid --- libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino b/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino index e3edff67108..9ae5bd531b9 100644 --- a/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino +++ b/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino @@ -24,7 +24,7 @@ void apMode() { WiFi.mode(WIFI_AP); char ssid[13]; char passwd[11]; - uint32_t espmac = ESP.getEfuseMac() & 0xFFFFFF; + uint32_t espmac = ESP.getEfuseMac() >> 16; snprintf(ssid, 13, SSID_FORMAT, espmac); #ifdef PASSWORD snprintf(passwd, 11, PASSWORD); From c8c3f23f870a4d91191a400b6802726a5fa0adf0 Mon Sep 17 00:00:00 2001 From: Larry Bernstone Date: Mon, 6 Nov 2023 10:15:46 -1000 Subject: [PATCH 3/4] Better not to cheat it on an example :) --- libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino b/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino index 9ae5bd531b9..d3ad7511390 100644 --- a/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino +++ b/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino @@ -24,7 +24,7 @@ void apMode() { WiFi.mode(WIFI_AP); char ssid[13]; char passwd[11]; - uint32_t espmac = ESP.getEfuseMac() >> 16; + uint32_t espmac = ESP.getEfuseMac() >> 24; snprintf(ssid, 13, SSID_FORMAT, espmac); #ifdef PASSWORD snprintf(passwd, 11, PASSWORD); From 524fc4af6c5b91a2401ef00428468c0386e9f837 Mon Sep 17 00:00:00 2001 From: Larry Bernstone Date: Thu, 9 Nov 2023 11:05:10 -1000 Subject: [PATCH 4/4] Changes requested by @me-no-dev --- .../Update/examples/OTAWebUpdater/OTAWebUpdater.ino | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino b/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino index d3ad7511390..27e4ac6d95f 100644 --- a/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino +++ b/libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino @@ -5,7 +5,7 @@ #include #include "html.h" -#define SSID_FORMAT "ESP32-%06X" // 12 chars total +#define SSID_FORMAT "ESP32-%06lX" // 12 chars total //#define PASSWORD "test123456" // generate if remarked WebServer server(80); @@ -21,16 +21,16 @@ String generatePass(uint8_t str_len) { } void apMode() { - WiFi.mode(WIFI_AP); char ssid[13]; char passwd[11]; - uint32_t espmac = ESP.getEfuseMac() >> 24; + long unsigned int espmac = ESP.getEfuseMac() >> 24; snprintf(ssid, 13, SSID_FORMAT, espmac); #ifdef PASSWORD snprintf(passwd, 11, PASSWORD); #else - snprintf(passwd, 11, "%s", generatePass(10).c_str()); + snprintf(passwd, 11, generatePass(10).c_str()); #endif + WiFi.mode(WIFI_AP); WiFi.softAP(ssid, passwd); // Set up the SoftAP MDNS.begin("esp32"); Serial.printf("AP: %s, PASS: %s\n", ssid, passwd); @@ -82,7 +82,7 @@ void webServerInit() { }); server.onNotFound([]() {server.send(200, "text/html", indexHtml);}); server.begin(); - Serial.printf("Web Server ready at http://esp32.local or http://%s\n", WiFi.softAPIP().toString()); + Serial.printf("Web Server ready at http://esp32.local or http://%s\n", WiFi.softAPIP().toString().c_str()); } void everySecond() {