From 390a84ba283d2e27251adea70b65d5d6d8fbc185 Mon Sep 17 00:00:00 2001 From: Hieromon Ikasamo Date: Thu, 21 May 2020 11:39:45 +0900 Subject: [PATCH] Describes the preserveAPMode --- mkdocs/advancedusage.md | 8 ++++++++ mkdocs/apiconfig.md | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/mkdocs/advancedusage.md b/mkdocs/advancedusage.md index 48f63dc..32b4edc 100644 --- a/mkdocs/advancedusage.md +++ b/mkdocs/advancedusage.md @@ -456,6 +456,12 @@ portal.config(acConfig); portal.begin(); ``` +### Launch SoftAP separately with the Sketch + +Certain communication protocols applicable to the ESP module require that the WiFi mode is AP + STA in order to operate normally. (ie. [ESP-NOW](https://www.espressif.com/en/products/software/esp-now), [ESP-MESH](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/mesh.html)) Even Sketches using Espressif own WiFi protocol will able to open a gateway to the Internet by connecting to a WiFi router via AutoConnect. To enable applying these protocols, It needs to launch SoftAP by itself in a sketch and then call [*AutoConnect::begin*](api.md#begin), but the default behavior of [*AutoConnect::begin*](api.md#begin) will turn off SoftAP always then it unable to open a connection. + +[*AutoConnectConfig::preserveAPMode*](apiconfig.md#preserveAPMode) setting maintains WiFi-AP mode without disabling SoftAP inside [*AutoConnect::begin*](api.md#begin). The Sketch can utilize the WiFi connection via AutoConnect with ESP-MESH and ESP-NOW protocol by enabling this option. + ### Make SSID of SoftAP unique You can change SoftAP's SSID and password programmatically when the captive portal starts up. By using chip specific ID of esp8266/esp32 you can make SSID of SoftAP unique. SSID and password for SoftAP is [*AutoConnectConfig::apid*](apiconfig.md#apid) and [*AutoConnectConfig::psk*](apiconfig.md#psk). @@ -656,6 +662,8 @@ You can adjust the AutoConnect behave at run-time using [AutoConnectConfig](apic AutoConnectConfig allows the Sketch controls the behavior of follows: - [Applying HTTP authentication](#applying-http-authentication) +- [Applying HTTP authentication for Built-in OTA](#applying-http-authentication-for-built-in-ota) +- [Authentication with the captive portal state](#authentication-with-the-captive-portal-state) - [Assign user sketch's home path](#assign-user-sketchs-home-path) - [Built-in OTA update](#built-in-ota-update-feature) - [Change menu title](#change-menu-title) diff --git a/mkdocs/apiconfig.md b/mkdocs/apiconfig.md index a3bf37d..4faa9c6 100644 --- a/mkdocs/apiconfig.md +++ b/mkdocs/apiconfig.md @@ -290,6 +290,19 @@ Specify the timeout value of the captive portal in [ms] units. It is valid when
unsigned longCaptive portal timeout value. The default value is 0.
+### preserveAPMode + +Specifies starting the STA while maintaining the state of the SoftAP mode in the [**AutoConnect::begin**](api.md#begin). This setting only applies when the [**AutoConnectConfig::autoRise**](apiconfig.md#autorise) is false. +
+
**Type**
+
bool
+
**Value**
+
trueAutoConnect::begin keeps AP mode.
+
falseAutoConnect::begin will stop SoftAP at the beginning of the process.
+
+ +Note that this option is not for starting the SoftAP forcibly in [**AutoConnect::begin**](api.md#begin) and only keeps AP mode, SoftAP initiation is left to the Sketch. + ### principle Specify the connection order will attempt to connect to one of the highest RSSI values among multiple available access points. It is given as an enumeration value of **AC_PRINCIPLE_t** indicating.