diff --git a/README.md b/README.md index 45b0960..d30e4ff 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ * [Why using Async](#why-using-async) * [Currently supported Boards](#currently-supported-boards) * [Changelog](#changelog) + * [Releases v1.2.3](#releases-v123) * [Releases v1.2.2](#releases-v122) * [Releases v1.2.1](#releases-v121) * [Major Releases v1.2.0](#major-releases-v120) @@ -144,6 +145,10 @@ This [**BlynkESP32_BT_WF** library](https://github.com/khoih-prog/BlynkESP32_BT_ ## Changelog +### Releases v1.2.3 + +1. To permit auto-reset after configurable timeout if DRD/MRD or non-persistent forced-CP. Check [**Good new feature: Blynk.resetAndEnterConfigPortal() Thanks & question #27**](https://github.com/khoih-prog/Blynk_WM/issues/27) + ### Releases v1.2.2 1. Fix rare Config Portal bug not updating Config and dynamic Params data successfully in very noisy or weak WiFi situation @@ -1208,7 +1213,7 @@ The following is the sample terminal output when running example [Async_ESP8266W ``` Starting Async_ESP8266WM_MRD_Config using LittleFS with SSL on ESP8266_NODEMCU -Blynk_Async_WM SSL for ESP8266 v1.2.2 +Blynk_Async_WM SSL for ESP8266 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFE0001 multiResetDetectorFlag = 0xFFFE0001 @@ -1288,7 +1293,7 @@ BBBBBB ``` Starting Async_ESP8266WM_MRD_Config using LittleFS with SSL on ESP8266_NODEMCU -Blynk_Async_WM SSL for ESP8266 v1.2.2 +Blynk_Async_WM SSL for ESP8266 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFC0003 multiResetDetectorFlag = 0xFFFC0003 @@ -1399,7 +1404,7 @@ F[229521] id: = HueNet1 ``` Starting Async_ESP8266WM_MRD_Config using LittleFS with SSL on ESP8266_NODEMCU -Blynk_Async_WM SSL for ESP8266 v1.2.2 +Blynk_Async_WM SSL for ESP8266 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFE0001 multiResetDetectorFlag = 0xFFFE0001 @@ -1485,7 +1490,7 @@ The following is the sample terminal output when running example [Async_ESP32WM_ ``` Starting Async_ESP32WM_MRD_Config using LittleFS with SSL on ESP32_DEV -Blynk_Async_WM SSL for ESP32 v1.2.2 +Blynk_Async_WM SSL for ESP32 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFE0001 multiResetDetectorFlag = 0xFFFE0001 @@ -1564,7 +1569,7 @@ Pubs Topics = default-mqtt-PubTopic ``` Starting Async_ESP32WM_MRD_Config using LittleFS with SSL on ESP32_DEV -Blynk_Async_WM SSL for ESP32 v1.2.2 +Blynk_Async_WM SSL for ESP32 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFC0003 multiResetDetectorFlag = 0xFFFC0003 @@ -1669,7 +1674,7 @@ RFRFRF[188660] id: = HueNet1 ``` Starting Async_ESP32WM_MRD_Config using LittleFS with SSL on ESP32_DEV -Blynk_Async_WM SSL for ESP32 v1.2.2 +Blynk_Async_WM SSL for ESP32 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFE0001 multiResetDetectorFlag = 0xFFFE0001 @@ -1806,7 +1811,7 @@ The following is the sample terminal output when running example [Async_ESP32_Mu ``` Starting Async_ESP32_MultiTask using LittleFS without SSL on ESP32_DEV -Blynk_Async_WM for ESP32 v1.2.2 +Blynk_Async_WM for ESP32 v1.2.3 ESP_DoubleResetDetector v1.1.1 [1431] Hostname=ESP32-Async-MTask [1517] LoadCfgFile @@ -2018,7 +2023,7 @@ Blynk.resetAndEnterConfigPortal(); ``` Starting Async_ESP32WM_MRD_ForcedConfig using LittleFS with SSL on ESP32_DEV -Blynk_Async_WM SSL for ESP32 v1.2.2 +Blynk_Async_WM SSL for ESP32 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFE0001 multiResetDetectorFlag = 0xFFFE0001 @@ -2109,7 +2114,7 @@ Non-Persistent CP will be removed after first reset, even you didn't enter the C ``` Starting Async_ESP32WM_MRD_ForcedConfig using LittleFS with SSL on ESP32_DEV -Blynk_Async_WM SSL for ESP32 v1.2.2 +Blynk_Async_WM SSL for ESP32 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFE0001 multiResetDetectorFlag = 0xFFFE0001 @@ -2224,7 +2229,7 @@ RF[66298] id: = HueNet1 ``` Starting Async_ESP32WM_MRD_ForcedConfig using LittleFS with SSL on ESP32_DEV -Blynk_Async_WM SSL for ESP32 v1.2.2 +Blynk_Async_WM SSL for ESP32 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFE0001 multiResetDetectorFlag = 0xFFFE0001 @@ -2323,7 +2328,7 @@ Blynk.resetAndEnterConfigPortalPersistent(); ``` Starting Async_ESP32WM_MRD_ForcedConfig using LittleFS with SSL on ESP32_DEV -Blynk_Async_WM SSL for ESP32 v1.2.2 +Blynk_Async_WM SSL for ESP32 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFE0001 multiResetDetectorFlag = 0xFFFE0001 @@ -2414,7 +2419,7 @@ Persistent CP will remain after resets. The only way to get rid of Config Portal ``` Starting Async_ESP32WM_MRD_ForcedConfig using LittleFS with SSL on ESP32_DEV -Blynk_Async_WM SSL for ESP32 v1.2.2 +Blynk_Async_WM SSL for ESP32 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFE0001 multiResetDetectorFlag = 0xFFFE0001 @@ -2526,7 +2531,7 @@ Enter CP, input (even fake data or none) and `Save` config data to exit persiste ``` Starting Async_ESP32WM_MRD_ForcedConfig using LittleFS with SSL on ESP32_DEV -Blynk_Async_WM SSL for ESP32 v1.2.2 +Blynk_Async_WM SSL for ESP32 v1.2.3 ESP_MultiResetDetector v1.1.1 LittleFS Flag read = 0xFFFE0001 multiResetDetectorFlag = 0xFFFE0001 @@ -2640,6 +2645,10 @@ Sometimes, the library will only work if you update the board core to the latest ## Releases +### Releases v1.2.3 + +1. To permit auto-reset after configurable timeout if DRD/MRD or non-persistent forced-CP. Check [**Good new feature: Blynk.resetAndEnterConfigPortal() Thanks & question #27**](https://github.com/khoih-prog/Blynk_WM/issues/27) + ### Releases v1.2.2 1. Fix rare Config Portal bug not updating Config and dynamic Params data successfully in very noisy or weak WiFi situation @@ -2682,6 +2691,8 @@ Submit issues to: [Blynk_Async_WM issues](https://github.com/khoih-prog/Blynk_As 1. Fix bug. Add enhancement +--- + ## DONE 1. Permit EEPROM size and location configurable to avoid conflict with others. @@ -2724,6 +2735,7 @@ Submit issues to: [Blynk_Async_WM issues](https://github.com/khoih-prog/Blynk_As Check these new features thanks to his direct contribution and/or enhancement requests : * [WM Config Portal using BlynkSimpleEsp32/8266_WM.h](https://community.blynk.cc/t/wm-config-portal-using-blynksimpleesp32-8266-wm-h/45402). * [How to trigger a Config Portal from code #25](https://github.com/khoih-prog/Blynk_WM/issues/25) + * [Good new feature: Blynk.resetAndEnterConfigPortal() Thanks & question #27](https://github.com/khoih-prog/Blynk_WM/issues/27) 4. Thanks to good work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip) for working with, developing, debugging and testing. diff --git a/library.json b/library.json index 9ea42d4..c3f7fa3 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Blynk_Async_WM", - "version": "1.2.2", + "version": "1.2.3", "description": "Library, using AsyncWebServer instead of (ESP8266)WebServer, for configuring/auto(re)connecting ESP8266/ESP32 modules to best or available MultiWiFi APs and MultiBlynk servers at runtime. Enable adding dynamic custom parameters from sketch and input using the same Config Portal. Config Portal will be auto-adjusted to match the number of dynamic parameters. Optional default Credentials to be autoloaded into Config Portal to use or change instead of manually input. Static STA IP and DHCP Hostname as well as Config Portal AP channel, IP, SSID, Password can be configured. Multi or Double DetectDetector feature permits entering Config Portal as requested.", "keywords": "sensors, control, device, smartphone, mobile, app, web, cloud, communication, protocol, iot, m2m, wifi, ble, bluetooth, ethernet, usb, serial, gsm, gprs, 3g, data, esp8266, esp32, http, drd, mrd, double-reset, multi-reset, configportal, portal, credentials, async", "authors": diff --git a/library.properties b/library.properties index 399c4f2..49d8815 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Blynk_Async_WM -version=1.2.2 +version=1.2.3 author=Khoi Hoang license=MIT maintainer=Khoi Hoang diff --git a/src/BlynkSimpleEsp32_Async_WM.h b/src/BlynkSimpleEsp32_Async_WM.h index dbf5f51..e01f743 100644 --- a/src/BlynkSimpleEsp32_Async_WM.h +++ b/src/BlynkSimpleEsp32_Async_WM.h @@ -17,7 +17,7 @@ @date Jan 2015 @brief - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -27,6 +27,7 @@ 1.2.0 K Hoang 01/01/2021 Add support to ESP32 LittleFS. Remove possible compiler warnings. Update examples. Add MRD 1.2.1 K Hoang 16/01/2021 Add functions to control Config Portal from software or Virtual Switches 1.2.2 K Hoang 28/01/2021 Fix Config Portal and Dynamic Params bugs + 1.2.3 K Hoang 31/01/2021 To permit autoreset after timeout if DRD/MRD or non-persistent forced-CP ********************************************************************************************************************************/ #pragma once @@ -35,7 +36,7 @@ #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. #endif -#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP32 v1.2.2" +#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP32 v1.2.3" #define BLYNK_SEND_ATOMIC @@ -488,8 +489,9 @@ class BlynkWifi clearForcedCP(); } + hadConfigData = isForcedConfigPortal ? true : (noConfigPortal ? false : true); + // failed to connect to Blynk server, will start configuration mode - hadConfigData = false; startConfigurationMode(); } } @@ -2281,10 +2283,22 @@ class BlynkWifi } // If there is no saved config Data, stay in config mode forever until having config Data. + // or SSID, PW, Server,Token ="nothing" if (hadConfigData) + { configTimeout = millis() + CONFIG_TIMEOUT; + +#if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG4(BLYNK_F("s:millis() = "), millis(), BLYNK_F(", configTimeout = "), configTimeout); +#endif + } else + { configTimeout = 0; +#if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG1(BLYNK_F("s:configTimeout = 0")); +#endif + } configuration_mode = true; } diff --git a/src/BlynkSimpleEsp32_SSL_Async_WM.h b/src/BlynkSimpleEsp32_SSL_Async_WM.h index 94618c0..e38f611 100644 --- a/src/BlynkSimpleEsp32_SSL_Async_WM.h +++ b/src/BlynkSimpleEsp32_SSL_Async_WM.h @@ -17,7 +17,7 @@ @date Jan 2015 @brief - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -27,6 +27,7 @@ 1.2.0 K Hoang 01/01/2021 Add support to ESP32 LittleFS. Remove possible compiler warnings. Update examples. Add MRD 1.2.1 K Hoang 16/01/2021 Add functions to control Config Portal from software or Virtual Switches 1.2.2 K Hoang 28/01/2021 Fix Config Portal and Dynamic Params bugs + 1.2.3 K Hoang 31/01/2021 To permit autoreset after timeout if DRD/MRD or non-persistent forced-CP ********************************************************************************************************************************/ #pragma once @@ -35,7 +36,7 @@ #error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting. #endif -#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP32 v1.2.2" +#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP32 v1.2.3" #if defined(BLYNK_SSL_USE_LETSENCRYPT) static const char BLYNK_DEFAULT_ROOT_CA[] = @@ -557,8 +558,9 @@ class BlynkWifi clearForcedCP(); } + hadConfigData = isForcedConfigPortal ? true : (noConfigPortal ? false : true); + // failed to connect to Blynk server, will start configuration mode - hadConfigData = false; startConfigurationMode(); } } @@ -2348,10 +2350,22 @@ class BlynkWifi } // If there is no saved config Data, stay in config mode forever until having config Data. + // or SSID, PW, Server,Token ="nothing" if (hadConfigData) + { configTimeout = millis() + CONFIG_TIMEOUT; + +#if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG4(BLYNK_F("s:millis() = "), millis(), BLYNK_F(", configTimeout = "), configTimeout); +#endif + } else + { configTimeout = 0; +#if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG1(BLYNK_F("s:configTimeout = 0")); +#endif + } configuration_mode = true; } diff --git a/src/BlynkSimpleEsp8266_Async_WM.h b/src/BlynkSimpleEsp8266_Async_WM.h index aa6fd27..314dc6f 100644 --- a/src/BlynkSimpleEsp8266_Async_WM.h +++ b/src/BlynkSimpleEsp8266_Async_WM.h @@ -17,7 +17,7 @@ @date Jan 2015 @brief - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -27,6 +27,7 @@ 1.2.0 K Hoang 01/01/2021 Add support to ESP32 LittleFS. Remove possible compiler warnings. Update examples. Add MRD 1.2.1 K Hoang 16/01/2021 Add functions to control Config Portal from software or Virtual Switches 1.2.2 K Hoang 28/01/2021 Fix Config Portal and Dynamic Params bugs + 1.2.3 K Hoang 31/01/2021 To permit autoreset after timeout if DRD/MRD or non-persistent forced-CP ********************************************************************************************************************************/ #pragma once @@ -35,7 +36,7 @@ #error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting. #endif -#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP8266 v1.2.2" +#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP8266 v1.2.3" #include @@ -470,8 +471,9 @@ class BlynkWifi clearForcedCP(); } + hadConfigData = isForcedConfigPortal ? true : (noConfigPortal ? false : true); + // failed to connect to Blynk server, will start configuration mode - hadConfigData = false; startConfigurationMode(); } } @@ -2265,10 +2267,20 @@ class BlynkWifi // If there is no saved config Data, stay in config mode forever until having config Data. // or SSID, PW, Server,Token ="nothing" if (hadConfigData) + { configTimeout = millis() + CONFIG_TIMEOUT; + +#if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG4(BLYNK_F("s:millis() = "), millis(), BLYNK_F(", configTimeout = "), configTimeout); +#endif + } else + { configTimeout = 0; - +#if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG1(BLYNK_F("s:configTimeout = 0")); +#endif + } configuration_mode = true; } }; diff --git a/src/BlynkSimpleEsp8266_SSL_Async_WM.h b/src/BlynkSimpleEsp8266_SSL_Async_WM.h index 0cc32ca..fe1c17d 100644 --- a/src/BlynkSimpleEsp8266_SSL_Async_WM.h +++ b/src/BlynkSimpleEsp8266_SSL_Async_WM.h @@ -17,7 +17,7 @@ @date Jan 2015 @brief - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -27,6 +27,7 @@ 1.2.0 K Hoang 01/01/2021 Add support to ESP32 LittleFS. Remove possible compiler warnings. Update examples. Add MRD 1.2.1 K Hoang 16/01/2021 Add functions to control Config Portal from software or Virtual Switches 1.2.2 K Hoang 28/01/2021 Fix Config Portal and Dynamic Params bugs + 1.2.3 K Hoang 31/01/2021 To permit autoreset after timeout if DRD/MRD or non-persistent forced-CP ********************************************************************************************************************************/ #pragma once @@ -35,7 +36,7 @@ #error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting. #endif -#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP8266 v1.2.2" +#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP8266 v1.2.3" #include @@ -580,8 +581,9 @@ class BlynkWifi clearForcedCP(); } + hadConfigData = isForcedConfigPortal ? true : (noConfigPortal ? false : true); + // failed to connect to Blynk server, will start configuration mode - hadConfigData = false; startConfigurationMode(); } } @@ -2374,9 +2376,20 @@ class BlynkWifi // If there is no saved config Data, stay in config mode forever until having config Data. // or SSID, PW, Server,Token ="nothing" if (hadConfigData) + { configTimeout = millis() + CONFIG_TIMEOUT; + +#if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG4(BLYNK_F("s:millis() = "), millis(), BLYNK_F(", configTimeout = "), configTimeout); +#endif + } else + { configTimeout = 0; +#if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG1(BLYNK_F("s:configTimeout = 0")); +#endif + } configuration_mode = true; }