diff --git a/README.md b/README.md index 4ee44ec..fab0a21 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,11 @@ Thanks to [cancodr](https://github.com/cancodr) for requesting an enhancement in --- --- +### Releases v1.1.2 + +1. Fix bug in examples. +2. Add example. + ### Releases v1.1.1 1. Add setCORSHeader function to allow **configurable CORS Header**. See [Using CORS feature](https://github.com/khoih-prog/ESP_WiFiManager#15-using-cors-cross-origin-resource-sharing-feature) @@ -108,6 +113,7 @@ to add support to `ESP32` besides `ESP8266`. This is an `ESP32 / ESP8266` WiFi Connection manager with fallback web ConfigPortal. It's using a web ConfigPortal, served from the `ESP32 / ESP8266`, and operating as an access point. +--- --- ## Prerequisite @@ -115,9 +121,7 @@ It's using a web ConfigPortal, served from the `ESP32 / ESP8266`, and operating 1. [`Arduino IDE 1.8.12+` for Arduino](https://www.arduino.cc/en/Main/Software) 2. [`ESP8266 Core 2.7.3+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. 3. [`ESP32 Core 1.0.4+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards - 4. [`ESP_DoubleResetDetector v1.0.3+`](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). + 4. [`ESP_DoubleResetDetector v1.0.3+`](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). --- @@ -139,6 +143,7 @@ The best and easiest way is to use `Arduino Library Manager`. Search for `ESP_Wi 3. Install **ESP_WiFiManager** library by using [Library Manager](https://docs.platformio.org/en/latest/librarymanager/). Search for ***ESP_WiFiManager*** in [Platform.io Author's Libraries](https://platformio.org/lib/search?query=author:%22Khoi%20Hoang%22) 4. Use included [platformio.ini](platformio/platformio.ini) file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples at [Project Configuration File](https://docs.platformio.org/page/projectconf.html) +--- --- ## How It Works @@ -165,6 +170,7 @@ then connect WebBrowser to configurable ConfigPortal IP address, default is 192. #### 1. Using default for every configurable parameter - Include in your sketch + ```cpp #ifdef ESP32 #include @@ -686,6 +692,8 @@ ESP_wifiManager.setSTAStaticIPConfig(stationIP, gatewayIP, netMask, dns1IP, dns2 #define USING_CORS_FEATURE false ``` +--- + #### 16. Using MultiWiFi auto(Re)connect feature 1. In loop() @@ -770,6 +778,7 @@ ESP_wifiManager.setConfigPortalChannel(0); Once WiFi network information is saved in the `ESP32 / ESP8266`, it will try to autoconnect to WiFi every time it is started, without requiring any function calls in the sketch. +--- --- ### Examples @@ -788,11 +797,13 @@ Once WiFi network information is saved in the `ESP32 / ESP8266`, it will try to 12. [AutoConnectWithFeedbackLED](examples/AutoConnectWithFeedbackLED) 13. [AutoConnectWithFSParameters](examples/AutoConnectWithFSParameters) 14. [ConfigOnSwitchFS_MQTT_Ptr](examples/ConfigOnSwitchFS_MQTT_Ptr) +15. [ConfigOnDRD_FS_MQTT_Ptr](examples/ConfigOnDRD_FS_MQTT_Ptr). **NEW** --- --- ## So, how it works? + In `ConfigPortal Mode`, it starts an access point called `ESP_XXXXXX`. Connect to it using the `configurable password` you can define in the code. For example, `your_password` (see examples): ```cpp @@ -838,6 +849,7 @@ If you're already connected to a listed WiFi AP and don't want to change anythin ## Documentation #### Password protect the configuration Access Point + You can password protect the ConfigPortal AP. Simply add an SSID as the first parameter and the password as a second parameter to `startConfigPortal`. See the above examples. A short password seems to have unpredictable results so use one that's around 8 characters or more in length. The guidelines are that a wifi password must consist of 8 to 63 ASCII-encoded characters in the range of 32 to 126 (decimal) @@ -849,6 +861,7 @@ ESP_wifiManager.startConfigPortal( SSID , password ) #### Callbacks ##### Save settings + This gets called when custom parameters have been set **AND** a connection has been established. Use it to set a flag, so when all the configuration finishes, you can save the extra parameters somewhere. See [ConfigOnSwitchFS Example](examples/ConfigOnSwitchFS). @@ -868,7 +881,9 @@ void saveConfigCallback () { ``` #### ConfigPortal Timeout + If you need to set a timeout so the `ESP32 / ESP8266` doesn't hang waiting to be configured for ever. + ```cpp ESP_wifiManager.setConfigPortalTimeout(120); ``` @@ -1001,9 +1016,11 @@ Many applications need configuration parameters like `MQTT host and port`, [Blyn To capture other parameters with `ESP_WiFiManager` is a lot more involved than all the other features and requires adding custom HTML to your form. If you want to do it with `ESP_WiFiManager` see the example [ConfigOnSwitchFS](examples/ConfigOnSwitchFS) #### Custom IP Configuration + You can set a custom IP for both AP (access point, config mode) and STA (station mode, client mode, normal project state) ##### Custom Access Point IP Configuration + This will set your captive portal to a specific IP should you need/want such a feature. Add the following snippet before `startConfigPortal()` ```cpp //set custom ip for portal @@ -1011,13 +1028,16 @@ ESP_wifiManager.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IP ``` ##### Custom Station (client) Static IP Configuration + This will use the specified IP configuration instead of using DHCP in station mode. ```cpp ESP_wifiManager.setSTAStaticIPConfig(IPAddress(192,168,0,99), IPAddress(192,168,0,1), IPAddress(255,255,255,0)); ``` #### Custom HTML, CSS, Javascript + There are various ways in which you can inject custom HTML, CSS or Javascript into the ConfigPortal. + The options are: - inject custom head element You can use this to any html bit to the head of the ConfigPortal. If you add a `