fix(ota): remove artificial chunk delay and enlarge buffer to prevent connection timeout
All checks were successful
ESP32 Build & Release / build (push) Successful in 1m11s
All checks were successful
ESP32 Build & Release / build (push) Successful in 1m11s
This commit is contained in:
@@ -494,9 +494,10 @@ static void ota_download_task(void *arg)
|
|||||||
esp_http_client_config_t http_cfg = {
|
esp_http_client_config_t http_cfg = {
|
||||||
.url = s_release.download_url,
|
.url = s_release.download_url,
|
||||||
.transport_type = HTTP_TRANSPORT_OVER_SSL,
|
.transport_type = HTTP_TRANSPORT_OVER_SSL,
|
||||||
.timeout_ms = 30000,
|
.timeout_ms = 45000,
|
||||||
.keep_alive_enable = true,
|
.keep_alive_enable = true,
|
||||||
.buffer_size = 2048,
|
.buffer_size = 4096,
|
||||||
|
.buffer_size_tx = 2048,
|
||||||
.cert_pem = s_isrg_root_x1_pem,
|
.cert_pem = s_isrg_root_x1_pem,
|
||||||
.cert_len = sizeof(s_isrg_root_x1_pem),
|
.cert_len = sizeof(s_isrg_root_x1_pem),
|
||||||
};
|
};
|
||||||
@@ -533,6 +534,7 @@ static void ota_download_task(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int chunk_counter = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
if (s_cancel_requested) {
|
if (s_cancel_requested) {
|
||||||
ESP_LOGW(TAG, "OTA canceled by user");
|
ESP_LOGW(TAG, "OTA canceled by user");
|
||||||
@@ -555,7 +557,10 @@ static void ota_download_task(void *arg)
|
|||||||
if (read > 0) s_bytes_read = (size_t)read;
|
if (read > 0) s_bytes_read = (size_t)read;
|
||||||
if (total > 0) s_total_bytes = (size_t)total;
|
if (total > 0) s_total_bytes = (size_t)total;
|
||||||
|
|
||||||
vTaskDelay(pdMS_TO_TICKS(10));
|
/* Yield every 4 chunks (16 KB) to feed the task watchdog without throttling throughput */
|
||||||
|
if (++chunk_counter % 4 == 0) {
|
||||||
|
vTaskDelay(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rfid_manager_pause(false);
|
rfid_manager_pause(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user