From aa7c860a6725ae42cabd92b413269cb83d51aecd Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 7 Feb 2021 12:20:10 +0100 Subject: [PATCH 1/3] Watchdog cause restart ESP - update not end. Command for disable watchdog added. --- src/AsyncElegantOTA.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/AsyncElegantOTA.h b/src/AsyncElegantOTA.h index c03c455..b07fbb5 100644 --- a/src/AsyncElegantOTA.h +++ b/src/AsyncElegantOTA.h @@ -106,6 +106,7 @@ class AsyncElegantOtaClass{ uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000; if (!Update.begin((cmd == U_FS)?fsSize:maxSketchSpace, cmd)){ // Start with max available size #elif defined(ESP32) + disableCore0WDT(); //////////////////////////////////////////////////////////////////////////// int cmd = (filename == "filesystem") ? U_SPIFFS : U_FLASH; if (!Update.begin(UPDATE_SIZE_UNKNOWN, cmd)) { // Start with max available size #endif @@ -126,6 +127,7 @@ class AsyncElegantOtaClass{ Update.printError(Serial); return request->send(400, "text/plain", "Could not end OTA"); } + //enableCore0WDT();/////////////////////////////////////////////////////////////////////////////////// }else{ return; } From 9f16a60d27143461cd55796118c8eaf853fb0ba0 Mon Sep 17 00:00:00 2001 From: Sejny Date: Sun, 26 Sep 2021 18:26:15 +0200 Subject: [PATCH 2/3] Update AsyncElegantOTA.h --- src/AsyncElegantOTA.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AsyncElegantOTA.h b/src/AsyncElegantOTA.h index b07fbb5..4e71595 100644 --- a/src/AsyncElegantOTA.h +++ b/src/AsyncElegantOTA.h @@ -127,7 +127,7 @@ class AsyncElegantOtaClass{ Update.printError(Serial); return request->send(400, "text/plain", "Could not end OTA"); } - //enableCore0WDT();/////////////////////////////////////////////////////////////////////////////////// + enableCore0WDT();/////////////////////////////////////////////////////////////////////////////////// }else{ return; } From 5c7adc399e0e7099fc517f9516e4eeaae6ef567b Mon Sep 17 00:00:00 2001 From: Sejny Date: Sun, 26 Sep 2021 18:34:47 +0200 Subject: [PATCH 3/3] Update AsyncElegantOTA.h --- src/AsyncElegantOTA.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/AsyncElegantOTA.h b/src/AsyncElegantOTA.h index 4e71595..270b440 100644 --- a/src/AsyncElegantOTA.h +++ b/src/AsyncElegantOTA.h @@ -123,11 +123,13 @@ class AsyncElegantOtaClass{ } if (final) { // if the final flag is set then this is the last frame of data + #if defined(ESP32) + enableCore0WDT();/////////////////////////////////////////////////////////////////////////////////// + #endif if (!Update.end(true)) { //true to set the size to the current progress Update.printError(Serial); return request->send(400, "text/plain", "Could not end OTA"); } - enableCore0WDT();/////////////////////////////////////////////////////////////////////////////////// }else{ return; }