mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-16 10:02:05 +00:00
Merge pull request #1783 from meshtastic/ota
debug print on early boot when OTA firmware is detected.
This commit is contained in:
commit
b2c3b405b1
@ -5,16 +5,13 @@
|
|||||||
static const String MESHTASTIC_OTA_APP_PROJECT_NAME("Meshtastic-OTA");
|
static const String MESHTASTIC_OTA_APP_PROJECT_NAME("Meshtastic-OTA");
|
||||||
|
|
||||||
const esp_partition_t* BleOta::findEspOtaAppPartition() {
|
const esp_partition_t* BleOta::findEspOtaAppPartition() {
|
||||||
const esp_partition_t *part
|
const esp_partition_t *part = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_OTA_0, nullptr);
|
||||||
= esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_OTA_1, nullptr);
|
|
||||||
|
|
||||||
esp_app_desc_t app_desc;
|
esp_app_desc_t app_desc;
|
||||||
esp_err_t ret = ESP_ERROR_CHECK_WITHOUT_ABORT(esp_ota_get_partition_description(part, &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) {
|
if (ret != ESP_OK || MESHTASTIC_OTA_APP_PROJECT_NAME != app_desc.project_name) {
|
||||||
part
|
part = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_OTA_1, nullptr);
|
||||||
= 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));
|
ret = ESP_ERROR_CHECK_WITHOUT_ABORT(esp_ota_get_partition_description(part, &app_desc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#include "nimble/NimbleBluetooth.h"
|
#include "nimble/NimbleBluetooth.h"
|
||||||
|
#include "BleOta.h"
|
||||||
#include "mesh/http/WiFiAPClient.h"
|
#include "mesh/http/WiFiAPClient.h"
|
||||||
|
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
@ -63,6 +64,12 @@ void esp32Setup()
|
|||||||
preferences.putUInt("rebootCounter", rebootCounter);
|
preferences.putUInt("rebootCounter", rebootCounter);
|
||||||
preferences.end();
|
preferences.end();
|
||||||
DEBUG_MSG("Number of Device Reboots: %d\n", rebootCounter);
|
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();
|
// enableModemSleep();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user