pull/137/head
Hieromon Ikasamo 5 years ago
parent 2fd24fecd3
commit 7d12936db8
  1. 2
      mkdocs/advancedusage.md
  2. 18
      mkdocs/faq.md
  3. 36
      mkdocs/menu.md

@ -190,7 +190,7 @@ void loop() {
If your sketch handles web pages, you can embed the pages into the AutoConnect menu in continuance enjoying the utility of the WiFi connection feature. Unlike the custom Web pages by [AutoConnectElements](acelements.md), this allows to legacy web pages registered by *ESP8266WebServer::on* or *WebServer::on* function.
You can use AutoConnectAux only constructed with the URI of the page to be embedding. AutoConnectElements is not required. The basic procedure for this as follows:
To implement embedding your legacy web pages to the AutoConnect menu, you can use AutoConnectAux only constructed with the URI of the page to be embedding. AutoConnectElements is not required. The basic procedure for this as follows:
1. Declare AutoConnectAux for each legacy page. It includes the URI of the page and item string which will display in the AutoConnect menu.
2. Sketch the legacy page handlers.

@ -182,11 +182,27 @@ If the sketch is correct, a JSON syntax error may have occurred. In this case, a
## <i class="fa fa-question-circle"></i> Saved credentials are wrong or lost.
A structure of AutoConnect saved credentials have changed in two times throughout enhancement with v1.0.3 and v1.1.0. Especially in v1.1.0 enhancements, there is no backward compatibility of AutoConnectCredential structures to the earlier versions. To save the credentials correctly in v110, you must erase the flash of the ESP module using the esptool completely.
A structure of AutoConnect saved credentials has changed two times throughout enhancement with v1.0.3 and v1.1.0. In particular, due to enhancements in v1.1.0, AutoConnectCredential data structure has lost the backward compatibility with previous versions. You must erase the flash of the ESP module using the esptool completely to save the credentials correctly with v1.1.0.
```
esptool -c esp8266 (or esp32) -p [COM_PORT] erase_flash
```
## <i class="fa fa-question-circle"></i> Some AutoConnect page is cut off.
It may be two possibilities as follows:
1. Packet loss during transmission due to a too weak WiFi signal.
2. Heap is insufficient memory. AutoConnect entrusts HTML generation to PageBuilder that makes heavy use the String::concatenate function and causes memory fragmentation. This is a structural problem with PageBuilder, but it is difficult to solve immediately.
If this issue produces with your sketch, Reloading the page may recover.
Also, you can check the memory running out status by rebuilding the sketch with [PageBuilder's debug log option](faq.html#fn:2) turned on.
If the heap memory is insufficient, the following message is displayed on the serial console.
```
[PB] Failed building, free heap:<Size of free heap>
```
## <i class="fa fa-question-circle"></i> Submit element in a custom Web page does not react.
Is there the AutoConnectElements element named **SUBMIT** in the custom Web page? (case sensitive ignored) AutoConnect does not rely on the `input type=submit` element for the form submission and uses [HTML form element submit](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit) function instead. So, the submit function will fail if there is an element named 'submit' in the form. You can not use **SUBMIT** as the element name of AutoConnectElements in a custom Web page that declares the AutoConnectSubmit element.

@ -3,12 +3,12 @@
## <i class="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 the *local IP address* of ESP8266/ESP32 module 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 <i class="fa fa-bars"></i> at right on top. (e.g. `http://172.217.28.1/_ac` for SoftAP mode.)
The following screen will appear as the AutoConnect menu when you access to **AutoConnect root URL** via `http://{localIP}/_ac`. (eg. `http://172.217.28.1/_ac`) It is a top page of AutoConnect which shows the current WiFi connection statistics. To invoke the AutoConnect menu, you can t tap <i class="fa fa-bars"></i> at right on top.
<img src="images/ac.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" />
!!! note "What's the local IP?"
A local IP means Local IP at connection established or SoftAP's IP.
!!! note "AutoConnect root URL"
It is assigned "**/_ac**" located on the *local IP address* of ESP8266/ESP32 module by default and can be changed with the sketch. A local IP means Local IP at connection established or SoftAP's IP.
## <i class="fa fa-bars"></i> Right on top
@ -24,38 +24,38 @@ Currently, AutoConnect supports four menus. Undermost menu as "HOME" returns to
## <i class="fa fa-bars"></i> Configure new AP
Scan all available access point in the vicinity and display it. Strength and security of the detected AP are marked. The <i class="fa fa-lock"></i> is indicated for the SSID that needs a security key. "**Hidden:**" means the number of hidden SSIDs discovered.
Enter SSID and Passphrase and tap "**Apply**" to starts WiFi connection.
It scans all available access points in the vicinity and display it further the WiFi signal strength and security indicator as <i class="fa fa-lock"></i> of the detected AP. Below that, the number of discovered hidden APs will be displayed.
Enter SSID and Passphrase and tap "**Apply**" to start a WiFi connection.
<img src="images/newap.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" />
If you want to configure with static IP, uncheck "**Enable DHCP**". Once the WiFi connection is established, the entered static IP[^1] configuration is saved in the credentials and restored to the station configuration via the [Open SSIDs](#open-ssids) menu.
If you want to configure with static IP, uncheck "**Enable DHCP**". Once the WiFi connection is established, the entered static IP[^1] configuration will be stored to the credentials in the flash and restored to the station configuration via the [Open SSIDs](#open-ssids) menu.
[^1]: AutoConnect will not check the syntax and validity of the entered IP address. If the entered static IPs are incorrect, it cannot connect to the access point.
[^1]: AutoConnect does not check the syntax and validity of the entered IP address. If the entered static IPs are incorrect, it cannot connect to the access point.
<img src="images/newap_static.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" />
## <i class="fa fa-bars"></i> Open SSIDs
Once it was established WiFi connection, its SSID and password will be saved in the flash of ESP8266/ESP32 automatically. The **Open SSIDs** menu reads the saved SSID credentials from the flash. The stored credential data are listed by the SSID as shown below. Its label is a clickable button. Tap the SSID button, starts WiFi connection it.
After WiFi connected, AutoConnect will automatically save the established SSID and password to the flash on the ESP module. **Open SSIDs** menu reads the saved SSID credentials and lists them as below. Listed items are clickable buttons and can initiate a connection to its access point.
<img src="images/open.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" />
!!! note "Saved credentials data structure has changed"
A structure of AutoConnect saved credentials have changed in v1.1.0 and was lost backward compatibility. Credentials saved by AutoConnect v1.0.3 (or earlier) will not display properly with AutoConnect v1.1.0. You need to erase the flash of the ESP module using the esptool before the sketch uploading.
A structure of AutoConnect saved credentials has changed in v1.1.0 and was lost backward compatibility. Credentials saved by AutoConnect v1.0.3 (or earlier) will not display properly with AutoConnect v1.1.0. You need to erase the flash of the ESP module using the esptool before the sketch uploading.
```
esptool -c esp8266 (or esp32) - p [COM_PORT] erase_flash
```
## <i class="fa fa-bars"></i> Disconnect
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.
It disconnects ESP8266/ESP32 from the current connection. Also, ESP8266/ESP32 can be automatically reset after WiFi cutting by instructing with the sketch using the [AutoConnect API](api.md#autoreset).
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 the **Disconnect**, you will not be able to reach the AutoConnect menu. Once disconnected, you will need to set the SSID again for connecting to the WLAN.
## <i class="fa fa-bars"></i> Reset...
Reset the ESP8266/ESP32 module, 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.
Resetting the ESP8266/ESP32 module will initiate a reboot. When the module restarting, the *esp8266ap* or *esp32ap* access point will disappear from the WLAN and the ESP8266/ESP32 module will begin to reconnect a previous access point with WIFI_STA mode.
<img src="images/resetting.png" style="width:280px;" />
@ -64,23 +64,23 @@ Reset the ESP8266/ESP32 module, it will start rebooting. After rebooting complet
## <i class="fa fa-bars"></i> Custom menu items
The menu items of the custom Web page line up at the below in the AutoConnect menu if the custom Web pages are joined. Details for [Custom Web pages in AutoConnect menu](acintro.md#custom-web-pages-in-autoconnectmenu).
If the sketch has custom Web pages, the AutoConnect menu lines them up with the AutoConnect's items. Details for [Custom Web pages in AutoConnect menu](acintro.md#custom-web-pages-in-autoconnectmenu).
## <i class="fa fa-bars"></i> HOME
A **HOME** item located at the bottom of the menu list is a link to the home path. The URI as the home path is `/` by default, and it is defined by `AUTOCONNECT_HOMEURI` with **AutoConnectDefs.h** file.
A **HOME** item at the bottom of the menu list is a link to the home path, and the default URI is `/` which is defined by `AUTOCONNECT_HOMEURI` in **AutoConnectDefs.h** header file.
```cpp
#define AUTOCONNECT_HOMEURI "/"
```
You can change the HOME path using the AutoConnect API. The [**AutoConnect::home**](api.md#home) function sets the URI as a link of the HOME item of the AutoConnect menu.
Also, you can change the HOME path using the AutoConnect API. The [**AutoConnect::home**](api.md#home) function sets the URI as a link of the HOME item in the AutoConnect menu.
## <i class="fa fa-bars"></i> by attaching AutoConnect menu
## <i class="fa fa-bars"></i> Attaching to AutoConnect menu
The AutoConnect menu can contain HTML pages of your owns sketch as custom items. It works for HTML pages implemented by **ESP8266WebServer::on** handler or **WebServer::on** handler for ESP32. That is, you can make it as menu items to invoke the legacy web page. The below screenshot is the result of adding an example sketch for the ESP8266WebServer library known as [FSBrowser](https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer/examples/FSBrowser) to the AutoConnect menu item. It adds Edit and List items with little modification to the legacy sketch code.
The AutoConnect menu can contain your sketch's web pages as extra items as a custom. It works for HTML pages implemented by the **ESP8266WebServer::on** handler or the **WebServer::on** handler for ESP32. That is, you can make them invoke the legacy web pages from the AutoConnect menu. The below screen-shot is the result of adding an example sketch for the ESP8266WebServer library known as [FSBrowser](https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer/examples/FSBrowser) to the AutoConnect menu item. It can add Edit and List items with little modification to the legacy sketch code.
<div style="float:left;width:auto;height:420px;"><img style="width:auto;height:420px;" src="images/fsbmenu.png"></div>
<img style="margin-left:70px;width:auto;height:420px;" src="images/fsbmenu_expand.png">
You can extend the AutoConnect menu to improve the original sketches and according to the procedure described in section [*Advanced Usage*](advancedusage.md#casts-the-html-pages-to-be-add-on-into-the-menu).
You can improve your sketches by extending the AutoConnect menu by adding the legacy web pages according to the procedure described in section [*Advanced Usage*](advancedusage.md#casts-the-html-pages-to-be-add-on-into-the-menu).

Loading…
Cancel
Save