Skip to content

Commit

Permalink
chore: Set OTA timeout config
Browse files Browse the repository at this point in the history
  • Loading branch information
becem-gharbi committed Sep 26, 2023
1 parent 467ed28 commit 7eb3385
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions include/OTA.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef H_ESP_ADMIN_OTA
#define H_ESP_ADMIN_OTA

#ifndef HTTP_TIMEOUT_MS
#define HTTP_TIMEOUT_MS 8000
#endif

#include <Arduino.h>
#include <esp_http_client.h>
#include <esp_https_ota.h>
Expand Down
1 change: 1 addition & 0 deletions src/OTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace ESPAdmin
esp_http_client_config_t config = {
.url = downloadURL.c_str(),
.cert_pem = Store::ISRG_ROOT_X1,
.timeout_ms = HTTP_TIMEOUT_MS,
};

Update::onChange(UPDATE_STARTED);
Expand Down
4 changes: 2 additions & 2 deletions src/Report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ namespace ESPAdmin
}
else
{
String message;

StaticJsonDocument<96> doc;

doc["status"] = status;
doc["deploymentId"] = updateMessage.deploymentId;

String message;

serializeJson(doc, message);

HTTP::post("/report/update", message, "application/json");
Expand Down

0 comments on commit 7eb3385

Please sign in to comment.