From 96f9423d8b2fd60fcf9db16effa29ca638cc4d77 Mon Sep 17 00:00:00 2001 From: Khoi Hoang <57012152+khoih-prog@users.noreply.github.com> Date: Mon, 2 Aug 2021 18:43:45 -0400 Subject: [PATCH] v1.9.2 to fix MultiWiFi and TLS ### Releases v1.9.2 1. Fix MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ 2. Fix AsyncWebServer library compile error with ESP32 core v2.0.0-rc1+. Check [Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+ #970](https://github.com/me-no-dev/ESPAsyncWebServer/pull/970) 3. Verify compatibility with new ESP32 core v2.0.0-rc1+ 4. Verify compatibility with new ESP8266 core v3.0.2 --- CONTRIBUTING.md | 10 +- README.md | 125 +++++++-- .../WebAuthentication.cpp | 249 ++++++++++++++++++ .../Async_AutoConnect/Async_AutoConnect.ino | 6 +- .../Async_AutoConnectWithFSParameters.ino | 6 +- ...AutoConnectWithFSParametersAndCustomIP.ino | 6 +- .../Async_AutoConnectWithFeedback.ino | 6 +- .../Async_AutoConnectWithFeedbackLED.ino | 6 +- .../Async_ConfigOnDRD_FS_MQTT_Ptr.ino | 6 +- .../Async_ConfigOnDRD_FS_MQTT_Ptr_Complex.ino | 6 +- .../Async_ConfigOnDRD_FS_MQTT_Ptr_Medium.ino | 6 +- .../Async_ConfigOnDoubleReset.ino | 6 +- .../Async_ConfigOnDoubleReset_TZ.ino | 7 +- .../Async_ConfigOnStartup.ino | 6 +- .../Async_ConfigOnSwitch.ino | 6 +- .../Async_ConfigOnSwitchFS.ino | 12 +- .../Async_ConfigOnSwitchFS_MQTT_Ptr.ino | 6 +- .../Async_ConfigPortalParamsOnSwitch.ino | 12 +- .../Async_ESP32_FSWebServer.ino | 6 +- .../Async_ESP32_FSWebServer_DRD.ino | 6 +- .../Async_ESP_FSWebServer.ino | 6 +- .../Async_ESP_FSWebServer_DRD.ino | 6 +- examples/ModelessConnect/ModelessConnect.ino | 2 +- .../ModelessWithInterrupts.ino | 2 +- library.json | 2 +- library.properties | 2 +- src/ESPAsync_WiFiManager-Impl.h | 3 +- src/ESPAsync_WiFiManager.h | 49 +++- src/ESPAsync_WiFiManager_Debug.h | 3 +- src_cpp/ESPAsync_WiFiManager.cpp | 3 +- src_cpp/ESPAsync_WiFiManager.h | 49 +++- src_cpp/ESPAsync_WiFiManager_Debug.h | 3 +- src_h/ESPAsync_WiFiManager-Impl.h | 3 +- src_h/ESPAsync_WiFiManager.h | 49 +++- src_h/ESPAsync_WiFiManager_Debug.h | 3 +- 35 files changed, 566 insertions(+), 118 deletions(-) create mode 100644 esp32c3_ESPAsyncWebServer_Patch/WebAuthentication.cpp diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 01fe05f5..eb90ce6e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,8 +14,8 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p Please ensure to specify the following: -* Arduino IDE version (e.g. 1.8.13) or Platform.io version -* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.0 or ESP32 v1.0.6) +* Arduino IDE version (e.g. 1.8.15) or Platform.io version +* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v1.0.6) * Contextual information (e.g. what you were trying to achieve) * Simplest possible steps to reproduce * Anything that might be relevant in your opinion, such as: @@ -26,10 +26,10 @@ Please ensure to specify the following: ### Example ``` -Arduino IDE version: 1.8.13 -ESP8266 Core Version 3.0.0 +Arduino IDE version: 1.8.15 +ESP8266 Core Version 3.0.2 OS: Ubuntu 20.04 LTS -Linux xy-Inspiron-3593 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux +Linux xy-Inspiron-3593 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Context: I encountered an endless loop while trying to connect to Local WiFi. diff --git a/README.md b/README.md index 84ce4c1b..9513f9c3 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.9.2](#releases-v192) * [Releases v1.9.1](#releases-v191) * [Releases v1.9.0](#releases-v190) * [Releases v1.8.1](#releases-v181) @@ -41,6 +42,8 @@ * [Use Arduino Library Manager](#use-arduino-library-manager) * [Manual Install](#manual-install) * [VS Code & PlatformIO](#vs-code--platformio) +* [Libraries' Patches](#libraries-patches) + * [1. For ESPAsyncWebServer library](#1-for-espasyncwebserver-library) * [HOWTO Install esp32 core for ESP32-S2 (Saola, AI-Thinker ESP-12K) and ESP32-C3 boards into Arduino IDE](#howto-install-esp32-core-for-esp32-s2-saola-ai-thinker-esp-12k-and-esp32-c3-boards-into-arduino-ide) * [1. Save the original esp32 core](#1-save-the-original-esp32-core) * [2. Install esp32 core v1.0.6](#2-install-esp32-core-v106) @@ -166,6 +169,7 @@ * [9.1 DRD => Config Portal](#91-drd--config-portal) * [9.2 Data Saved => Connect to WiFi with correct local time, TZ set and using NTP](#92-data-saved--connect-to-wifi-with-correct-local-time-tz-set-and-using-ntp) * [9.3 Normal running with correct local time, TZ set and using NTP](#93-normal-running-with-correct-local-time-tz-set-and-using-ntp) + * [10. Async_ConfigOnDoubleReset_TZ on ESP32C3_DEV using SPIFFS](#10-async_configondoublereset_tz-on-esp32c3_dev-using-spiffs) * [Debug](#debug) * [Troubleshooting](#troubleshooting) * [Issues](#issues) @@ -227,6 +231,13 @@ This [**ESPAsync_WiFiManager** library](https://github.com/khoih-prog/ESPAsync_W ## Changelog +### Releases v1.9.2 + +1. Fix MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ +2. Fix AsyncWebServer library compile error with ESP32 core v2.0.0-rc1+. Check [Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+ #970](https://github.com/me-no-dev/ESPAsyncWebServer/pull/970) +3. Verify compatibility with new ESP32 core v2.0.0-rc1+ +4. Verify compatibility with new ESP8266 core v3.0.2 + ### Releases v1.9.1 1. Fix warnings and verify compatibility with new ESP8266 core v3.0.0 @@ -349,15 +360,16 @@ This [**ESPAsync_WiFiManager** library](https://github.com/khoih-prog/ESPAsync_W ## Prerequisites - 1. [`Arduino IDE 1.8.13+` for Arduino](https://www.arduino.cc/en/Main/Software) - 2. [`ESP8266 Core 3.0.0+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/) + 1. [`Arduino IDE 1.8.15+` for Arduino](https://www.arduino.cc/en/Main/Software) + 2. [`ESP8266 Core 3.0.2+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/) 3. [`ESP32 Core 1.0.6+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/) 4. [`ESP32-S2/C3 Core 1.0.6+`](https://github.com/espressif/arduino-esp32) for ESP32-S2/C3-based boards. Must follow [HOWTO Install esp32 core for ESP32-S2 (Saola, AI-Thinker ESP-12K) and ESP32-C3 boards into Arduino IDE](#howto-install-esp32-core-for-esp32-s2-saola-ai-thinker-esp-12k-and-esp32-c3-boards-into-arduino-ide). - 5. [`ESPAsyncWebServer v1.2.3+`](https://github.com/me-no-dev/ESPAsyncWebServer) for all ESP32/ESP8266-based boards. - 6. [`ESPAsyncTCP v1.2.2+`](https://github.com/me-no-dev/ESPAsyncTCP) for ESP8266-based boards. - 7. [`AsyncTCP v1.1.1+`](https://github.com/me-no-dev/AsyncTCP) for ESP32-based boards - 8. [`ESP_DoubleResetDetector v1.1.1+`](https://github.com/khoih-prog/ESP_DoubleResetDetector) if using DRD feature. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_DoubleResetDetector.svg?)](https://www.ardu-badge.com/ESP_DoubleResetDetector). Use v1.1.0+ if using LittleFS for EP32. - 9. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32). **Notice**: This [`LittleFS_esp32 library`](https://github.com/lorol/LITTLEFS) has been integrated to Arduino [esp32 core v1.0.6](https://github.com/espressif/arduino-esp32/tree/master/libraries/LITTLEFS). + 5. [`ESP32-S2/C3 Core 2.0.0-rc1+`](https://github.com/espressif/arduino-esp32) for ESP32-S2/C3-based boards to use experimental ESP32 core v2.0.0-rc1. + 6. [`ESPAsyncWebServer v1.2.3+`](https://github.com/me-no-dev/ESPAsyncWebServer) for all ESP32/ESP8266-based boards. You'd better use the [forked ESPAsyncWebServer](https://github.com/khoih-prog/ESPAsyncWebServer) if the PR [Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+ #970](https://github.com/me-no-dev/ESPAsyncWebServer/pull/970) hasn't been merged. + 7. [`ESPAsyncTCP v1.2.2+`](https://github.com/me-no-dev/ESPAsyncTCP) for ESP8266-based boards. + 8. [`AsyncTCP v1.1.1+`](https://github.com/me-no-dev/AsyncTCP) for ESP32-based boards + 9. [`ESP_DoubleResetDetector v1.1.1+`](https://github.com/khoih-prog/ESP_DoubleResetDetector) if using DRD feature. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_DoubleResetDetector.svg?)](https://www.ardu-badge.com/ESP_DoubleResetDetector). Use v1.1.0+ if using LittleFS for EP32. +10. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32). **Notice**: This [`LittleFS_esp32 library`](https://github.com/lorol/LITTLEFS) has been integrated to Arduino [esp32 core v1.0.6](https://github.com/espressif/arduino-esp32/tree/master/libraries/LITTLEFS). --- @@ -383,6 +395,22 @@ The best and easiest way is to use `Arduino Library Manager`. Search for `ESPAsy --- --- +--- + +### Libraries' Patches + +#### 1. For ESPAsyncWebServer library + +If you don't use the [forked ESPAsyncWebServer](https://github.com/khoih-prog/ESPAsyncWebServer), to fix [`ESPAsyncWebServer library`](https://github.com/me-no-dev/ESPAsyncWebServer) compile errors, just copy these following files into the [`ESPAsyncWebServer library`](https://github.com/me-no-dev/ESPAsyncWebServer) directory to overwrite the old files: +- [AsyncWebSocket.cpp](esp32c3_ESPAsyncWebServer_Patch/AsyncWebSocket.cpp) +- [WebAuthentication.cpp](esp32c3_ESPAsyncWebServer_Patch/WebAuthentication.cpp) + + +Check the PR [Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+ #970](https://github.com/me-no-dev/ESPAsyncWebServer/pull/970) + +--- +--- + ## HOWTO Install esp32 core for ESP32-S2 (Saola, AI-Thinker ESP-12K) and ESP32-C3 boards into Arduino IDE @@ -2383,7 +2411,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -2799,7 +2827,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -2835,7 +2863,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; @@ -3735,7 +3763,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.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 Config File not found Can't read Config File, using default values @@ -3754,7 +3782,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.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 Config File not found Can't read Config File, using default values @@ -3842,7 +3870,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_ESP12E -ESPAsync_WiFiManager v1.9.1 +ESPAsync_WiFiManager v1.9.2 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 @@ -3882,7 +3910,7 @@ TWWWW WTWWW ``` Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP8266_NODEMCU_ESP12E -ESPAsync_WiFiManager v1.9.1 +ESPAsync_WiFiManager v1.9.2 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 @@ -3972,7 +4000,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.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 [WM] RFC925 Hostname = ConfigOnDoubleReset [WM] setSTAStaticIPConfig for USE_CONFIGURABLE_DNS @@ -4031,7 +4059,7 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset](examples/ ```cpp Starting Async_ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP8266_NODEMCU_ESP12E -ESPAsync_WiFiManager v1.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 [WM] RFC925 Hostname = ConfigOnDoubleReset [WM] setSTAStaticIPConfig for USE_CONFIGURABLE_DNS @@ -4091,7 +4119,7 @@ This is terminal debug output when running [Async_ESP_FSWebServer_DRD](examples/ ```cpp Starting Async_ESP_FSWebServer_DRD using LittleFS on ESP8266_NODEMCU_ESP12E -ESPAsync_WiFiManager v1.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 Opening / directory FS File: CanadaFlag_1.png, size: 40.25KB @@ -4169,7 +4197,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.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 FS File: /CanadaFlag_1.png, size: 40.25KB FS File: /CanadaFlag_2.png, size: 8.12KB @@ -4280,7 +4308,7 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset](examples/ ``` Starting Async_ConfigOnDoubleReset using LittleFS on ESP32S2_DEV -ESPAsync_WiFiManager v1.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 ESP Self-Stored: SSID = HueNet1, Pass = 12345678 [WM] * Add SSID = HueNet1 , PW = 12345678 @@ -4317,7 +4345,7 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset_TZ](exampl ``` Starting Async_ConfigOnDoubleReset_TZ using LittleFS on ESP32_DEV -ESPAsync_WiFiManager v1.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 ESP Self-Stored: SSID = HueNet1, Pass = password [WM] * Add SSID = HueNet1 , PW = password @@ -4361,7 +4389,7 @@ Local Date/Time: Sat May 1 00:17:30 2021 ``` Starting Async_ConfigOnDoubleReset_TZ using LittleFS on ESP32_DEV -ESPAsync_WiFiManager v1.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 ESP Self-Stored: SSID = HueNet1, Pass = password [WM] * Add SSID = HueNet1 , PW = password @@ -4408,7 +4436,7 @@ This is terminal debug output when running [Async_ESP_FSWebServer_DRD](examples/ ``` Starting Async_ESP_FSWebServer_DRD using LittleFS on ESP8266_NODEMCU_ESP12E -ESPAsync_WiFiManager v1.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 Opening / directory FS File: drd.dat, size: 4B @@ -4481,7 +4509,7 @@ Local Date/Time: Sat May 1 03:12:54 2021 ``` Starting Async_ESP_FSWebServer_DRD using LittleFS on ESP8266_NODEMCU_ESP12E -ESPAsync_WiFiManager v1.9.1 +ESPAsync_WiFiManager v1.9.2 ESP_DoubleResetDetector v1.1.1 Opening / directory FS File: drd.dat, size: 4B @@ -4532,6 +4560,50 @@ Local Date/Time: Sat May 1 03:16:54 2021 Local Date/Time: Sat May 1 03:12754 2021 ``` +--- + +#### 10. [Async_ConfigOnDoubleReset_TZ](examples/Async_ConfigOnDoubleReset_TZ) on ESP32C3_DEV using SPIFFS + +This is terminal debug output when running [Async_ConfigOnDoubleReset_TZ](examples/Async_ConfigOnDoubleReset_TZ) on **ESP32C3_DEV using SPIFFS and ESP32 core v2.0.0-rc1.**. + +``` +Starting Async_ConfigOnDoubleReset_TZ using SPIFFS on ESP32C3_DEV +ESPAsync_WiFiManager v1.9.2 +ESP_DoubleResetDetector v1.1.1 +ESP Self-Stored: SSID = HueNet1, Pass = 12345678 +[WM] * Add SSID = HueNet1 , PW = 12345678 +Got ESP Self-Stored Credentials. Timeout 120s for Config Portal +[WM] LoadWiFiCfgFile +[WM] OK +[WM] stationIP = 0.0.0.0 , gatewayIP = 192.168.2.1 +[WM] netMask = 255.255.255.0 +[WM] dns1IP = 192.168.2.1 , dns2IP = 8.8.8.8 +Got stored Credentials. Timeout 120s for Config Portal +[WM] Current TZ_Name = America/New_York , TZ = EST5EDT,M3.2.0,M11.1.0 +SPIFFS Flag read = 0xD0D04321 +No doubleResetDetected +Saving config file... +Saving config file OK +[WM] * Add SSID = HueNet1 , PW = 12345678 +[WM] * Add SSID = HueNet , PW = 12345678 +ConnectMultiWiFi in setup +[WM] ConnectMultiWiFi with : +[WM] * Flash-stored Router_SSID = HueNet1 , Router_Pass = 12345678 +[WM] * Add SSID = HueNet1 , PW = 12345678 +[WM] * Additional SSID = HueNet1 , PW = 12345678 +[WM] * Additional SSID = HueNet , PW = 12345678 +[WM] Connecting MultiWifi... +[WM] WiFi connected after time: 3 +[WM] SSID: HueNet ,RSSI= -27 +[WM] Channel: 10 ,IP address: 192.168.2.99 +After waiting 11.85 secs more in setup(), connection result is connected. Local IP: 192.168.2.99 +Stop doubleResetDetecting +Saving config file... +Saving config file OK +Local Date/Time: Mon Aug 2 17:06:42 2021 +Local Date/Time: Mon Aug 2 17:07:42 2021 +Local Date/Time: Mon Aug 2 17:08:42 2021 +``` --- --- @@ -4571,6 +4643,13 @@ Submit issues to: [ESPAsync_WiFiManager issues](https://github.com/khoih-prog/ES ## Releases +### Releases v1.9.2 + +1. Fix MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ +2. Fix AsyncWebServer library compile error with ESP32 core v2.0.0-rc1+. Check [Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+ #970](https://github.com/me-no-dev/ESPAsyncWebServer/pull/970) +3. Verify compatibility with new ESP32 core v2.0.0-rc1+ +4. Verify compatibility with new ESP8266 core v3.0.2 + ### Releases v1.9.1 1. Fix warnings and verify compatibility with new ESP8266 core v3.0.0 diff --git a/esp32c3_ESPAsyncWebServer_Patch/WebAuthentication.cpp b/esp32c3_ESPAsyncWebServer_Patch/WebAuthentication.cpp new file mode 100644 index 00000000..170fb170 --- /dev/null +++ b/esp32c3_ESPAsyncWebServer_Patch/WebAuthentication.cpp @@ -0,0 +1,249 @@ +/* + Asynchronous WebServer library for Espressif MCUs + + Copyright (c) 2016 Hristo Gochkov. All rights reserved. + This file is part of the esp8266 core for Arduino environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +#include "WebAuthentication.h" +#include +#ifdef ESP32 +#include "mbedtls/md5.h" +#include "mbedtls/version.h" +#else +#include "md5.h" +#endif + + +// Basic Auth hash = base64("username:password") + +bool checkBasicAuthentication(const char * hash, const char * username, const char * password){ + if(username == NULL || password == NULL || hash == NULL) + return false; + + size_t toencodeLen = strlen(username)+strlen(password)+1; + size_t encodedLen = base64_encode_expected_len(toencodeLen); + if(strlen(hash) != encodedLen) + return false; + + char *toencode = new char[toencodeLen+1]; + if(toencode == NULL){ + return false; + } + char *encoded = new char[base64_encode_expected_len(toencodeLen)+1]; + if(encoded == NULL){ + delete[] toencode; + return false; + } + sprintf(toencode, "%s:%s", username, password); + if(base64_encode_chars(toencode, toencodeLen, encoded) > 0 && memcmp(hash, encoded, encodedLen) == 0){ + delete[] toencode; + delete[] encoded; + return true; + } + delete[] toencode; + delete[] encoded; + return false; +} + +static bool getMD5(uint8_t * data, uint16_t len, char * output){//33 bytes or more +#ifdef ESP32 + mbedtls_md5_context _ctx; +#else + md5_context_t _ctx; +#endif + uint8_t i; + uint8_t * _buf = (uint8_t*)malloc(16); + if(_buf == NULL) + return false; + memset(_buf, 0x00, 16); +#ifdef ESP32 + mbedtls_md5_init(&_ctx); + + // KH + #if (MBEDTLS_VERSION_NUMBER < 0x02070000) + #warning MBEDTLS_VERSION_NUMBER < 2.7.0 + // Superseded from v2.7.0 + mbedtls_md5_starts(&_ctx); + mbedtls_md5_update(&_ctx, data, len); + mbedtls_md5_finish(&_ctx, _buf); + #else + #warning MBEDTLS_VERSION_NUMBER >= 2.7.0 + mbedtls_md5_starts_ret(&_ctx); + mbedtls_md5_update_ret(&_ctx, data, len); + mbedtls_md5_finish_ret(&_ctx, _buf); + #endif + ////// + +#else + MD5Init(&_ctx); + MD5Update(&_ctx, data, len); + MD5Final(_buf, &_ctx); +#endif + for(i = 0; i < 16; i++) { + sprintf(output + (i * 2), "%02x", _buf[i]); + } + free(_buf); + return true; +} + +static String genRandomMD5(){ +#ifdef ESP8266 + uint32_t r = RANDOM_REG32; +#else + uint32_t r = rand(); +#endif + char * out = (char*)malloc(33); + if(out == NULL || !getMD5((uint8_t*)(&r), 4, out)) + return ""; + String res = String(out); + free(out); + return res; +} + +static String stringMD5(const String& in){ + char * out = (char*)malloc(33); + if(out == NULL || !getMD5((uint8_t*)(in.c_str()), in.length(), out)) + return ""; + String res = String(out); + free(out); + return res; +} + +String generateDigestHash(const char * username, const char * password, const char * realm){ + if(username == NULL || password == NULL || realm == NULL){ + return ""; + } + char * out = (char*)malloc(33); + String res = String(username); + res.concat(":"); + res.concat(realm); + res.concat(":"); + String in = res; + in.concat(password); + if(out == NULL || !getMD5((uint8_t*)(in.c_str()), in.length(), out)) + return ""; + res.concat(out); + free(out); + return res; +} + +String requestDigestAuthentication(const char * realm){ + String header = "realm=\""; + if(realm == NULL) + header.concat("asyncesp"); + else + header.concat(realm); + header.concat( "\", qop=\"auth\", nonce=\""); + header.concat(genRandomMD5()); + header.concat("\", opaque=\""); + header.concat(genRandomMD5()); + header.concat("\""); + return header; +} + +bool checkDigestAuthentication(const char * header, const char * method, const char * username, const char * password, const char * realm, bool passwordIsHash, const char * nonce, const char * opaque, const char * uri){ + if(username == NULL || password == NULL || header == NULL || method == NULL){ + //os_printf("AUTH FAIL: missing requred fields\n"); + return false; + } + + String myHeader = String(header); + int nextBreak = myHeader.indexOf(","); + if(nextBreak < 0){ + //os_printf("AUTH FAIL: no variables\n"); + return false; + } + + String myUsername = String(); + String myRealm = String(); + String myNonce = String(); + String myUri = String(); + String myResponse = String(); + String myQop = String(); + String myNc = String(); + String myCnonce = String(); + + myHeader += ", "; + do { + String avLine = myHeader.substring(0, nextBreak); + avLine.trim(); + myHeader = myHeader.substring(nextBreak+1); + nextBreak = myHeader.indexOf(","); + + int eqSign = avLine.indexOf("="); + if(eqSign < 0){ + //os_printf("AUTH FAIL: no = sign\n"); + return false; + } + String varName = avLine.substring(0, eqSign); + avLine = avLine.substring(eqSign + 1); + if(avLine.startsWith("\"")){ + avLine = avLine.substring(1, avLine.length() - 1); + } + + if(varName.equals("username")){ + if(!avLine.equals(username)){ + //os_printf("AUTH FAIL: username\n"); + return false; + } + myUsername = avLine; + } else if(varName.equals("realm")){ + if(realm != NULL && !avLine.equals(realm)){ + //os_printf("AUTH FAIL: realm\n"); + return false; + } + myRealm = avLine; + } else if(varName.equals("nonce")){ + if(nonce != NULL && !avLine.equals(nonce)){ + //os_printf("AUTH FAIL: nonce\n"); + return false; + } + myNonce = avLine; + } else if(varName.equals("opaque")){ + if(opaque != NULL && !avLine.equals(opaque)){ + //os_printf("AUTH FAIL: opaque\n"); + return false; + } + } else if(varName.equals("uri")){ + if(uri != NULL && !avLine.equals(uri)){ + //os_printf("AUTH FAIL: uri\n"); + return false; + } + myUri = avLine; + } else if(varName.equals("response")){ + myResponse = avLine; + } else if(varName.equals("qop")){ + myQop = avLine; + } else if(varName.equals("nc")){ + myNc = avLine; + } else if(varName.equals("cnonce")){ + myCnonce = avLine; + } + } while(nextBreak > 0); + + String ha1 = (passwordIsHash) ? String(password) : stringMD5(myUsername + ":" + myRealm + ":" + String(password)); + String ha2 = String(method) + ":" + myUri; + String response = ha1 + ":" + myNonce + ":" + myNc + ":" + myCnonce + ":" + myQop + ":" + stringMD5(ha2); + + if(myResponse.equals(stringMD5(response))){ + //os_printf("AUTH SUCCESS\n"); + return true; + } + + //os_printf("AUTH FAIL: password\n"); + return false; +} diff --git a/examples/Async_AutoConnect/Async_AutoConnect.ino b/examples/Async_AutoConnect/Async_AutoConnect.ino index f22b35e8..bc4e0108 100644 --- a/examples/Async_AutoConnect/Async_AutoConnect.ino +++ b/examples/Async_AutoConnect/Async_AutoConnect.ino @@ -18,7 +18,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -322,7 +322,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -358,7 +358,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino b/examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino index 8400a54b..1c950bf7 100644 --- a/examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino +++ b/examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino @@ -19,7 +19,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -352,7 +352,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -388,7 +388,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino b/examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino index 22191c84..76acd9f4 100644 --- a/examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino +++ b/examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino @@ -19,7 +19,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -348,7 +348,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -384,7 +384,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino b/examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino index cd61ed65..3339eaef 100644 --- a/examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino +++ b/examples/Async_AutoConnectWithFeedback/Async_AutoConnectWithFeedback.ino @@ -18,7 +18,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -329,7 +329,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -365,7 +365,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino b/examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino index 5d1db61c..a2ff7e8c 100644 --- a/examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino +++ b/examples/Async_AutoConnectWithFeedbackLED/Async_AutoConnectWithFeedbackLED.ino @@ -19,7 +19,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -334,7 +334,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -370,7 +370,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; 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 f21114f9..2df336d6 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 @@ -31,7 +31,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -447,7 +447,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -483,7 +483,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; 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 ef264a83..c168d621 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 @@ -31,7 +31,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 2 @@ -501,7 +501,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -537,7 +537,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; 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 f3183c25..1ac7d8be 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 @@ -31,7 +31,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -484,7 +484,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -520,7 +520,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino b/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino index f052567f..f3b98fde 100644 --- a/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino +++ b/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino @@ -42,7 +42,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 1 @@ -413,7 +413,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -449,7 +449,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino b/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino index e2f923b2..83e60935 100644 --- a/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino +++ b/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino @@ -42,7 +42,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 1 @@ -413,7 +413,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -444,12 +444,13 @@ uint8_t connectMultiWiFi() #endif int i = 0; + status = wifiMulti.run(); delay(WIFI_MULTI_1ST_CONNECT_WAITING_MS); while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_ConfigOnStartup/Async_ConfigOnStartup.ino b/examples/Async_ConfigOnStartup/Async_ConfigOnStartup.ino index da3d7102..eacd8b2e 100644 --- a/examples/Async_ConfigOnStartup/Async_ConfigOnStartup.ino +++ b/examples/Async_ConfigOnStartup/Async_ConfigOnStartup.ino @@ -33,7 +33,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -345,7 +345,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -381,7 +381,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino b/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino index e969783a..7a06f597 100644 --- a/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino +++ b/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino @@ -30,7 +30,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -463,7 +463,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -499,7 +499,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino b/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino index 0645a9af..0f741ddc 100644 --- a/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino +++ b/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino @@ -53,7 +53,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -240,7 +240,11 @@ Alternative trigger pin. Needs to be connected to a button to use this pin. It must be a momentary connection not connected permanently to ground. Either trigger pin will work. */ - const int TRIGGER_PIN2 = PIN_D25; // Pin D25 mapped to pin GPIO25/ADC18/DAC1 of ESP32 + #if ( ARDUINO_ESP32C3_DEV ) + const int TRIGGER_PIN2 = PIN_D8; // Pin D8 mapped to pin GPIO8/FLASH_D1 of ESP32 + #else + const int TRIGGER_PIN2 = PIN_D25; // Pin D25 mapped to pin GPIO25/ADC18/DAC1 of ESP32 + #endif int pinSda = PIN_SDA; // Pin SDA mapped to pin GPIO21/SDA of ESP32 int pinScl = PIN_SCL; // Pin SCL mapped to pin GPIO22/SCL of ESP32 @@ -502,7 +506,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -538,7 +542,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; 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 981c4a82..ae64c0c3 100644 --- a/examples/Async_ConfigOnSwitchFS_MQTT_Ptr/Async_ConfigOnSwitchFS_MQTT_Ptr.ino +++ b/examples/Async_ConfigOnSwitchFS_MQTT_Ptr/Async_ConfigOnSwitchFS_MQTT_Ptr.ino @@ -35,7 +35,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -509,7 +509,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -545,7 +545,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino b/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino index eb2c5b19..bed928ec 100644 --- a/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino +++ b/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino @@ -32,7 +32,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -218,7 +218,11 @@ Alternative trigger pin. Needs to be connected to a button to use this pin. It must be a momentary connection not connected permanently to ground. Either trigger pin will work. */ - const int TRIGGER_PIN2 = PIN_D25; // Pin D25 mapped to pin GPIO25/ADC18/DAC1 of ESP32 + #if ( ARDUINO_ESP32C3_DEV ) + const int TRIGGER_PIN2 = PIN_D8; // Pin D8 mapped to pin GPIO8/FLASH_D1 of ESP32 + #else + const int TRIGGER_PIN2 = PIN_D25; // Pin D25 mapped to pin GPIO25/ADC18/DAC1 of ESP32 + #endif #else /* Trigger for inititating config mode is Pin D3 and also flash button on NodeMCU @@ -477,7 +481,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -513,7 +517,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino b/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino index a6bdd9df..d9791239 100644 --- a/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino +++ b/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino @@ -34,7 +34,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -321,7 +321,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -357,7 +357,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; 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 0178c41c..2ff2dcb9 100644 --- a/examples/Async_ESP32_FSWebServer_DRD/Async_ESP32_FSWebServer_DRD.ino +++ b/examples/Async_ESP32_FSWebServer_DRD/Async_ESP32_FSWebServer_DRD.ino @@ -34,7 +34,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -354,7 +354,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -390,7 +390,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/Async_ESP_FSWebServer/Async_ESP_FSWebServer.ino b/examples/Async_ESP_FSWebServer/Async_ESP_FSWebServer.ino index 64abe811..ded5fd1f 100644 --- a/examples/Async_ESP_FSWebServer/Async_ESP_FSWebServer.ino +++ b/examples/Async_ESP_FSWebServer/Async_ESP_FSWebServer.ino @@ -34,7 +34,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -317,7 +317,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -353,7 +353,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; 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 28a8e932..5f083d4c 100644 --- a/examples/Async_ESP_FSWebServer_DRD/Async_ESP_FSWebServer_DRD.ino +++ b/examples/Async_ESP_FSWebServer_DRD/Async_ESP_FSWebServer_DRD.ino @@ -34,7 +34,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 @@ -333,7 +333,7 @@ uint8_t connectMultiWiFi() uint8_t status; - WiFi.mode(WIFI_STA); + //WiFi.mode(WIFI_STA); LOGERROR(F("ConnectMultiWiFi with :")); @@ -369,7 +369,7 @@ uint8_t connectMultiWiFi() while ( ( i++ < 20 ) && ( status != WL_CONNECTED ) ) { - status = wifiMulti.run(); + status = WiFi.status(); if ( status == WL_CONNECTED ) break; diff --git a/examples/ModelessConnect/ModelessConnect.ino b/examples/ModelessConnect/ModelessConnect.ino index 70ee6766..a1eb1ae8 100644 --- a/examples/ModelessConnect/ModelessConnect.ino +++ b/examples/ModelessConnect/ModelessConnect.ino @@ -19,7 +19,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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // 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 89bae3c7..92702ce5 100644 --- a/examples/ModelessWithInterrupts/ModelessWithInterrupts.ino +++ b/examples/ModelessWithInterrupts/ModelessWithInterrupts.ino @@ -19,7 +19,7 @@ #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.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.2" // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3 diff --git a/library.json b/library.json index 72dc8764..215f1440 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "ESPAsync_WiFiManager", - "version": "1.9.1", + "version": "1.9.2", "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 991d0771..da1831c9 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ESPAsync_WiFiManager -version=1.9.1 +version=1.9.2 author=Khoi Hoang maintainer=Khoi Hoang license=MIT diff --git a/src/ESPAsync_WiFiManager-Impl.h b/src/ESPAsync_WiFiManager-Impl.h index 5ee7d3e1..177dde35 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.9.1 + Version: 1.9.2 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -40,6 +40,7 @@ 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. 1.9.0 K Hoang 08/05/2021 Add WiFi /scan page. Fix timezoneName not displayed in Info page. Clean up. 1.9.1 K Hoang 18/05/2021 Fix warnings with ESP8266 core v3.0.0 + 1.9.2 K Hoang 02/08/2021 Fix Mbed TLS compile error and MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ *****************************************************************************************************************************/ #pragma once diff --git a/src/ESPAsync_WiFiManager.h b/src/ESPAsync_WiFiManager.h index 6b017309..4eeef191 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.9.1 + Version: 1.9.2 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -40,6 +40,7 @@ 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. 1.9.0 K Hoang 08/05/2021 Add WiFi /scan page. Fix timezoneName not displayed in Info page. Clean up. 1.9.1 K Hoang 18/05/2021 Fix warnings with ESP8266 core v3.0.0 + 1.9.2 K Hoang 02/08/2021 Fix Mbed TLS compile error and MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ *****************************************************************************************************************************/ #pragma once @@ -55,41 +56,75 @@ #warning Using ESP32_S2. To follow library instructions to install esp32-s2 core and WebServer Patch #warning You have to select HUGE APP or 1.9-2.0 MB APP to be able to run Config Portal. Must use PSRAM #define USING_ESP32_S2 true -#elif ( ARDUINO_ESP32C3_DEV ) +#elif defined( ARDUINO_ESP32C3_DEV ) #warning Using ESP32_C3. To follow library instructions to install esp32-c3 core. Only SPIFFS and EEPROM OK. - #warning You have to select HUGE APP or 1.9-2.0 MB APP to be able to run Config Portal. Must use PSRAM + #warning You have to select Flash size 2MB and Minimal APP (1.3MB + 700KB) for some boards #define USING_ESP32_C3 true #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.9.2" #if ESP8266 - #if (ARDUINO_ESP8266_GIT_VER == 0xefb0341a) + #if (ARDUINO_ESP8266_GIT_VER == 0xcf6ff4c4) + #define USING_ESP8266_CORE_VERSION 30002 + #define ESP8266_CORE_VERSION "ESP8266 core v3.0.2" + #warning USING_ESP8266_CORE_VERSION "3.0.2" + #elif (ARDUINO_ESP8266_GIT_VER == 0xcbf44fb3) + #define USING_ESP8266_CORE_VERSION 30001 + #define ESP8266_CORE_VERSION "ESP8266 core v3.0.1" + #warning USING_ESP8266_CORE_VERSION "3.0.1" + #elif (ARDUINO_ESP8266_GIT_VER == 0xefb0341a) #define USING_ESP8266_CORE_VERSION 30000 - #warning USING_ESP8266_CORE_VERSION "3.0.0" + #define ESP8266_CORE_VERSION "ESP8266 core v3.0.0" + #warning USING_ESP8266_CORE_VERSION "3.0.0" #elif (ARDUINO_ESP8266_GIT_VER == 0x2843a5ac) #define USING_ESP8266_CORE_VERSION 20704 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.4" #warning USING_ESP8266_CORE_VERSION "2.7.4" #elif (ARDUINO_ESP8266_GIT_VER == 0x5d3af165) #define USING_ESP8266_CORE_VERSION 20703 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.3" + #warning USING_ESP8266_CORE_VERSION "2.7.3" #elif (ARDUINO_ESP8266_GIT_VER == 0x39c79d9b) #define USING_ESP8266_CORE_VERSION 20702 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.2" + #warning USING_ESP8266_CORE_VERSION "2.7.2" #elif (ARDUINO_ESP8266_GIT_VER == 0xa5432625) #define USING_ESP8266_CORE_VERSION 20701 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.1" + #warning USING_ESP8266_CORE_VERSION "2.7.1" #elif (ARDUINO_ESP8266_GIT_VER == 0x3d128e5c) #define USING_ESP8266_CORE_VERSION 20603 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.3" + #warning USING_ESP8266_CORE_VERSION "2.6.3" #elif (ARDUINO_ESP8266_GIT_VER == 0x482516e3) #define USING_ESP8266_CORE_VERSION 20602 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.2" + #warning USING_ESP8266_CORE_VERSION "2.6.2" #elif (ARDUINO_ESP8266_GIT_VER == 0x482516e3) #define USING_ESP8266_CORE_VERSION 20601 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.1" + #warning USING_ESP8266_CORE_VERSION "2.6.1" #elif (ARDUINO_ESP8266_GIT_VER == 0x643ec203) #define USING_ESP8266_CORE_VERSION 20600 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.0" + #warning USING_ESP8266_CORE_VERSION "2.6.0" #elif (ARDUINO_ESP8266_GIT_VER == 0x8b899c12) #define USING_ESP8266_CORE_VERSION 20502 + #define ESP8266_CORE_VERSION "ESP8266 core v2.5.2" + #warning USING_ESP8266_CORE_VERSION "2.5.2" #elif (ARDUINO_ESP8266_GIT_VER == 0x00000000) #define USING_ESP8266_CORE_VERSION 20402 + #define ESP8266_CORE_VERSION "ESP8266 core v2.4.2" + #warning USING_ESP8266_CORE_VERSION "2.4.2" #elif (ARDUINO_ESP8266_GIT_VER == 0x643ec203) - #define USING_ESP8266_CORE_VERSION 0 + #define USING_ESP8266_CORE_VERSION 0 + #define ESP8266_CORE_VERSION "ESP8266 core too old" + #warning USING_ESP8266_CORE_VERSION "0.0.0" + #else + #define USING_ESP8266_CORE_VERSION 999999 + #define ESP8266_CORE_VERSION "ESP8266 core unknown" + #warning USING_ESP8266_CORE_VERSION "x.y.z" #endif #endif diff --git a/src/ESPAsync_WiFiManager_Debug.h b/src/ESPAsync_WiFiManager_Debug.h index 7e01aba7..a3efe5eb 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.9.1 + Version: 1.9.2 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -40,6 +40,7 @@ 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. 1.9.0 K Hoang 08/05/2021 Add WiFi /scan page. Fix timezoneName not displayed in Info page. Clean up. 1.9.1 K Hoang 18/05/2021 Fix warnings with ESP8266 core v3.0.0 + 1.9.2 K Hoang 02/08/2021 Fix Mbed TLS compile error and MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ *****************************************************************************************************************************/ #pragma once diff --git a/src_cpp/ESPAsync_WiFiManager.cpp b/src_cpp/ESPAsync_WiFiManager.cpp index f09dc647..0faf2a5b 100644 --- a/src_cpp/ESPAsync_WiFiManager.cpp +++ b/src_cpp/ESPAsync_WiFiManager.cpp @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.9.1 + Version: 1.9.2 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -40,6 +40,7 @@ 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. 1.9.0 K Hoang 08/05/2021 Add WiFi /scan page. Fix timezoneName not displayed in Info page. Clean up. 1.9.1 K Hoang 18/05/2021 Fix warnings with ESP8266 core v3.0.0 + 1.9.2 K Hoang 02/08/2021 Fix Mbed TLS compile error and MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ *****************************************************************************************************************************/ #include "ESPAsync_WiFiManager.h" diff --git a/src_cpp/ESPAsync_WiFiManager.h b/src_cpp/ESPAsync_WiFiManager.h index 6430274c..84fc9090 100644 --- a/src_cpp/ESPAsync_WiFiManager.h +++ b/src_cpp/ESPAsync_WiFiManager.h @@ -14,7 +14,7 @@ Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager Licensed under MIT license - Version: 1.9.1 + Version: 1.9.2 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -40,6 +40,7 @@ 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. 1.9.0 K Hoang 08/05/2021 Add WiFi /scan page. Fix timezoneName not displayed in Info page. Clean up. 1.9.1 K Hoang 18/05/2021 Fix warnings with ESP8266 core v3.0.0 + 1.9.2 K Hoang 02/08/2021 Fix Mbed TLS compile error and MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ *****************************************************************************************************************************/ #pragma once @@ -55,41 +56,75 @@ #warning Using ESP32_S2. To follow library instructions to install esp32-s2 core and WebServer Patch #warning You have to select HUGE APP or 1.9-2.0 MB APP to be able to run Config Portal. Must use PSRAM #define USING_ESP32_S2 true -#elif ( ARDUINO_ESP32C3_DEV ) +#elif defined( ARDUINO_ESP32C3_DEV ) #warning Using ESP32_C3. To follow library instructions to install esp32-c3 core. Only SPIFFS and EEPROM OK. - #warning You have to select HUGE APP or 1.9-2.0 MB APP to be able to run Config Portal. Must use PSRAM + #warning You have to select Flash size 2MB and Minimal APP (1.3MB + 700KB) for some boards #define USING_ESP32_C3 true #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.9.2" #if ESP8266 - #if (ARDUINO_ESP8266_GIT_VER == 0xefb0341a) + #if (ARDUINO_ESP8266_GIT_VER == 0xcf6ff4c4) + #define USING_ESP8266_CORE_VERSION 30002 + #define ESP8266_CORE_VERSION "ESP8266 core v3.0.2" + #warning USING_ESP8266_CORE_VERSION "3.0.2" + #elif (ARDUINO_ESP8266_GIT_VER == 0xcbf44fb3) + #define USING_ESP8266_CORE_VERSION 30001 + #define ESP8266_CORE_VERSION "ESP8266 core v3.0.1" + #warning USING_ESP8266_CORE_VERSION "3.0.1" + #elif (ARDUINO_ESP8266_GIT_VER == 0xefb0341a) #define USING_ESP8266_CORE_VERSION 30000 - #warning USING_ESP8266_CORE_VERSION "3.0.0" + #define ESP8266_CORE_VERSION "ESP8266 core v3.0.0" + #warning USING_ESP8266_CORE_VERSION "3.0.0" #elif (ARDUINO_ESP8266_GIT_VER == 0x2843a5ac) #define USING_ESP8266_CORE_VERSION 20704 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.4" #warning USING_ESP8266_CORE_VERSION "2.7.4" #elif (ARDUINO_ESP8266_GIT_VER == 0x5d3af165) #define USING_ESP8266_CORE_VERSION 20703 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.3" + #warning USING_ESP8266_CORE_VERSION "2.7.3" #elif (ARDUINO_ESP8266_GIT_VER == 0x39c79d9b) #define USING_ESP8266_CORE_VERSION 20702 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.2" + #warning USING_ESP8266_CORE_VERSION "2.7.2" #elif (ARDUINO_ESP8266_GIT_VER == 0xa5432625) #define USING_ESP8266_CORE_VERSION 20701 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.1" + #warning USING_ESP8266_CORE_VERSION "2.7.1" #elif (ARDUINO_ESP8266_GIT_VER == 0x3d128e5c) #define USING_ESP8266_CORE_VERSION 20603 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.3" + #warning USING_ESP8266_CORE_VERSION "2.6.3" #elif (ARDUINO_ESP8266_GIT_VER == 0x482516e3) #define USING_ESP8266_CORE_VERSION 20602 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.2" + #warning USING_ESP8266_CORE_VERSION "2.6.2" #elif (ARDUINO_ESP8266_GIT_VER == 0x482516e3) #define USING_ESP8266_CORE_VERSION 20601 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.1" + #warning USING_ESP8266_CORE_VERSION "2.6.1" #elif (ARDUINO_ESP8266_GIT_VER == 0x643ec203) #define USING_ESP8266_CORE_VERSION 20600 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.0" + #warning USING_ESP8266_CORE_VERSION "2.6.0" #elif (ARDUINO_ESP8266_GIT_VER == 0x8b899c12) #define USING_ESP8266_CORE_VERSION 20502 + #define ESP8266_CORE_VERSION "ESP8266 core v2.5.2" + #warning USING_ESP8266_CORE_VERSION "2.5.2" #elif (ARDUINO_ESP8266_GIT_VER == 0x00000000) #define USING_ESP8266_CORE_VERSION 20402 + #define ESP8266_CORE_VERSION "ESP8266 core v2.4.2" + #warning USING_ESP8266_CORE_VERSION "2.4.2" #elif (ARDUINO_ESP8266_GIT_VER == 0x643ec203) - #define USING_ESP8266_CORE_VERSION 0 + #define USING_ESP8266_CORE_VERSION 0 + #define ESP8266_CORE_VERSION "ESP8266 core too old" + #warning USING_ESP8266_CORE_VERSION "0.0.0" + #else + #define USING_ESP8266_CORE_VERSION 999999 + #define ESP8266_CORE_VERSION "ESP8266 core unknown" + #warning USING_ESP8266_CORE_VERSION "x.y.z" #endif #endif diff --git a/src_cpp/ESPAsync_WiFiManager_Debug.h b/src_cpp/ESPAsync_WiFiManager_Debug.h index 7e01aba7..a3efe5eb 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.9.1 + Version: 1.9.2 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -40,6 +40,7 @@ 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. 1.9.0 K Hoang 08/05/2021 Add WiFi /scan page. Fix timezoneName not displayed in Info page. Clean up. 1.9.1 K Hoang 18/05/2021 Fix warnings with ESP8266 core v3.0.0 + 1.9.2 K Hoang 02/08/2021 Fix Mbed TLS compile error and MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ *****************************************************************************************************************************/ #pragma once diff --git a/src_h/ESPAsync_WiFiManager-Impl.h b/src_h/ESPAsync_WiFiManager-Impl.h index 5ee7d3e1..177dde35 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.9.1 + Version: 1.9.2 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -40,6 +40,7 @@ 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. 1.9.0 K Hoang 08/05/2021 Add WiFi /scan page. Fix timezoneName not displayed in Info page. Clean up. 1.9.1 K Hoang 18/05/2021 Fix warnings with ESP8266 core v3.0.0 + 1.9.2 K Hoang 02/08/2021 Fix Mbed TLS compile error and MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ *****************************************************************************************************************************/ #pragma once diff --git a/src_h/ESPAsync_WiFiManager.h b/src_h/ESPAsync_WiFiManager.h index 6b017309..4eeef191 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.9.1 + Version: 1.9.2 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -40,6 +40,7 @@ 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. 1.9.0 K Hoang 08/05/2021 Add WiFi /scan page. Fix timezoneName not displayed in Info page. Clean up. 1.9.1 K Hoang 18/05/2021 Fix warnings with ESP8266 core v3.0.0 + 1.9.2 K Hoang 02/08/2021 Fix Mbed TLS compile error and MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ *****************************************************************************************************************************/ #pragma once @@ -55,41 +56,75 @@ #warning Using ESP32_S2. To follow library instructions to install esp32-s2 core and WebServer Patch #warning You have to select HUGE APP or 1.9-2.0 MB APP to be able to run Config Portal. Must use PSRAM #define USING_ESP32_S2 true -#elif ( ARDUINO_ESP32C3_DEV ) +#elif defined( ARDUINO_ESP32C3_DEV ) #warning Using ESP32_C3. To follow library instructions to install esp32-c3 core. Only SPIFFS and EEPROM OK. - #warning You have to select HUGE APP or 1.9-2.0 MB APP to be able to run Config Portal. Must use PSRAM + #warning You have to select Flash size 2MB and Minimal APP (1.3MB + 700KB) for some boards #define USING_ESP32_C3 true #endif -#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.9.1" +#define ESP_ASYNC_WIFIMANAGER_VERSION "ESPAsync_WiFiManager v1.9.2" #if ESP8266 - #if (ARDUINO_ESP8266_GIT_VER == 0xefb0341a) + #if (ARDUINO_ESP8266_GIT_VER == 0xcf6ff4c4) + #define USING_ESP8266_CORE_VERSION 30002 + #define ESP8266_CORE_VERSION "ESP8266 core v3.0.2" + #warning USING_ESP8266_CORE_VERSION "3.0.2" + #elif (ARDUINO_ESP8266_GIT_VER == 0xcbf44fb3) + #define USING_ESP8266_CORE_VERSION 30001 + #define ESP8266_CORE_VERSION "ESP8266 core v3.0.1" + #warning USING_ESP8266_CORE_VERSION "3.0.1" + #elif (ARDUINO_ESP8266_GIT_VER == 0xefb0341a) #define USING_ESP8266_CORE_VERSION 30000 - #warning USING_ESP8266_CORE_VERSION "3.0.0" + #define ESP8266_CORE_VERSION "ESP8266 core v3.0.0" + #warning USING_ESP8266_CORE_VERSION "3.0.0" #elif (ARDUINO_ESP8266_GIT_VER == 0x2843a5ac) #define USING_ESP8266_CORE_VERSION 20704 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.4" #warning USING_ESP8266_CORE_VERSION "2.7.4" #elif (ARDUINO_ESP8266_GIT_VER == 0x5d3af165) #define USING_ESP8266_CORE_VERSION 20703 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.3" + #warning USING_ESP8266_CORE_VERSION "2.7.3" #elif (ARDUINO_ESP8266_GIT_VER == 0x39c79d9b) #define USING_ESP8266_CORE_VERSION 20702 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.2" + #warning USING_ESP8266_CORE_VERSION "2.7.2" #elif (ARDUINO_ESP8266_GIT_VER == 0xa5432625) #define USING_ESP8266_CORE_VERSION 20701 + #define ESP8266_CORE_VERSION "ESP8266 core v2.7.1" + #warning USING_ESP8266_CORE_VERSION "2.7.1" #elif (ARDUINO_ESP8266_GIT_VER == 0x3d128e5c) #define USING_ESP8266_CORE_VERSION 20603 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.3" + #warning USING_ESP8266_CORE_VERSION "2.6.3" #elif (ARDUINO_ESP8266_GIT_VER == 0x482516e3) #define USING_ESP8266_CORE_VERSION 20602 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.2" + #warning USING_ESP8266_CORE_VERSION "2.6.2" #elif (ARDUINO_ESP8266_GIT_VER == 0x482516e3) #define USING_ESP8266_CORE_VERSION 20601 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.1" + #warning USING_ESP8266_CORE_VERSION "2.6.1" #elif (ARDUINO_ESP8266_GIT_VER == 0x643ec203) #define USING_ESP8266_CORE_VERSION 20600 + #define ESP8266_CORE_VERSION "ESP8266 core v2.6.0" + #warning USING_ESP8266_CORE_VERSION "2.6.0" #elif (ARDUINO_ESP8266_GIT_VER == 0x8b899c12) #define USING_ESP8266_CORE_VERSION 20502 + #define ESP8266_CORE_VERSION "ESP8266 core v2.5.2" + #warning USING_ESP8266_CORE_VERSION "2.5.2" #elif (ARDUINO_ESP8266_GIT_VER == 0x00000000) #define USING_ESP8266_CORE_VERSION 20402 + #define ESP8266_CORE_VERSION "ESP8266 core v2.4.2" + #warning USING_ESP8266_CORE_VERSION "2.4.2" #elif (ARDUINO_ESP8266_GIT_VER == 0x643ec203) - #define USING_ESP8266_CORE_VERSION 0 + #define USING_ESP8266_CORE_VERSION 0 + #define ESP8266_CORE_VERSION "ESP8266 core too old" + #warning USING_ESP8266_CORE_VERSION "0.0.0" + #else + #define USING_ESP8266_CORE_VERSION 999999 + #define ESP8266_CORE_VERSION "ESP8266 core unknown" + #warning USING_ESP8266_CORE_VERSION "x.y.z" #endif #endif diff --git a/src_h/ESPAsync_WiFiManager_Debug.h b/src_h/ESPAsync_WiFiManager_Debug.h index 7e01aba7..a3efe5eb 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.9.1 + Version: 1.9.2 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -40,6 +40,7 @@ 1.8.1 K Hoang 06/05/2021 Fix bug. Don't display invalid time when not synch yet. 1.9.0 K Hoang 08/05/2021 Add WiFi /scan page. Fix timezoneName not displayed in Info page. Clean up. 1.9.1 K Hoang 18/05/2021 Fix warnings with ESP8266 core v3.0.0 + 1.9.2 K Hoang 02/08/2021 Fix Mbed TLS compile error and MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ *****************************************************************************************************************************/ #pragma once