diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index 7bd947f4..4090b40f 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -1516,7 +1516,9 @@ void halt() { void reloadCompanionWiFiPowerSave() { uint8_t configured = mesh::wifi::kDefaultPowerSave; Preferences nvs; - if (nvs.begin("mesh-wifi", true)) { + // On a fresh install the namespace may not exist until WiFi setup runs. + // Create it here so loading the default does not log NVS_NOT_FOUND. + if (nvs.begin("mesh-wifi", false)) { configured = nvs.getUChar("powersave", mesh::wifi::kDefaultPowerSave); nvs.end(); } diff --git a/src/helpers/IdentityStore.cpp b/src/helpers/IdentityStore.cpp index feb24bb2..732e0da8 100644 --- a/src/helpers/IdentityStore.cpp +++ b/src/helpers/IdentityStore.cpp @@ -54,7 +54,9 @@ IdentityLoadResult IdentityStore::loadResult( // accepts either that temporary key or a missing identity. if (strcmp(_dir, "/identity") == 0 && strcmp(name, "_main") == 0) { Preferences migration_nvs; - if (migration_nvs.begin("mesh-pt-migrate", true)) { + // A fresh device has no migration namespace. Open read-write to create the + // empty namespace once instead of logging NVS_NOT_FOUND on every boot. + if (migration_nvs.begin("mesh-pt-migrate", false)) { const bool pending = migration_nvs.getBool("id-pending", false); uint8_t file_bytes[PUB_KEY_SIZE + PRV_KEY_SIZE]; const size_t staged = pending