diff --git a/mkdocs/advancedusage.md b/mkdocs/advancedusage.md
index 865737d..a9a0c94 100644
--- a/mkdocs/advancedusage.md
+++ b/mkdocs/advancedusage.md
@@ -6,7 +6,7 @@ Registering the "not found" handler is a different way than ESP8266WebServer (We
### Access to saved credentials
-AutoConnect stores the established WiFi connection in the flash of the ESP8266/ESP32 module and equips the class to access it from the sketch. You can read, write or erase the credentials using this class individually. It's [AutoConnectCredential](credit.md#autoconnectcredential) class which provides the access method to the saved credentials in the flash. Refer to section [Saved credentials access](credit.md) for details.
+AutoConnect stores the established WiFi connection in the flash of the ESP8266/ESP32 module and equips the class to access it from the Sketch. You can read, write or erase the credentials using this class individually. It's [AutoConnectCredential](credit.md#autoconnectcredential) class which provides the access method to the saved credentials in the flash. Refer to section [Saved credentials access](credit.md) for details.
!!! note "Where to store credentials in ESP32 with AutoConnect v1.0.0 or later"
Since v1.0.0, credentials are stored in nvs of ESP32. AutoConnect v1.0.0 or later accesses the credentials area using the **Preferences** class with the arduino esp-32 core. So in ESP32, the credentials are not in the EEPROM, it is in the namespace **AC_CREDT** of the nvs. See [Saved credentials access](credit.md) for details.
@@ -74,7 +74,7 @@ Portal.begin();
### Captive portal start detection
-The captive portal will only be activated if the first *WiFi::begin* fails. Sketch can detect with the [*AutoConnect::onDetect*](api.md#ondetect) function that the captive portal has started. For example, the sketch can be written like as follows that turns on the LED at the start captive portal.
+The captive portal will only be activated if 1st-WiFi::begin fails. Sketch can detect with the [*AutoConnect::onDetect*](api.md#ondetect) function that the captive portal has started. For example, the Sketch can be written like as follows that turns on the LED at the start captive portal.
```cpp hl_lines="3 13"
AutoConnect Portal;
@@ -100,9 +100,36 @@ void loop() {
}
```
+### Captive portal starting control
+
+Basically, the captive portal launch is subject to 1st-WiFi.begin result, but Sketch can control it. The Sketch can direct the following four actions by configuring AutoConnect with two parameters, [*AutoConnectConfig::immediateStart*](apiconfig.md#immediatestart) and [*AutoConnectConfig::autoRise*](apiconfig.md#autorise).
+
+
+
+ AutoConnectConfig ::immediateStart |
+ AutoConnectConfig::autoRise |
+
+
+ true |
+ false |
+
+
+ true |
+ Skip 1st-WiFi.begin ESP module becomes SoftAP and the captive portal starts immediately.
|
+ Not attempt WiFi connection. Only WebServer will start in STA mode. |
+
+
+ false |
+ Attempts WiFi connection in STA mode. In some cases, the autoReconnect may restore the connection even if 1st-WiFiBeing fails. If the connection is completely lost, the captive portal will be launched. This is the default. |
+ Attempts WiFi connection in STA mode. In some cases, the autoReconnect may restore the connection even if 1st-WiFiBeing fails. ESP module stays in STA mode and WebServer will start. |
+
+
+
### Captive portal timeout control
-AutoConnect has two parameters for timeout control. One is a timeout value used when trying to connect to the specified AP. It behaves the same as general timeout control in connection attempt by WiFi.begin. This control is specified by the third parameter of [*AutoConnect::begin*](api.md#begin). The default value is macro defined by [**AUTOCONNECT_TIMEOUT**](api.md#defined-macros) in the **AutoConnectDefs.h** file.
+Once AutoConnect has entered the captive portal state due to the above conditions, it will not exit until a WiFi connection can be established. (But that is the default behavior)
+
+The Sketch can abort the [*AutoConnect::begin*](api.md#begin) by setting the captive portal timeout and returns control to Sketch. AutoConnect has two parameters for timeout control. One is a timeout value used when trying to connect to the specified AP. It behaves the same as general timeout control in connection attempt by WiFi.begin. This control is specified by the third parameter of [*AutoConnect::begin*](api.md#begin). The default value is macro defined by [**AUTOCONNECT_TIMEOUT**](api.md#defined-macros) in the **AutoConnectDefs.h** file.
The other timeout control is for the captive portal itself. It is useful when you want to continue sketch execution with offline even if the WiFi connection is not possible. You can also combine it with the [**immediateStart**](#on-demand-start-the-captive-portal) option to create sketches with high mobility.
@@ -159,7 +186,7 @@ void loop() {
}
```
-There is another option related to timeout in AutoConnectConfig. It can make use of the captive portal function even after a timeout. The [*AutoConnectConfig::retainPortal*](apiconfig.md#retainportal) option will not stop the SoftAP when the captive portal is timed out. If you enable the ratainPortal option, you can try to connect to the AP at any time while continuing to sketch execution with offline even after the captive portal timed-out. Compared to the above code specified no option with the following example code, the captive portal will remain available even after a timeout without changing the logic of the sketch.
+There is another option related to timeout in AutoConnectConfig. It can make use of the captive portal function even after a timeout. The [*AutoConnectConfig::retainPortal*](apiconfig.md#retainportal) option will not stop the SoftAP when the captive portal is timed out. If you enable the ratainPortal option, you can try to connect to the AP at any time while continuing to sketch execution with offline even after the captive portal timed-out. Compared to the above code specified no option with the following example code, the captive portal will remain available even after a timeout without changing the logic of the Sketch.
```cpp hl_lines="10"
#include
@@ -251,7 +278,7 @@ You can change the label text for each menu item but cannot change them at run t
1. Overwrite the label literal of library source code directly.
- You can change the label of the AutoConnect menu item by rewriting the default label literal in [AutoConnectLabels.h](https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnectLabels.h) macros. However, changing menu items literal influences all the sketch's build scenes.
+ You can change the label of the AutoConnect menu item by rewriting the default label literal in [AutoConnectLabels.h](https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnectLabels.h) macros. However, changing menu items literal influences all the Sketch's build scenes.
```cpp
#define AUTOCONNECT_MENULABEL_CONFIGNEW "Configure new AP"
@@ -276,7 +303,7 @@ You can change the label text for each menu item but cannot change them at run t
### Combination with mDNS
-With [mDNS library](https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266mDNS), you can access to ESP8266 by name instead of IP address after connection. The sketch can start the MDNS responder after [*AutoConnect::begin*](api.md#begin).
+With [mDNS library](https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266mDNS), you can access to ESP8266 by name instead of IP address after connection. The Sketch can start the MDNS responder after [*AutoConnect::begin*](api.md#begin).
```cpp hl_lines="8 9"
#include
@@ -329,7 +356,7 @@ Combining these two parameters allows you to filter the destination AP when mult
Restoring static IPs suitable for the SSID from saved credentials |
- Specified with the sketch |
+ Specified with the Sketch |
Not efective |
By AutoConnect::begin parameters |
Use the specified value of AutoConnectConfig |
@@ -359,7 +386,7 @@ You can output AutoConnect monitor messages to the **Serial**. A monitor message
### Disable the captive portal
-It can also prevent the captive portal from starting even if the connection at the first *WiFi.begin* fails. In this case, [*AutoConnect::begin*](api.md#begin) behaves same as *WiFi.begin*.
+It can also prevent the captive portal from starting even if the connection at the 1st-WiFi.begin fails. In this case, [*AutoConnect::begin*](api.md#begin) behaves same as *WiFi.begin*.
For disabling the captive portal, [**autoRise**](apiconfig.md#autorise) sets to false with [AutoConnectConfig](apiconfig.md).
@@ -513,7 +540,7 @@ server.send(200, "text/plain", "Hello, world");
### Usage for automatically instantiated ESP8266WebServer/WebServer
-The sketch can handle URL requests using ESP8266WebServer or WebServer that AutoConnect started internally. ESP8266WebServer/WebServer instantiated dynamically by AutoConnect can be referred to by [*AutoConnect::host*](api.md#host) function. The sketch can use the '**on**' function, '**send**' function, '**client**' function and others by ESP8266WebServer/WebServer reference of its return value.
+The Sketch can handle URL requests using ESP8266WebServer or WebServer that AutoConnect started internally. ESP8266WebServer/WebServer instantiated dynamically by AutoConnect can be referred to by [*AutoConnect::host*](api.md#host) function. The Sketch can use the '**on**' function, '**send**' function, '**client**' function and others by ESP8266WebServer/WebServer reference of its return value.
```cpp hl_lines="8 9 13 14 20 21 27"
#include
@@ -551,7 +578,7 @@ void loop() {
```
!!! note "ESP8266WebServer/WebServer function should be called after AutoConnect::begin"
- The sketch cannot refer to an instance of ESP8266WebServer/WebServer until AutoConnect::begin completes successfully.
+ The Sketch cannot refer to an instance of ESP8266WebServer/WebServer until AutoConnect::begin completes successfully.
!!! warning "Do not use with ESP8266WebServer::begin or WebServer::begin"
ESP8266WebServer/WebServer is already running inside the AutoConnect.
@@ -591,7 +618,7 @@ AutoConnectConfig can specify the following runtime behavior:
-The sketch HOME path is closely related to the [bootUri](apiconfig.md#booturi) that specifies the access path on module restart. AutoConnect has the following three parameters concerning control the URIs:
+The Sketch HOME path is closely related to the [bootUri](apiconfig.md#booturi) that specifies the access path on module restart. AutoConnect has the following three parameters concerning control the URIs:
- **AUTOCONNECT_URI**
The **ROOT** of AutoConnect. It is defined in `AutoConnectDefs.h` and is assigned an [AutoConnect statistics screen](menu.md#where-the-from) by default.
@@ -670,7 +697,7 @@ But this method is not recommended. The broadcast radio of SSID emitted from Sof
### Configuration for Soft AP and captive portal
-AutoConnect will activate SoftAP at failed the first *WiFi.begin*. It SoftAP settings are stored in [**AutoConnectConfig**](apiconfig.md#autoconnectconfig) as the following parameters. The sketch could be configured SoftAP using these parameters, refer the [AutoConnectConfig API](apiconfig.md#public-member-variables) for details.
+AutoConnect will activate SoftAP at failed the 1st-WiFi.begin. It SoftAP settings are stored in [**AutoConnectConfig**](apiconfig.md#autoconnectconfig) as the following parameters. The Sketch could be configured SoftAP using these parameters, refer the [AutoConnectConfig API](apiconfig.md#public-member-variables) for details.
### Configure WiFi channel
diff --git a/mkdocs/apiconfig.md b/mkdocs/apiconfig.md
index bd7dd7b..a42267f 100644
--- a/mkdocs/apiconfig.md
+++ b/mkdocs/apiconfig.md
@@ -70,7 +70,7 @@ Reset ESP8266 module automatically after WLAN disconnected.
### autoRise
-Captive portal activation switch. False for disabling the captive portal. It prevents starting the captive portal even if the connection at the first *WiFi.begin* fails.
+Captive portal activation switch. False for disabling the captive portal. It prevents starting the captive portal even if the connection at the 1st-WiFi.begin fails.
- **Type**
- bool
@@ -112,7 +112,7 @@ This option is valid only for ESP8266 or ESP32 arduino core 1.0.2 earlier.
!!! warning "It will conflict with user data."
- If the sketch leaves this offset at zero, it will conflict the storage area of credentials with the user sketch owned data. It needs to use the behind of credential area.
+ If the Sketch leaves this offset at zero, it will conflict the storage area of credentials with the user sketch owned data. It needs to use the behind of credential area.
### channel
@@ -180,13 +180,13 @@ Sets the station host name of ESP8266/ESP32.
### immediateStart
-Disable the first WiFi.begin() and start the captive portal. If this option is enabled, the module will be in AP_STA mode and the captive portal will be activated regardless of [**AutoConnectConfig::autoRise**](apiconfig.md#autorise) specification.
+Disable the 1st-WiFi.begin and start the captive portal. If this option is enabled, the module will be in AP_STA mode and the captive portal. The evaluation rank of this parameter is lower than the [**AutoConnectConfig::autoRise**](apiconfig.md#autorise). Even if immediateStart is true, the captive portal will not launch if autoRise is false.
- **Type**
- bool
- **Value**
- trueStart the captive portal with [**AutoConnect::begin**](api.md#begin).
- - falseEnable the first WiFi.begin() and it will start captive portal when connection failed. This is default.
+ - falseEnable the 1st-WiFi.begin and it will start captive portal when connection failed. This is default.
### menuItems
@@ -232,7 +232,7 @@ Sets subnet mask for Soft AP in captive portal. When AutoConnect fails the initi
### ota
-Specifies to import the built-in OTA update class into the sketch. When this option is enabled, an **Update** item will appear in the AutoConnect menu, and the OTA update via Web browser will be automatically embedded to the Sketch.
+Specifies to import the built-in OTA update class into the Sketch. When this option is enabled, an **Update** item will appear in the AutoConnect menu, and the OTA update via Web browser will be automatically embedded to the Sketch.
- **Type**
- AC_OTA_t
@@ -281,7 +281,7 @@ Specify whether to continue the portal function even if the captive portal timed
!!! hint "Connection request after timed-out"
- With the **retainPortal**, even if AutoConnect::begin in the setup() is timed out, you can execute the sketch and the portal function as a WiFi connection attempt by calling AutoConnect::handleClient in the loop().
+ With the **retainPortal**, even if AutoConnect::begin in the setup() is timed out, you can execute the Sketch and the portal function as a WiFi connection attempt by calling AutoConnect::handleClient in the loop().
!!! info "All unresolved addresses redirects to /_ac"
If you enable the **retainPortal** option, **all unresolved URIs will be redirected to `SoftAPIP/_ac`**. It happens frequently as client devices repeat captive portal probes in particular. To avoid this, you need to exit from the WiFi connection Apps on your device once.
@@ -362,7 +362,7 @@ Config.autoSave = AC_SAVECREDENTIAL_NEVER; // No save credential
Config.boundaryOffset = 64; // Reserve 64 bytes for the user data in EEPROM.
Config.portalTimeout = 60000; // Sets timeout value for the captive portal
Config.retainPortal = true; // Retains the portal function after timed-out
-Config.homeUri = "/index.html"; // Sets home path of the sketch application
+Config.homeUri = "/index.html"; // Sets home path of Sketch application
Config.title ="My menu"; // Customize the menu title
Config.staip = IPAddress(192,168,10,10); // Sets static IP
Config.staGateway = IPAddress(192,168,10,1); // Sets WiFi router address
diff --git a/mkdocs/images/process_begin.svg b/mkdocs/images/process_begin.svg
index acef36c..f2ff4bc 100644
--- a/mkdocs/images/process_begin.svg
+++ b/mkdocs/images/process_begin.svg
@@ -10,11 +10,11 @@
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="104.57415mm"
- height="371.83472mm"
- viewBox="0 0 104.57414 371.83472"
+ height="387.70978mm"
+ viewBox="0 0 104.57414 387.70978"
version="1.1"
id="svg8776"
- inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
+ inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
sodipodi:docname="process_begin.svg">
@@ -247,9 +247,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="1.4142136"
- inkscape:cx="305.90966"
- inkscape:cy="637.13379"
+ inkscape:zoom="0.7071068"
+ inkscape:cx="-27.323778"
+ inkscape:cy="441.74167"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
@@ -265,9 +265,9 @@
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:window-width="1920"
- inkscape:window-height="1013"
- inkscape:window-x="2551"
- inkscape:window-y="-9"
+ inkscape:window-height="1029"
+ inkscape:window-x="1272"
+ inkscape:window-y="-8"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
@@ -277,8 +277,8 @@
+ originx="-23.664531"
+ originy="31.419329" />
@@ -317,8 +317,8 @@
transform="translate(-15.875002,-48.749459)">
+ transform="translate(-68.285876,66.439446)">
+ transform="translate(-78.07551,51.887317)">
START Web Server
+ transform="translate(-43.656245,46.632841)">
+ transform="translate(-67.492182,32.04356)">
+ transform="translate(-79.374976,45.442212)">
+ transform="translate(0,47.823462)">
+ transform="translate(-15.875002,136.72368)">
+ transform="translate(0,47.823462)">
+ transform="translate(-9.2604205,38.959925)">
+ transform="translate(-1.3229224,113.5725)">
@@ -844,12 +844,12 @@
inkscape:connector-curvature="0" />
@@ -1029,75 +1029,75 @@
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="60.544109"
- y="233.40862"
+ y="249.2834"
id="text10760-5-5-6-4">NO
YES
YES
NO
YES
NO
restore it.
+
+ autoRise
+ YES
+
+
+ NO
diff --git a/mkdocs/lsbegin.md b/mkdocs/lsbegin.md
index 6bc553d..c553a71 100644
--- a/mkdocs/lsbegin.md
+++ b/mkdocs/lsbegin.md
@@ -2,8 +2,9 @@
The following parameters of [AutoConnectConfig](apiconfig.md) affect the behavior and control a logic sequence of [AutoConnect::begin](api.md#begin) function. These parameters are evaluated on a case-by-case basis and may not be valid in all situations. The Sketch must consider the role of these parameters and the conditions under which they will work as intended. You need to understand what happens when using these parameters in combination.
-- [immediateStart](apiconfig.md#immediatestart) : The captive portal start immediately, without the 1st-WiFi.begin.
-- [autoReconenct](apiconfig.md#autoreconnect) : Attempt re-connect with past SSID by saved credential.
+- [autoReconnect](apiconfig.md#autoreconnect) : Attempts re-connect with past SSID by saved credential.
+- [autoRise](apiconfig.md#autorise) : Controls starting the captive portal.
+- [immediateStart](apiconfig.md#immediatestart) : Starts the captive portal immediately, without the 1st-WiFi.begin.
- [portalTimeout](apiconfig.md#portaltimeout) : Time out limit for the portal.
- [retainPortal](apiconfig.md#retainportal) : Keep DNS server functioning for the captive portal.