Supports ESP32

pull/11/head
Hieromon Ikasamo 6 years ago
parent 61ff1816b4
commit 8cb41a65bc
  1. 10
      docs/404.html
  2. 57
      docs/advancedusage/index.html
  3. 81
      docs/api/index.html
  4. 93
      docs/basicusage/index.html
  5. 33
      docs/changelog/index.html
  6. 10
      docs/examples/index.html
  7. 10
      docs/faq/index.html
  8. 30
      docs/gettingstarted/index.html
  9. 45
      docs/index.html
  10. 10
      docs/license/index.html
  11. 24
      docs/menu/index.html
  12. 133
      docs/search/search_index.json
  13. 20
      docs/sitemap.xml
  14. 13
      examples/mqttRSSI/mqttRSSI.ino
  15. 56
      mkdocs/api.md
  16. 5
      mkdocs/changelog.md

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
@ -40,7 +40,7 @@
<title>AutoConnect for ESP8266</title>
<title>AutoConnect for ESP8266/ESP32</title>
@ -104,7 +104,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="/AutoConnect/images/arduino-logo.svg" width="24" height="24">
@ -118,7 +118,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
@ -243,7 +243,7 @@
<img src="/AutoConnect/images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
<link rel="canonical" href="https://Hieromon.github.io/AutoConnect/advancedusage/index.html">
@ -42,7 +42,7 @@
<title>Advanced usage - AutoConnect for ESP8266</title>
<title>Advanced usage - AutoConnect for ESP8266/ESP32</title>
@ -110,7 +110,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="../images/arduino-logo.svg" width="24" height="24">
@ -124,7 +124,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
Advanced usage
@ -249,7 +249,7 @@
<img src="../images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">
@ -417,15 +417,15 @@
</li>
<li class="md-nav__item">
<a href="#refers-the-hosted-esp8266webserver" title=" Refers the hosted ESP8266WebServer" class="md-nav__link">
Refers the hosted ESP8266WebServer
<a href="#refers-the-hosted-esp8266webserverwebserver" title=" Refers the hosted ESP8266WebServer/WebServer" class="md-nav__link">
Refers the hosted ESP8266WebServer/WebServer
</a>
</li>
<li class="md-nav__item">
<a href="#usage-for-automatically-instantiated-esp8266webserver" title=" Usage for automatically instantiated ESP8266WebServer" class="md-nav__link">
Usage for automatically instantiated ESP8266WebServer
<a href="#usage-for-automatically-instantiated-esp8266webserverwebserver" title=" Usage for automatically instantiated ESP8266WebServer/WebServer" class="md-nav__link">
Usage for automatically instantiated ESP8266WebServer/WebServer
</a>
</li>
@ -637,15 +637,15 @@
</li>
<li class="md-nav__item">
<a href="#refers-the-hosted-esp8266webserver" title=" Refers the hosted ESP8266WebServer" class="md-nav__link">
Refers the hosted ESP8266WebServer
<a href="#refers-the-hosted-esp8266webserverwebserver" title=" Refers the hosted ESP8266WebServer/WebServer" class="md-nav__link">
Refers the hosted ESP8266WebServer/WebServer
</a>
</li>
<li class="md-nav__item">
<a href="#usage-for-automatically-instantiated-esp8266webserver" title=" Usage for automatically instantiated ESP8266WebServer" class="md-nav__link">
Usage for automatically instantiated ESP8266WebServer
<a href="#usage-for-automatically-instantiated-esp8266webserverwebserver" title=" Usage for automatically instantiated ESP8266WebServer/WebServer" class="md-nav__link">
Usage for automatically instantiated ESP8266WebServer/WebServer
</a>
</li>
@ -724,9 +724,10 @@
<h2 id="advanced-usage">Advanced usage<a class="headerlink" href="#advanced-usage" title="Permanent link">&para;</a></h2>
<h3 id="404-handler"><i class="fa fa-caret-right"></i> 404 handler<a class="headerlink" href="#404-handler" title="Permanent link">&para;</a></h3>
<p>Registering the "not found" handler is a different way than ESP8266WebServer. The <em>onNotFound</em> of ESP8266WebServer does not work with AutoConnect. AutoConnect overrides <em>ESP8266WebServer::onNotFound</em> to handle a captive portal. To register "not found" handler, use <a href="../api/index.html#onnotfound"><em>AutoConnect::onNotFound</em></a>.</p>
<p>Registering the "not found" handler is a different way than ESP8266WebServer/WebServer. The <em>onNotFound</em> of ESP8266WebServer/WebServer does not work with AutoConnect. AutoConnect overrides <em>ESP8266WebServer::onNotFound</em>/<em>WebServer::onNotFound</em> to handle a captive portal. To register "not found" handler, use <a href="../api/index.html#onnotfound"><em>AutoConnect::onNotFound</em></a>.</p>
<h3 id="automatic-reconnect"><i class="fa fa-caret-right"></i> Automatic reconnect<a class="headerlink" href="#automatic-reconnect" title="Permanent link">&para;</a></h3>
<p>When the captive portal is started, SoftAP starts and the STA is disconnected. The current SSID setting memorized in ESP8266 will be lost.<br />
<p>When the captive portal is started, SoftAP starts and the STA is disconnected. The current SSID setting memorized in ESP8266 will be lost but then the reconnect behavior of ESP32 is somewhat different from this.<br />
The <a href="https://github.com/espressif/arduino-esp32/blob/a0f0bd930cfd2d607bf3d3288f46e2d265dd2e11/libraries/WiFi/src/WiFiSTA.h#L46">WiFiSTAClass::disconnect</a> function implemented in the arduino-esp32 has extended parameters than the ESP8266's arduino-core. The second parameter of WiFi.disconnect on the arduino-esp32 core that does not exist in the <a href="https://github.com/esp8266/Arduino/blob/7e1bdb225da8ab337373517e6a86a99432921a86/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp#L296">ESP8266WiFiSTAClass</a> has the effect of deleting the currently connected WiFi configuration and its default value is "false". On the ESP32 platform, even if WiFi.disconnect is executed, WiFi.begin() without the parameters in the next turn will try to connect to that AP. That is, automatic reconnection is implemented in arduino-esp32 already. Although this behavior appears seemingly competent, it is rather a disadvantage in scenes where you want to change the access point each time. When explicitly disconnecting WiFi from the Disconnect menu, AutoConnect will erase the AP connection settings saved by arduino-esp32 core. AutoConnect's automatic reconnection is a mechanism independent from the automatic reconnection of the arduino-esp32 core.<br />
If the <a href="../api/index.html#autoreconnect"><strong>autoReconnect</strong></a> option of the <a href="../api/index.html#autoconnectconfig-api"><strong>AutoConnectConfig</strong></a> 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.</p>
<div class="codehilite"><pre><span></span><span class="n">AutoConnect</span> <span class="n">Portal</span><span class="p">;</span>
<span class="n">AutoConnectConfig</span> <span class="n">Config</span><span class="p">;</span>
@ -745,6 +746,10 @@ If the <a href="../api/index.html#autoreconnect"><strong>autoReconnect</strong><
<span class="n">Portal</span><span class="p">.</span><span class="nf">begin</span><span class="p">();</span>
</pre></div>
<div class="admonition note">
<p class="admonition-title">In ESP32, the credentials for AutoConnect are not in NVS</p>
<p>The credentials used by AutoConnect are not saved in NVS on ESP32 module. ESP-IDF saves the WiFi connection configuration to NVS, but AutoConnect stores it on the eeprom partition. You can find the partition table for default as <a href="https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/default.csv">default.csv</a></p>
</div>
<h3 id="captive-portal-start-detection"><i class="fa fa-caret-right"></i> Captive portal start detection<a class="headerlink" href="#captive-portal-start-detection" title="Permanent link">&para;</a></h3>
<p>The captive portal will only be activated if the first <em>WiFi::begin</em> fails. Sketch can detect with the <a href="../api/index.html#ondetect"><em>AutoConnect::onDetect</em></a> 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.</p>
<div class="codehilite"><pre><span></span><span class="n">AutoConnect</span> <span class="n">Portal</span><span class="p">;</span>
@ -823,10 +828,10 @@ If the <a href="../api/index.html#autoreconnect"><strong>autoReconnect</strong><
<blockquote>
<p>EEPROM library uses one sector of flash located <a href="http://arduino-esp8266.readthedocs.io/en/latest/libraries.html?highlight=SPIFFS#eeprom">just after the SPIFFS</a>.</p>
</blockquote>
<p>So in the default state, the credential storage area used by AutoConnect conflicts with data owned by the user sketch. It will be destroyed together saved data in EEPROM by user sketch and AutoConnect each other. But you can move the storage area to avoid this.</p>
<p>Also, the placement of the EEPROM area of ESP32 is described in the <a href="https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/default.csv">partition table</a>. So in the default state, the credential storage area used by AutoConnect conflicts with data owned by the user sketch. It will be destroyed together saved data in EEPROM by user sketch and AutoConnect each other. But you can move the storage area to avoid this.</p>
<p>The <a href="../api/index.html#boundaryoffset"><strong>boundaryOffset</strong></a> in <a href="../api/index.html#autoconnectconfig-api"><strong>AutoConnectConfig</strong></a> specifies the start offset of the credentials storage area. The default value is 0.</p>
<h3 id="refers-the-hosted-esp8266webserver"><i class="fa fa-caret-right"></i> Refers the hosted ESP8266WebServer<a class="headerlink" href="#refers-the-hosted-esp8266webserver" title="Permanent link">&para;</a></h3>
<p>Constructing an AutoConnect object variable without parameters then creates and starts an ESP8266WebServer inside the AutoConnect. This object variable could be referred by <a href="../api/index.html#host"><em>AutoConnect::host()</em></a> function to access ESP8266WebServer instance as like below.</p>
<h3 id="refers-the-hosted-esp8266webserverwebserver"><i class="fa fa-caret-right"></i> Refers the hosted ESP8266WebServer/WebServer<a class="headerlink" href="#refers-the-hosted-esp8266webserverwebserver" title="Permanent link">&para;</a></h3>
<p>Constructing an AutoConnect object variable without parameters then creates and starts an ESP8266WebServer/WebServer inside the AutoConnect. This object variable could be referred by <a href="../api/index.html#host"><em>AutoConnect::host()</em></a> function to access ESP8266WebServer/WebServer instance as like below.</p>
<div class="codehilite"><pre><span></span><span class="n">AutoConnect</span> <span class="n">Portal</span><span class="p">;</span>
<span class="n">Portal</span><span class="p">.</span><span class="nf">begin</span><span class="p">();</span>
@ -838,8 +843,8 @@ If the <a href="../api/index.html#autoreconnect"><strong>autoReconnect</strong><
<p class="admonition-title">When host() is valid</p>
<p>The host() can be referred at after <em>AutoConnect::begin</em>.</p>
</div>
<h3 id="usage-for-automatically-instantiated-esp8266webserver"><i class="fa fa-caret-right"></i> Usage for automatically instantiated ESP8266WebServer<a class="headerlink" href="#usage-for-automatically-instantiated-esp8266webserver" title="Permanent link">&para;</a></h3>
<p>The sketch can handle URL requests using ESP8266WebServer that AutoConnect started internally. ESP8266WebServer instantiated dynamically by AutoConnect can be referred to by <a href="../api/index.html#host"><em>AutoConnect::host</em></a> function. The sketch can use the '<strong>on</strong>' function, '<strong>send</strong>' function, '<strong>client</strong>' function and others by ESP8266WebServer reference of its return value.</p>
<h3 id="usage-for-automatically-instantiated-esp8266webserverwebserver"><i class="fa fa-caret-right"></i> Usage for automatically instantiated ESP8266WebServer/WebServer<a class="headerlink" href="#usage-for-automatically-instantiated-esp8266webserverwebserver" title="Permanent link">&para;</a></h3>
<p>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 <a href="../api/index.html#host"><em>AutoConnect::host</em></a> function. The sketch can use the '<strong>on</strong>' function, '<strong>send</strong>' function, '<strong>client</strong>' function and others by ESP8266WebServer/WebServer reference of its return value.</p>
<div class="codehilite"><pre><span></span><span class="cp">#include</span> <span class="cpf">&lt;ESP8266WiFi.h&gt;</span><span class="cp"></span>
<span class="cp">#include</span> <span class="cpf">&lt;ESP8266WebServer.h&gt;</span><span class="cp"></span>
<span class="cp">#include</span> <span class="cpf">&lt;AutoConnect.h&gt;</span><span class="cp"></span>
@ -875,12 +880,12 @@ If the <a href="../api/index.html#autoreconnect"><strong>autoReconnect</strong><
</pre></div>
<div class="admonition note">
<p class="admonition-title">ESP8266WebServer function should be called after AutoConnect::begin</p>
<p>The sketch cannot refer to an instance of ESP8266WebServer until AutoConnect::begin completes successfully.</p>
<p class="admonition-title">ESP8266WebServer/WebServer function should be called after AutoConnect::begin</p>
<p>The sketch cannot refer to an instance of ESP8266WebServer/WebServer until AutoConnect::begin completes successfully.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Do not use with ESP8266WebServer::begin</p>
<p>ESP8266WebServer is already running inside the AutoConnect.</p>
<p class="admonition-title">Do not use with ESP8266WebServer::begin or WebServer::begin</p>
<p>ESP8266WebServer/WebServer is already running inside the AutoConnect.</p>
</div>
<h3 id="use-with-the-pagebuilder-library"><i class="fa fa-caret-right"></i> Use with the <a href="https://github.com/Hieromon/PageBuilder">PageBuilder</a> library<a class="headerlink" href="#use-with-the-pagebuilder-library" title="Permanent link">&para;</a></h3>
<p>In ordinary, the URL handler will respond the request by sending some HTML. <a href="https://github.com/Hieromon/PageBuilder">PageBuilder</a> library is HTML assembly aid. it can handle predefined HTML as like a template and simplify an HTML string assemble logic, and also the generated HTML send automatically.</p>
@ -917,8 +922,8 @@ If the <a href="../api/index.html#autoreconnect"><strong>autoReconnect</strong><
</pre></div>
<h3 id="static-ip-assignment-1"><i class="fa fa-caret-right"></i> Static IP assignment <sup id="fnref:1"><a class="footnote-ref" href="#fn:1" rel="footnote">1</a></sup><a class="headerlink" href="#static-ip-assignment-1" title="Permanent link">&para;</a></h3>
<p>It is also possible to assign static IP Address to ESP8266 in STA mode. By default DHCP is enabled and it becomes the IP address assigned by the DHCP server with <em>WiFi.begin</em>.</p>
<p>To assign a static IP to ESP8266 with WIFI_MODE_STA, the following parameters are required:</p>
<p>It is also possible to assign static IP Address to ESP8266/ESP32 in STA mode. By default DHCP is enabled and it becomes the IP address assigned by the DHCP server with <em>WiFi.begin</em>.</p>
<p>To assign a static IP to ESP8266/ESP32 with WIFI_MODE_STA, the following parameters are required:</p>
<ul>
<li>IP address.</li>
<li>Gateway address.</li>

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
<link rel="canonical" href="https://Hieromon.github.io/AutoConnect/api/index.html">
@ -42,7 +42,7 @@
<title>Library APIs - AutoConnect for ESP8266</title>
<title>Library APIs - AutoConnect for ESP8266/ESP32</title>
@ -110,7 +110,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="../images/arduino-logo.svg" width="24" height="24">
@ -124,7 +124,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
Library APIs
@ -249,7 +249,7 @@
<img src="../images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">
@ -381,8 +381,8 @@
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#define-macros" title="Define macros" class="md-nav__link">
Define macros
<a href="#defined-macros" title="Defined macros" class="md-nav__link">
Defined macros
</a>
</li>
@ -786,8 +786,8 @@
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#define-macros" title="Define macros" class="md-nav__link">
Define macros
<a href="#defined-macros" title="Defined macros" class="md-nav__link">
Defined macros
</a>
</li>
@ -1121,7 +1121,7 @@
<div class="codehilite"><pre><span></span><span class="cp">#include</span> <span class="cpf">&lt;AutoConnect.h&gt;</span><span class="cp"></span>
</pre></div>
<h4 id="define-macros">Define macros<a class="headerlink" href="#define-macros" title="Permanent link">&para;</a></h4>
<h4 id="defined-macros">Defined macros<a class="headerlink" href="#defined-macros" title="Permanent link">&para;</a></h4>
<div class="codehilite"><pre><span></span><span class="cp">#define AC_DEBUG </span><span class="c1">// Monitor message output activation</span>
<span class="cp">#define AC_DEBUG_PORT Serial </span><span class="c1">// Default message output device</span>
<span class="cp">#define AUTOCONNECT_AP_IP 0x01F4A8C0 </span><span class="c1">// Default SoftAP IP</span>
@ -1142,15 +1142,24 @@
</pre></div>
<p><a id="withparameter"></a></p>
<p>AutoConnect default constructor. This entry internally allocates the ESP8266WebServer and is activated internally.</p>
<p>AutoConnect default constructor. This entry internally allocates the ESP8266WebServer for ESP8266 or WebServer for ESP32 and is activated internally.</p>
<ul>
<li>For ESP8266</li>
</ul>
<div class="codehilite"><pre><span></span><span class="n">AutoConnect</span><span class="p">(</span><span class="n">ESP8266WebServer</span><span class="o">&amp;</span> <span class="n">webServer</span><span class="p">)</span>
</pre></div>
<p>Run the AutoConnect site using the externally ensured ESP8266WebServer.</p>
<p>The <a href="index.html#handleclient"><strong>handleClient</strong></a> function of AutoConnect can include the response of the URI handler added by the user using the "<em>on</em>" function of ESP8266WebServer. If ESP8266WebServer is assigned internally by AutoConnect, the sketch can obtain that reference with the <a href="../api.me#host"><strong>host</strong></a> function.
<ul>
<li>For ESP32</li>
</ul>
<div class="codehilite"><pre><span></span><span class="n">AutoConnect</span><span class="p">(</span><span class="n">WebServer</span><span class="o">&amp;</span> <span class="n">webServer</span><span class="p">)</span>
</pre></div>
<p>Run the AutoConnect site using the externally ensured ESP8266WebServer for ESP8266 or WebServer for ESP32.</p>
<p>The <a href="index.html#handleclient"><strong>handleClient</strong></a> function of AutoConnect can include the response of the URI handler added by the user using the "<em>on</em>" function of ESP8266WebServer/WebServer. If ESP8266WebServer/WebServer is assigned internally by AutoConnect, the sketch can obtain that reference with the <a href="../api.me#host"><strong>host</strong></a> function.
<dl class="apidl">
<dt><strong>Parameters</strong></dt>
<dd><span class="apidef">webServer</span>A reference of ESP8266WebServer instance.</dd>
<dd><span class="apidef">webServer</span>A reference of ESP8266WebServer or WebServer instance.</dd>
</dl></p>
<h3 id="public-member-functions"><i class="fa fa-code"></i> Public member functions<a class="headerlink" href="#public-member-functions" title="Permanent link">&para;</a></h3>
<h4 id="begin">begin<a class="headerlink" href="#begin" title="Permanent link">&para;</a></h4>
@ -1158,10 +1167,10 @@
</pre></div>
<div class="codehilite"><pre><span></span><span class="kt">bool</span> <span class="n">begin</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">ssid</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">passphraase</span><span class="p">)</span>
</pre></div>
<div class="codehilite"><pre><span></span><span class="kt">bool</span> <span class="n">begin</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">ssid</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">passphraase</span><span class="p">,</span> <span class="n">unsinged</span> <span class="kt">long</span> <span class="n">timeout</span><span class="p">)</span>
<div class="codehilite"><pre><span></span><span class="kt">bool</span> <span class="n">begin</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">ssid</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">passphraase</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">timeout</span><span class="p">)</span>
</pre></div></p>
<p>Starts establishing the WiFi connection.<br />
AutoConnect first invokes <em>WiFi.begin</em>. If the case of SSID and Password missing, its <em>WiFi.begin</em> has no SSID and Password. The WiFi mode at this time is WIFI_STA. Then ESP8266WebServer will be started immediately after the first <em>WiFi.beign</em> regardless of the result.</p>
AutoConnect first invokes <em>WiFi.begin</em>. If the case of SSID and Password missing, its <em>WiFi.begin</em> has no SSID and Password. The WiFi mode at this time is WIFI_STA. Then ESP8266WebServer/WebServer will be started immediately after the first <em>WiFi.begin</em> regardless of the result.</p>
<p>The captive portal will not be started if the connection has been established with first <em>WiFi.begin</em>. If the connection cannot establish, switch to WIFI_AP_STA mode and activate SoftAP. Then DNS server starts.
<dl class="apidl">
<dt><strong>Parameters</strong></dt>
@ -1181,7 +1190,7 @@ AutoConnect first invokes <em>WiFi.begin</em>. If the case of SSID and Password
<dl class="apidl">
<dt><strong>Parameters</strong></dt>
<dd><span class="apidef">config</span>Reference to <a href="index.html#autoconnectconfig"><strong>AutoConnectConfig</strong></a> containing SoftAP's parameters and static IP parameters.</dd>
<dd><span class="apidef">ap</span>SSID for SoftAP. The default value is <strong>esp8266ap</strong>.</dd>
<dd><span class="apidef">ap</span>SSID for SoftAP. The default value is <strong>esp8266ap</strong> for ESP8266, <strong>esp32ap</strong> for ESP32.</dd>
<dd><span class="apidef">password</span>Password for SodtAP. The default value is <strong>12345678</strong>.</dd>
<dt><strong>Return value</strong></dt>
<dd><span class="apidef">true</span>Successfully configured.</dd>
@ -1191,16 +1200,16 @@ AutoConnect first invokes <em>WiFi.begin</em>. If the case of SSID and Password
<div class="codehilite"><pre><span></span><span class="kt">void</span> <span class="n">end</span><span class="p">()</span>
</pre></div>
<p>Stops AutoConnect captive portal service. Release ESP8266WebServer and DNSServer. </p>
<p>Stops AutoConnect captive portal service. Release ESP8266WebServer/WebServer and DNSServer. </p>
<div class="admonition warning">
<p class="admonition-title">Attention to end</p>
<p>The end function releases the instance of ESP8266WebServer and DNSServer. It can not process them after the end function.</p>
<p>The end function releases the instance of ESP8266WebServer/WebServer and DNSServer. It can not process them after the end function.</p>
</div>
<h4 id="handleclient">handleClient<a class="headerlink" href="#handleclient" title="Permanent link">&para;</a></h4>
<div class="codehilite"><pre><span></span><span class="kt">void</span> <span class="n">handleClient</span><span class="p">()</span>
</pre></div>
<p>Process the AutoConnect menu interface. It will be processed the client request too contained in the user sketch handler by calling from inside of AutoConnect to the hosted <em>ESP8266WebServer::handleClient</em>.</p>
<p>Process the AutoConnect menu interface. The handleClient() function of the ESP8266WebServer/WebServer hosted by AutoConnect is also called from within AutoConnect and client requests contained in the user sketch handler are also handled.</p>
<h4 id="handlerequest">handleRequest<a class="headerlink" href="#handlerequest" title="Permanent link">&para;</a></h4>
<div class="codehilite"><pre><span></span><span class="kt">void</span> <span class="n">handleRequest</span><span class="p">()</span>
</pre></div>
@ -1208,7 +1217,7 @@ AutoConnect first invokes <em>WiFi.begin</em>. If the case of SSID and Password
<p>Handling for the AutoConnect menu request.</p>
<div class="admonition warning">
<p class="admonition-title">About used in combination with handleClient</p>
<p>The handleRequest function is not supposed to use with AutoConnect::handleClient. It should be used with ESP8266::handleClient.</p>
<p>The handleRequest function is not supposed to use with AutoConnect::handleClient. It should be used with ESP8266WebServer::handleClient or WebServer::handleClient.</p>
</div>
<h4 id="home">home<a class="headerlink" href="#home" title="Permanent link">&para;</a></h4>
<div class="codehilite"><pre><span></span><span class="kt">void</span> <span class="n">home</span><span class="p">(</span><span class="n">String</span> <span class="n">uri</span><span class="p">)</span>
@ -1220,12 +1229,21 @@ AutoConnect first invokes <em>WiFi.begin</em>. If the case of SSID and Password
<dd><span class="apidef">uri</span> A URI string of user site's home path.</dd>
</dl></p>
<h4 id="host">host<a class="headerlink" href="#host" title="Permanent link">&para;</a></h4>
<p>Returns the reference of the ESP8266WebServer which is allocated in AutoConnect automatically.</p>
<p><div class="codehilite"><pre><span></span><span class="n">ESP8266WebServer</span><span class="o">&amp;</span> <span class="n">host</span><span class="p">()</span>
<p>Returns the reference of the ESP8266WebServer/WebServer which is allocated in AutoConnect automatically.</p>
<ul>
<li>For ESP8266</li>
</ul>
<div class="codehilite"><pre><span></span><span class="n">ESP8266WebServer</span><span class="o">&amp;</span> <span class="n">host</span><span class="p">()</span>
</pre></div>
<ul>
<li>For ESP32</li>
</ul>
<p><div class="codehilite"><pre><span></span><span class="n">WebServer</span><span class="o">&amp;</span> <span class="n">host</span><span class="p">()</span>
</pre></div>
<dl class="apidl">
<dt><strong>Return value</strong></dt>
<dd>A reference of the ESP8266WebServer.</dd>
<dd>A reference of the ESP8266WebServer/WebServer.</dd>
</dl></p>
<div class="admonition note">
<p class="admonition-title">&amp;reference is not a pointer</p>
@ -1257,7 +1275,16 @@ Register the function which will call from AutoConnect at the start of the capti
<dd><span class="apidef">false</span>Cancel the captive portal. AutoConnect::begin function will return with a false.</dd>
</dl></p>
<h4 id="onnotfound">onNotFound<a class="headerlink" href="#onnotfound" title="Permanent link">&para;</a></h4>
<p><div class="codehilite"><pre><span></span><span class="kt">void</span> <span class="n">onNotFound</span><span class="p">(</span><span class="n">ESP8266WebServer</span><span class="o">::</span><span class="n">THandlerFunction</span> <span class="n">fn</span><span class="p">)</span>
<ul>
<li>For ESP8266</li>
</ul>
<div class="codehilite"><pre><span></span><span class="kt">void</span> <span class="n">onNotFound</span><span class="p">(</span><span class="n">ESP8266WebServer</span><span class="o">::</span><span class="n">THandlerFunction</span> <span class="n">fn</span><span class="p">)</span>
</pre></div>
<ul>
<li>For ESP32</li>
</ul>
<p><div class="codehilite"><pre><span></span><span class="kt">void</span> <span class="n">onNotFound</span><span class="p">(</span><span class="n">WebServer</span><span class="o">::</span><span class="n">THandlerFunction</span> <span class="n">fn</span><span class="p">)</span>
</pre></div>
Register the handler function for undefined URL request detected.
<dl class="apidl">
@ -1273,7 +1300,7 @@ Register the handler function for undefined URL request detected.
</pre></div>
<dl class="apidl">
<dt><strong>Parameters</strong></dt>
<dd><span class="apidef">ap</span>SSID for SoftAP. The length should be up to 31. The default value is <strong>esp8266ap</strong>.</dd>
<dd><span class="apidef">ap</span>SSID for SoftAP. The length should be up to 31. The default value is <strong>esp8266ap</strong> for ESP8266, <strong>esp32ap</strong> for ESP32.</dd>
<dd><span class="apidef">password</span>Password for SodtAP. The length should be from 8 to up to 63. The default value is <strong>12345678</strong>.</dd>
</dl></p>
<h3 id="public-member-variables"><i class="fa fa-code"></i> Public member variables<a class="headerlink" href="#public-member-variables" title="Permanent link">&para;</a></h3>
@ -1290,7 +1317,7 @@ Register the handler function for undefined URL request detected.
<dd><span class="apidef" style="width:230px;">IPAddress</span>The default value is <strong>192.168.244.1</strong></dd>
</dl></p>
<h4 id="autoreconnect">autoReconnect<a class="headerlink" href="#autoreconnect" title="Permanent link">&para;</a></h4>
<p>Automatically reconnect to past established access point (BSSID) when the current configured SSID in ESP8266 could not be connected. By enabling this option, <em>AutoConnect::begin()</em> function will attempt to reconnect to a known access point using credentials stored in the EEPROM, even if the connection failed by current SSID.<br />
<p>Automatically will try to reconnect with the past established access point (BSSID) when the current configured SSID in ESP8266/ESP32 could not be connected. By enabling this option, <em>AutoConnect::begin()</em> function will attempt to reconnect to a known access point using credentials stored in the EEPROM, even if the connection failed by current SSID.<br />
If the connection fails, starts the captive portal in SoftAP + STA mode.<br />
<dl class="apidl">
<dt><strong>Type</strong></dt>

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
<link rel="canonical" href="https://Hieromon.github.io/AutoConnect/basicusage/index.html">
@ -42,7 +42,7 @@
<title>Basic usage - AutoConnect for ESP8266</title>
<title>Basic usage - AutoConnect for ESP8266/ESP32</title>
@ -110,7 +110,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="../images/arduino-logo.svg" width="24" height="24">
@ -124,7 +124,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
Basic usage
@ -249,7 +249,7 @@
<img src="../images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">
@ -398,8 +398,8 @@
</li>
<li class="md-nav__item">
<a href="#4-alternate-esp8266webserverbegin" title="4. Alternate ESP8266WebServer::begin()" class="md-nav__link">
4. Alternate ESP8266WebServer::begin()
<a href="#4-alternate-esp8266webserverbegin-and-webserverbegin" title="4. Alternate ESP8266WebServer::begin() and WebServer::begin()" class="md-nav__link">
4. Alternate ESP8266WebServer::begin() and WebServer::begin()
</a>
</li>
@ -412,15 +412,15 @@
</li>
<li class="md-nav__item">
<a href="#6-use-esp8266webserveron-to-handle-url" title="6. Use ESP8266WebServer::on to handle URL" class="md-nav__link">
6. Use ESP8266WebServer::on to handle URL
<a href="#6-use-esp8266webserveron-and-webserveron-to-handle-url" title="6. Use ESP8266WebServer::on and WebServer::on to handle URL" class="md-nav__link">
6. Use ESP8266WebServer::on and WebServer::on to handle URL
</a>
</li>
<li class="md-nav__item">
<a href="#7-use-either-esp8266webserverhandleclient-or-autoconnecthandleclient" title="7. Use either ESP8266WebServer::handleClient() or AutoConnect::handleClient()" class="md-nav__link">
7. Use either ESP8266WebServer::handleClient() or AutoConnect::handleClient()
<a href="#7-use-either-esp8266webserverhandleclientwebserverhandleclient-or-autoconnecthandleclient" title="7. Use either ESP8266WebServer::handleClient()/WebServer::handleClient() or AutoConnect::handleClient()" class="md-nav__link">
7. Use either ESP8266WebServer::handleClient()/WebServer::handleClient() or AutoConnect::handleClient()
</a>
</li>
@ -431,8 +431,8 @@
</li>
<li class="md-nav__item">
<a href="#esp8266webserver-hosted-or-parasitic" title=" ESP8266WebServer hosted or parasitic" class="md-nav__link">
ESP8266WebServer hosted or parasitic
<a href="#esp8266webserverwebserver-hosted-or-parasitic" title=" ESP8266WebServer/WebServer hosted or parasitic" class="md-nav__link">
ESP8266WebServer/WebServer hosted or parasitic
</a>
</li>
@ -601,8 +601,8 @@
</li>
<li class="md-nav__item">
<a href="#4-alternate-esp8266webserverbegin" title="4. Alternate ESP8266WebServer::begin()" class="md-nav__link">
4. Alternate ESP8266WebServer::begin()
<a href="#4-alternate-esp8266webserverbegin-and-webserverbegin" title="4. Alternate ESP8266WebServer::begin() and WebServer::begin()" class="md-nav__link">
4. Alternate ESP8266WebServer::begin() and WebServer::begin()
</a>
</li>
@ -615,15 +615,15 @@
</li>
<li class="md-nav__item">
<a href="#6-use-esp8266webserveron-to-handle-url" title="6. Use ESP8266WebServer::on to handle URL" class="md-nav__link">
6. Use ESP8266WebServer::on to handle URL
<a href="#6-use-esp8266webserveron-and-webserveron-to-handle-url" title="6. Use ESP8266WebServer::on and WebServer::on to handle URL" class="md-nav__link">
6. Use ESP8266WebServer::on and WebServer::on to handle URL
</a>
</li>
<li class="md-nav__item">
<a href="#7-use-either-esp8266webserverhandleclient-or-autoconnecthandleclient" title="7. Use either ESP8266WebServer::handleClient() or AutoConnect::handleClient()" class="md-nav__link">
7. Use either ESP8266WebServer::handleClient() or AutoConnect::handleClient()
<a href="#7-use-either-esp8266webserverhandleclientwebserverhandleclient-or-autoconnecthandleclient" title="7. Use either ESP8266WebServer::handleClient()/WebServer::handleClient() or AutoConnect::handleClient()" class="md-nav__link">
7. Use either ESP8266WebServer::handleClient()/WebServer::handleClient() or AutoConnect::handleClient()
</a>
</li>
@ -634,8 +634,8 @@
</li>
<li class="md-nav__item">
<a href="#esp8266webserver-hosted-or-parasitic" title=" ESP8266WebServer hosted or parasitic" class="md-nav__link">
ESP8266WebServer hosted or parasitic
<a href="#esp8266webserverwebserver-hosted-or-parasitic" title=" ESP8266WebServer/WebServer hosted or parasitic" class="md-nav__link">
ESP8266WebServer/WebServer hosted or parasitic
</a>
</li>
@ -666,7 +666,7 @@
<h2 id="simple-usage">Simple usage<a class="headerlink" href="#simple-usage" title="Permanent link">&para;</a></h2>
<h3 id="embed-to-the-sketches"><i class="fa fa-edit"></i> Embed to the sketches<a class="headerlink" href="#embed-to-the-sketches" title="Permanent link">&para;</a></h3>
<p>How embed the AutoConnect to the sketches you have. Most simple approach to applying AutoConnect for the existing sketches, follow the below steps.</p>
<p>How embed the AutoConnect to the sketches you have. Most simple approach to applying AutoConnect for the existing sketches, follow the below steps. The below sketch is for ESP8266. For ESP32, replace <code class="codehilite">ESP8266WebServer</code> with <code class="codehilite">WebServer</code> and <code class="codehilite">ESP8266WiFi.h</code> with <code class="codehilite">WiFi.h</code> respectively.</p>
<p><img src="../images/BeforeAfter.svg" /></p>
<ul class="ulsty-edit" style="list-style:none;">
<li>Insert <code class="codehilite"><span class="cp">#include</span> <span class="cpf">&lt;AutoConnect.h&gt;</span></code> to behind of <code class="codehilite"><span class="cp">#include</span> <span class="cpf">&lt;ESP8266WebServer.h&gt;</span></code>.</li>
@ -682,22 +682,23 @@
<h4 id="1-a-typical-logic-sequence">1. A typical logic sequence<a class="headerlink" href="#1-a-typical-logic-sequence" title="Permanent link">&para;</a></h4>
<div class="admonition note">
<ol>
<li><strong>Include headers,</strong> <code class="codehilite">ESP8266WebServer.h</code> and <code class="codehilite">AutoConnect.h</code> </li>
<li><strong>Include headers,</strong> <code class="codehilite">ESP8266WebServer.h</code>/<code class="codehilite">WebServer.h</code> and <code class="codehilite">AutoConnect.h</code> </li>
<li><strong>Declare ESP8266WebServer variable.</strong> </li>
<li><strong>Declare AutoConnect variable.</strong> </li>
<li><strong>Implements the URL handler with the <em>function()</em>.</strong> </li>
<li><strong>setup()</strong><br />
5.1 <strong>Sets URL handler <em>function()</em> to ESP8266WebServer by</strong><code class="codehilite">ESP8266WebServer::on</code><strong>.</strong><br />
5.1 <strong>Sets URL handler <em>function()</em> to ESP8266WebServer/WebServer by</strong><code class="codehilite">ESP8266WebServer::on</code><strong>/</strong><code class="codehilite">WebServer::on</code><strong>.</strong><br />
5.2 <strong>Starts </strong><code class="codehilite">AutoConnect::begin()</code><strong>.</strong><br />
5.3 <strong>Check WiFi connection status.</strong> </li>
<li><strong>loop()</strong><br />
6.1 <strong>Invokes </strong><code class="codehilite">AutoConnect::handleClient()</code><strong>, or invokes </strong><code class="codehilite">ESP8266WebServer::handleClient()</code><strong> then </strong><code class="codehilite">AutoConnect::handleRequest()</code><strong>.</strong><br />
6.1 <strong>Invokes </strong><code class="codehilite">AutoConnect::handleClient()</code><strong>, or invokes </strong><code class="codehilite">ESP8266WebServer::handleClient()</code><strong>/</strong><code class="codehilite">WebServer::handleClient</code><strong> then </strong><code class="codehilite">AutoConnect::handleRequest()</code><strong>.</strong><br />
6.2 <strong>Do the process for actual sketch.</strong> </li>
</ol>
</div>
<h4 id="2-declare-autoconnect-object">2. Declare AutoConnect object<a class="headerlink" href="#2-declare-autoconnect-object" title="Permanent link">&para;</a></h4>
<p><a href="#esp8266webserver-hosted-or-parasitic">Two options</a> are available for <a href="../api/index.html#constructors">AutoConnect constructor</a>.</p>
<p><div class="codehilite"><pre><span></span><span class="n">AutoConnect</span> <span class="nf">VARIABLE</span><span class="p">(</span><span class="o">&amp;</span><span class="n">ESP8266WebServer</span><span class="p">);</span>
<p><div class="codehilite"><pre><span></span><span class="n">AutoConnect</span> <span class="nf">VARIABLE</span><span class="p">(</span><span class="o">&amp;</span><span class="n">ESP8266WebServer</span><span class="p">);</span> <span class="c1">// For ESP8266</span>
<span class="n">AutoConnect</span> <span class="nf">VARIABLE</span><span class="p">(</span><span class="o">&amp;</span><span class="n">WebServer</span><span class="p">);</span> <span class="c1">// For ESP32</span>
</pre></div>
or</p>
<div class="codehilite"><pre><span></span><span class="n">AutoConnect</span> <span class="n">VARIABLE</span><span class="p">;</span>
@ -705,44 +706,44 @@ or</p>
<ul>
<li>
<p><strong>The parameter with an ESP8266WebServer variable:</strong> An ESP8266WebServer object variable must be declared. AutoConnect uses its variable to handles the <a href="../menu/index.html">AutoConnect menu</a>.</p>
<p><strong>The parameter with an ESP8266WebServer/WebServer variable:</strong> An ESP8266WebServer/WebServer object variable must be declared. AutoConnect uses its variable to handles the <a href="../menu/index.html">AutoConnect menu</a>.</p>
</li>
<li>
<p><strong>With no parameter:</strong> The sketch does not declare ESP8266WebServer object. In this case, AutoConnect allocates an instance of the ESP8266WebServer internally. The logic sequence of the sketch is somewhat different as the above. To register a URL handler function by <em>ESP8266WebServer::on</em> should be performed after <a href="../api/index.html#begin"><em>AutoConnect::begin</em></a>.</p>
<p><strong>With no parameter:</strong> The sketch does not declare ESP8266WebServer/WebServer object. In this case, AutoConnect allocates an instance of the ESP8266WebServer/WebServer internally. The logic sequence of the sketch is somewhat different as the above. To register a URL handler function by <em>ESP8266WebServer::on</em> or <em>WebServer::on</em> should be performed after <a href="../api/index.html#begin"><em>AutoConnect::begin</em></a>.</p>
</li>
</ul>
<h4 id="3-no-need-wifibegin">3. No need WiFI.begin(...)<a class="headerlink" href="#3-no-need-wifibegin" title="Permanent link">&para;</a></h4>
<p>AutoConnect internally performs <em>WiFi.begin</em> to establish a WiFi connection. There is no need for a general process to establish a connection using <em>WiFi.begin</em> with a sketch code.</p>
<h4 id="4-alternate-esp8266webserverbegin">4. Alternate ESP8266WebServer::begin()<a class="headerlink" href="#4-alternate-esp8266webserverbegin" title="Permanent link">&para;</a></h4>
<p><a href="../api/index.html#begin"><em>AutoConnect::begin</em></a> executes <em>ESP8266WebServer::begin</em> internally too and it starts the DNS server to behave as a Captive portal. So it is not needed to call <em>ESP8266WebServer::begin</em> with the sketch.</p>
<h4 id="4-alternate-esp8266webserverbegin-and-webserverbegin">4. Alternate ESP8266WebServer::begin() and WebServer::begin()<a class="headerlink" href="#4-alternate-esp8266webserverbegin-and-webserverbegin" title="Permanent link">&para;</a></h4>
<p><a href="../api/index.html#begin"><em>AutoConnect::begin</em></a> executes <em>ESP8266WebServer::begin</em>/<em>WebServer::begin</em> internally too and it starts the DNS server to behave as a Captive portal. So it is not needed to call <em>ESP8266WebServer::begin</em>/<em>WebServer::begin</em> with the sketch.</p>
<div class="admonition info">
<p class="admonition-title">Why DNS Server starts</p>
<p>AutoConnect traps the detection of the captive portal and achieves a connection with the WLAN interactively by the AutoConnect menu. It responds SoftAP address to all DNS queries temporarily to trap. When the WLAN connection establishes, then stops DNS server.</p>
</div>
<h4 id="5-autoconnectbegin-with-ssid-and-password">5. AutoConnect::begin with SSID and Password<a class="headerlink" href="#5-autoconnectbegin-with-ssid-and-password" title="Permanent link">&para;</a></h4>
<p>SSID and Password can also specify by <a href="../api.me#begin"><em>AutoConnect::begin</em></a>. ESP8266 uses provided SSID and Password explicitly. If the connection false with specified SSID with Password then a captive portal is activated. SSID and Password are not present, ESP8266 SDK will attempt to connect using the still effectual SSID and password. Usually, it succeeds.</p>
<h4 id="6-use-esp8266webserveron-to-handle-url">6. Use ESP8266WebServer::on to handle URL<a class="headerlink" href="#6-use-esp8266webserveron-to-handle-url" title="Permanent link">&para;</a></h4>
<p>AutoConnect is designed to coexist with the process for handling the web pages by user sketches. The page processing function which will send an HTML to the client invoked by the "<em>on::ESP8266WebServer</em>" function is the same as when using ESP8266WebServer natively.</p>
<h4 id="7-use-either-esp8266webserverhandleclient-or-autoconnecthandleclient">7. Use either ESP8266WebServer::handleClient() or AutoConnect::handleClient()<a class="headerlink" href="#7-use-either-esp8266webserverhandleclient-or-autoconnecthandleclient" title="Permanent link">&para;</a></h4>
<p>Both classes member function name is the same: <em>handleClient</em>, but the behavior is different. Using the AutoConnect embedded along with ESP8266WebServer::handleClient has limitations. Refer to the below section for details. </p>
<h3 id="esp8266webserver-hosted-or-parasitic"><i class="fa fa-caret-right"></i> ESP8266WebServer hosted or parasitic<a class="headerlink" href="#esp8266webserver-hosted-or-parasitic" title="Permanent link">&para;</a></h3>
<p>The interoperable process with an ESP8266WebServer depends on the parameters of the <a href="../api/index.html#constructors">AutoConnect constructor</a>.</p>
<p>SSID and Password can also specify by <a href="../api.me#begin"><em>AutoConnect::begin</em></a>. ESP8266/ESP32 uses provided SSID and Password explicitly. If the connection false with specified SSID with Password then a captive portal is activated. SSID and Password are not present, ESP8266 SDK will attempt to connect using the still effectual SSID and password. Usually, it succeeds.</p>
<h4 id="6-use-esp8266webserveron-and-webserveron-to-handle-url">6. Use ESP8266WebServer::on and WebServer::on to handle URL<a class="headerlink" href="#6-use-esp8266webserveron-and-webserveron-to-handle-url" title="Permanent link">&para;</a></h4>
<p>AutoConnect is designed to coexist with the process for handling the web pages by user sketches. The page processing function which will send an HTML to the client invoked by the "<em>on::ESP8266WebServer</em>" or the "<em>on::WebServer</em>" function is the same as when using ESP8266WebServer/WebServer natively.</p>
<h4 id="7-use-either-esp8266webserverhandleclientwebserverhandleclient-or-autoconnecthandleclient">7. Use either ESP8266WebServer::handleClient()/WebServer::handleClient() or AutoConnect::handleClient()<a class="headerlink" href="#7-use-either-esp8266webserverhandleclientwebserverhandleclient-or-autoconnecthandleclient" title="Permanent link">&para;</a></h4>
<p>Both classes member function name is the same: <em>handleClient</em>, but the behavior is different. Using the AutoConnect embedded along with ESP8266WebServer::handleClient/WebServer::handleClient has limitations. Refer to the below section for details. </p>
<h3 id="esp8266webserverwebserver-hosted-or-parasitic"><i class="fa fa-caret-right"></i> ESP8266WebServer/WebServer hosted or parasitic<a class="headerlink" href="#esp8266webserverwebserver-hosted-or-parasitic" title="Permanent link">&para;</a></h3>
<p>The interoperable process with an ESP8266WebServer/WebServer depends on the parameters of the <a href="../api/index.html#constructors">AutoConnect constructor</a>.</p>
<table>
<thead>
<tr>
<th>Declaration parameter for the constructor</th>
<th>Use ESP8266WebServer::handleClient only</th>
<th>Use ESP8266WebServer::handleClient or WebServer::handleClient only</th>
<th>Use AutoConnect::handleClient</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="../api/index.html#constructors">None</a></td>
<td>AutoConnect menu not available.<br>To use AutoConnect menu, need <a href="../api/index.html#handlerequest">AutoConnect::handleRequest()</a>.<br>also to use ESP8266WebServer natively, need <a href="../api/index.html#host">AutoConnect::host()</a>.</td>
<td>AutoConnect menu not available.<br>To use AutoConnect menu, need <a href="../api/index.html#handlerequest">AutoConnect::handleRequest()</a>.<br>also to use ESP8266WebServer/WebServer natively, need <a href="../api/index.html#host">AutoConnect::host()</a>.</td>
<td>AutoConnect menu available.<br>To use ESP8266WebServer natively, need <a href="../api/index.html#host">AutoConnect::host()</a>.</td>
</tr>
<tr>
<td><a href="../api/index.html#withparameter">Reference to ESP8266WebServer</a></td>
<td><a href="../api/index.html#withparameter">Reference to ESP8266WebServer/WebServer</a></td>
<td>AutoConnect menu not available.<br>To use AutoConnect menu, need <a href="../api/index.html#handlerequest">AutoConnect::handleRequest()</a>.</td>
<td>AutoConnect menu available.</td>
</tr>
@ -750,22 +751,22 @@ or</p>
</table>
<ul>
<li>
<p><strong>By declaration for the AutoConnect variable with no parameter</strong>: The ESP8266WebServer instance is hosted by AutoConnect automatically then the sketches use <a href="../api/index.html#host"><em>AutoConnect::host</em></a> as API to get it after <a href="../api/index.html#begin"><em>AutoConnect::begin</em></a> performed.</p>
<p><strong>By declaration for the AutoConnect variable with no parameter</strong>: The ESP8266WebServer/WebServer instance is hosted by AutoConnect automatically then the sketches use <a href="../api/index.html#host"><em>AutoConnect::host</em></a> as API to get it after <a href="../api/index.html#begin"><em>AutoConnect::begin</em></a> performed.</p>
</li>
<li>
<p><strong>By declaration for the AutoConnect variable with the reference of ESP8266WebServer</strong>: AutoConnect will use it. The sketch can use it is too.</p>
<p><strong>By declaration for the AutoConnect variable with the reference of ESP8266WebServer/WebServer</strong>: AutoConnect will use it. The sketch can use it is too.</p>
</li>
<li>
<p><strong>In use ESP8266WebServer::handleClient()</strong>: AutoConnect menu can be dispatched but not works normally. It is necessary to call <a href="../api/index.html#void-handlerequest"><em>AutoConnect::handleRequest</em></a> after <em>ESP8255WebServer::handleClient</em> invoking.</p>
<p><strong>In use ESP8266WebServer::handleClient()/WebServer::handleClient()</strong>: AutoConnect menu can be dispatched but not works normally. It is necessary to call <a href="../api/index.html#void-handlerequest"><em>AutoConnect::handleRequest</em></a> after <em>ESP8255WebServer::handleClient</em>/<em>WebServer::handleClient</em> invoking.</p>
</li>
<li>
<p><strong>In use <a href="../api/index.html#void-handleclient">AutoConnect::handleClient()</a></strong>: The handleClient() process and the AutoConnect menu is available without calling <em>ESP8266WebServer::handleClient</em>.</p>
</li>
</ul>
<div class="admonition info">
<p class="admonition-title">Why AutoConnect::handleRequest is needed when using ESP8266::handleClient</p>
<p>The AutoConnect menu function may affect WiFi connection state. It follows that the menu process must execute outside <em>ESP8266WebServer::handleClient</em>.<br />
<a href="../api/index.html#void-handleclient"><em>AutoConnect::handleClient</em></a> is equivalent <em>ESP8266WebServer::handleClient</em> included <a href="../api/index.html#void-handlerequest"><em>AutoConnect::handleRequest</em></a>.</p>
<p class="admonition-title">Why AutoConnect::handleRequest is needed when using ESP8266WebServer::handleClient/WebServer::handleClient</p>
<p>The AutoConnect menu function may affect WiFi connection state. It follows that the menu process must execute outside <em>ESP8266WebServer::handleClient</em> and <em>WebServer::handleClient</em>.<br />
<a href="../api/index.html#void-handleclient"><em>AutoConnect::handleClient</em></a> is equivalent <em>ESP8266WebServer::handleClient</em> and <em>WEbServer::handleClient</em> included <a href="../api/index.html#void-handlerequest"><em>AutoConnect::handleRequest</em></a>.</p>
</div>
<div class="footnote">
<hr />

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
<link rel="canonical" href="https://Hieromon.github.io/AutoConnect/changelog/index.html">
@ -42,7 +42,7 @@
<title>Change log - AutoConnect for ESP8266</title>
<title>Change log - AutoConnect for ESP8266/ESP32</title>
@ -101,7 +101,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
<a href="#094-may-5-2018" tabindex="1" class="md-skip">
<a href="#095-aug27-2018" tabindex="1" class="md-skip">
Skip to content
</a>
@ -110,7 +110,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="../images/arduino-logo.svg" width="24" height="24">
@ -124,7 +124,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
Change log
@ -249,7 +249,7 @@
<img src="../images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">
@ -400,6 +400,13 @@
<label class="md-nav__title" for="toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#095-aug27-2018" title="[0.9.5] Aug.27, 2018." class="md-nav__link">
[0.9.5] Aug.27, 2018.
</a>
</li>
<li class="md-nav__item">
<a href="#094-may-5-2018" title="[0.9.4] May 5, 2018." class="md-nav__link">
[0.9.4] May 5, 2018.
@ -469,6 +476,13 @@
<label class="md-nav__title" for="toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#095-aug27-2018" title="[0.9.5] Aug.27, 2018." class="md-nav__link">
[0.9.5] Aug.27, 2018.
</a>
</li>
<li class="md-nav__item">
<a href="#094-may-5-2018" title="[0.9.4] May 5, 2018." class="md-nav__link">
[0.9.4] May 5, 2018.
@ -516,7 +530,12 @@
<h1>Change log</h1>
<h4 id="094-may-5-2018">[0.9.4] May 5, 2018.<a class="headerlink" href="#094-may-5-2018" title="Permanent link">&para;</a></h4>
<h4 id="095-aug27-2018">[0.9.5] Aug.27, 2018.<a class="headerlink" href="#095-aug27-2018" title="Permanent link">&para;</a></h4>
<ul>
<li>Supports ESP32.</li>
<li>Fixed that crash may occur if the number of stored credentials in the EEPROM is smaller than the number of found WiFi networks.</li>
</ul>
<h4 id="094-may-5-2018">[0.9.4] May 5, 2018.<a class="headerlink" href="#094-may-5-2018" title="Permanent link">&para;</a></h4>
<ul>
<li>Automatically focus passphrase after selecting SSID with Configure New AP.</li>
<li>Supports AutoConnectConfig::autoReconnect option, it will scan the WLAN when it can not connect to the default SSID, apply the applicable credentials if it is saved, and try reconnecting.</li>

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
<link rel="canonical" href="https://Hieromon.github.io/AutoConnect/examples/index.html">
@ -42,7 +42,7 @@
<title>Examples - AutoConnect for ESP8266</title>
<title>Examples - AutoConnect for ESP8266/ESP32</title>
@ -110,7 +110,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="../images/arduino-logo.svg" width="24" height="24">
@ -124,7 +124,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
Examples
@ -249,7 +249,7 @@
<img src="../images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
<link rel="canonical" href="https://Hieromon.github.io/AutoConnect/faq/index.html">
@ -42,7 +42,7 @@
<title>FAQ - AutoConnect for ESP8266</title>
<title>FAQ - AutoConnect for ESP8266/ESP32</title>
@ -110,7 +110,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="../images/arduino-logo.svg" width="24" height="24">
@ -124,7 +124,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
FAQ
@ -249,7 +249,7 @@
<img src="../images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
<link rel="canonical" href="https://Hieromon.github.io/AutoConnect/gettingstarted/index.html">
@ -42,7 +42,7 @@
<title>Getting started - AutoConnect for ESP8266</title>
<title>Getting started - AutoConnect for ESP8266/ESP32</title>
@ -110,7 +110,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="../images/arduino-logo.svg" width="24" height="24">
@ -124,7 +124,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
Getting started
@ -249,7 +249,7 @@
<img src="../images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">
@ -544,11 +544,11 @@
<h2 id="lets-do-the-most-simple-sketch">Let's do the most simple sketch<a class="headerlink" href="#lets-do-the-most-simple-sketch" title="Permanent link">&para;</a></h2>
<p>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.</p>
<div class="codehilite"><pre><span></span><span class="cp">#include</span> <span class="cpf">&lt;ESP8266WiFi.h&gt;</span><span class="cp"></span>
<span class="cp">#include</span> <span class="cpf">&lt;ESP8266WebServer.h&gt;</span><span class="cp"></span>
<div class="codehilite"><pre><span></span><span class="cp">#include</span> <span class="cpf">&lt;ESP8266WiFi.h&gt; // Replace with WiFi.h for ESP32</span><span class="cp"></span>
<span class="cp">#include</span> <span class="cpf">&lt;ESP8266WebServer.h&gt; // Replace with WebServer.h for ESP32</span><span class="cp"></span>
<span class="cp">#include</span> <span class="cpf">&lt;AutoConnect.h&gt;</span><span class="cp"></span>
<span class="n">ESP8266WebServer</span> <span class="nf">Server</span><span class="p">;</span>
<span class="n">ESP8266WebServer</span> <span class="nf">Server</span><span class="p">;</span> <span class="c1">// Replace with WebServer for ESP32</span>
<span class="n">AutoConnect</span> <span class="nf">Portal</span><span class="p">(</span><span class="nf">Server</span><span class="p">);</span>
<span class="kr">void</span> <span class="nf">rootPage</span><span class="p">()</span> <span class="p">{</span>
@ -572,8 +572,11 @@
<span class="p">}</span>
</pre></div>
<div class="admonition note">
<p>The above code can be applied to ESP8266. To apply to ESP32, replace <code class="codehilite">ESP8266WebServer</code> class with <code class="codehilite">WebServer</code> and include <code class="codehilite">WiFi.h</code> and <code class="codehilite">WebServer.h</code> appropriately.</p>
</div>
<h3 id="run-at-first"><i class="fa fa-play-circle"></i> Run at first<a class="headerlink" href="#run-at-first" title="Permanent link">&para;</a></h3>
<p>After about 30 seconds, if the ESP8266 cannot connect to nearby Wi-Fi spot, you pull out your smartphone and open <em>Wi-Fi settings</em> from the <em>Settings</em> Apps. You can see the <strong>esp8266ap</strong> in the list of <em>"CHOOSE A NETWORK..."</em>. Then tap the esp8266ap and enter password <strong>12345678</strong>, a something screen pops up automatically as shown below.</p>
<p>After about 30 seconds, if the ESP8266 cannot connect to nearby Wi-Fi spot, you pull out your smartphone and open <em>Wi-Fi settings</em> from the <em>Settings</em> Apps. You can see the <strong>esp8266ap</strong> <sup id="fnref:1"><a class="footnote-ref" href="#fn:1" rel="footnote">1</a></sup> in the list of <em>"CHOOSE A NETWORK..."</em>. Then tap the esp8266ap and enter password <strong>12345678</strong>, a something screen pops up automatically as shown below.</p>
<p><span style="display:inline-block;width:282px;height:501px;border:1px solid lightgrey;"><img data-gifffer="../images/login_ani.gif" data-gifffer-width="280" style="width:280px;" /></span><img src="../images/arrow_right.svg" style="vertical-align:top;padding-top:120px;width:48px;margin-left:30px;margin-right:30px;" /><img src="../images/stat.png" style="border:1px solid lightgrey;width:280px;" /></span></p>
<p>This is the AutoConnect statistics screen. This screen displays the current status of the established connection, WiFi mode, IP address, free memory size, and etc. Also, the <strong>hamburger icon</strong> is the control menu of AutoConnect seems at the upper right. By tap the hamburger icon, the control menu appears as the below.</p>
<h3 id="join-to-the-new-access-point"><i class="fa fa-cog"></i> Join to the new access point<a class="headerlink" href="#join-to-the-new-access-point" title="Permanent link">&para;</a></h3>
@ -592,6 +595,15 @@ Or, "<strong>RESET</strong>" can be selected. The ESP8266 resets and reboots. Af
Gifffer();
}
</script>
<div class="footnote">
<hr />
<ol>
<li id="fn:1">
<p>When applied to ESP32, <strong>esp32ap</strong>&#160;<a class="footnote-backref" href="#fnref:1" rev="footnote" title="Jump back to footnote 1 in the text">&#8617;</a></p>
</li>
</ol>
</div>

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
<link rel="canonical" href="https://Hieromon.github.io/AutoConnect/index.html">
@ -42,7 +42,7 @@
<title>AutoConnect for ESP8266</title>
<title>AutoConnect for ESP8266/ESP32</title>
@ -101,7 +101,7 @@
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
<a href="#autoconnect-for-esp8266" tabindex="1" class="md-skip">
<a href="#autoconnect-for-esp8266esp32" tabindex="1" class="md-skip">
Skip to content
</a>
@ -110,7 +110,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="./images/arduino-logo.svg" width="24" height="24">
@ -124,7 +124,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
Overview
@ -249,7 +249,7 @@
<img src="./images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">
@ -654,22 +654,22 @@
<h1 id="autoconnect-for-esp8266">AutoConnect <small>for ESP8266</small><a class="headerlink" href="#autoconnect-for-esp8266" title="Permanent link">&para;</a></h1>
<p>An Arduino library for ESP8266 WLAN configuration at run time with web interface.</p>
<h1 id="autoconnect-for-esp8266esp32">AutoConnect <small>for ESP8266/ESP32</small><a class="headerlink" href="#autoconnect-for-esp8266esp32" title="Permanent link">&para;</a></h1>
<p>An Arduino library for ESP8266/ESP32 WLAN configuration at run time with web interface.</p>
<h2 id="overview">Overview<a class="headerlink" href="#overview" title="Permanent link">&para;</a></h2>
<p>To the dynamic configuration for joining to WLAN with SSID and PSK accordingly. It an Arduino library united with <em>ESP8266WebServer</em> class.
Easy implementing the Web interface constituting the WLAN for ESP8266 WiFi connection. With this library to make a sketch easily which connects from ESP8266 to the access point at runtime by the web interface without hard-coded SSID and password.</p>
<p>To the dynamic configuration for joining to WLAN with SSID and PSK accordingly. It an Arduino library united with <em>ESP8266WebServer</em> class for ESP8266 or <em>WebServer</em> class for ESP32.
Easy implementing the Web interface constituting the WLAN for ESP8266/ESP32 WiFi connection. With this library to make a sketch easily which connects from ESP8266/ESP32 to the access point at runtime by the web interface without hard-coded SSID and password.</p>
<p><img style="display:inline-block;width:460px;margin-right:30px;" src="./images/ov.png" /><span style="display:inline-block;width:182px;height:322px;border:solid 1px lightgrey;"><img data-gifffer="./images/ov.gif" data-gifffer-width="180" style="width:180px;" /></span></p>
<h3 id="no-need-pre-coded-ssid-password"><i class="fa fa-arrow-circle-right" aria-hidden="true"></i> No need pre-coded SSID &amp; password<a class="headerlink" href="#no-need-pre-coded-ssid-password" title="Permanent link">&para;</a></h3>
<p><span class="lead">It is no needed hard-coding in advance the SSID and Password into the sketch to connect between ESP8266 and WLAN. You can input SSID &amp; Password from a smartphone via the web interface at runtime.</span></p>
<p><span class="lead">It is no needed hard-coding in advance the SSID and Password into the sketch to connect between ESP8266/ESP32 and WLAN. You can input SSID &amp; Password from a smartphone via the web interface at runtime.</span></p>
<h3 id="simple-usage"><i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Simple usage<a class="headerlink" href="#simple-usage" title="Permanent link">&para;</a></h3>
<p><span class="lead">AutoConnect control screen will be displayed automatically for establishing new connections. It aids by the <a href="https://en.wikipedia.org/wiki/Captive_portal">captive portal</a> when vested the connection cannot be detected.<br>By using the <a href="menu/index.html">AutoConnect menu</a>, to manage the connections convenient.</span></p>
<h3 id="store-the-established-connection"><i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Store the established connection<a class="headerlink" href="#store-the-established-connection" title="Permanent link">&para;</a></h3>
<p><span class="lead">The connection authentication data as credentials are saved automatically in EEPROM of ESP8266 and You can select the past SSID from the <a href="menu/index.html">AutoConnect menu</a>.</span></p>
<p><span class="lead">The connection authentication data as credentials are saved automatically in EEPROM of ESP8266/ESP32 and You can select the past SSID from the <a href="menu/index.html">AutoConnect menu</a>.</span></p>
<h3 id="easy-to-embed-in"><i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Easy to embed in<a class="headerlink" href="#easy-to-embed-in" title="Permanent link">&para;</a></h3>
<p><span class="lead">AutoConnect can be placed easily in your sketch. It's "<strong>begin</strong>" and "<strong>handleClient</strong>" only.</span></p>
<h3 id="lives-with-the-your-sketches"><i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Lives with the your sketches<a class="headerlink" href="#lives-with-the-your-sketches" title="Permanent link">&para;</a></h3>
<p><span class="lead">The sketches which provide the web page using ESP8266WebServer there is, AutoConnect will not disturb it. AutoConnect can use an already instantiated ESP8266WebServer object, or itself can assign it.</span></p>
<p><span class="lead">The sketches which provide the web page using ESP8266WebServer there is, AutoConnect will not disturb it. AutoConnect can use an already instantiated ESP8266WebServer object, or itself can assign it.<br>This efficacy can also be applied to ESP32. The corresponding class for ESP32 will be the WebServer.</span></p>
<h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link">&para;</a></h2>
<h3 id="requirements">Requirements<a class="headerlink" href="#requirements" title="Permanent link">&para;</a></h3>
<h4 id="supported-hardware">Supported hardware<a class="headerlink" href="#supported-hardware" title="Permanent link">&para;</a></h4>
@ -682,6 +682,13 @@ Easy implementing the Web interface constituting the WLAN for ESP8266 WiFi conne
<li class="task-list-item"><input type="checkbox" disabled checked/> Olimex MOD-WIFI-ESP8266</li>
<li class="task-list-item"><input type="checkbox" disabled checked/> SparkFun Thing</li>
<li class="task-list-item"><input type="checkbox" disabled checked/> SweetPea ESP-210</li>
<li class="task-list-item"><input type="checkbox" disabled checked/> ESP32Dev Board (applying the Espressif's arduino-esp32 core)</li>
<li class="task-list-item"><input type="checkbox" disabled checked/> SparkFun ESP32 Thing</li>
<li class="task-list-item"><input type="checkbox" disabled checked/> WEMOS LOLIN D32</li>
<li class="task-list-item"><input type="checkbox" disabled checked/> Ai-Thinker NodeMCU-32S</li>
<li class="task-list-item"><input type="checkbox" disabled checked/> Heltec WiFi Kit 32</li>
<li class="task-list-item"><input type="checkbox" disabled checked/> M5Stack</li>
<li class="task-list-item"><input type="checkbox" disabled checked/> And other ESP8266/ESP32 modules supported by the Additional Board Manager URLs of the Arduino-IDE.</li>
</ul>
<div class="admonition info">
<p class="admonition-title">About flash size on the module</p>
@ -694,15 +701,13 @@ Easy implementing the Web interface constituting the WLAN for ESP8266 WiFi conne
<p><i class="fa fa-download"></i> <strong>ESP8266 Arduino core</strong></p>
<p>AutoConnect targets sketches made on the assumption of <a href="https://github.com/esp8266/Arduino">ESP8266 Community's Arduino core</a>. The <a href="https://github.com/esp8266/Arduino/releases/latest">latest release</a> is recommended.<br />
Install third-party platform using the <em>Boards Manager</em> of Arduino IDE. Package URL is <a href="http://arduino.esp8266.com/stable/package_esp8266com_index.json">http://arduino.esp8266.com/stable/package_esp8266com_index.json</a></p>
<p><i class="fa fa-download"></i> <strong>ESP32 Arduino core</strong></p>
<p>Also, to apply AutoConnect to ESP32, the <a href="https://github.com/espressif/arduino-esp32">arduino-esp32 core</a> provided by Espressif is needed. The <a href="https://github.com/espressif/arduino-esp32/releases/latest">latest release</a> is recommended.<br />
Install third-party platform using the <em>Boards Manager</em> of Arduino IDE. You can add multiple URLs into <em>Additional Board Manager URLs</em> field, separating them with commas. Package URL is <a href="https://dl.espressif.com/dl/package_esp32_index.json">https://dl.espressif.com/dl/package_esp32_index.json</a></p>
<p><i class="fa fa-download"></i> <strong>Additional necessary library</strong></p>
<p>The <a href="https://github.com/Hieromon/PageBuilder">PageBuilder</a> library to build HTML for ESP8266WebServer is needed.<br />
To install the PageBuilder library into your Arduino IDE, you can use the <em>Library Manager</em>. Select the board of ESP8266 series in the Arduino IDE, open the library manager and search keyword '<strong>PageBuilder</strong>' with the topic '<strong>Communication</strong>', then you can see the <em>PageBuilder</em>. The latest version or 1.0.0 later is required.</p>
To install the PageBuilder library into your Arduino IDE, you can use the <em>Library Manager</em>. Select the board of ESP8266 series in the Arduino IDE, open the library manager and search keyword '<strong>PageBuilder</strong>' with the topic '<strong>Communication</strong>', then you can see the <em>PageBuilder</em>. The latest version is required 1.1.0 later for ESP32.</p>
<p><img src="./images/lm.png" width="640"/></p>
<div class="admonition warning">
<p class="admonition-title">Library Manager of Arduino IDE</p>
<p>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. <a href="https://github.com/Hieromon/PageBuilder/releases/latest">The PageBuilder release</a> of the Github repository is the latest version. The <a href="https://platformio.org/lib/show/2010/PageBuilder">PlatformIO library</a> has the latest version of 1.0.0.<br />
In 0.93.0, the PageBuilder class has a compile error about without the 'cancel' method.</p>
</div>
<h3 id="install-the-autoconnect">Install the AutoConnect<a class="headerlink" href="#install-the-autoconnect" title="Permanent link">&para;</a></h3>
<p>Clone or download from the <a href="https://github.com/Hieromon/AutoConnect">AutoConnect GitHub repository</a>.</p>
<p><img src="./images/gitrepo.png" width="640"/></p>
@ -710,7 +715,7 @@ In 0.93.0, the PageBuilder class has a compile error about without the 'cancel'
<p><img src="./images/ins_lib.png" /></p>
<div class="admonition info">
<p class="admonition-title">Supported by Library manager.</p>
<p>AutoConnect was added to the Arduino IDE library manager as of March 17, 2018. It can be used with the PlatformIO library also.</p>
<p>AutoConnect was added to the Arduino IDE library manager. It can be used with the PlatformIO library also.</p>
</div>
<script>
window.onload = function() {

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
<link rel="canonical" href="https://Hieromon.github.io/AutoConnect/license/index.html">
@ -42,7 +42,7 @@
<title>License - AutoConnect for ESP8266</title>
<title>License - AutoConnect for ESP8266/ESP32</title>
@ -106,7 +106,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="../images/arduino-logo.svg" width="24" height="24">
@ -120,7 +120,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
License
@ -245,7 +245,7 @@
<img src="../images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="ESP8266 WLAN configuration at run time with web interface">
<meta name="description" content="ESP8266/ESP32 WLAN configuration at run time with web interface">
<link rel="canonical" href="https://Hieromon.github.io/AutoConnect/menu/index.html">
@ -42,7 +42,7 @@
<title>AutoConnect menu - AutoConnect for ESP8266</title>
<title>AutoConnect menu - AutoConnect for ESP8266/ESP32</title>
@ -110,7 +110,7 @@
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266" class="md-header-nav__button md-logo">
<a href="https://Hieromon.github.io/AutoConnect/" title="AutoConnect for ESP8266/ESP32" class="md-header-nav__button md-logo">
<img src="../images/arduino-logo.svg" width="24" height="24">
@ -124,7 +124,7 @@
<span class="md-header-nav__topic">
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</span>
<span class="md-header-nav__topic">
AutoConnect menu
@ -249,7 +249,7 @@
<img src="../images/arduino-logo.svg" width="48" height="48">
</span>
AutoConnect for ESP8266
AutoConnect for ESP8266/ESP32
</label>
<div class="md-nav__source">
@ -549,7 +549,7 @@
<p>The AutoConnect menu is developed using the <a href="https://github.com/balzss/luxbar">LuxBar</a> which is licensed under the MIT License. See the <a href="../license/index.html">License</a>.</p>
</div>
<h2 id="where-the-from"><i class="fa fa-external-link"></i> Where the from<a class="headerlink" href="#where-the-from" title="Permanent link">&para;</a></h2>
<p>The AutoConnect menu appears when you access the <strong>AutoConnect root path</strong>. It is assigned "<strong>/_ac</strong>" located on ESP8266 <em>local IP address</em> by default. This location can be changed in the sketch. The following screen will appear at access to <code class="codehilite">http://{localIP}/_ac</code> 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. <code class="codehilite">http://192.168.244.1/_ac</code> for SoftAP mode.)</p>
<p>The AutoConnect menu appears when you access the <strong>AutoConnect root path</strong>. It is assigned "<strong>/_ac</strong>" located on ESP8266/ESP32 <em>local IP address</em> by default. This location can be changed in the sketch. The following screen will appear at access to <code class="codehilite">http://{localIP}/_ac</code> 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. <code class="codehilite">http://192.168.244.1/_ac</code> for SoftAP mode.)</p>
<p><img src="../images/ac.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" /></p>
<div class="admonition note">
<p class="admonition-title">What's local IP?</p>
@ -561,7 +561,7 @@
<li><strong>Configure new AP</strong>: Configure SSID and Password for new access point.</li>
<li><strong>Open SSIDs</strong>: Opens the past SSID which has been established connection from EEPROM.</li>
<li><strong>Disconnect</strong>: Disconnects current connection.</li>
<li><strong>Reset...</strong>: Rest the ESP8266 module.</li>
<li><strong>Reset...</strong>: Rest the ESP8266/ESP32 module.</li>
<li><strong>HOME</strong>: Return to user home page.</li>
</ul>
<p><img src="../images/menu.png" style="width:280px;" /></p>
@ -570,17 +570,17 @@
Enter SSID and Passphrase and tap "<strong>apply</strong>" to starts a connection. </p>
<p><img src="../images/newap.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" /></p>
<h2 id="open-ssids"><i class="fa fa-bars"></i> Open SSIDs<a class="headerlink" href="#open-ssids" title="Permanent link">&para;</a></h2>
<p>Once it was established connection, its SSID and Password will be stored to the EEPROM of ESP8266 automatically. The <strong>Open SSIDs</strong> 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.</p>
<p>Once it was established connection, its SSID and Password will be stored to the EEPROM of ESP8266/ESP32 automatically. The <strong>Open SSIDs</strong> 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.</p>
<p><img src="../images/open.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" /></p>
<h2 id="disconnect"><i class="fa fa-bars"></i> Disconnect<a class="headerlink" href="#disconnect" title="Permanent link">&para;</a></h2>
<p>Disconnect ESP8266 from the current connection. It can also reset the ESP8266 automatically after disconnection by instructing with using <a href="../api/index.html#autoreset">API</a> in the sketch.</p>
<p>Disconnect ESP8266/ESP32 from the current connection. It can also reset the ESP8266/ESP32 automatically after disconnection by instructing with using <a href="../api/index.html#autoreset">API</a> in the sketch.</p>
<p>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. </p>
<h2 id="reset"><i class="fa fa-bars"></i> Reset...<a class="headerlink" href="#reset" title="Permanent link">&para;</a></h2>
<p>Reset the ESP8266, it will start rebooting. After rebooting complete, the ESP8266 begins establishing the previous connection with WIFI_STA mode, and <em>esp8266ap</em> of an access point will disappear from WLAN.</p>
<p>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 <em>esp8266ap</em> or <em>esp32ap</em> of an access point will disappear from WLAN.</p>
<p><img src="../images/resetting.png" style="width:280px;" /></p>
<div class="admonition warning">
<p class="admonition-title">Not every module will be rebooted normally</p>
<p>The Reset menu is using the <strong>ESP.reset()</strong> function. This is an almost hardware reset. In order to resume the sketch normally, the <a href="https://github.com/esp8266/esp8266-wiki/wiki/Boot-Process#esp-boot-modes">state of GPIO0</a> is important. Since this depends on the circuit implementation for each module, not every module will be rebooted normally. See also <a href="../faq/index.html#hang-up-after-reset">FAQ</a>.</p>
<p class="admonition-title">Not every ESP8266 module will be rebooted normally</p>
<p>The Reset menu is using the <strong>ESP.reset()</strong> function for ESP8266. This is an almost hardware reset. In order to resume the sketch normally, the <a href="https://github.com/esp8266/esp8266-wiki/wiki/Boot-Process#esp-boot-modes">state of GPIO0</a> is important. Since this depends on the circuit implementation for each module, not every module will be rebooted normally. See also <a href="../faq/index.html#hang-up-after-reset">FAQ</a>.</p>
</div>

File diff suppressed because one or more lines are too long

@ -4,7 +4,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//index.html</loc>
<lastmod>2018-05-06</lastmod>
<lastmod>2018-09-14</lastmod>
<changefreq>daily</changefreq>
</url>
@ -12,7 +12,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//gettingstarted/index.html</loc>
<lastmod>2018-05-06</lastmod>
<lastmod>2018-09-14</lastmod>
<changefreq>daily</changefreq>
</url>
@ -20,7 +20,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//menu/index.html</loc>
<lastmod>2018-05-06</lastmod>
<lastmod>2018-09-14</lastmod>
<changefreq>daily</changefreq>
</url>
@ -28,7 +28,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//basicusage/index.html</loc>
<lastmod>2018-05-06</lastmod>
<lastmod>2018-09-14</lastmod>
<changefreq>daily</changefreq>
</url>
@ -36,7 +36,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//advancedusage/index.html</loc>
<lastmod>2018-05-06</lastmod>
<lastmod>2018-09-14</lastmod>
<changefreq>daily</changefreq>
</url>
@ -44,7 +44,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//api/index.html</loc>
<lastmod>2018-05-06</lastmod>
<lastmod>2018-09-14</lastmod>
<changefreq>daily</changefreq>
</url>
@ -52,7 +52,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//examples/index.html</loc>
<lastmod>2018-05-06</lastmod>
<lastmod>2018-09-14</lastmod>
<changefreq>daily</changefreq>
</url>
@ -60,7 +60,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//faq/index.html</loc>
<lastmod>2018-05-06</lastmod>
<lastmod>2018-09-14</lastmod>
<changefreq>daily</changefreq>
</url>
@ -68,7 +68,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//changelog/index.html</loc>
<lastmod>2018-05-06</lastmod>
<lastmod>2018-09-14</lastmod>
<changefreq>daily</changefreq>
</url>
@ -76,7 +76,7 @@
<url>
<loc>https://Hieromon.github.io/AutoConnect//license/index.html</loc>
<lastmod>2018-05-06</lastmod>
<lastmod>2018-09-14</lastmod>
<changefreq>daily</changefreq>
</url>

@ -74,6 +74,17 @@ void mqttPublish(String msg) {
mqttClient.publish(topic, payload);
}
int getStrength(uint8_t points) {
uint8_t sc = points;
long rssi = 0;
while (sc--) {
rssi += WiFi.RSSI();
delay(20);
}
return points ? (int)(rssi / points) : 0;
}
unsigned long lastPub = 0;
void setup() {
@ -100,7 +111,7 @@ void loop() {
if (!mqttClient.connected()) {
mqttConnect();
}
String item = String("field1=") + String(WiFi.RSSI());
String item = String("field1=") + String(getStrength(7));
mqttPublish(item);
mqttClient.loop();
lastPub = millis();

@ -6,7 +6,7 @@
#include <AutoConnect.h>
```
#### Define macros
#### Defined macros
```cpp
#define AC_DEBUG // Monitor message output activation
@ -34,18 +34,26 @@ AutoConnect()
<a id="withparameter"></a>
AutoConnect default constructor. This entry internally allocates the ESP8266WebServer and is activated internally.
AutoConnect default constructor. This entry internally allocates the ESP8266WebServer for ESP8266 or WebServer for ESP32 and is activated internally.
- For ESP8266
```cpp
AutoConnect(ESP8266WebServer& webServer)
```
Run the AutoConnect site using the externally ensured ESP8266WebServer.
- For ESP32
```cpp
AutoConnect(WebServer& webServer)
```
Run the AutoConnect site using the externally ensured ESP8266WebServer for ESP8266 or WebServer for ESP32.
The [**handleClient**](api.md#handleclient) function of AutoConnect can include the response of the URI handler added by the user using the "*on*" function of ESP8266WebServer. If ESP8266WebServer is assigned internally by AutoConnect, the sketch can obtain that reference with the [**host**](api.me#host) function.
The [**handleClient**](api.md#handleclient) function of AutoConnect can include the response of the URI handler added by the user using the "*on*" function of ESP8266WebServer/WebServer. If ESP8266WebServer/WebServer is assigned internally by AutoConnect, the sketch can obtain that reference with the [**host**](api.me#host) function.
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">webServer</span>A reference of ESP8266WebServer instance.</dd>
<dd><span class="apidef">webServer</span>A reference of ESP8266WebServer or WebServer instance.</dd>
</dl>
### <i class="fa fa-code"></i> Public member functions
@ -59,11 +67,11 @@ bool begin()
bool begin(const char* ssid, const char* passphraase)
```
```cpp
bool begin(const char* ssid, const char* passphraase, unsinged long timeout)
bool begin(const char* ssid, const char* passphraase, unsigned long timeout)
```
Starts establishing the WiFi connection.
AutoConnect first invokes *WiFi.begin*. If the case of SSID and Password missing, its *WiFi.begin* has no SSID and Password. The WiFi mode at this time is WIFI_STA. Then ESP8266WebServer will be started immediately after the first *WiFi.beign* regardless of the result.
AutoConnect first invokes *WiFi.begin*. If the case of SSID and Password missing, its *WiFi.begin* has no SSID and Password. The WiFi mode at this time is WIFI_STA. Then ESP8266WebServer/WebServer will be started immediately after the first *WiFi.begin* regardless of the result.
The captive portal will not be started if the connection has been established with first *WiFi.begin*. If the connection cannot establish, switch to WIFI_AP_STA mode and activate SoftAP. Then DNS server starts.
<dl class="apidl">
@ -89,7 +97,7 @@ Set SoftAP's WiFi configuration and static IP configuration.
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">config</span>Reference to [**AutoConnectConfig**](api.md#autoconnectconfig) containing SoftAP's parameters and static IP parameters.</dd>
<dd><span class="apidef">ap</span>SSID for SoftAP. The default value is **esp8266ap**.</dd>
<dd><span class="apidef">ap</span>SSID for SoftAP. The default value is **esp8266ap** for ESP8266, **esp32ap** for ESP32.</dd>
<dd><span class="apidef">password</span>Password for SodtAP. The default value is **12345678**.</dd>
<dt>**Return value**</dt>
<dd><span class="apidef">true</span>Successfully configured.</dd>
@ -102,10 +110,10 @@ Set SoftAP's WiFi configuration and static IP configuration.
void end()
```
Stops AutoConnect captive portal service. Release ESP8266WebServer and DNSServer.
Stops AutoConnect captive portal service. Release ESP8266WebServer/WebServer and DNSServer.
!!! warning "Attention to end"
The end function releases the instance of ESP8266WebServer and DNSServer. It can not process them after the end function.
The end function releases the instance of ESP8266WebServer/WebServer and DNSServer. It can not process them after the end function.
#### handleClient
@ -113,7 +121,7 @@ Stops AutoConnect captive portal service. Release ESP8266WebServer and DNSServer
void handleClient()
```
Process the AutoConnect menu interface. It will be processed the client request too contained in the user sketch handler by calling from inside of AutoConnect to the hosted *ESP8266WebServer::handleClient*.
Process the AutoConnect menu interface. The handleClient() function of the ESP8266WebServer/WebServer hosted by AutoConnect is also called from within AutoConnect and client requests contained in the user sketch handler are also handled.
#### handleRequest
@ -124,7 +132,7 @@ void handleRequest()
Handling for the AutoConnect menu request.
!!! warning "About used in combination with handleClient"
The handleRequest function is not supposed to use with AutoConnect::handleClient. It should be used with ESP8266::handleClient.
The handleRequest function is not supposed to use with AutoConnect::handleClient. It should be used with ESP8266WebServer::handleClient or WebServer::handleClient.
#### home
@ -140,14 +148,22 @@ Put a user site's home URI. The URI specified by home is linked from "HOME" in t
#### host
Returns the reference of the ESP8266WebServer which is allocated in AutoConnect automatically.
Returns the reference of the ESP8266WebServer/WebServer which is allocated in AutoConnect automatically.
- For ESP8266
```cpp
ESP8266WebServer& host()
```
- For ESP32
```cpp
WebServer& host()
```
<dl class="apidl">
<dt>**Return value**</dt>
<dd>A reference of the ESP8266WebServer.</dd>
<dd>A reference of the ESP8266WebServer/WebServer.</dd>
</dl>
!!! note "&reference is not a pointer"
@ -188,9 +204,17 @@ typedef std::function<bool(IPAddress softapIP)> DetectExit_ft
#### onNotFound
- For ESP8266
```cpp
void onNotFound(ESP8266WebServer::THandlerFunction fn)
```
- For ESP32
```cpp
void onNotFound(WebServer::THandlerFunction fn)
```
Register the handler function for undefined URL request detected.
<dl class="apidl">
<dt>**Parameters**</dt>
@ -211,7 +235,7 @@ AutoConnectConfig(const char* ap, const char* password);
```
<dl class="apidl">
<dt>**Parameters**</dt>
<dd><span class="apidef">ap</span>SSID for SoftAP. The length should be up to 31. The default value is **esp8266ap**.</dd>
<dd><span class="apidef">ap</span>SSID for SoftAP. The length should be up to 31. The default value is **esp8266ap** for ESP8266, **esp32ap** for ESP32.</dd>
<dd><span class="apidef">password</span>Password for SodtAP. The length should be from 8 to up to 63. The default value is **12345678**.</dd>
</dl>
@ -234,7 +258,7 @@ Sets IP address for Soft AP in captive portal. When AutoConnect fails the initia
#### autoReconnect
Automatically reconnect to past established access point (BSSID) when the current configured SSID in ESP8266 could not be connected. By enabling this option, *AutoConnect::begin()* function will attempt to reconnect to a known access point using credentials stored in the EEPROM, even if the connection failed by current SSID.
Automatically will try to reconnect with the past established access point (BSSID) when the current configured SSID in ESP8266/ESP32 could not be connected. By enabling this option, *AutoConnect::begin()* function will attempt to reconnect to a known access point using credentials stored in the EEPROM, even if the connection failed by current SSID.
If the connection fails, starts the captive portal in SoftAP + STA mode.
<dl class="apidl">
<dt>**Type**</dt>

@ -1,3 +1,8 @@
#### [0.9.5] Aug.27, 2018.
- Supports ESP32.
- Fixed that crash may occur if the number of stored credentials in the EEPROM is smaller than the number of found WiFi networks.
#### [0.9.4] May 5, 2018.
- Automatically focus passphrase after selecting SSID with Configure New AP.

Loading…
Cancel
Save