From 2ed466fb67ab5b7a32dacfa07e90f6d411ff6fa5 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sat, 22 Sep 2018 16:48:51 +0200 Subject: [PATCH] Increasing stream timeout to avoid read timeout If using nginx webserver to feed the OTA stream with the binary, i'm getting reproducely _error #6 (stream read timeout) on a ESP32 Pycom LoPy with CPU revision 0. This error does not occur with some other ESP32 boards with same setup and server, don't know why. But i could fix the issue with the LoPy following a hint for ESP 8266 Update.cpp, found in this issue: https://github.com/esp8266/Arduino/issues/1157 This PR is a quick&dirty fix. Problem should be further analysed and then solved at the root cause. --- libraries/Update/src/Updater.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/Update/src/Updater.cpp b/libraries/Update/src/Updater.cpp index d2ea1e9b41a..3447b6176b1 100644 --- a/libraries/Update/src/Updater.cpp +++ b/libraries/Update/src/Updater.cpp @@ -303,6 +303,7 @@ size_t UpdateClass::write(uint8_t *data, size_t len) { } size_t UpdateClass::writeStream(Stream &data) { + data.setTimeout(10000); size_t written = 0; size_t toRead = 0; if(hasError() || !isRunning())