Marcus 2024-10-22 01:16:09 +02:00
parent 5af5bcd94d
commit 44ca2c6a8e
2 changed files with 6 additions and 0 deletions

View file

@ -45,6 +45,7 @@
#include <WiFi.h>
#include <AsyncTCP.h>
#include <Update.h>
#endif
// https://github.com/mathieucarbou/ESPAsyncWebServer

View file

@ -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);
}