diff --git a/lib/app/app.cpp b/lib/app/app.cpp index e2a9826..f4885c9 100644 --- a/lib/app/app.cpp +++ b/lib/app/app.cpp @@ -198,7 +198,6 @@ void setupApiSettings() root["system"]["dst"] = NVS.getInt("system.dst"); root["system"]["wifi"] = NVS.getString("wifi.ssid"); - //root["device"]["angle"] = NVS.getInt("device.angle"); root["device"]["theme"] = NVS.getString("device.theme"); root["device"]["name"] = NVS.getString("device.name"); @@ -455,15 +454,16 @@ void setupApiCache() } /** - * api data endpoint + * ota update */ void setupOTA() { - // Simple Firmware Update Form + // recovery update mode server.on("/update", HTTP_GET, [](AsyncWebServerRequest *request) { request->send(200, "text/html", "
"); }); + // handle update server.on( "/update", HTTP_POST, [](AsyncWebServerRequest *request) {}, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) { diff --git a/lib/download/download.cpp b/lib/download/download.cpp index a8a366f..e7ffb4c 100644 --- a/lib/download/download.cpp +++ b/lib/download/download.cpp @@ -4,7 +4,7 @@ #include "device.h" #include "esp_task_wdt.h" -bool downloadFile(String url, const char *path, const char* CAcert) +bool downloadFile(String url, const char *path, const char *CAcert) { // @note duration time: 200kb = 35sec write to flash Serial.println("Download file: " + url); @@ -32,9 +32,12 @@ bool downloadFile(String url, const char *path, const char* CAcert) // use the last 8 bytes of the unique serial id http.addHeader("X-PaperDash-Id", DeviceId); - if (CAcert) { + if (CAcert) + { http.begin(url, CAcert); - } else { + } + else + { http.begin(url); } @@ -68,7 +71,6 @@ bool downloadFile(String url, const char *path, const char* CAcert) return !hasError; } - bool downloadFile(String url, const char *path) { return downloadFile(url, path, NULL);