diff --git a/ChangeLog.txt b/ChangeLog.txt index c1de034cacf31c1bed285d9c9e422bd8846207e4..606c0d5976894e3c23d0d068c0c97741fab1b6e3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -5,7 +5,8 @@ # (c) neOCampus / F.Thiebolt Université Toulouse3, Laboratoire IRIT -=== Release 221225 / feature-NVSbackport (ESP32 NVS WiFiCredentials backport) +=== Release 221225 / backport-NVSnamespace +Note: temporary release only intended to neOSensors with FW <= 220815 Based on Release 220815 / esp32 2.0.4 (because later releases broke the SPIFFS partitioning) - backport NVS namespace for WiFi credentials diff --git a/neosensor/libraries/neocampus/sensocampus.cpp b/neosensor/libraries/neocampus/sensocampus.cpp index 415f8cbae742953d74e1e2e13a068f70affc5e5a..d55d42ddec30b1259e1102f7cf60c1f90bc4134c 100644 --- a/neosensor/libraries/neocampus/sensocampus.cpp +++ b/neosensor/libraries/neocampus/sensocampus.cpp @@ -10,10 +10,11 @@ * --- * Notes: * --- - * F.Thiebolt aug.20 removed EEPROM support + * F.Thiebolt may.23 add NVS support to save sensOCampus given credentials + * F.Thiebolt aug.20 removed EEPROM support * added SPIFFS support to load/save config file - * Thiebolt F. Nov.19 migrate to Arduino Json 6 - * Thiebolt F. July 17 + * Thiebolt F. Nov.19 migrate to Arduino Json 6 + * Thiebolt F. July 17 * */ @@ -27,6 +28,14 @@ #include "SPIFFS.h" #endif +/* NVS namespace @ EPS32 */ +#ifdef ESP32 + #include "Preferences.h" // NVS storage (instead of the DEPRECATED eeprom) +#elif defined (ESP8266) + #warning "[esp8266] no NVS namespace available ... grab WiFi ssid/psk from last connection" +#endif + +/* neOCampus related includes */ #include "sensocampus.h" #include "neocampus_utils.h" @@ -42,6 +51,10 @@ // note that config of various modules is NOT saved #define CONFIG_JSON_SIZE (JSON_OBJECT_SIZE(20)) // used to parse sensOCampus config FILE +// NVS namespace for WiFi credentials +#define SENCO_NVS_NAMESPACE "sensOCampus" // 15 chars max. +#define SENSO_MQTT_LOGIN_KEY xxxxxxx +#define SENSO_MQTT_PASS_KEY yyyyyy