From 439ea0c0576628197c2c3d60fde017f60a5aa775 Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Wed, 3 Mar 2021 18:46:41 +0100 Subject: [PATCH] maintenance mode adjustments --- src/ota.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ota.cpp b/src/ota.cpp index ae46d42f..bfc1d4a9 100644 --- a/src/ota.cpp +++ b/src/ota.cpp @@ -403,6 +403,7 @@ void start_maintenance(void) { server.sendHeader("Connection", "close"); server.send(200, "text/html", serverIndex); }); + // handling uploading firmware file server.on( "/update", HTTP_POST, @@ -428,11 +429,14 @@ void start_maintenance(void) { } else if (upload.status == UPLOAD_FILE_END) { if (Update.end( true)) { // true to set the size to the current progress - ESP_LOGI(TAG, "Update Success: %u\nRebooting...\n", + ESP_LOGI(TAG, "Update finished, %u bytes written", upload.totalSize); + } else { ESP_LOGE(TAG, "Update failed"); } + delay(3000); + do_reset(false); } }); server.begin();