When the captive portal is started, SoftAP starts and the STA is disconnected. The current SSID setting memorized in ESP8266 will be lost.
When the captive portal is started, SoftAP starts and the STA is disconnected. The current SSID setting memorized in ESP8266/ESP32 will be lost.
If the [**autoReconnect**](api.md#autoreconnect) option of the [**AutoConnectConfig**](api.md#autoconnectconfig-api) class is enabled, it automatically attempts to reconnect to the disconnected past access point. When the autoReconnect option is specified, AutoConnect will not start SoftAP immediately if the first WiFi.begin fails. It will scan WiFi signal and the same connection information as the detected BSSID is stored in EEPROM as AutoConnect's credentials, explicitly apply it with WiFi.begin and rerun.
If the [**autoReconnect**](api.md#autoreconnect) option of the [**AutoConnectConfig**](api.md#autoconnectconfig-api) class is enabled, it automatically attempts to reconnect to the disconnected past access point. When the autoReconnect option is specified, AutoConnect will not start SoftAP immediately if the first WiFi.begin fails. It will scan WiFi signal and the same connection information as the detected BSSID is stored in EEPROM as AutoConnect's credentials, explicitly apply it with WiFi.begin and rerun.
Open the Arduino IDE, write the following sketch and upload it. The feature of this sketch is that the SSID and Password are not coded.
Open the Arduino IDE, write the following sketch and upload it. The feature of this sketch is that the SSID and Password are not coded.
```arduino
```arduino
#include<ESP8266WiFi.h>
#include<ESP8266WiFi.h> // Replace with WiFi.h for ESP32
#include<ESP8266WebServer.h>
#include<ESP8266WebServer.h> // Replace with WebServer.h for ESP32
#include<AutoConnect.h>
#include<AutoConnect.h>
ESP8266WebServer Server;
ESP8266WebServer Server; // Replace with WebServer for ESP32
AutoConnect Portal(Server);
AutoConnect Portal(Server);
void rootPage() {
void rootPage() {
@ -33,7 +33,9 @@ void loop() {
### <iclass="fa fa-play-circle"></i> Run at first
### <iclass="fa fa-play-circle"></i> Run at first
After about 30 seconds, if the ESP8266 cannot connect to nearby Wi-Fi spot, you pull out your smartphone and open *Wi-Fi settings* from the *Settings* Apps. You can see the **esp8266ap** in the list of *"CHOOSE A NETWORK..."*. Then tap the esp8266ap and enter password **12345678**, a something screen pops up automatically as shown below.
After about 30 seconds, if the ESP8266 cannot connect to nearby Wi-Fi spot, you pull out your smartphone and open *Wi-Fi settings* from the *Settings* Apps. You can see the **esp8266ap** [^1] in the list of *"CHOOSE A NETWORK..."*. Then tap the esp8266ap and enter password **12345678**, a something screen pops up automatically as shown below.
@ -79,10 +79,6 @@ To install the PageBuilder library into your Arduino IDE, you can use the *Libra
<imgsrc="./images/lm.png"width="640"/>
<imgsrc="./images/lm.png"width="640"/>
!!! warning "Library Manager of Arduino IDE"
The version of PageBuilder may not have been updated yet. If the library manager shows only version 0.93.0, please install the latest PageBuilder version than 1.0.0 from the Github repository. [The PageBuilder release](https://github.com/Hieromon/PageBuilder/releases/latest) of the Github repository is the latest version. The [PlatformIO library](https://platformio.org/lib/show/2010/PageBuilder) has the latest version of 1.0.0.
In 0.93.0, the PageBuilder class has a compile error about without the 'cancel' method.
### Install the AutoConnect
### Install the AutoConnect
Clone or download from the [AutoConnect GitHub repository](https://github.com/Hieromon/AutoConnect).
Clone or download from the [AutoConnect GitHub repository](https://github.com/Hieromon/AutoConnect).
@ -94,7 +90,7 @@ When you select Download, you can import it to Arduino IDE immediately. After do
<imgsrc="./images/ins_lib.png"/>
<imgsrc="./images/ins_lib.png"/>
!!! info "Supported by Library manager."
!!! info "Supported by Library manager."
AutoConnect was added to the Arduino IDE library manager as of March 17, 2018. It can be used with the PlatformIO library also.
AutoConnect was added to the Arduino IDE library manager. It can be used with the PlatformIO library also.
## <iclass="fa fa-external-link"></i> Where the from
## <iclass="fa fa-external-link"></i> Where the from
The AutoConnect menu appears when you access the **AutoConnect root path**. It is assigned "**/_ac**" located on ESP8266 *local IP address* by default. This location can be changed in the sketch. The following screen will appear at access to `http://{localIP}/_ac` as the root path. This is the statistics of the current WiFi connection. You can access the menu from the here, to invoke it tap <iclass="fa fa-bars"></i> at right on top. (e.g. `http://192.168.244.1/_ac` for SoftAP mode.)
The AutoConnect menu appears when you access the **AutoConnect root path**. It is assigned "**/_ac**" located on ESP8266/ESP32*local IP address* by default. This location can be changed in the sketch. The following screen will appear at access to `http://{localIP}/_ac` as the root path. This is the statistics of the current WiFi connection. You can access the menu from the here, to invoke it tap <iclass="fa fa-bars"></i> at right on top. (e.g. `http://192.168.244.1/_ac` for SoftAP mode.)
@ -31,21 +31,21 @@ Enter SSID and Passphrase and tap "**apply**" to starts a connection.
## <iclass="fa fa-bars"></i> Open SSIDs
## <iclass="fa fa-bars"></i> Open SSIDs
Once it was established connection, its SSID and Password will be stored to the EEPROM of ESP8266 automatically. The **Open SSIDs** menu reads the saved SSID credentials from the EEPROM. The stored credential data are listed by the SSID as shown below. Its label is a clickable button. Tap the SSID button, starts connection it.
Once it was established connection, its SSID and Password will be stored to the EEPROM of ESP8266/ESP32 automatically. The **Open SSIDs** menu reads the saved SSID credentials from the EEPROM. The stored credential data are listed by the SSID as shown below. Its label is a clickable button. Tap the SSID button, starts connection it.
Disconnect ESP8266 from the current connection. It can also reset the ESP8266 automatically after disconnection by instructing with using [API](api.md#autoreset) in the sketch.
Disconnect ESP8266/ESP32 from the current connection. It can also reset the ESP8266/ESP32 automatically after disconnection by instructing with using [API](api.md#autoreset) in the sketch.
After tapping "Disconnect", you will not be able to reach the AutoConnect menu. Once disconnected, you will need to set the SSID again for connecting the WLAN.
After tapping "Disconnect", you will not be able to reach the AutoConnect menu. Once disconnected, you will need to set the SSID again for connecting the WLAN.
## <iclass="fa fa-bars"></i> Reset...
## <iclass="fa fa-bars"></i> Reset...
Reset the ESP8266, it will start rebooting. After rebooting complete, the ESP8266 begins establishing the previous connection with WIFI_STA mode, and *esp8266ap* of an access point will disappear from WLAN.
Reset the ESP8266/ESP32, it will start rebooting. After rebooting complete, the ESP8266/ESP32 module begins establishing the previous connection with WIFI_STA mode, and *esp8266ap* or *esp32ap* of an access point will disappear from WLAN.
!!! warning "Not every module will be rebooted normally"
!!! warning "Not every ESP8266 module will be rebooted normally"
The Reset menu is using the **ESP.reset()** function. This is an almost hardware reset. In order to resume the sketch normally, the [state of GPIO0](https://github.com/esp8266/esp8266-wiki/wiki/Boot-Process#esp-boot-modes) is important. Since this depends on the circuit implementation for each module, not every module will be rebooted normally. See also [FAQ](faq.md#hang-up-after-reset).
The Reset menu is using the **ESP.reset()** function for ESP8266. This is an almost hardware reset. In order to resume the sketch normally, the [state of GPIO0](https://github.com/esp8266/esp8266-wiki/wiki/Boot-Process#esp-boot-modes) is important. Since this depends on the circuit implementation for each module, not every module will be rebooted normally. See also [FAQ](faq.md#hang-up-after-reset).