From 4534d17d79dcb73c0f58a6fdfc22f61b3782d355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 10 Oct 2022 23:05:24 +0200 Subject: [PATCH] debug print on early boot when OTA firmware is detected. --- src/platform/esp32/BleOta.cpp | 7 ++----- src/platform/esp32/main-esp32.cpp | 7 +++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/platform/esp32/BleOta.cpp b/src/platform/esp32/BleOta.cpp index 8062eede6..ef93a240b 100644 --- a/src/platform/esp32/BleOta.cpp +++ b/src/platform/esp32/BleOta.cpp @@ -5,16 +5,13 @@ static const String MESHTASTIC_OTA_APP_PROJECT_NAME("Meshtastic-OTA"); const esp_partition_t* BleOta::findEspOtaAppPartition() { - const esp_partition_t *part - = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_OTA_1, nullptr); + const esp_partition_t *part = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_OTA_0, nullptr); esp_app_desc_t app_desc; esp_err_t ret = ESP_ERROR_CHECK_WITHOUT_ABORT(esp_ota_get_partition_description(part, &app_desc)); if (ret != ESP_OK || MESHTASTIC_OTA_APP_PROJECT_NAME != app_desc.project_name) { - part - = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_OTA_1, - nullptr); + part = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_OTA_1, nullptr); ret = ESP_ERROR_CHECK_WITHOUT_ABORT(esp_ota_get_partition_description(part, &app_desc)); } diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index 134d89332..9e8990d97 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -4,6 +4,7 @@ #include "main.h" #include "nimble/NimbleBluetooth.h" +#include "BleOta.h" #include "mesh/http/WiFiAPClient.h" #include "sleep.h" @@ -63,6 +64,12 @@ void esp32Setup() preferences.putUInt("rebootCounter", rebootCounter); preferences.end(); DEBUG_MSG("Number of Device Reboots: %d\n", rebootCounter); + String BLEOTA=BleOta::getOtaAppVersion(); + if (BLEOTA.isEmpty()) { + DEBUG_MSG("No OTA firmware available\n"); + }else{ + DEBUG_MSG("OTA firmware version %s\n", BLEOTA); + } // enableModemSleep();