Skip to content

Commit 4047a1d

Browse files
committed
remove error message when accessing unused NVS key, update arduinojson version
1 parent 72811c3 commit 4047a1d

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP32 Wifi Manager",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "A multi wifi manager for arduino based ESP applications, with extensive RESTful API, and configuration stored on non volatile memory.",
55
"keywords": "esp32, wifi, ap, softap, sta, restful, api, manager, arduino",
66
"repository":
@@ -18,7 +18,7 @@
1818
],
1919
"license": "CC-BY-NC-SA-4.0",
2020
"dependencies": {
21-
"bblanchon/ArduinoJson": "^7.0.3"
21+
"bblanchon/ArduinoJson": "^7.2.1"
2222
},
2323
"frameworks": "arduino",
2424
"platforms": "espressif32"

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP32_Wifi_Manager
2-
version=1.1.2
2+
version=1.1.3
33
author=Martin Verges
44
maintainer=Martin Verges <[email protected]>
55
sentence=Wifi manager for ESP32 devices

wifimanager.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,16 @@ bool WIFIMANAGER::loadFromNVS() {
151151
char tmpKey[10] = { 0 };
152152
for(uint8_t i=0; i<WIFIMANAGER_MAX_APS; i++) {
153153
sprintf(tmpKey, "apName%d", i);
154-
String apName = preferences.getString(tmpKey, "");
155-
if (apName.length() > 0) {
156-
sprintf(tmpKey, "apPass%d", i);
157-
String apPass = preferences.getString(tmpKey);
158-
Serial.printf("[WIFI] Load SSID '%s' to %d. slot.\n", apName.c_str(), i+1);
159-
apList[i].apName = apName;
160-
apList[i].apPass = apPass;
161-
configuredSSIDs++;
154+
if (preferences.getType(tmpKey) == PT_STR) {
155+
String apName = preferences.getString(tmpKey, "");
156+
if (apName.length() > 0) {
157+
sprintf(tmpKey, "apPass%d", i);
158+
String apPass = preferences.getString(tmpKey);
159+
Serial.printf("[WIFI] Load SSID '%s' to %d. slot.\n", apName.c_str(), i+1);
160+
apList[i].apName = apName;
161+
apList[i].apPass = apPass;
162+
configuredSSIDs++;
163+
}
162164
}
163165
}
164166
preferences.end();

0 commit comments

Comments
 (0)