From 6bbdc3bd3364dffaa6c24b202a4a833ae711dd84 Mon Sep 17 00:00:00 2001 From: Mario Mariete <11509521+melkati@users.noreply.github.com> Date: Sun, 18 Feb 2024 14:48:34 +0100 Subject: [PATCH] Enable debug mode in CO2_Gadget_Preferences.h --- CO2_Gadget_Preferences.h | 6 +++++- CO2_Gadget_WIFI.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CO2_Gadget_Preferences.h b/CO2_Gadget_Preferences.h index 28e5ebcc..cd04b3f2 100644 --- a/CO2_Gadget_Preferences.h +++ b/CO2_Gadget_Preferences.h @@ -165,7 +165,7 @@ void initPreferences() { wifiPass.trim(); hostName.trim(); preferences.end(); -// #define DEBUG_PREFERENCES +#define DEBUG_PREFERENCES #ifdef DEBUG_PREFERENCES printPreferences(); #endif @@ -237,6 +237,10 @@ void putPreferences() { preferences.putUInt("timeBtwnBzr", timeBetweenBuzzerBeeps); // Time between beeps preferences.end(); + +#ifdef DEBUG_PREFERENCES + printPreferences(); +#endif } String getPreferencesAsJson() { diff --git a/CO2_Gadget_WIFI.h b/CO2_Gadget_WIFI.h index 3125ebc3..2402c1ca 100644 --- a/CO2_Gadget_WIFI.h +++ b/CO2_Gadget_WIFI.h @@ -737,6 +737,8 @@ void wifiClientLoop() { // Only checks for SSID changed (not password) if ((WiFi.SSID() != wifiSSID) && (!inMenu)) { Serial.println("-->[WiFi] Wi-Fi SSID changed. Old SSID: " + wifiSSID + ", new SSID: " + WiFi.SSID()); + Serial.println("-->[WiFi] IP address: " + WiFi.localIP().toString()); + Serial.println("-->[WiFi] RSSI: " + String(WiFi.RSSI()) + " dBm"); wifiSSID = WiFi.SSID(); activeWIFI = true; putPreferences();