diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index b6e35f5..56dd492 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -45,6 +45,7 @@ #include #include +#include #endif // https://github.com/mathieucarbou/ESPAsyncWebServer diff --git a/Arduino/CanGrow/include/Webserver/Page_system.h b/Arduino/CanGrow/include/Webserver/Page_system.h index 370b046..9f2e26b 100644 --- a/Arduino/CanGrow/include/Webserver/Page_system.h +++ b/Arduino/CanGrow/include/Webserver/Page_system.h @@ -95,7 +95,12 @@ void WebPage_system_restart(AsyncWebServerRequest *request) { void WebPage_system_update_ApplyUpdate(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final){ if(!index){ Serial.printf(":: [Webserver:system:update:ApplyUpdate] Update Start: %s\n", filename.c_str()); + + // https://github.com/me-no-dev/ESPAsyncWebServer/issues/455#issuecomment-451728099 + // workaround for bug with ESP32 + #ifdef ESP8266 Update.runAsync(true); + #endif if(!Update.begin((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000)){ Update.printError(Serial); }