diff --git a/src/ota.cpp b/src/ota.cpp index 83c8a568..ac409a0c 100644 --- a/src/ota.cpp +++ b/src/ota.cpp @@ -118,6 +118,10 @@ int do_ota_update() { // Fetch the latest firmware version ESP_LOGI(TAG, "Checking latest firmware version on server"); display(2, "**", "checking version"); + + if (WiFi.status() != WL_CONNECTED) + return 1; + const String latest = bintray.getLatestVersion(); if (latest.length() == 0) { @@ -133,6 +137,8 @@ int do_ota_update() { display(2, "OK", latest.c_str()); display(3, "**", ""); + if (WiFi.status() != WL_CONNECTED) + return 1; String firmwarePath = bintray.getBinaryPath(latest); if (!firmwarePath.endsWith(".bin")) { ESP_LOGI(TAG, "Unsupported binary format"); diff --git a/src/rcommand.cpp b/src/rcommand.cpp index 0ce4bb6a..bd417b0e 100644 --- a/src/rcommand.cpp +++ b/src/rcommand.cpp @@ -8,8 +8,6 @@ static const char TAG[] = "main"; // helper function void do_reset() { ESP_LOGI(TAG, "Remote command: restart device"); - if (irqHandlerTask != NULL) - vTaskDelete(irqHandlerTask); LMIC_shutdown(); vTaskDelay(3000 / portTICK_PERIOD_MS); esp_restart();