### <iclass="fa fa-caret-right"></i> 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.
### <iclass="fa fa-caret-right"></i> Make SSID of SoftAP unique
### <iclass="fa fa-caret-right"></i> 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).
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:
AutoConnectConfig allows the Sketch controls the behavior of follows:
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.
<dlclass="apidl">
<dt>**Type**</dt>
<dd>bool</dd>
<dt>**Value**</dt>
<dd><spanclass="apidef">true</span><spanclass="apidesc">AutoConnect::begin keeps AP mode.</span></dd>
<dd><spanclass="apidef">false</span>AutoConnect::begin will stop SoftAP at the beginning of the process.<spanclass="apidesc"></span></dd>
</dl>
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.
### <iclass="fa fa-caret-right"></i> principle
### <iclass="fa fa-caret-right"></i> 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.
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.