diff --git a/README.md b/README.md
index e604a757..b90f660e 100644
--- a/README.md
+++ b/README.md
@@ -69,6 +69,13 @@ In other cases you can contact the developer via email: 0)
{
filetype = "BIN";
fn = retfirmware;
- zw = "HTML Update Successfull! Additioal firmware found in ZIP file.\n";
- httpd_resp_sendstr_chunk(req, zw.c_str());
}
else
{
- zw = "HTML Update Successfull! No reboot necessary.\n";
+ zw = "HTML Update Successfull! No reboot necessary.\n";
httpd_resp_sendstr_chunk(req, zw.c_str());
httpd_resp_sendstr_chunk(req, NULL);
return ESP_OK;
@@ -385,21 +380,20 @@ esp_err_t handler_ota_update(httpd_req_t *req)
if (filetype == "BIN")
{
- const char* resp_str;
+ const char* resp_str;
+
KillTFliteTasks();
gpio_handler_deinit();
if (ota_update_task(fn))
{
-// resp_str = "rebooting - Firmware Update Successfull! You can restart now.";
-// httpd_resp_send(req, resp_str, strlen(resp_str));
-// httpd_resp_sendstr_chunk(req, NULL);
- return handler_reboot(req);
- }
- else
- {
- resp_str = "Error during Firmware Update!!! Please check output of console.";
+ std::string zw = "reboot\n";
+ httpd_resp_sendstr_chunk(req, zw.c_str());
+ httpd_resp_sendstr_chunk(req, NULL);
+ printf("Send reboot\n");
+ return ESP_OK;
}
+ resp_str = "Error during Firmware Update!!!\nPlease check output of console.";
httpd_resp_send(req, resp_str, strlen(resp_str));
#ifdef DEBUG_DETAIL_ON
@@ -428,7 +422,7 @@ esp_err_t handler_ota_update(httpd_req_t *req)
delete_all_in_directory(out);
unzip(in, out+"/");
- zw = "HTML Update Successfull! No reboot necessary";
+ zw = "HTML Update Successfull!\nNo reboot necessary";
httpd_resp_send(req, zw.c_str(), strlen(zw.c_str()));
httpd_resp_sendstr_chunk(req, NULL);
return ESP_OK;
diff --git a/code/components/jomjol_helper/Helper.cpp b/code/components/jomjol_helper/Helper.cpp
index 411553b0..6a46a4a4 100644
--- a/code/components/jomjol_helper/Helper.cpp
+++ b/code/components/jomjol_helper/Helper.cpp
@@ -209,6 +209,23 @@ size_t findDelimiterPos(string input, string delimiter)
return pos;
}
+
+void RenameFile(string from, string to)
+{
+// ESP_LOGI(logTag, "Deleting file : %s", fn.c_str());
+ /* Delete file */
+ FILE* fpSourceFile = OpenFileAndWait(from.c_str(), "rb");
+ if (!fpSourceFile) // Sourcefile existiert nicht sonst gibt es einen Fehler beim Kopierversuch!
+ {
+ printf("DeleteFile: File %s existiert nicht!\n", from.c_str());
+ return;
+ }
+ fclose(fpSourceFile);
+
+ rename(from.c_str(), to.c_str());
+}
+
+
void DeleteFile(string fn)
{
// ESP_LOGI(logTag, "Deleting file : %s", fn.c_str());
diff --git a/code/components/jomjol_helper/Helper.h b/code/components/jomjol_helper/Helper.h
index ab263cf2..bf2929a7 100644
--- a/code/components/jomjol_helper/Helper.h
+++ b/code/components/jomjol_helper/Helper.h
@@ -11,6 +11,8 @@ void FindReplace(std::string& line, std::string& oldString, std::string& newStri
void CopyFile(string input, string output);
void DeleteFile(string fn);
+void RenameFile(string from, string to);
+
FILE* OpenFileAndWait(const char* nm, const char* _mode, int _waitsec = 1);
diff --git a/code/main/main.cpp b/code/main/main.cpp
index 3a9488d2..c047929b 100644
--- a/code/main/main.cpp
+++ b/code/main/main.cpp
@@ -87,7 +87,7 @@ bool Init_NVS_SDCard()
// formatted in case when mounting fails.
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
.format_if_mount_failed = false,
- .max_files = 5,
+ .max_files = 7, // anstatt 5 (2022-09-21)
.allocation_unit_size = 16 * 1024
};
diff --git a/code/main/version.cpp b/code/main/version.cpp
index c400eed7..abada786 100644
--- a/code/main/version.cpp
+++ b/code/main/version.cpp
@@ -1,4 +1,4 @@
-const char* GIT_REV="45c9914";
+const char* GIT_REV="562cc43";
const char* GIT_TAG="";
const char* GIT_BRANCH="rolling";
-const char* BUILD_TIME="2022-09-19 20:06";
\ No newline at end of file
+const char* BUILD_TIME="2022-09-21 20:25";
\ No newline at end of file
diff --git a/code/sd-card/html/version.txt b/code/sd-card/html/version.txt
index d62af4ab..846b9361 100644
--- a/code/sd-card/html/version.txt
+++ b/code/sd-card/html/version.txt
@@ -1 +1 @@
-rolling, 45c9914,
\ No newline at end of file
+rolling, 562cc43,
\ No newline at end of file
diff --git a/code/version.cpp b/code/version.cpp
index c400eed7..abada786 100644
--- a/code/version.cpp
+++ b/code/version.cpp
@@ -1,4 +1,4 @@
-const char* GIT_REV="45c9914";
+const char* GIT_REV="562cc43";
const char* GIT_TAG="";
const char* GIT_BRANCH="rolling";
-const char* BUILD_TIME="2022-09-19 20:06";
\ No newline at end of file
+const char* BUILD_TIME="2022-09-21 20:25";
\ No newline at end of file
diff --git a/sd-card/html/ota_page.html b/sd-card/html/ota_page.html
index 1b97175c..658785a0 100644
--- a/sd-card/html/ota_page.html
+++ b/sd-card/html/ota_page.html
@@ -30,116 +30,49 @@ input[type=number] {
Check at https://github.com/jomjol/AI-on-the-edge-device/releases to see if there is an update available.
-It is strongly recommended to update firmware and web interface (stored separately in the html directory on SD-card) at the same time!
+If not use the overall update (update.zip), it is strongly recommended to update firmware and web interface at the same time!
-1. Firmware Update
+Update
-
-
-
+
+ Select the update file (update.zip, firmware.bin, html.zip, *.tfl/tflite):
+
+
-
-2. Web Interface Update
-
-
-
-
+
+
+
+
+
+
+ Do upload and update (incl. reboot - if needed)
+
+
+
+
+
Status: idle
+
-3. Reboot
- Reboot to activate updates
+Reboot
+ Manual reboot
-Upload Neural Network Definition (tfl/tflite file)
-The file must be set active afterwards on the Config page !
-
-
diff --git a/sd-card/html/ota_page_new.html b/sd-card/html/ota_page_new.html
deleted file mode 100644
index adf4dc2b..00000000
--- a/sd-card/html/ota_page_new.html
+++ /dev/null
@@ -1,238 +0,0 @@
-
-
-
-
-OTA Update
-
-
-
-
-
-
-
-Check at https://github.com/jomjol/AI-on-the-edge-device/releases to see if there is an update available.
-It is strongly recommended to update firmware and web interface (stored separately in the html directory on SD-card) at the same time!
-
-Update
-
-
-
- Select the update file (update.zip, firmware.bin, html.zip, *.tfl/tflite):
-
-
-
-
-
-
-
-
-
-
- Do upload and update (incl. reboot - if needed)
-
-
-
-
-
Status: idle
-
-
-
-Reboot
- Manual reboot
-
-
-
-
-
-
-
-
diff --git a/sd-card/html/ota_page_v2.html b/sd-card/html/ota_page_old.html
similarity index 85%
rename from sd-card/html/ota_page_v2.html
rename to sd-card/html/ota_page_old.html
index dfc0f126..1b97175c 100644
--- a/sd-card/html/ota_page_v2.html
+++ b/sd-card/html/ota_page_old.html
@@ -1,40 +1,59 @@
+
-
- AI on the edge
-
-
-
-
-
-UpDownload
-
-It is strongly recommended to update firmware and content of /html directory on SD-card at the same time!
+
+Check at https://github.com/jomjol/AI-on-the-edge-device/releases to see if there is an update available.
+It is strongly recommended to update firmware and web interface (stored separately in the html directory on SD-card) at the same time!
+
1. Firmware Update
-
-
- Flash the firmware (Takes about 60s)
-
-
-
-2. Update /html directory
+2. Web Interface Update
-
-
- Update "/html" directory
-
-
3. Reboot
-
-
-
- Reboot to activate updates
-
-
-
-4. Upload neural network definition (tfl/tflite file)
+ Reboot to activate updates
+
+Upload Neural Network Definition (tfl/tflite file)
+The file must be set active afterwards on the Config page !
- The file must be activated in the config.ini file.
@@ -127,29 +133,19 @@
-
-
-
\ No newline at end of file
+
+
diff --git a/sd-card/html/reboot_action.html b/sd-card/html/reboot_action.html
deleted file mode 100644
index 1ebe851b..00000000
--- a/sd-card/html/reboot_action.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/sd-card/html/version.txt b/sd-card/html/version.txt
index d62af4ab..846b9361 100644
--- a/sd-card/html/version.txt
+++ b/sd-card/html/version.txt
@@ -1 +1 @@
-rolling, 45c9914,
\ No newline at end of file
+rolling, 562cc43,
\ No newline at end of file