diff --git a/examples/Async_AutoConnect/Async_AutoConnect.ino b/examples/Async_AutoConnect/Async_AutoConnect.ino index 8e549fe6..ca4b3c19 100644 --- a/examples/Async_AutoConnect/Async_AutoConnect.ino +++ b/examples/Async_AutoConnect/Async_AutoConnect.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. @@ -34,10 +35,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL //Ported to ESP32 #ifdef ESP32 @@ -421,10 +422,11 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); + ////// ////// if (file) diff --git a/examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino b/examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino index e6580472..eee6a4ff 100644 --- a/examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino +++ b/examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.3.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -24,6 +24,8 @@ 1.1.2 K Hoang 17/09/2020 Fix bug in examples. 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library + 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. @@ -33,10 +35,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include @@ -529,6 +531,8 @@ bool saveFileFSConfigFile() if (!configFile) { Serial.println("Failed to open config file for writing"); + + return false; } #if (ARDUINOJSON_VERSION_MAJOR >= 6) @@ -545,6 +549,8 @@ bool saveFileFSConfigFile() configFile.close(); //end save + + return true; } void toggleLED() @@ -623,10 +629,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino b/examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino index 695285b1..86e394b1 100644 --- a/examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino +++ b/examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -24,7 +24,8 @@ 1.1.2 K Hoang 17/09/2020 Fix bug in examples. 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library - 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) @@ -35,10 +36,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include //this needs to be first, or it all crashes and burns... @@ -469,10 +470,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino b/examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino index 61f457fd..ac63d86f 100644 --- a/examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino +++ b/examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. @@ -34,10 +35,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL //Ported to ESP32 #ifdef ESP32 @@ -425,10 +426,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino b/examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino index f29faa1d..3677d1dc 100644 --- a/examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino +++ b/examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. @@ -34,10 +35,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL //Ported to ESP32 #ifdef ESP32 @@ -456,10 +457,11 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); + ////// ////// if (file) diff --git a/examples/Async_ConfigOnDRD_FS_MQTT_Ptr/Async_ConfigOnDRD_FS_MQTT_Ptr.ino b/examples/Async_ConfigOnDRD_FS_MQTT_Ptr/Async_ConfigOnDRD_FS_MQTT_Ptr.ino index 05cc91d3..664b348f 100644 --- a/examples/Async_ConfigOnDRD_FS_MQTT_Ptr/Async_ConfigOnDRD_FS_MQTT_Ptr.ino +++ b/examples/Async_ConfigOnDRD_FS_MQTT_Ptr/Async_ConfigOnDRD_FS_MQTT_Ptr.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a Config Portal when there is no stored WiFi Credentials or when a DRD is detected. @@ -47,10 +48,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include @@ -593,10 +594,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_ConfigOnDRD_FS_MQTT_Ptr_Complex/Async_ConfigOnDRD_FS_MQTT_Ptr_Complex.ino b/examples/Async_ConfigOnDRD_FS_MQTT_Ptr_Complex/Async_ConfigOnDRD_FS_MQTT_Ptr_Complex.ino index bc7e2737..0d880ca9 100644 --- a/examples/Async_ConfigOnDRD_FS_MQTT_Ptr_Complex/Async_ConfigOnDRD_FS_MQTT_Ptr_Complex.ino +++ b/examples/Async_ConfigOnDRD_FS_MQTT_Ptr_Complex/Async_ConfigOnDRD_FS_MQTT_Ptr_Complex.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a Config Portal when there is no stored WiFi Credentials or when a DRD is detected. @@ -47,10 +48,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include @@ -643,10 +644,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_ConfigOnDRD_FS_MQTT_Ptr_Medium/Async_ConfigOnDRD_FS_MQTT_Ptr_Medium.ino b/examples/Async_ConfigOnDRD_FS_MQTT_Ptr_Medium/Async_ConfigOnDRD_FS_MQTT_Ptr_Medium.ino index 7f95f35f..f3dc6da2 100644 --- a/examples/Async_ConfigOnDRD_FS_MQTT_Ptr_Medium/Async_ConfigOnDRD_FS_MQTT_Ptr_Medium.ino +++ b/examples/Async_ConfigOnDRD_FS_MQTT_Ptr_Medium/Async_ConfigOnDRD_FS_MQTT_Ptr_Medium.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a Config Portal when there is no stored WiFi Credentials or when a DRD is detected. @@ -47,10 +48,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include @@ -629,10 +630,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) @@ -807,7 +808,7 @@ void wifi_manager() // add all parameters here // order of adding is not important - for (int i = 0; i < NUMBER_PARAMETERS; i++) + for (unsigned int i = 0; i < NUMBER_PARAMETERS; i++) { ESPAsync_wifiManager.addParameter(DATA_FIELD[i]); } @@ -900,7 +901,7 @@ void wifi_manager() // Getting posted form values and overriding local variables parameters // Config file is written regardless the connection state - for (int i = 0; i < NUMBER_PARAMETERS; i++) + for (unsigned int i = 0; i < NUMBER_PARAMETERS; i++) { strcpy(AIO_SERVER_TOTAL_DATA[i]._value, DATA_FIELD[i]->getValue()); } @@ -973,7 +974,7 @@ bool readConfigFile() // Parse all config file parameters, override // local config variables with parsed values - for (int i = 0; i < NUMBER_PARAMETERS; i++) + for (unsigned int i = 0; i < NUMBER_PARAMETERS; i++) { if (json.containsKey(AIO_SERVER_TOTAL_DATA[i]._id)) { @@ -999,7 +1000,7 @@ bool writeConfigFile() #endif // JSONify local configuration parameters - for (int i = 0; i < NUMBER_PARAMETERS; i++) + for (unsigned int i = 0; i < NUMBER_PARAMETERS; i++) { json[AIO_SERVER_TOTAL_DATA[i]._id] = AIO_SERVER_TOTAL_DATA[i]._value; } diff --git a/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino b/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino index e6cca87a..e5e64349 100644 --- a/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino +++ b/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a configuration portal when the reset button is pressed twice. @@ -57,10 +58,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include @@ -511,10 +512,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino b/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino index b54abf51..e70f097d 100644 --- a/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino +++ b/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a configuration portal when no WiFi configuration has been previously entered or when a button is pushed. @@ -46,10 +47,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL //For ESP32, To use ESP32 Dev Module, QIO, Flash 4MB/80MHz, Upload 921600 @@ -565,10 +566,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino b/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino index a4706a69..413d821f 100644 --- a/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino +++ b/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a configuration portal when the reset button is pressed twice. @@ -69,10 +70,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include @@ -617,10 +618,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_ConfigOnSwitchFS_MQTT_Ptr/Async_ConfigOnSwitchFS_MQTT_Ptr.ino b/examples/Async_ConfigOnSwitchFS_MQTT_Ptr/Async_ConfigOnSwitchFS_MQTT_Ptr.ino index 2a55947f..0ab137bf 100644 --- a/examples/Async_ConfigOnSwitchFS_MQTT_Ptr/Async_ConfigOnSwitchFS_MQTT_Ptr.ino +++ b/examples/Async_ConfigOnSwitchFS_MQTT_Ptr/Async_ConfigOnSwitchFS_MQTT_Ptr.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a Config Portal when there is no stored WiFi Credentials or when a button is pressed. @@ -51,10 +52,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include // for button #include // for button @@ -648,10 +649,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino b/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino index 42063f0a..de3097bd 100644 --- a/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino +++ b/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -24,7 +24,8 @@ 1.1.2 K Hoang 17/09/2020 Fix bug in examples. 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library - 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a configuration portal when a predetermined button is pressed @@ -48,10 +49,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include // Now support ArduinoJson 6.0.0+ ( tested with v6.14.1 ) @@ -590,10 +591,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino b/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino index 90e40d36..1844ae51 100644 --- a/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino +++ b/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /***************************************************************************************************************************** Compare this efficient Async_ESP32_FSWebServer_DRD example with the so complicated twin ESP32_FSWebServer @@ -50,10 +51,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include #include @@ -454,10 +455,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_ESP32_FSWebServer_DRD/Async_ESP32_FSWebServer_DRD.ino b/examples/Async_ESP32_FSWebServer_DRD/Async_ESP32_FSWebServer_DRD.ino index 85af447b..84d571ce 100644 --- a/examples/Async_ESP32_FSWebServer_DRD/Async_ESP32_FSWebServer_DRD.ino +++ b/examples/Async_ESP32_FSWebServer_DRD/Async_ESP32_FSWebServer_DRD.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /***************************************************************************************************************************** Compare this efficient Async_ESP32_FSWebServer_DRD example with the so complicated twin ESP32_FSWebServer @@ -50,10 +51,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include #include @@ -486,10 +487,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) @@ -550,8 +551,6 @@ void setup() Serial.setDebugOutput(false); - bool FileFSReady = true; - if (FORMAT_FILESYSTEM) FileFS.format(); diff --git a/examples/Async_ESP_FSWebServer/Async_ESP_FSWebServer.ino b/examples/Async_ESP_FSWebServer/Async_ESP_FSWebServer.ino index eaa3b86f..44791fd6 100644 --- a/examples/Async_ESP_FSWebServer/Async_ESP_FSWebServer.ino +++ b/examples/Async_ESP_FSWebServer/Async_ESP_FSWebServer.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /***************************************************************************************************************************** Compare this efficient Async_ESP_FSWebServer example with the so complicated twin ESP32_FSWebServer @@ -50,10 +51,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include #include @@ -454,10 +455,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/Async_ESP_FSWebServer_DRD/Async_ESP_FSWebServer_DRD.ino b/examples/Async_ESP_FSWebServer_DRD/Async_ESP_FSWebServer_DRD.ino index 00622f73..658e76bd 100644 --- a/examples/Async_ESP_FSWebServer_DRD/Async_ESP_FSWebServer_DRD.ino +++ b/examples/Async_ESP_FSWebServer_DRD/Async_ESP_FSWebServer_DRD.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ /***************************************************************************************************************************** Compare this efficient Async_ESP_FSWebServer example with the so complicated twin ESP32_FSWebServer @@ -50,10 +51,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include #include @@ -471,10 +472,10 @@ void loadConfigData() File file = FileFS.open(CONFIG_FILENAME, "r"); LOGERROR(F("LoadWiFiCfgFile ")); - memset(&WM_config, sizeof(WM_config), 0); + memset(&WM_config, 0, sizeof(WM_config)); // New in v1.4.0 - memset(&WM_STA_IPconfig, sizeof(WM_STA_IPconfig), 0); + memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig)); ////// if (file) diff --git a/examples/ModelessConnect/ModelessConnect.ino b/examples/ModelessConnect/ModelessConnect.ino index 30ae4de6..75161fe1 100644 --- a/examples/ModelessConnect/ModelessConnect.ino +++ b/examples/ModelessConnect/ModelessConnect.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) @@ -35,10 +36,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #if defined(ESP8266) #include //https://github.com/esp8266/Arduino diff --git a/examples/ModelessWithInterrupts/ModelessWithInterrupts.ino b/examples/ModelessWithInterrupts/ModelessWithInterrupts.ino index 6abdf7f7..54346bff 100644 --- a/examples/ModelessWithInterrupts/ModelessWithInterrupts.ino +++ b/examples/ModelessWithInterrupts/ModelessWithInterrupts.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.4.0 + Version: 1.4.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -25,6 +25,7 @@ 1.2.0 K Hoang 15/10/2020 Restore cpp code besides Impl.h code to use if linker error. Fix bug. 1.3.0 K Hoang 04/12/2020 Add LittleFS support to ESP32 using LITTLEFS Library 1.4.0 K Hoang 18/12/2020 Fix staticIP not saved. Add functions. Add complex examples. + 1.4.1 K Hoang 21/12/2020 Fix bug and compiler warnings. *****************************************************************************************************************************/ #if !defined(ESP8266) @@ -35,10 +36,10 @@ #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 // Default is 30s, using 20s now -#define TIME_BETWEEN_MODAL_SCANS 20000 +#define TIME_BETWEEN_MODAL_SCANS 20000UL // Default is 60s, using 30s now -#define TIME_BETWEEN_MODELESS_SCANS 30000 +#define TIME_BETWEEN_MODELESS_SCANS 30000UL #include //https://github.com/esp8266/Arduino #include