Skip to content

Commit ab73583

Browse files
committed
Fix ESP32-Solo WDT on HTTP OTA update
1 parent 4ada3f5 commit ab73583

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

libraries/HTTPUpdate/src/HTTPUpdate.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ HTTPUpdateResult HTTPUpdate::handleUpdate(HTTPClient& http, const String& curren
199199
if(sketchMD5.length() != 0) {
200200
http.addHeader("x-ESP32-sketch-md5", sketchMD5);
201201
}
202+
203+
delay(1); // Fix solo WDT
204+
202205
// Add also a SHA256
203206
String sketchSHA256 = getSketchSHA256();
204207
if(sketchSHA256.length() != 0) {

libraries/Update/src/Updater.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ size_t UpdateClass::writeStream(Stream &data) {
352352
bytesToRead = remaining();
353353
}
354354

355-
/*
355+
/*
356356
Init read&timeout counters and try to read, if read failed, increase counter,
357357
wait 100ms and try to read again. If counter > 300 (30 sec), give up/abort
358358
*/
@@ -377,6 +377,8 @@ size_t UpdateClass::writeStream(Stream &data) {
377377
if((_bufferLen == remaining() || _bufferLen == SPI_FLASH_SEC_SIZE) && !_writeBuffer())
378378
return written;
379379
written += toRead;
380+
381+
delay(1); // Fix solo WDT
380382
}
381383
return written;
382384
}

0 commit comments

Comments
 (0)