From b281ae95837a7c395d62baa8361dabb0300e8b1b Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Mon, 26 Sep 2022 22:29:48 +0200 Subject: [PATCH 1/7] add check if filename longer than 30 characters, fixed handling after error dialog --- sd-card/html/ota_page.html | 55 ++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/sd-card/html/ota_page.html b/sd-card/html/ota_page.html index 3eba65664..21ef64f86 100644 --- a/sd-card/html/ota_page.html +++ b/sd-card/html/ota_page.html @@ -168,6 +168,8 @@

Reboot

alert("No file selected!"); } else if (filePath.length == 0) { alert("File path on server is not set!"); + } else if (filePath.length > 30) { + alert("Filename is to long! Use a shorter name."); } else if (filePath.indexOf(' ') >= 0) { alert("File path on server cannot have spaces!"); } else if (filePath[filePath.length-1] == '/') { @@ -199,35 +201,36 @@

Reboot

xhttp.open("POST", upload_path, false); document.getElementById("status").innerText = "Status: uploading"; xhttp.send(file); - } + - document.getElementById("status").innerText = "Status: processing on ESP32"; + document.getElementById("status").innerText = "Status: processing on ESP32"; - var xhttp = new XMLHttpRequest(); - /* first delete the old firmware */ - xhttp.onreadystatechange = function() { - if (xhttp.readyState == 4) { - if (xhttp.status == 200) { - if (xhttp.responseText.startsWith("reboot")) - { - doReboot(); - } - else - { - alert("Processing done!\n\n" + xhttp.responseText); + var xhttp = new XMLHttpRequest(); + /* first delete the old firmware */ + xhttp.onreadystatechange = function() { + if (xhttp.readyState == 4) { + if (xhttp.status == 200) { + if (xhttp.responseText.startsWith("reboot")) + { + doReboot(); + } + else + { + alert("Processing done!\n\n" + xhttp.responseText); + } + } else if (xhttp.status == 0) { + alert("Server closed the connection abruptly!"); + UpdatePage(); + } else { + alert(xhttp.status + " Error!\n" + xhttp.responseText); + UpdatePage(); } - } else if (xhttp.status == 0) { - alert("Server closed the connection abruptly!"); - UpdatePage(); - } else { - alert(xhttp.status + " Error!\n" + xhttp.responseText); - UpdatePage(); - } - } - }; - var _toDo = basepath + "/ota?task=update&file=" + filePath; - xhttp.open("GET", _toDo, false); - xhttp.send(); + } + }; + var _toDo = basepath + "/ota?task=update&file=" + filePath; + xhttp.open("GET", _toDo, false); + xhttp.send(); + } /* ----------------------------- */ document.getElementById("reboot").disabled = false; From 98b7224c659ebfabba11d70f3eec98a244fb3633 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Mon, 26 Sep 2022 22:39:29 +0200 Subject: [PATCH 2/7] Add suggestion on firefox --- Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.md b/Changelog.md index 8127b7ac3..2641e0b36 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,6 +11,7 @@ - using the update.zip from release page - status (upload, processing, ...) displayed - auto suggestion for reboot (or not in case of web ui update only) + - Best for OTA use Firefox. Chrome works with warnings. Safari stuck in upload. ### Changed - Integrated version info better into the html (main page, logfile) From b76d6cd9876539bd0e3fbae24856009eb7820952 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Mon, 26 Sep 2022 22:42:56 +0200 Subject: [PATCH 3/7] fix links --- Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 2641e0b36..2cad303ce 100644 --- a/Changelog.md +++ b/Changelog.md @@ -26,7 +26,7 @@ ### Removed - Remove `/firmware` from GitHub. - - If you want to get the latest firmware and html files, please download from the automated (build action)[https://github.com/jomjol/AI-on-the-edge-device/actions] or (release page)[https://github.com/jomjol/AI-on-the-edge-device/releases] + - If you want to get the latest firmware and html files, please download from the automated [build action](https://github.com/jomjol/AI-on-the-edge-device/actions) or [release page](https://github.com/jomjol/AI-on-the-edge-device/releases) ## [11.3.1] - (2022-09-17) Intermediate Digits From 96a59ca429e43d7b047e33ad341eab02138d9437 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Mon, 26 Sep 2022 23:04:25 +0200 Subject: [PATCH 4/7] add html.zip for update from 11.3.1 --- .github/workflows/build.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 29f866d29..880cc6744 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -268,7 +268,9 @@ jobs: zip -r ../release/update.zip . cd ../firmware zip -r ../release/initial_esp32_setup.zip . - + cd ../sd-card/html + zip -r ../../firmware/html-from-11.3.1.zip . + # extract the version used in next step - id: get_version @@ -301,7 +303,9 @@ jobs: name: ${{ steps.get_version.outputs.version-without-v }} body: ${{ steps.extract-release-notes.outputs.release_notes }} files: | - release/* + release/* + firmware/firmware.bin + firmware/html-from-11.3.1.zip # Commit&Push Changelog to master branch. Must be manually merged back to rolling From 90595968b21c5a638ceafd3066ccf33fe8c3ba74 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Mon, 26 Sep 2022 23:19:09 +0200 Subject: [PATCH 5/7] update release notes to update from 11.3.1 --- Changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Changelog.md b/Changelog.md index 2cad303ce..4a095d969 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,12 @@ ## [Unreleased] +The release breaks a few things in ota update. So **read the update from version 11.3.1 carefully**. + +1.) You should update to 11.3.1 before you update to this release. All other are not tested. +2.) Upload and update the firmware.bin file from this release. **but do not reboot** +3.) Upload the html-from-11.3.1.zip in html upload and update the web interface. +4.) Now you can reboot. ### Added - automatic release creation From 924f03595b9645692cce7f542615d180f006824d Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Tue, 27 Sep 2022 16:23:11 +0200 Subject: [PATCH 6/7] add number of max characters to the failure dialog in upload check --- sd-card/html/ota_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd-card/html/ota_page.html b/sd-card/html/ota_page.html index 21ef64f86..10e7d323b 100644 --- a/sd-card/html/ota_page.html +++ b/sd-card/html/ota_page.html @@ -169,7 +169,7 @@

Reboot

} else if (filePath.length == 0) { alert("File path on server is not set!"); } else if (filePath.length > 30) { - alert("Filename is to long! Use a shorter name."); + alert("Filename is to long! Max 30 characters."); } else if (filePath.indexOf(' ') >= 0) { alert("File path on server cannot have spaces!"); } else if (filePath[filePath.length-1] == '/') { From 356b208f33520daafef13856369cbe1523b6b629 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Tue, 27 Sep 2022 16:30:41 +0200 Subject: [PATCH 7/7] change max file characters to 100 --- sd-card/html/ota_page.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sd-card/html/ota_page.html b/sd-card/html/ota_page.html index 10e7d323b..f1a6f3562 100644 --- a/sd-card/html/ota_page.html +++ b/sd-card/html/ota_page.html @@ -168,8 +168,8 @@

Reboot

alert("No file selected!"); } else if (filePath.length == 0) { alert("File path on server is not set!"); - } else if (filePath.length > 30) { - alert("Filename is to long! Max 30 characters."); + } else if (filePath.length > 100) { + alert("Filename is to long! Max 100 characters."); } else if (filePath.indexOf(' ') >= 0) { alert("File path on server cannot have spaces!"); } else if (filePath[filePath.length-1] == '/') {