Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 343ccd8

Browse files
authored
v1.0.7
### Releases 1.0.7 1. Use `just-in-time` scanWiFiNetworks() to reduce connection time necessary for battery-operated DeepSleep application. Thanks to [CrispinP](https://github.com/CrispinP) for identifying, requesting and testing. See [Starting WiFIManger is very slow (2000ms)](#6) 2. Fix bug relating SPIFFS in examples : - [ConfigOnSwitchFS](examples/ConfigOnSwitchFS) - [ConfigPortalParamsOnSwitch](examples/ConfigPortalParamsOnSwitch) (now support ArduinoJson 6.0.0+ as well as 5.13.5-) - [AutoConnectWithFSParameters](examples/AutoConnectWithFSParameters) See [Having issue to read the SPIFF file](#14), Thanks to [OttoKlaasen](https://github.com/OttoKlaasen) to report. 3. Fix [README](README.md). See [Accessing manager after connection](#15)
1 parent 381ca3a commit 343ccd8

File tree

15 files changed

+923
-859
lines changed

15 files changed

+923
-859
lines changed

README.md

+56-28
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
[![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_WiFiManager.svg?)](https://www.ardu-badge.com/ESP_WiFiManager)
44

5+
### Releases 1.0.7
6+
7+
1. Use `just-in-time` scanWiFiNetworks() to reduce connection time necessary for battery-operated DeepSleep application. Thanks to [CrispinP](https://github.com/CrispinP) for identifying, requesting and testing. See [Starting WiFIManger is very slow (2000ms)](https://github.com/khoih-prog/ESP_WiFiManager/issues/6)
8+
2. Fix bug relating SPIFFS in examples :
9+
- [ConfigOnSwitchFS](examples/ConfigOnSwitchFS)
10+
- [ConfigPortalParamsOnSwitch](examples/ConfigPortalParamsOnSwitch) (now support ArduinoJson 6.0.0+ as well as 5.13.5-)
11+
- [AutoConnectWithFSParameters](examples/AutoConnectWithFSParameters)
12+
See [Having issue to read the SPIFF file](https://github.com/khoih-prog/ESP_WiFiManager/issues/14), Thanks to [OttoKlaasen](https://github.com/OttoKlaasen) to report.
13+
3. Fix [README](README.md). See [Accessing manager after connection](https://github.com/khoih-prog/ESP_WiFiManager/issues/15)
14+
515
### Releases 1.0.6
616

717
1. Add function getConfigPortalPW()
@@ -14,10 +24,8 @@ This library is based on, modified, bug-fixed and improved from:
1424

1525
to add support to `ESP32` besides `ESP8266`.
1626

17-
This is an `ESP32 / ESP8266` WiFi Connection manager with fallback web configuration portal.
18-
It's using a web configuration portal, served from the `ESP32 / ESP8266`, and operating as an access point.
19-
20-
The configuration portal is captive, so it will present the configuration dialogue regardless of the web address selected, excluding https requests.
27+
This is an `ESP32 / ESP8266` WiFi Connection manager with fallback web ConfigPortal.
28+
It's using a web ConfigPortal, served from the `ESP32 / ESP8266`, and operating as an access point.
2129

2230
## Prerequisite
2331
1. [`Arduino IDE 1.8.12 or later` for Arduino](https://www.arduino.cc/en/Main/Software)
@@ -28,14 +36,18 @@ The configuration portal is captive, so it will present the configuration dialog
2836
## How It Works
2937

3038
- The [ConfigOnSwitch](examples/ConfigOnSwitch) example shows how it works and should be used as the basis for a sketch that uses this library.
31-
- The concept of ConfigOnSwitch is that a new `ESP32 / ESP8266` will start a WiFi configuration portal when powered up and save the configuration data in non volatile memory. Thereafter, the configuration portal will only be started again if a button is pushed on the `ESP32 / ESP8266` module.
32-
- Using any WiFi enabled device with a browser (computer, phone, tablet) connect to the newly created Access Point and type in any http address.
33-
- Because of the Captive Portal and the DNS server you will either get a 'Join to network' type of popup or get any domain you try to access redirected to the configuration portal.
34-
- All http web addresses will be redirected to wifi.urremote.com which will be at IP address `192.168.4.1` . This address is also a valid internet address where the user will see advice that they are connected to the wrong network.
35-
- Choose one of the access points scanned, enter password, click save.
36-
- ESP will try to connect. If successful, the IP address on the new network will be displayed in the configuration portal.
37-
- The configuration portal will now be visible on two networks, these being it's own network and the network to which it has connected. On it's own network it will have two IP addresses, the original `192.168.4.1` and the same IP address it has on the network to which it connected.
38-
- Selecting "close configuration portal" will shutdown the web server, shutdown the `ESP32 / ESP8266` WiFi network and return control to the following sketch code.
39+
- The concept of ConfigOnSwitch is that a new `ESP32 / ESP8266` will start a WiFi ConfigPortal when powered up and save the configuration data in non volatile memory. Thereafter, the ConfigPortal will only be started again if a button is pushed on the `ESP32 / ESP8266` module.
40+
- Using any WiFi enabled device with a browser (computer, phone, tablet) connect to the newly created Access Point (AP) using configurable SSID and Password (specified in sketch)
41+
42+
```cpp
43+
// SSID and PW for Config Portal
44+
String ssid = "ESP_" + String(ESP_getChipId(), HEX);
45+
const char* password = "your_password";
46+
```
47+
then connect WebBrower to configurable ConfigPortal IP address, default is 192.168.4.1
48+
49+
- Choose one of the access points scanned, enter password, click ***Save***.
50+
- ESP will restart, then try to connect to the WiFi netwotk using STA-only mode, ***without running the ConfigPortal WebServer and WiFi AP***. See [Accessing manager after connection](https://github.com/khoih-prog/ESP_WiFiManager/issues/15).
3951

4052
## Quick Start
4153

@@ -109,8 +121,14 @@ then later call
109121
ESP_wifiManager.startConfigPortal()
110122
```
111123

112-
While in AP mode, connect to it using its `SSID` (ESP_XXXXXX) / `Password` ("your_password"), then open a browser to the gateway IP, default `192.168.4.1`, configure wifi then save. The WiFi connection information will be saved in non volatile memory. It will then reboot and autoconnect.
124+
While in AP mode, connect to it using its `SSID` (ESP_XXXXXX) / `Password` ("your_password"), then open a browser to the AP IP, default `192.168.4.1`, configure wifi then save. The WiFi connection information will be saved in non volatile memory. It will then reboot and autoconnect.
113125

126+
You can also change the AP IP by using this call
127+
128+
```cpp
129+
//set custom ip for portal
130+
ESP_wifiManager.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
131+
```
114132

115133
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.
116134

@@ -128,7 +146,7 @@ Also see examples:
128146
10. [AutoConnectWithFSParameters](examples/AutoConnectWithFSParameters)
129147

130148
## So, how it works?
131-
In `Configuration Portal 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):
149+
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):
132150

133151
```cpp
134152
// SSID and PW for Config Portal
@@ -159,14 +177,14 @@ Select `Configuration` to enter this page where you can select an AP and specify
159177
<img src="https://github.com/khoih-prog/ESP_WiFiManager/blob/master/Images/Configuration.png">
160178
</p>
161179

162-
Enter your credentials, then click `Save`. The WiFi Credentials will be saved and the board reboots to connect to the selected WiFi AP.
180+
Enter your credentials, then click ***Save***. The WiFi Credentials will be saved and the board reboots to connect to the selected WiFi AP.
163181

164-
If you're already connected to a listed WiFi AP and don't want to change anything, just select `Exit Portal` from the `Main` page to reboot the board and connect to the previously-stored AP. The WiFi Credentials are still intact.
182+
If you're already connected to a listed WiFi AP and don't want to change anything, just select ***Exit Portal*** from the `Main` page to reboot the board and connect to the previously-stored AP. The WiFi Credentials are still intact.
165183

166184
## Documentation
167185

168186
#### Password protect the configuration Access Point
169-
You can password protect the configuration access point. Simply add an SSID as the first parameter and the password as a second parameter to `startConfigPortal`. See the above examples.
187+
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.
170188
A short password seems to have unpredictable results so use one that's around 8 characters or more in length.
171189
The guidelines are that a wifi password must consist of 8 to 63 ASCII-encoded characters in the range of 32 to 126 (decimal)
172190

@@ -195,7 +213,7 @@ void saveConfigCallback () {
195213
}
196214
```
197215

198-
#### Configuration Portal Timeout
216+
#### ConfigPortal Timeout
199217
If you need to set a timeout so the `ESP32 / ESP8266` doesn't hang waiting to be configured for ever.
200218
```cpp
201219
ESP_wifiManager.setConfigPortalTimeout(60);
@@ -205,17 +223,17 @@ unless you're accessing the Config Portal. In this case, the `startConfigPortal`
205223
the Config Portal.
206224

207225

208-
#### On Demand Configuration Portal
226+
#### On Demand ConfigPortal
209227

210228
Example usage
211229

212230
```cpp
213231
void loop()
214232
{
215-
// is configuration portal requested?
233+
// is ConfigPortal requested?
216234
if ((digitalRead(TRIGGER_PIN) == LOW) || (digitalRead(TRIGGER_PIN2) == LOW))
217235
{
218-
Serial.println("\nConfiguration portal requested.");
236+
Serial.println("\nConfigPortal requested.");
219237
digitalWrite(PIN_LED, LED_ON); // turn the LED on by making the voltage LOW to tell us we are in configuration mode.
220238

221239
//Local intialization. Once its business is done, there is no need to keep it around
@@ -231,7 +249,7 @@ void loop()
231249

232250
//Check if there is stored WiFi router/password credentials.
233251
//If not found, device will remain in configuration mode until switched off via webserver.
234-
Serial.print("Opening configuration portal. ");
252+
Serial.print("Opening ConfigPortal. ");
235253
Router_SSID = ESP_wifiManager.WiFi_SSID();
236254
if (Router_SSID != "")
237255
{
@@ -264,7 +282,7 @@ void loop()
264282
See [ConfigOnSwitch](examples/ConfigOnSwitch) example for a more complex version.
265283

266284
#### Custom Parameters
267-
Many applications need configuration parameters like `MQTT host and port`, [Blynk](http://www.blynk.cc) or [emoncms](http://emoncms.org) tokens, etc. While it is possible to use `ESP_WiFiManager` to collect additional parameters it is better to read these parameters from a web service once `ESP_WiFiManager` has been used to connect to the internet. This makes `ESP_WiFiManager` simple to code and use, parameters can be edited on a regular web server and can be changed remotely after deployment. A web service that can provide these parameters is at [configure.urremote.com](http://configure.urremote.com/).
285+
Many applications need configuration parameters like `MQTT host and port`, [Blynk](http://www.blynk.cc) or [emoncms](http://emoncms.org) tokens, etc. While it is possible to use `ESP_WiFiManager` to collect additional parameters it is better to read these parameters from a web service once `ESP_WiFiManager` has been used to connect to the internet.
268286

269287
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)
270288

@@ -285,10 +303,10 @@ ESP_wifiManager.setSTAStaticIPConfig(IPAddress(192,168,0,99), IPAddress(192,168,
285303
```
286304

287305
#### Custom HTML, CSS, Javascript
288-
There are various ways in which you can inject custom HTML, CSS or Javascript into the configuration portal.
306+
There are various ways in which you can inject custom HTML, CSS or Javascript into the ConfigPortal.
289307
The options are:
290308
- inject custom head element
291-
You can use this to any html bit to the head of the configuration portal. If you add a `<style>` element, bare in mind it overwrites the included css, not replaces.
309+
You can use this to any html bit to the head of the ConfigPortal. If you add a `<style>` element, bare in mind it overwrites the included css, not replaces.
292310

293311
```cpp
294312
ESP_wifiManager.setCustomHeadElement("<style>html{filter: invert(100%); -webkit-filter: invert(100%);}</style>");
@@ -337,8 +355,18 @@ If you get compilation errors, more often than not, you may need to install a ne
337355

338356
Sometimes, the library will only work if you update the `ESP32 / ESP8266` core to the latest version because I am using some newly added function.
339357

340-
If you connect to the created configuration Access Point but the configuration portal does not show up, just open a browser and type in the IP of the web portal, by default `192.168.4.1`.
358+
If you connect to the created configuration Access Point but the ConfigPortal does not show up, just open a browser and type in the IP of the web portal, by default `192.168.4.1`.
359+
360+
### Releases 1.0.7
341361

362+
1. Use `just-in-time` scanWiFiNetworks() to reduce connection time necessary for battery-operated DeepSleep application. Thanks to [CrispinP](https://github.com/CrispinP) for identifying, requesting and testing. See [Starting WiFIManger is very slow (2000ms)](https://github.com/khoih-prog/ESP_WiFiManager/issues/6)
363+
2. Fix bug relating SPIFFS in examples :
364+
- [ConfigOnSwitchFS](examples/ConfigOnSwitchFS)
365+
- [ConfigPortalParamsOnSwitch](examples/ConfigPortalParamsOnSwitch) (now support ArduinoJson 6.0.0+ as well as 5.13.5-)
366+
- [AutoConnectWithFSParameters](examples/AutoConnectWithFSParameters)
367+
See [Having issue to read the SPIFF file](https://github.com/khoih-prog/ESP_WiFiManager/issues/14), Thanks to [OttoKlaasen](https://github.com/OttoKlaasen) to report.
368+
3. Fix [README](README.md). See [Accessing manager after connection](https://github.com/khoih-prog/ESP_WiFiManager/issues/15)
369+
342370
### Releases 1.0.6
343371

344372
#### New in v1.0.6
@@ -390,8 +418,8 @@ See [KenTaylor's version](https://github.com/kentaylor/WiFiManager) for previous
390418
### Contributions and thanks
391419
1. Based on and modified from [Tzapu](https://github.com/tzapu/WiFiManager) and [KenTaylor's version]( https://github.com/kentaylor/WiFiManager)
392420
2. Thanks to [Amorphous](https://community.blynk.cc/t/esp-wifimanager-for-esp32-and-esp8266/42257/13) for the static DNS feature and code, included in v1.0.5
393-
3. Thanks to [CrispinP](https://github.com/CrispinP) for idea to add HostName (v1.0.4) and request to reduce the unnecessary waiting time in ESP_WiFiManager constructor (v1.0.6+).
394-
4. Thanks to [OttoKlaasen](https://github.com/OttoKlaasen) for reporting [Having issue to read the SPIFF file](https://github.com/khoih-prog/ESP_WiFiManager/issues/14) bug.
421+
3. Thanks to [CrispinP](https://github.com/CrispinP) for idea to add HostName (v1.0.4) and request to reduce the unnecessary waiting time in ESP_WiFiManager constructor (v1.0.6+). See [Starting WiFIManger is very slow (2000ms)](https://github.com/khoih-prog/ESP_WiFiManager/issues/6)
422+
4. Thanks to [OttoKlaasen](https://github.com/OttoKlaasen) for reporting [Having issue to read the SPIFF file](https://github.com/khoih-prog/ESP_WiFiManager/issues/14) bug in examples.
395423

396424
### Contributing
397425

examples/AutoConnect/AutoConnect.ino

+24-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
/****************************************************************************************************************************
2-
* AutoConnect.ino
3-
* For ESP8266 / ESP32 boards
4-
*
5-
* ESP_WiFiManager is a library for the ESP8266/ESP32 platform (https://github.com/esp8266/Arduino) to enable easy
6-
* configuration and reconfiguration of WiFi credentials using a Captive Portal.
7-
*
8-
* Forked from Tzapu https://github.com/tzapu/WiFiManager
9-
* and from Ken Taylor https://github.com/kentaylor
10-
*
11-
* Built by Khoi Hoang https://github.com/khoih-prog/ESP_WiFiManager
12-
* Licensed under MIT license
13-
* Version: 1.0.6
14-
*
15-
* Version Modified By Date Comments
16-
* ------- ----------- ---------- -----------
17-
* 1.0.0 K Hoang 07/10/2019 Initial coding
18-
* 1.0.1 K Hoang 13/12/2019 Fix bug. Add features. Add support for ESP32
19-
* 1.0.4 K Hoang 07/01/2020 Use ESP_WiFiManager setHostname feature
20-
* 1.0.5 K Hoang 15/01/2020 Add configurable DNS feature. Thanks to @Amorphous of https://community.blynk.cc
21-
* 1.0.6 K Hoang 03/02/2020 Add support for ArduinoJson version 6.0.0+ ( tested with v6.14.1 )
2+
AutoConnect.ino
3+
For ESP8266 / ESP32 boards
4+
5+
ESP_WiFiManager is a library for the ESP8266/ESP32 platform (https://github.com/esp8266/Arduino) to enable easy
6+
configuration and reconfiguration of WiFi credentials using a Captive Portal.
7+
8+
Forked from Tzapu https://github.com/tzapu/WiFiManager
9+
and from Ken Taylor https://github.com/kentaylor
10+
11+
Built by Khoi Hoang https://github.com/khoih-prog/ESP_WiFiManager
12+
Licensed under MIT license
13+
Version: 1.0.7
14+
15+
Version Modified By Date Comments
16+
------- ----------- ---------- -----------
17+
1.0.0 K Hoang 07/10/2019 Initial coding
18+
1.0.1 K Hoang 13/12/2019 Fix bug. Add features. Add support for ESP32
19+
1.0.2 K Hoang 19/12/2019 Fix bug thatkeeps ConfigPortal in endless loop if Portal/Router SSID or Password is NULL.
20+
1.0.3 K Hoang 05/01/2020 Option not displaying AvailablePages in Info page. Enhance README.md. Modify examples
21+
1.0.4 K Hoang 07/01/2020 Add RFC952 setHostname feature.
22+
1.0.5 K Hoang 15/01/2020 Add configurable DNS feature. Thanks to @Amorphous of https://community.blynk.cc
23+
1.0.6 K Hoang 03/02/2020 Add support for ArduinoJson version 6.0.0+ ( tested with v6.14.1 )
24+
1.0.7 K Hoang 13/04/2020 Reduce start time, fix SPIFFS bug in examples, update README.md
2225
*****************************************************************************************************************************/
2326

2427
//Ported to ESP32
@@ -124,7 +127,7 @@ void setup()
124127

125128
String chipID = String(ESP_getChipId(), HEX);
126129
chipID.toUpperCase();
127-
130+
128131
// SSID and PW for Config Portal
129132
String AP_SSID = "ESP_" + chipID + "_AutoConnectAP";
130133
String AP_PASS = "MyESP_" + chipID;

examples/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@
1010
1111
Built by Khoi Hoang https://github.com/khoih-prog/ESP_WiFiManager
1212
Licensed under MIT license
13-
Version: 1.0.6
13+
Version: 1.0.7
1414
1515
Version Modified By Date Comments
1616
------- ----------- ---------- -----------
1717
1.0.0 K Hoang 07/10/2019 Initial coding
1818
1.0.1 K Hoang 13/12/2019 Fix bug. Add features. Add support for ESP32
19-
1.0.4 K Hoang 07/01/2020 Use ESP_WiFiManager setHostname feature
19+
1.0.2 K Hoang 19/12/2019 Fix bug thatkeeps ConfigPortal in endless loop if Portal/Router SSID or Password is NULL.
20+
1.0.3 K Hoang 05/01/2020 Option not displaying AvailablePages in Info page. Enhance README.md. Modify examples
21+
1.0.4 K Hoang 07/01/2020 Add RFC952 setHostname feature.
2022
1.0.5 K Hoang 15/01/2020 Add configurable DNS feature. Thanks to @Amorphous of https://community.blynk.cc
2123
1.0.6 K Hoang 03/02/2020 Add support for ArduinoJson version 6.0.0+ ( tested with v6.14.1 )
24+
1.0.7 K Hoang 13/04/2020 Reduce start time, fix SPIFFS bug in examples, update README.md
2225
*****************************************************************************************************************************/
2326

2427
//Ported to ESP32

0 commit comments

Comments
 (0)