Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Watchdog cause restart ESP - update not end. Must be done better, but problem is fixed. #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/AsyncElegantOTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -122,6 +123,9 @@ 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");
Expand Down