From 59e18324f0fc26c1c3f1fc31b9e3b972332c5e8d Mon Sep 17 00:00:00 2001 From: Mario Mariete <11509521+melkati@users.noreply.github.com> Date: Sun, 28 Jan 2024 19:44:11 +0100 Subject: [PATCH] Add Improv-WiFi save credentials to NVR --- CO2_Gadget_Improv.h | 7 ++++--- platformio.ini | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CO2_Gadget_Improv.h b/CO2_Gadget_Improv.h index 91598cd5..766910ab 100644 --- a/CO2_Gadget_Improv.h +++ b/CO2_Gadget_Improv.h @@ -32,10 +32,11 @@ void onImprovWiFiErrorCb(ImprovTypes::Error err) { blink_led(2000, 3); } -void onImprovWiFiConnectedCb(const char *ssid, const char *password) { - // Save ssid and password here - // server.begin(); +void onImprovWiFiConnectedCb(const char *ssid, const char *password) { Serial.println("-->[IMPR] Connected to: " + String(ssid)); + wifiSSID = ssid; + wifiPass = password; + putPreferences(); blink_led(100, 3); } diff --git a/platformio.ini b/platformio.ini index 212e44ab..b8324a20 100644 --- a/platformio.ini +++ b/platformio.ini @@ -58,7 +58,7 @@ build_flags = -D MQTT_BROKER_SERVER="\"192.168.1.145"\" -D CO2_GADGET_VERSION="\"0.8."\" - -D CO2_GADGET_REV="\"086"\" + -D CO2_GADGET_REV="\"087"\" -D CORE_DEBUG_LEVEL=0 -DNEOPIXEL_PIN=26 ; Pinnumber for button for down/next and back / exit actions -DNEOPIXEL_COUNT=16 ; How many neopixels to control