diff --git a/README.md b/README.md index 94e04d37..ee9b76aa 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ * [Why Async is better](#why-async-is-better) * [Currently supported Boards](#currently-supported-boards) * [Changelog](#changelog) + * [Releases v1.8.1](#releases-v181) * [Major Releases v1.8.0](#major-releases-v180) * [Releases v1.7.1](#releases-v171) * [Releases v1.7.0](#releases-v170) @@ -224,6 +225,11 @@ This [**ESPAsync_WiFiManager** library](https://github.com/khoih-prog/ESPAsync_W ## Changelog +### Releases v1.8.1 + +1. Fix bug. +2. Don't display invalid time when not synch yet. + ### Major Releases v1.8.0 1. Add auto-Timezone feature with variable `_timezoneName` (e.g. `America/New_York`) and function to retrieve TZ (e.g. `EST5EDT,M3.2.0,M11.1.0`) to use directly to configure ESP32/ESP8266 timezone. Check [How to retrieve timezone? #51](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/51) @@ -2364,7 +2370,7 @@ ESPAsync_wifiManager.setRemoveDuplicateAPs(false); #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -2862,7 +2868,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -2871,8 +2877,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } @@ -3710,7 +3722,7 @@ This is terminal debug output when running [Async_ConfigOnDRD_FS_MQTT_Ptr_Medium ``` Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Medium using LittleFS on ESP32_DEV -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 Config File not found Can't read Config File, using default values @@ -3729,7 +3741,7 @@ Opening Configuration Portal. No timeout : DRD or No stored Credentials.. ``` Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Medium using LittleFS on ESP32_DEV -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 Config File not found Can't read Config File, using default values @@ -3817,7 +3829,7 @@ This is terminal debug output when running [Async_ConfigOnDRD_FS_MQTT_Ptr_Comple ``` Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP8266_NODEMCU -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector Version v1.1.1 {"AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name","AIO_KEY_Label":"aio_key"} Config File successfully parsed @@ -3857,7 +3869,7 @@ TWWWW WTWWW ``` Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP8266_NODEMCU -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector Version v1.1.1 {"AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name","AIO_KEY_Label":"aio_key"} Config File successfully parsed @@ -3947,7 +3959,7 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset](examples/ ```cpp Starting Async_ConfigOnDoubleReset with DoubleResetDetect using SPIFFS on ESP32_DEV -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 [WM] RFC925 Hostname = ConfigOnDoubleReset [WM] setSTAStaticIPConfig for USE_CONFIGURABLE_DNS @@ -4006,7 +4018,7 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset](examples/ ```cpp Starting Async_ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP8266_NODEMCU -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 [WM] RFC925 Hostname = ConfigOnDoubleReset [WM] setSTAStaticIPConfig for USE_CONFIGURABLE_DNS @@ -4066,7 +4078,7 @@ This is terminal debug output when running [Async_ESP_FSWebServer_DRD](examples/ ```cpp Starting Async_ESP_FSWebServer_DRD using LittleFS on ESP8266_NODEMCU -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 Opening / directory FS File: CanadaFlag_1.png, size: 40.25KB @@ -4144,7 +4156,7 @@ This is terminal debug output when running [Async_ESP32_FSWebServer_DRD](example ``` Starting Async_ESP32_FSWebServer_DRD using LittleFS on ESP32_DEV -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 FS File: /CanadaFlag_1.png, size: 40.25KB FS File: /CanadaFlag_2.png, size: 8.12KB @@ -4255,7 +4267,7 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset](examples/ ``` Starting Async_ConfigOnDoubleReset using LittleFS on ESP32S2_DEV -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 ESP Self-Stored: SSID = HueNet1, Pass = 12345678 [WM] * Add SSID = HueNet1 , PW = 12345678 @@ -4292,7 +4304,7 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset_TZ](exampl ``` Starting Async_ConfigOnDoubleReset_TZ using LittleFS on ESP32_DEV -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 ESP Self-Stored: SSID = HueNet1, Pass = password [WM] * Add SSID = HueNet1 , PW = password @@ -4336,7 +4348,7 @@ Local Date/Time: Sat May 1 00:17:30 2021 ``` Starting Async_ConfigOnDoubleReset_TZ using LittleFS on ESP32_DEV -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 ESP Self-Stored: SSID = HueNet1, Pass = password [WM] * Add SSID = HueNet1 , PW = password @@ -4383,7 +4395,7 @@ This is terminal debug output when running [Async_ESP_FSWebServer_DRD](examples/ ``` Starting Async_ESP_FSWebServer_DRD using LittleFS on ESP8266_NODEMCU -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 Opening / directory FS File: drd.dat, size: 4B @@ -4456,7 +4468,7 @@ Local Date/Time: Sat May 1 03:12:54 2021 ``` Starting Async_ESP_FSWebServer_DRD using LittleFS on ESP8266_NODEMCU -ESPAsync_WiFiManager v1.8.0 +ESPAsync_WiFiManager v1.8.1 ESP_DoubleResetDetector v1.1.1 Opening / directory FS File: drd.dat, size: 4B @@ -4546,6 +4558,11 @@ Submit issues to: [ESPAsync_WiFiManager issues](https://github.com/khoih-prog/ES ## Releases +### Releases v1.8.1 + +1. Fix bug. +2. Don't display invalid time when not synch yet. + ### Major Releases v1.8.0 1. Add auto-Timezone feature with variable `_timezoneName` (e.g. `America/New_York`) and function to retrieve TZ (e.g. `EST5EDT,M3.2.0,M11.1.0`) to use directly to configure ESP32/ESP8266 timezone. Check [How to retrieve timezone? #51](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/51) diff --git a/examples/Async_AutoConnect/Async_AutoConnect.ino b/examples/Async_AutoConnect/Async_AutoConnect.ino index 4e7510a2..77533ea7 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,12 +36,13 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -418,7 +419,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -427,8 +428,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } diff --git a/examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino b/examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino index 70a121e7..185bf45b 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,13 +36,14 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -617,7 +618,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -626,8 +627,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } diff --git a/examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino b/examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino index 5f4fb61b..fbaaaa26 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,13 +36,14 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -451,7 +452,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -460,8 +461,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } diff --git a/examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino b/examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino index dfc3f049..ee6485ba 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,12 +36,13 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -425,7 +426,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -434,8 +435,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } diff --git a/examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino b/examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino index 4d14d042..5814f455 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,13 +36,14 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -445,7 +446,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -454,8 +455,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } 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 08326109..01e6e166 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a Config Portal when there is no stored WiFi Credentials or when a DRD is detected. @@ -54,7 +55,7 @@ #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -552,7 +553,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -561,8 +562,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } 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 9cb9fb47..cad120cb 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a Config Portal when there is no stored WiFi Credentials or when a DRD is detected. @@ -54,7 +55,7 @@ #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 2 @@ -606,7 +607,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -615,8 +616,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } 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 1210ad2e..117605bd 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a Config Portal when there is no stored WiFi Credentials or when a DRD is detected. @@ -54,7 +55,7 @@ #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -598,8 +599,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } diff --git a/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino b/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino index 426233c2..87e35c68 100644 --- a/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino +++ b/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -37,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a configuration portal when the reset button is pressed twice. @@ -66,7 +67,7 @@ #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 1 @@ -513,7 +514,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -522,8 +523,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } @@ -793,7 +800,7 @@ void setup() // SSID to uppercase ssid.toUpperCase(); - password = "My" + ssid; + password = "My" + ssid; bool configDataLoaded = false; @@ -922,6 +929,13 @@ void setup() if ( strlen(WM_config.TZ_Name) > 0 ) { LOGERROR3(F("Saving current TZ_Name ="), WM_config.TZ_Name, F(", TZ = "), WM_config.TZ); + +#if ESP8266 + configTime(WM_config.TZ, "pool.ntp.org"); +#else + //configTzTime(WM_config.TZ, "pool.ntp.org" ); + configTzTime(WM_config.TZ, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); +#endif } else { diff --git a/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino b/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino index 7ff4e0a5..43bf2c46 100644 --- a/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino +++ b/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -37,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a configuration portal when the reset button is pressed twice. @@ -66,7 +67,7 @@ #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 1 @@ -513,7 +514,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -522,8 +523,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } diff --git a/examples/Async_ConfigOnStartup/Async_ConfigOnStartup.ino b/examples/Async_ConfigOnStartup/Async_ConfigOnStartup.ino index 03463e21..1af8dd8a 100644 --- a/examples/Async_ConfigOnStartup/Async_ConfigOnStartup.ino +++ b/examples/Async_ConfigOnStartup/Async_ConfigOnStartup.ino @@ -13,7 +13,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a configuration portal for 60 seconds when first powered up if the boards has stored WiFi Credentials. @@ -56,7 +57,7 @@ #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -447,7 +448,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -456,8 +457,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } diff --git a/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino b/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino index 9feae376..8d1fc35c 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a configuration portal when no WiFi configuration has been previously entered or when a button is pushed. @@ -53,7 +54,7 @@ #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -565,7 +566,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -574,8 +575,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } @@ -1166,6 +1173,38 @@ void loop() } } +#if USE_ESP_WIFIMANAGER_NTP + String tempTZ = ESPAsync_wifiManager.getTimezoneName(); + + if (strlen(tempTZ.c_str()) < sizeof(WM_config.TZ_Name) - 1) + strcpy(WM_config.TZ_Name, tempTZ.c_str()); + else + strncpy(WM_config.TZ_Name, tempTZ.c_str(), sizeof(WM_config.TZ_Name) - 1); + + const char * TZ_Result = ESPAsync_wifiManager.getTZ(WM_config.TZ_Name); + + if (strlen(TZ_Result) < sizeof(WM_config.TZ) - 1) + strcpy(WM_config.TZ, TZ_Result); + else + strncpy(WM_config.TZ, TZ_Result, sizeof(WM_config.TZ_Name) - 1); + + if ( strlen(WM_config.TZ_Name) > 0 ) + { + LOGERROR3(F("Saving current TZ_Name ="), WM_config.TZ_Name, F(", TZ = "), WM_config.TZ); + + #if ESP8266 + configTime(WM_config.TZ, "pool.ntp.org"); + #else + //configTzTime(WM_config.TZ, "pool.ntp.org" ); + configTzTime(WM_config.TZ, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); + #endif + } + else + { + LOGERROR(F("Current Timezone Name is not set. Enter Config Portal to set.")); + } +#endif + // New in v1.4.0 ESPAsync_wifiManager.getSTAStaticIPConfig(WM_STA_IPconfig); ////// diff --git a/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino b/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino index 9fc6b70a..9b094c8e 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a configuration portal when the reset button is pressed twice. @@ -76,7 +77,7 @@ #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -604,7 +605,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -613,8 +614,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } @@ -1374,6 +1381,38 @@ void loop() } } +#if USE_ESP_WIFIMANAGER_NTP + String tempTZ = ESPAsync_wifiManager.getTimezoneName(); + + if (strlen(tempTZ.c_str()) < sizeof(WM_config.TZ_Name) - 1) + strcpy(WM_config.TZ_Name, tempTZ.c_str()); + else + strncpy(WM_config.TZ_Name, tempTZ.c_str(), sizeof(WM_config.TZ_Name) - 1); + + const char * TZ_Result = ESPAsync_wifiManager.getTZ(WM_config.TZ_Name); + + if (strlen(TZ_Result) < sizeof(WM_config.TZ) - 1) + strcpy(WM_config.TZ, TZ_Result); + else + strncpy(WM_config.TZ, TZ_Result, sizeof(WM_config.TZ_Name) - 1); + + if ( strlen(WM_config.TZ_Name) > 0 ) + { + LOGERROR3(F("Saving current TZ_Name ="), WM_config.TZ_Name, F(", TZ = "), WM_config.TZ); + + #if ESP8266 + configTime(WM_config.TZ, "pool.ntp.org"); + #else + //configTzTime(WM_config.TZ, "pool.ntp.org" ); + configTzTime(WM_config.TZ, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); + #endif + } + else + { + LOGERROR(F("Current Timezone Name is not set. Enter Config Portal to set.")); + } +#endif + // New in v1.4.0 ESPAsync_wifiManager.getSTAStaticIPConfig(WM_STA_IPconfig); ////// 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 e6ded75b..7c16b385 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a Config Portal when there is no stored WiFi Credentials or when a button is pressed. @@ -58,7 +59,7 @@ #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -611,7 +612,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -620,8 +621,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } diff --git a/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino b/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino index b6fdb8aa..7ff753e4 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /**************************************************************************************************************************** This example will open a configuration portal when a predetermined button is pressed @@ -55,7 +56,7 @@ #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -579,7 +580,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -588,8 +589,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } @@ -1317,6 +1324,38 @@ void loop() } } +#if USE_ESP_WIFIMANAGER_NTP + String tempTZ = ESPAsync_wifiManager.getTimezoneName(); + + if (strlen(tempTZ.c_str()) < sizeof(WM_config.TZ_Name) - 1) + strcpy(WM_config.TZ_Name, tempTZ.c_str()); + else + strncpy(WM_config.TZ_Name, tempTZ.c_str(), sizeof(WM_config.TZ_Name) - 1); + + const char * TZ_Result = ESPAsync_wifiManager.getTZ(WM_config.TZ_Name); + + if (strlen(TZ_Result) < sizeof(WM_config.TZ) - 1) + strcpy(WM_config.TZ, TZ_Result); + else + strncpy(WM_config.TZ, TZ_Result, sizeof(WM_config.TZ_Name) - 1); + + if ( strlen(WM_config.TZ_Name) > 0 ) + { + LOGERROR3(F("Saving current TZ_Name ="), WM_config.TZ_Name, F(", TZ = "), WM_config.TZ); + + #if ESP8266 + configTime(WM_config.TZ, "pool.ntp.org"); + #else + //configTzTime(WM_config.TZ, "pool.ntp.org" ); + configTzTime(WM_config.TZ, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); + #endif + } + else + { + LOGERROR(F("Current Timezone Name is not set. Enter Config Portal to set.")); + } +#endif + // New in v1.4.0 ESPAsync_wifiManager.getSTAStaticIPConfig(WM_STA_IPconfig); ////// diff --git a/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino b/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino index 457c515e..edc1ab4d 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /***************************************************************************************************************************** Compare this efficient Async_ESP32_FSWebServer_DRD example with the so complicated twin ESP32_FSWebServer @@ -57,7 +58,7 @@ #error This code is intended to run only on the ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -440,7 +441,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -449,8 +450,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } 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 6e1a29f4..224062b2 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /***************************************************************************************************************************** Compare this efficient Async_ESP32_FSWebServer_DRD example with the so complicated twin ESP32_FSWebServer @@ -57,7 +58,7 @@ #error This code is intended to run only on the ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -476,7 +477,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -485,8 +486,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } diff --git a/examples/Async_ESP_FSWebServer/Async_ESP_FSWebServer.ino b/examples/Async_ESP_FSWebServer/Async_ESP_FSWebServer.ino index 7b244681..aa8c5a4d 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /***************************************************************************************************************************** Compare this efficient Async_ESP_FSWebServer example with the so complicated twin ESP32_FSWebServer @@ -57,7 +58,7 @@ #error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -436,7 +437,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -445,8 +446,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } 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 36ca1804..1cc3d588 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +36,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ /***************************************************************************************************************************** Compare this efficient Async_ESP_FSWebServer example with the so complicated twin ESP32_FSWebServer @@ -57,7 +58,7 @@ #error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -456,7 +457,7 @@ void printLocalTime() now = time(nullptr); - if ( now > 1000000 ) + if ( now > 1451602800 ) { Serial.print("Local Date/Time: "); Serial.print(ctime(&now)); @@ -465,8 +466,14 @@ void printLocalTime() struct tm timeinfo; getLocalTime( &timeinfo ); - Serial.print("Local Date/Time: "); - Serial.print( asctime( &timeinfo ) ); + + // Valid only if year > 2000. + // You can get from timeinfo : tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec + if (timeinfo.tm_year > 100 ) + { + Serial.print("Local Date/Time: "); + Serial.print( asctime( &timeinfo ) ); + } #endif } diff --git a/examples/ModelessConnect/ModelessConnect.ino b/examples/ModelessConnect/ModelessConnect.ino index b0e0b6c1..4b45d8bc 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,13 +36,14 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #if !( defined(ESP8266) || defined(ESP32) ) #error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 diff --git a/examples/ModelessWithInterrupts/ModelessWithInterrupts.ino b/examples/ModelessWithInterrupts/ModelessWithInterrupts.ino index db9e0c67..df438559 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.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,13 +36,14 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #if !defined(ESP8266) #error This code is intended to run on the ESP8266! Please check your Tools->Board setting. #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.8.1" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 diff --git a/keywords.txt b/keywords.txt index b0b1b32e..0c170286 100644 --- a/keywords.txt +++ b/keywords.txt @@ -9,8 +9,8 @@ ESPAsync_WiFiManager KEYWORD1 ESPAsync_WMParameter KEYWORD1 -WiFi_AP_IPConfig -WiFi_STA_IPConfig +WiFi_AP_IPConfig KEYWORD1 +WiFi_STA_IPConfig KEYWORD1 WiFiResult KEYWORD1 wifi_ssid_count_t KEYWORD1 @@ -72,7 +72,7 @@ getTZ KEYWORD2 # LITERAL1 -ESP_ASYNC_WIFIMANAGER_VERSION +ESP_ASYNC_WIFIMANAGER_VERSION LITERAL1 WM_HTTP_200 LITERAL1 WM_HTTP_HEAD_START LITERAL1 diff --git a/library.json b/library.json index f09823dd..fd76fcf1 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "ESPAsync_WiFiManager", - "version": "1.8.0", + "version": "1.8.1", "keywords": "wifi, wi-fi, WiFiManager, esp8266, esp32, esp32-s2, esp32-c3, AsyncWebServer, Async-WebServer, Async-WiFiManager, MultiWiFi, Async, Communication, Credentials, Config-Portal, DoubleReset, MultiReset, littlefs, spiffs, eeprom, dns-server, iot", "description": "ESP32 (including ESP32-S2 and ESP32-C3), ESP8266 WiFi Connection Manager using AsyncWebServer, with enhanced GUI and fallback Web ConfigPortal. This Library is used for configuring ESP32 (including ESP32-S2 and ESP32-C3), ESP8266 modules WiFi Credentials at runtime. You can also specify static DNS servers, personalized HostName, fixed or random AP channel. Now with MultiWiFi auto(Re)connect, configurable CORS Header and auto-Timezone features.", "authors": diff --git a/library.properties b/library.properties index fe53e09f..15c72c6a 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ESPAsync_WiFiManager -version=1.8.0 +version=1.8.1 author=Khoi Hoang maintainer=Khoi Hoang license=MIT diff --git a/src/ESPAsync_WiFiManager-Impl.h b/src/ESPAsync_WiFiManager-Impl.h index 0e1db3bc..16d7f4ff 100644 --- a/src/ESPAsync_WiFiManager-Impl.h +++ b/src/ESPAsync_WiFiManager-Impl.h @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -37,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #pragma once diff --git a/src/ESPAsync_WiFiManager.h b/src/ESPAsync_WiFiManager.h index b145ab2f..4c4a6125 100644 --- a/src/ESPAsync_WiFiManager.h +++ b/src/ESPAsync_WiFiManager.h @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -37,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #pragma once @@ -58,7 +59,7 @@ #define USING_ESP32_C3 true #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.8.1" #include "ESPAsync_WiFiManager_Debug.h" @@ -545,7 +546,7 @@ class ESPAsync_WiFiManager return _timezoneName; } - String setTimezoneName(String& inTimezoneName) + void setTimezoneName(String& inTimezoneName) { _timezoneName = inTimezoneName; } diff --git a/src/ESPAsync_WiFiManager_Debug.h b/src/ESPAsync_WiFiManager_Debug.h index f8e4136f..363e8ccd 100644 --- a/src/ESPAsync_WiFiManager_Debug.h +++ b/src/ESPAsync_WiFiManager_Debug.h @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -37,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #pragma once diff --git a/src_cpp/ESPAsync_WiFiManager.cpp b/src_cpp/ESPAsync_WiFiManager.cpp index 38f84948..48d5bb36 100644 --- a/src_cpp/ESPAsync_WiFiManager.cpp +++ b/src_cpp/ESPAsync_WiFiManager.cpp @@ -13,7 +13,8 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #include "ESPAsync_WiFiManager.h" diff --git a/src_cpp/ESPAsync_WiFiManager.h b/src_cpp/ESPAsync_WiFiManager.h index f5da5b53..9cf145d6 100644 --- a/src_cpp/ESPAsync_WiFiManager.h +++ b/src_cpp/ESPAsync_WiFiManager.h @@ -13,7 +13,8 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -36,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #pragma once @@ -57,7 +59,7 @@ #define USING_ESP32_C3 true #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.8.1" #include "ESPAsync_WiFiManager_Debug.h" @@ -544,7 +546,7 @@ class ESPAsync_WiFiManager return _timezoneName; } - String setTimezoneName(String& inTimezoneName) + void setTimezoneName(String& inTimezoneName) { _timezoneName = inTimezoneName; } @@ -731,6 +733,5 @@ class ESPAsync_WiFiManager }; - #endif // ESPAsync_WiFiManager_h diff --git a/src_cpp/ESPAsync_WiFiManager_Debug.h b/src_cpp/ESPAsync_WiFiManager_Debug.h index f8e4136f..363e8ccd 100644 --- a/src_cpp/ESPAsync_WiFiManager_Debug.h +++ b/src_cpp/ESPAsync_WiFiManager_Debug.h @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -37,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #pragma once diff --git a/src_h/ESPAsync_WiFiManager-Impl.h b/src_h/ESPAsync_WiFiManager-Impl.h index 0e1db3bc..16d7f4ff 100644 --- a/src_h/ESPAsync_WiFiManager-Impl.h +++ b/src_h/ESPAsync_WiFiManager-Impl.h @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -37,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #pragma once diff --git a/src_h/ESPAsync_WiFiManager.h b/src_h/ESPAsync_WiFiManager.h index b145ab2f..4c4a6125 100644 --- a/src_h/ESPAsync_WiFiManager.h +++ b/src_h/ESPAsync_WiFiManager.h @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -37,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #pragma once @@ -58,7 +59,7 @@ #define USING_ESP32_C3 true #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.8.0" +#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.8.1" #include "ESPAsync_WiFiManager_Debug.h" @@ -545,7 +546,7 @@ class ESPAsync_WiFiManager return _timezoneName; } - String setTimezoneName(String& inTimezoneName) + void setTimezoneName(String& inTimezoneName) { _timezoneName = inTimezoneName; } diff --git a/src_h/ESPAsync_WiFiManager_Debug.h b/src_h/ESPAsync_WiFiManager_Debug.h index f8e4136f..363e8ccd 100644 --- a/src_h/ESPAsync_WiFiManager_Debug.h +++ b/src_h/ESPAsync_WiFiManager_Debug.h @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.8.0 + Version: 1.8.1 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -37,6 +37,7 @@ 1.7.0 K Hoang 20/04/2021 Add support to new ESP32-C3 using SPIFFS or EEPROM 1.7.1 K Hoang 25/04/2021 Fix MultiWiFi bug. Fix captive-portal bug if CP AP address is not default 192.168.4.1 1.8.0 K Hoang 30/04/2021 Set _timezoneName. Add support to new ESP32-S2 (METRO_ESP32S2, FUNHOUSE_ESP32S2, etc.) + 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. *****************************************************************************************************************************/ #pragma once