Revised the explanation.

pull/8/head
Hieromon Ikasamo 7 years ago
parent 96e03434c2
commit fe81b8d17d
  1. 8
      docs/advancedusage/index.html
  2. 15
      docs/api/index.html
  3. 36
      docs/basicusage/index.html
  4. 27
      docs/faq/index.html
  5. 2
      docs/gettingstarted/index.html
  6. 6
      docs/index.html
  7. 25
      docs/menu/index.html
  8. 82
      docs/search/search_index.json
  9. 8
      mkdocs/advancedusage.md
  10. 16
      mkdocs/api.md
  11. 26
      mkdocs/basicusage.md
  12. 12
      mkdocs/faq.md
  13. 2
      mkdocs/gettingstarted.md
  14. 6
      mkdocs/index.md
  15. 25
      mkdocs/menu.md

@ -730,7 +730,7 @@
</pre></div> </pre></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> <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> funciton 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> <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> <div class="codehilite"><pre><span></span><span class="n">AutoConnect</span> <span class="n">Portal</span><span class="p">;</span>
<span class="hll"><span class="kr">bool</span> <span class="nf">startCP</span><span class="p">(</span><span class="nf">IPAddress</span> <span class="n">ip</span><span class="p">)</span> <span class="p">{</span> <span class="hll"><span class="kr">bool</span> <span class="nf">startCP</span><span class="p">(</span><span class="nf">IPAddress</span> <span class="n">ip</span><span class="p">)</span> <span class="p">{</span>
@ -791,7 +791,7 @@
</pre></div> </pre></div>
<h3 id="move-the-saving-area-of-eeprom-for-the-credentials"><i class="fa fa-caret-right"></i> Move the saving area of EEPROM for the credentials<a class="headerlink" href="#move-the-saving-area-of-eeprom-for-the-credentials" title="Permanent link">&para;</a></h3> <h3 id="move-the-saving-area-of-eeprom-for-the-credentials"><i class="fa fa-caret-right"></i> Move the saving area of EEPROM for the credentials<a class="headerlink" href="#move-the-saving-area-of-eeprom-for-the-credentials" title="Permanent link">&para;</a></h3>
<p>By default, the credentials saving area is occupied from the beginning of EEPROM. <a href="http://arduino-esp8266.readthedocs.io/en/latest/filesystem.html?highlight=eeprom#flash-layout">ESP8266 Arduino core document</a> says that:</p> <p>By default, the credentials saving area is occupied from the beginning of EEPROM area. <a href="http://arduino-esp8266.readthedocs.io/en/latest/filesystem.html?highlight=eeprom#flash-layout">ESP8266 Arduino core document</a> says that:</p>
<blockquote> <blockquote>
<p>The following diagram illustrates flash layout used in Arduino environment:</p> <p>The following diagram illustrates flash layout used in Arduino environment:</p>
</blockquote> </blockquote>
@ -807,7 +807,7 @@
<blockquote> <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> <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> </blockquote>
<p>So in the default state, the credential storage area used by AutoConnect conflicts with data area 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>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> <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> <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> <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>
@ -896,7 +896,7 @@
<p>"<strong>HOME</strong>" for returning to the user's sketch homepage is displayed at the bottom of the AutoConnect menu. It could be set using the <a href="../api/index.html#home"><em>AutoConnect::home</em></a> function.</p> <p>"<strong>HOME</strong>" for returning to the user's sketch homepage is displayed at the bottom of the AutoConnect menu. It could be set using the <a href="../api/index.html#home"><em>AutoConnect::home</em></a> function.</p>
<p><img src="../images/menu_home.png" /></p> <p><img src="../images/menu_home.png" /></p>
<h3 id="relocate-the-autoconnect-home-path"><i class="fa fa-caret-right"></i> Relocate the AutoConnect home path<a class="headerlink" href="#relocate-the-autoconnect-home-path" title="Permanent link">&para;</a></h3> <h3 id="relocate-the-autoconnect-home-path"><i class="fa fa-caret-right"></i> Relocate the AutoConnect home path<a class="headerlink" href="#relocate-the-autoconnect-home-path" title="Permanent link">&para;</a></h3>
<p>A home path of AutoConnect is <strong>_ac</strong> by default. You can access from the browser with http://IPADDRESS/_ac. You can change the home path by revising <a href="https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnect.h#L58"><strong>AUTOCONNECT_URI</strong></a> macro in the include header file as <a href="https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnect.h">AutoConnect.h</a>.</p> <p>A home path of AutoConnect is <strong>/_ac</strong> by default. You can access from the browser with http://IPADDRESS/_ac. You can change the home path by revising <a href="https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnect.h#L58"><strong>AUTOCONNECT_URI</strong></a> macro in the include header file as <a href="https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnect.h">AutoConnect.h</a>.</p>
<div class="codehilite"><pre><span></span><span class="cp">#define AUTOCONNECT_URI &quot;/_ac&quot;</span> <div class="codehilite"><pre><span></span><span class="cp">#define AUTOCONNECT_URI &quot;/_ac&quot;</span>
</pre></div> </pre></div>

@ -1076,6 +1076,7 @@
<div class="codehilite"><pre><span></span><span class="n">AutoConnect</span><span class="p">()</span> <div class="codehilite"><pre><span></span><span class="n">AutoConnect</span><span class="p">()</span>
</pre></div> </pre></div>
<p><a id="withparameter"></a></p>
<p>AutoConnect default constructor. This entry activates WebServer internally and the web server is allocated internal.</p> <p>AutoConnect default constructor. This entry activates WebServer internally and the web server is allocated internal.</p>
<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> <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> </pre></div>
@ -1177,7 +1178,7 @@ Register the function which will call from AutoConnect at the start of the capti
<dd><span class="apidef">fn</span>Function called at the captive portal start.</dd></p> <dd><span class="apidef">fn</span>Function called at the captive portal start.</dd></p>
</dl> </dl>
<p>An <em>fn</em> specifies the function called when the captive portal starts. Its prototype declaration is defined as "<em>DetectFunc_ft</em>".</p> <p>An <em>fn</em> specifies the function called when the captive portal starts. Its prototype declaration is defined as "<em>DetectExit_ft</em>".</p>
<p><div class="codehilite"><pre><span></span><span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">bool</span><span class="p">(</span><span class="n">IPAddress</span> <span class="n">softapIP</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">DetectExit_ft</span> <p><div class="codehilite"><pre><span></span><span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">bool</span><span class="p">(</span><span class="n">IPAddress</span> <span class="n">softapIP</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">DetectExit_ft</span>
</pre></div> </pre></div>
<dl class="apidl"> <dl class="apidl">
@ -1218,10 +1219,10 @@ Register the handler function for undefined URL request detected.
<p>Sets IP address for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this. <p>Sets IP address for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this.
<dl class="apidl"> <dl class="apidl">
<dt><strong>Type</strong></dt> <dt><strong>Type</strong></dt>
<dd>IPAddress</dd> <dd><span class="apidef" style="width:230px;">IPAddress</span>The default value is <strong>192.168.244.1</strong></dd>
</dl></p> </dl></p>
<h4 id="autoreset">autoReset<a class="headerlink" href="#autoreset" title="Permanent link">&para;</a></h4> <h4 id="autoreset">autoReset<a class="headerlink" href="#autoreset" title="Permanent link">&para;</a></h4>
<p>Reset ESP8266 module automatically when WLAN disconnected. <p>Reset ESP8266 module automatically after WLAN disconnected.
<dl class="apidl"> <dl class="apidl">
<dt><strong>Type</strong></dt> <dt><strong>Type</strong></dt>
<dd>bool</dd> <dd>bool</dd>
@ -1244,7 +1245,7 @@ Register the handler function for undefined URL request detected.
<dt><strong>Type</strong></dt> <dt><strong>Type</strong></dt>
<dd>AC_SAVECREDENTIAL_t</dd> <dd>AC_SAVECREDENTIAL_t</dd>
<dt><strong>Value</strong></dt> <dt><strong>Value</strong></dt>
<dd><span class="apidef" style="width:230px;">AC_SAVECREDENTIAL_AUTO</span>The credential saved automatically.</dd> <dd><span class="apidef" style="width:230px;">AC_SAVECREDENTIAL_AUTO</span>The credential saved automatically. This is the default.</dd>
<dd><span class="apidef" style="width:230px;">AC_SAVECREDENTIAL_NEVER</span>The credential no saved.</dd> <dd><span class="apidef" style="width:230px;">AC_SAVECREDENTIAL_NEVER</span>The credential no saved.</dd>
</dl></p> </dl></p>
<h4 id="boundaryoffset">boundaryOffset<a class="headerlink" href="#boundaryoffset" title="Permanent link">&para;</a></h4> <h4 id="boundaryoffset">boundaryOffset<a class="headerlink" href="#boundaryoffset" title="Permanent link">&para;</a></h4>
@ -1267,14 +1268,14 @@ The default value is 0.
<dd>1 ~ 14. The default value is 1.</dd> <dd>1 ~ 14. The default value is 1.</dd>
</dl></p> </dl></p>
<div class="admonition info"> <div class="admonition info">
<p class="admonition-title">See Application note</p> <p class="admonition-title">How do I choose Channel</p>
<p>Espressif Systems had announced the <a href="https://www.espressif.com/sites/default/files/esp8266_wi-fi_channel_selection_guidelines.pdf">application note</a> about Wi-Fi channel selection.</p> <p>Espressif Systems had announced the <a href="https://www.espressif.com/sites/default/files/esp8266_wi-fi_channel_selection_guidelines.pdf">application note</a> about Wi-Fi channel selection.</p>
</div> </div>
<h4 id="gateway">gateway<a class="headerlink" href="#gateway" title="Permanent link">&para;</a></h4> <h4 id="gateway">gateway<a class="headerlink" href="#gateway" title="Permanent link">&para;</a></h4>
<p>Sets gateway address for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this. <p>Sets gateway address for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this.
<dl class="apidl"> <dl class="apidl">
<dt><strong>Type</strong></dt> <dt><strong>Type</strong></dt>
<dd>IPAddress</dd> <dd><span class="apidef" style="width:230px;">IPAddress</span>The default value is <strong>192.168.244.1</strong></dd>
</dl></p> </dl></p>
<h4 id="hidden">hidden<a class="headerlink" href="#hidden" title="Permanent link">&para;</a></h4> <h4 id="hidden">hidden<a class="headerlink" href="#hidden" title="Permanent link">&para;</a></h4>
<p>Sets SoftAP to hidden SSID. <p>Sets SoftAP to hidden SSID.
@ -1295,7 +1296,7 @@ The default value is 0.
<p>Sets subnet mask for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this. <p>Sets subnet mask for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this.
<dl class="apidl"> <dl class="apidl">
<dt><strong>Type</strong></dt> <dt><strong>Type</strong></dt>
<dd>IPAddress</dd> <dd><span class="apidef" style="width:230px;">IPAddress</span>The default value is <strong>255.255.255.0</strong></dd>
</dl></p> </dl></p>
<h4 id="psk">psk<a class="headerlink" href="#psk" title="Permanent link">&para;</a></h4> <h4 id="psk">psk<a class="headerlink" href="#psk" title="Permanent link">&para;</a></h4>
<p>Sets password for SoftAP. The length should be from 8 to up to 63. The default value is <strong>12345678</strong>. <p>Sets password for SoftAP. The length should be from 8 to up to 63. The default value is <strong>12345678</strong>.

@ -708,13 +708,13 @@
<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> and <code class="codehilite">AutoConnect.h</code> </li>
<li><strong>Declare ESP8266WebServer variable.</strong> </li> <li><strong>Declare ESP8266WebServer variable.</strong> </li>
<li><strong>Declare AutoConnect variable.</strong> </li> <li><strong>Declare AutoConnect variable.</strong> </li>
<li><strong>Implements the URL handler <em>function()</em>.</strong> </li> <li><strong>Implements the URL handler with the <em>function()</em>.</strong> </li>
<li><strong>setup()</strong><br /> <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 by</strong><code class="codehilite">ESP8266WebServer::on</code><strong>.</strong><br />
5.2 <strong>Starts </strong><code class="codehilite">AutoConnect::begin()</code><strong>.</strong><br /> 5.2 <strong>Starts </strong><code class="codehilite">AutoConnect::begin()</code><strong>.</strong><br />
5.3 <strong>Check connection status.</strong> </li> 5.3 <strong>Check WiFi connection status.</strong> </li>
<li><strong>loop()</strong><br /> <li><strong>loop()</strong><br />
6.1 <strong>Invokes </strong><code class="codehilite">AutoConnect::handleClient()</code><strong>,<br>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> then </strong><code class="codehilite">AutoConnect::handleRequest()</code><strong>.</strong><br />
6.2 <strong>Do the process for actual sketch.</strong> </li> 6.2 <strong>Do the process for actual sketch.</strong> </li>
</ol> </ol>
</div> </div>
@ -728,46 +728,46 @@ or</p>
<ul> <ul>
<li> <li>
<p><strong>Parameter with ESP8266WebServer variable:</strong> An ESP8266WebServer object variable must be declared in the sketch. AutoConnect uses its variable for handling the <a href="../menu/index.html">AutoConnect menu</a>.</p> <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>
</li> </li>
<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 and 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 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>
</li> </li>
</ul> </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> <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 performs <em>WiFi.begin</em> for establishing a connection with WLAN internally. There is no need for a general process to establish a connection with <em>WiFi.begin</em> in a sketch.</p> <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> <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> internally executes <em>ESP8266WebServer::begin</em> too and it starts DNS server to behave as a captive portal. So the sketch does not need to call <em>ESP8266WebServer::begin</em>.</p> <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>
<div class="admonition info"> <div class="admonition info">
<p class="admonition-title">Why DNS Server Starts</p> <p class="admonition-title">Why DNS Server starts</p>
<p>AutoConnect traps the detection of captive portals and directs them to the AutoConnect menu to achieve a connection with the WLAN interactively. In order to trap, it temporarily responds SoftAP address to all DNS queries. When the connection with the WLAN is successfully established, the DNS server will stop.</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> </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> <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> <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> <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> <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> <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 behavior is different. Using the AutoConnect embedded along with ESP8266WebServer::handleClient has limitations. Refer to the below section for details. </p> <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> <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>The interoperable process with an ESP8266WebServer depends on the parameters of the <a href="../api/index.html#constructors">AutoConnect constructor</a>.</p>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Declaration parameter</th> <th>Declaration parameter for the constructor</th>
<th>Use ESP8266WebServer::handleClient</th> <th>Use ESP8266WebServer::handleClient only</th>
<th>Use AutoConnect::handleClient</th> <th>Use AutoConnect::handleClient</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>None</td> <td><a href="../api/index.html#constructors">None</a></td>
<td>AutoConnect menu not available.<br>host() is needed.</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 available.<br>host() is needed.</td> <td>AutoConnect menu available.<br>To use ESP8266WebServer natively, need <a href="../api/index.html#host">AutoConnect::host()</a>.</td>
</tr> </tr>
<tr> <tr>
<td>Reference to ESP8266WebServer</td> <td><a href="../api/index.html#withparameter">Reference to ESP8266WebServer</a></td>
<td>AutoConnect menu not available.<br>host() not necessary.</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.<br>host() not necessary.</td> <td>AutoConnect menu available.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

@ -441,8 +441,8 @@
</li> </li>
<li class="md-nav__item"> <li class="md-nav__item">
<a href="#does-not-response-from-95ac" title=" Does not response from _ac." class="md-nav__link"> <a href="#does-not-response-from-95ac" title=" Does not response from /_ac." class="md-nav__link">
Does not response from _ac. Does not response from /_ac.
</a> </a>
</li> </li>
@ -517,8 +517,8 @@
</li> </li>
<li class="md-nav__item"> <li class="md-nav__item">
<a href="#how-much-memory-consumption-is-autoconnect" title=" How much memory consumption is AutoConnect?" class="md-nav__link"> <a href="#how-much-memory-does-autoconnect-consume" title=" How much memory does AutoConnect consume?" class="md-nav__link">
How much memory consumption is AutoConnect? How much memory does AutoConnect consume?
</a> </a>
<nav class="md-nav"> <nav class="md-nav">
@ -613,8 +613,8 @@
</li> </li>
<li class="md-nav__item"> <li class="md-nav__item">
<a href="#does-not-response-from-95ac" title=" Does not response from _ac." class="md-nav__link"> <a href="#does-not-response-from-95ac" title=" Does not response from /_ac." class="md-nav__link">
Does not response from _ac. Does not response from /_ac.
</a> </a>
</li> </li>
@ -689,8 +689,8 @@
</li> </li>
<li class="md-nav__item"> <li class="md-nav__item">
<a href="#how-much-memory-consumption-is-autoconnect" title=" How much memory consumption is AutoConnect?" class="md-nav__link"> <a href="#how-much-memory-does-autoconnect-consume" title=" How much memory does AutoConnect consume?" class="md-nav__link">
How much memory consumption is AutoConnect? How much memory does AutoConnect consume?
</a> </a>
<nav class="md-nav"> <nav class="md-nav">
@ -744,10 +744,11 @@
<h2 id="after-connected-autoconnect-menu-performs-but-no-happens"><i class="fa fa-question-circle"></i> After connected, AutoConnect menu performs but no happens.<a class="headerlink" href="#after-connected-autoconnect-menu-performs-but-no-happens" title="Permanent link">&para;</a></h2> <h2 id="after-connected-autoconnect-menu-performs-but-no-happens"><i class="fa fa-question-circle"></i> After connected, AutoConnect menu performs but no happens.<a class="headerlink" href="#after-connected-autoconnect-menu-performs-but-no-happens" title="Permanent link">&para;</a></h2>
<p>If you can access the <strong>AutoConnect root path</strong> as http://ESP8266IPADDRESS/_ac from browser, probably the sketch uses <em>ESP8266WebServer::handleClient()</em> without <a href="../api/index.html#handlerequest"><em>AutoConnect::handleRequest()</em></a>.<br /> <p>If you can access the <strong>AutoConnect root path</strong> as http://ESP8266IPADDRESS/_ac from browser, probably the sketch uses <em>ESP8266WebServer::handleClient()</em> without <a href="../api/index.html#handlerequest"><em>AutoConnect::handleRequest()</em></a>.<br />
For AutoConnect menus to work properly, call <a href="../api/index.html#handlerequest"><em>AutoConnect::handleRequest()</em></a> after <em>ESP8266WebServer::handleClient()</em> invoked, or use <a href="../api/index.html#handleclient"><em>AutoConnect::handleClient()</em></a>. <a href="../api/index.html#handleclient"><em>AutoConnect::handleClient()</em></a> is equivalent <em>ESP8266WebServer::handleClient</em> combinated <a href="../api/index.html#handlerequest"><em>AutoConnect::handleRequest()</em></a>.</p> For AutoConnect menus to work properly, call <a href="../api/index.html#handlerequest"><em>AutoConnect::handleRequest()</em></a> after <em>ESP8266WebServer::handleClient()</em> invoked, or use <a href="../api/index.html#handleclient"><em>AutoConnect::handleClient()</em></a>. <a href="../api/index.html#handleclient"><em>AutoConnect::handleClient()</em></a> is equivalent <em>ESP8266WebServer::handleClient</em> combinated <a href="../api/index.html#handlerequest"><em>AutoConnect::handleRequest()</em></a>.</p>
<p>See also the explanation <a href="../basicusage/index.html#esp8266webserver-hosted-or-parasitic">here</a>.</p>
<h2 id="an-esp8266ap-as-softap-was-connected-but-captive-portal-does-not-start"><i class="fa fa-question-circle"></i> An esp8266ap as SoftAP was connected but Captive portal does not start.<a class="headerlink" href="#an-esp8266ap-as-softap-was-connected-but-captive-portal-does-not-start" title="Permanent link">&para;</a></h2> <h2 id="an-esp8266ap-as-softap-was-connected-but-captive-portal-does-not-start"><i class="fa fa-question-circle"></i> An esp8266ap as SoftAP was connected but Captive portal does not start.<a class="headerlink" href="#an-esp8266ap-as-softap-was-connected-but-captive-portal-does-not-start" title="Permanent link">&para;</a></h2>
<p>Captive portal detection could not be trapped. It is necessary to disconnect and reset ESP8266 to clear memorized connection data in ESP8266. Also, It may be displayed on the smartphone if the connection information of esp8266ap is wrong. In that case, delete the connection information of esp8266ap memorized by the smartphone once.</p> <p>Captive portal detection could not be trapped. It is necessary to disconnect and reset ESP8266 to clear memorized connection data in ESP8266. Also, It may be displayed on the smartphone if the connection information of esp8266ap is wrong. In that case, delete the connection information of esp8266ap memorized by the smartphone once.</p>
<h2 id="does-not-appear-esp8266ap-in-smartphone"><i class="fa fa-question-circle"></i> Does not appear esp8266ap in smartphone.<a class="headerlink" href="#does-not-appear-esp8266ap-in-smartphone" title="Permanent link">&para;</a></h2> <h2 id="does-not-appear-esp8266ap-in-smartphone"><i class="fa fa-question-circle"></i> Does not appear esp8266ap in smartphone.<a class="headerlink" href="#does-not-appear-esp8266ap-in-smartphone" title="Permanent link">&para;</a></h2>
<p>Maybe it is successfully connected at the <strong>first WiFi.begin</strong>. ESP8266 remembers the SSID successfully connected and will use at the next. It means SoftAP will only start up when the first <em>WiFi.begin()</em> fails.</p> <p>Maybe it is successfully connected at the <strong>first WiFi.begin</strong>. ESP8266 remembers the last SSID successfully connected and will use at the next. It means SoftAP will only start up when the first <em>WiFi.begin()</em> fails.</p>
<p>The saved SSID would be cleared by <em>WiFi.disconnect()</em> with WIFI_STA mode. If you do not want automatic reconnection, you can erase the memorized SSID with the following simple sketch.</p> <p>The saved SSID would be cleared by <em>WiFi.disconnect()</em> with WIFI_STA mode. If you do not want automatic reconnection, you can erase the memorized SSID with the following simple sketch.</p>
<div class="codehilite"><pre><span></span><span class="cp">#include</span> <span class="cpf">&lt;ESP8266WiFi.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;</span><span class="cp"></span>
@ -770,10 +771,10 @@ For AutoConnect menus to work properly, call <a href="../api/index.html#handlere
<span class="p">}</span> <span class="p">}</span>
</pre></div> </pre></div>
<details class="hint"><summary>You can interactively check the WiFi state of ESP8266.</summary><p>Please try <a href="https://github.com/Hieromon/ESPShaker"><strong>ESPShaker</strong></a>. It is ESP8266 interactive serial command processor.</p><p><img src="../images/espshaker.gif" /></p></details><h2 id="does-not-response-from-95ac"><i class="fa fa-question-circle"></i> Does not response from _ac.<a class="headerlink" href="#does-not-response-from-95ac" title="Permanent link">&para;</a></h2> <details class="hint"><summary>You can interactively check the WiFi state of ESP8266.</summary><p>Please try <a href="https://github.com/Hieromon/ESPShaker"><strong>ESPShaker</strong></a>. It is ESP8266 interactive serial command processor.</p><p><img src="../images/espshaker.gif" /></p></details><h2 id="does-not-response-from-95ac"><i class="fa fa-question-circle"></i> Does not response from /_ac.<a class="headerlink" href="#does-not-response-from-95ac" title="Permanent link">&para;</a></h2>
<p>Probably <strong>WiFi.begin</strong> failed with the specified SSID. Activating the <a href="../advancedusage/index.html#debug-print">debug printing</a> will help you to track down the cause.</p> <p>Probably <strong>WiFi.begin</strong> failed with the specified SSID. Activating the <a href="../advancedusage/index.html#debug-print">debug printing</a> will help you to track down the cause.</p>
<h2 id="how-change-esp8266ap-for-ssid-name-in-captive-portal"><i class="fa fa-question-circle"></i> How change esp8266ap for SSID name in Captive portal?<a class="headerlink" href="#how-change-esp8266ap-for-ssid-name-in-captive-portal" title="Permanent link">&para;</a></h2> <h2 id="how-change-esp8266ap-for-ssid-name-in-captive-portal"><i class="fa fa-question-circle"></i> How change esp8266ap for SSID name in Captive portal?<a class="headerlink" href="#how-change-esp8266ap-for-ssid-name-in-captive-portal" title="Permanent link">&para;</a></h2>
<p>An <strong>esp8266</strong> is default SSID name for SoftAP of captive portal and password is <strong>12345678</strong>. You can change both by using <a href="../api/index.html#autoconnectconfig-api">AutoConnectConfig</a>.</p> <p>An <strong>esp8266ap</strong> is default SSID name for SoftAP of captive portal and password is <strong>12345678</strong>. You can change both by using <a href="../api/index.html#autoconnectconfig-api">AutoConnectConfig</a>.</p>
<h2 id="how-change-http-port"><i class="fa fa-question-circle"></i> How change HTTP port?<a class="headerlink" href="#how-change-http-port" title="Permanent link">&para;</a></h2> <h2 id="how-change-http-port"><i class="fa fa-question-circle"></i> How change HTTP port?<a class="headerlink" href="#how-change-http-port" title="Permanent link">&para;</a></h2>
<p>HTTP port number is defined as a macro in <a href="https://github.com/Hieromon/AutoConnect/blob/77d5cb5dc6d50651fd15f74b47859105c71fc317/src/AutoConnect.h#L89">AutoConnect.h</a> header file. You can change it directly with several editors and must re-compile.</p> <p>HTTP port number is defined as a macro in <a href="https://github.com/Hieromon/AutoConnect/blob/77d5cb5dc6d50651fd15f74b47859105c71fc317/src/AutoConnect.h#L89">AutoConnect.h</a> header file. You can change it directly with several editors and must re-compile.</p>
<div class="codehilite"><pre><span></span><span class="cp">#define AUTOCONNECT_HTTPPORT 80</span> <div class="codehilite"><pre><span></span><span class="cp">#define AUTOCONNECT_HTTPPORT 80</span>
@ -909,9 +910,9 @@ wdt reset
<div class="codehilite"><pre><span></span><span class="p">&lt;</span><span class="nt">a</span> <span class="na">style</span><span class="o">=</span><span class="s">&quot;background-color:SteelBlue; display:inline-block; padding:7px 13px; text-decoration:none;&quot;</span> <span class="na">href</span><span class="o">=</span><span class="s">&quot;/_ac&quot;</span><span class="p">&gt;</span>MENU<span class="p">&lt;/</span><span class="nt">a</span><span class="p">&gt;</span> <div class="codehilite"><pre><span></span><span class="p">&lt;</span><span class="nt">a</span> <span class="na">style</span><span class="o">=</span><span class="s">&quot;background-color:SteelBlue; display:inline-block; padding:7px 13px; text-decoration:none;&quot;</span> <span class="na">href</span><span class="o">=</span><span class="s">&quot;/_ac&quot;</span><span class="p">&gt;</span>MENU<span class="p">&lt;/</span><span class="nt">a</span><span class="p">&gt;</span>
</pre></div> </pre></div>
<h2 id="how-much-memory-consumption-is-autoconnect"><i class="fa fa-question-circle"></i> How much memory consumption is AutoConnect?<a class="headerlink" href="#how-much-memory-consumption-is-autoconnect" title="Permanent link">&para;</a></h2> <h2 id="how-much-memory-does-autoconnect-consume"><i class="fa fa-question-circle"></i> How much memory does AutoConnect consume?<a class="headerlink" href="#how-much-memory-does-autoconnect-consume" title="Permanent link">&para;</a></h2>
<h3 id="sketch-size">Sketch size<a class="headerlink" href="#sketch-size" title="Permanent link">&para;</a></h3> <h3 id="sketch-size">Sketch size<a class="headerlink" href="#sketch-size" title="Permanent link">&para;</a></h3>
<p>It increases about 53K bytes compared to the case without AutoConnect. A sketch size of the most simple example introduced at the Getting started is about 330K bytes. (270K byte without AutoConnect)</p> <p>It increases about 53K bytes compared to the case without AutoConnect. A sketch size of the most simple example introduced in the Getting started is about 330K bytes. (270K byte without AutoConnect)</p>
<h3 id="heap-size">Heap size<a class="headerlink" href="#heap-size" title="Permanent link">&para;</a></h3> <h3 id="heap-size">Heap size<a class="headerlink" href="#heap-size" title="Permanent link">&para;</a></h3>
<p>It consumes about 2K bytes in the static and about 12K bytes are consumed at the moment when menu executed.</p> <p>It consumes about 2K bytes in the static and about 12K bytes are consumed at the moment when menu executed.</p>
<h2 id="i-cannot-complete-to-wi-fi-login-from-smartphone"><i class="fa fa-question-circle"></i> I cannot complete to Wi-Fi login from smartphone.<a class="headerlink" href="#i-cannot-complete-to-wi-fi-login-from-smartphone" title="Permanent link">&para;</a></h2> <h2 id="i-cannot-complete-to-wi-fi-login-from-smartphone"><i class="fa fa-question-circle"></i> I cannot complete to Wi-Fi login from smartphone.<a class="headerlink" href="#i-cannot-complete-to-wi-fi-login-from-smartphone" title="Permanent link">&para;</a></h2>

@ -604,7 +604,7 @@
Or, "<strong>RESET</strong>" can be selected. The ESP8266 resets and reboots. After that, immediately before the connection will be restored automatically with WIFI_STA mode.</p> Or, "<strong>RESET</strong>" can be selected. The ESP8266 resets and reboots. After that, immediately before the connection will be restored automatically with WIFI_STA mode.</p>
<p><img src="../images/established.png" style="border:1px solid lightgrey;width:280px;" /><img src="../images/arrow_right.svg" style="vertical-align:top;padding-top:120px;width:48px;margin-left:30px;margin-right:30px;" /><img src="../images/reset.png" style="border:1px solid lightgrey;width:280px;" /></p> <p><img src="../images/established.png" style="border:1px solid lightgrey;width:280px;" /><img src="../images/arrow_right.svg" style="vertical-align:top;padding-top:120px;width:48px;margin-left:30px;margin-right:30px;" /><img src="../images/reset.png" style="border:1px solid lightgrey;width:280px;" /></p>
<h3 id="run-for-usually"><i class="fa fa-play-circle"></i> Run for usually<a class="headerlink" href="#run-for-usually" title="Permanent link">&para;</a></h3> <h3 id="run-for-usually"><i class="fa fa-play-circle"></i> Run for usually<a class="headerlink" href="#run-for-usually" title="Permanent link">&para;</a></h3>
<p>The IP address of ESP8266 would be displayed on the serial monitor after connection recovered. Please access its address from the browser. The "Hello, world" page will respond. It's the page that was handled by in the sketch with "<strong>on</strong>" function of <em>ESP8266WebServer</em>.</p> <p>The IP address of ESP8266 would be displayed on the serial monitor after connection restored. Please access its address from the browser. The "Hello, world" page will respond. It's the page that was handled by in the sketch with "<strong>on</strong>" function of <em>ESP8266WebServer</em>.</p>
<p><img src="../images/serial.png" style="vertical-align:top;" /><img src="../images/arrow_right.svg" style="vertical-align:top;padding-top:60px;width:48px;margin-left:45px;margin-right:30px;" /><img src="../images/hello_world.png" style="border:1px solid lightgrey;width:280px;" /></p> <p><img src="../images/serial.png" style="vertical-align:top;" /><img src="../images/arrow_right.svg" style="vertical-align:top;padding-top:60px;width:48px;margin-left:45px;margin-right:30px;" /><img src="../images/hello_world.png" style="border:1px solid lightgrey;width:280px;" /></p>
<script> <script>
window.onload = function() { window.onload = function() {

@ -677,7 +677,7 @@
<p>An Arduino library for ESP8266 WLAN configuration at run time with web interface.</p> <p>An Arduino library for ESP8266 WLAN configuration at run time with web interface.</p>
<h2 id="overview">Overview<a class="headerlink" href="#overview" title="Permanent link">&para;</a></h2> <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. <p>To the dynamic configuration for joining to WLAN with SSID and PSK accordingly. It an Arduino library united with <em>ESP8266WebServer</em> class.
Easily 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> 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><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> <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> <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 and WLAN. You can input SSID &amp; Password from a smartphone via the web interface at runtime.</span></p>
@ -686,7 +686,7 @@ Easily implementing the Web interface constituting the WLAN for ESP8266 WiFi con
<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> <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 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> <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 embedded easily into your sketch, just "<strong>begin</strong>" and "<strong>handleClient</strong>".</span></p> <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> <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.</span></p>
<h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link">&para;</a></h2> <h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link">&para;</a></h2>
@ -715,7 +715,7 @@ Easily implementing the Web interface constituting the WLAN for ESP8266 WiFi con
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> 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>Additional necessary library</strong></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 /> <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>' in 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 or 1.0.0 later is required.</p>
<p><img src="./images/lm.png" width="640"/></p> <p><img src="./images/lm.png" width="640"/></p>
<h3 id="install-the-autoconnect">Install the AutoConnect<a class="headerlink" href="#install-the-autoconnect" title="Permanent link">&para;</a></h3> <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>Clone or download from the <a href="https://github.com/Hieromon/AutoConnect">AutoConnect GitHub repository</a>.</p>

@ -568,35 +568,34 @@
<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> <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> </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> <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 to "<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. (e.g. <code class="codehilite">http://192.168.244.1/_ac</code> for SoftAP mode.)<br /> <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>
To invoke the menu tap <i class="fa fa-bars"></i> at right on top.</p>
<p><img src="../images/ac.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" /></p> <p><img src="../images/ac.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" /></p>
<div class="admonition note"> <div class="admonition note">
<p class="admonition-title">What's local IP?</p> <p class="admonition-title">What's local IP?</p>
<p>A local IP means Local IP at connection established or SoftAP's IP.</p> <p>A local IP means Local IP at connection established or SoftAP's IP.</p>
</div> </div>
<h2 id="right-on-top"><i class="fa fa-bars"></i> Right on top<a class="headerlink" href="#right-on-top" title="Permanent link">&para;</a></h2> <h2 id="right-on-top"><i class="fa fa-bars"></i> Right on top<a class="headerlink" href="#right-on-top" title="Permanent link">&para;</a></h2>
<p>Currently, AutoConnect supports four menus. Undermost menu returns to home path of its sketch.</p> <p>Currently, AutoConnect supports four menus. Undermost menu as "HOME" returns to the home path of its sketch.</p>
<ul> <ul>
<li><strong>Configure new AP</strong> : Configure SSID and Password for new access point.</li> <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>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>Disconnect</strong>: Disconnects current connection.</li>
<li><strong>Reset...</strong> : Rest the ESP8266 module.</li> <li><strong>Reset...</strong>: Rest the ESP8266 module.</li>
<li><strong>HOME</strong> : Return to user home page.</li> <li><strong>HOME</strong>: Return to user home page.</li>
</ul> </ul>
<p><img src="../images/menu.png" style="width:280px;" /></p> <p><img src="../images/menu.png" style="width:280px;" /></p>
<h2 id="configure-new-ap"><i class="fa fa-bars"></i> Configure new AP<a class="headerlink" href="#configure-new-ap" title="Permanent link">&para;</a></h2> <h2 id="configure-new-ap"><i class="fa fa-bars"></i> Configure new AP<a class="headerlink" href="#configure-new-ap" title="Permanent link">&para;</a></h2>
<p>Scan all available access point and display it. Strength and security of the detected AP are marked. The <i class="fa fa-lock"></i> is indicated for the SSID that needs a security key. "<strong>Hidden:</strong>" means the number of hidden SSIDs discovered.<br /> <p>Scan all available access point and display it. Strength and security of the detected AP are marked. The <i class="fa fa-lock"></i> is indicated for the SSID that needs a security key. "<strong>Hidden:</strong>" means the number of hidden SSIDs discovered.<br />
Enter SSID and Passphrase and tap "<strong>apply</strong>" to try connection. </p> 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> <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> <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. To 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 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> <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> <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. After the menu tapped, AutoConnect menu cannot be accessed. Once disconnected, you will need to set the SSID again to connect to the WLAN.</p> <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>It can also reset the ESP8266 automatically after being disconnected from the <a href="../api/index.html#autoreset">API</a> used 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> <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 be rebooted. After rebooting complete, the ESP8266 begins establishing the previous connection by WIFI_STA mode and the <em>esp8266ap</em> as SoftAP disappears from the WLAN.</p> <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><img src="../images/resetting.png" style="width:280px;" /></p> <p><img src="../images/resetting.png" style="width:280px;" /></p>
<div class="admonition warning"> <div class="admonition warning">
<p class="admonition-title">Not every module will be rebooted normally</p> <p class="admonition-title">Not every module will be rebooted normally</p>

File diff suppressed because one or more lines are too long

@ -18,7 +18,7 @@ Portal.begin();
### <i class="fa fa-caret-right"></i> Captive portal start detection ### <i class="fa fa-caret-right"></i> Captive portal start detection
The captive portal will only be activated if the first *WiFi::begin* fails. Sketch can detect with the [*AutoConnect::onDetect*](api.md#ondetect) funciton 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. The captive portal will only be activated if the first *WiFi::begin* fails. Sketch can detect with the [*AutoConnect::onDetect*](api.md#ondetect) 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.
```arduino hl_lines="3 13" ```arduino hl_lines="3 13"
AutoConnect Portal; AutoConnect Portal;
@ -92,7 +92,7 @@ portal.begin();
### <i class="fa fa-caret-right"></i> Move the saving area of EEPROM for the credentials ### <i class="fa fa-caret-right"></i> Move the saving area of EEPROM for the credentials
By default, the credentials saving area is occupied from the beginning of EEPROM. [ESP8266 Arduino core document](http://arduino-esp8266.readthedocs.io/en/latest/filesystem.html?highlight=eeprom#flash-layout) says that: By default, the credentials saving area is occupied from the beginning of EEPROM area. [ESP8266 Arduino core document](http://arduino-esp8266.readthedocs.io/en/latest/filesystem.html?highlight=eeprom#flash-layout) says that:
> The following diagram illustrates flash layout used in Arduino environment: > The following diagram illustrates flash layout used in Arduino environment:
@ -109,7 +109,7 @@ and
> EEPROM library uses one sector of flash located [just after the SPIFFS](http://arduino-esp8266.readthedocs.io/en/latest/libraries.html?highlight=SPIFFS#eeprom). > EEPROM library uses one sector of flash located [just after the SPIFFS](http://arduino-esp8266.readthedocs.io/en/latest/libraries.html?highlight=SPIFFS#eeprom).
So in the default state, the credential storage area used by AutoConnect conflicts with data area 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. 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.
The [**boundaryOffset**](api.md#boundaryoffset) in [**AutoConnectConfig**](api.md#autoconnectconfig-api) specifies the start offset of the credentials storage area. The default value is 0. The [**boundaryOffset**](api.md#boundaryoffset) in [**AutoConnectConfig**](api.md#autoconnectconfig-api) specifies the start offset of the credentials storage area. The default value is 0.
@ -212,7 +212,7 @@ AutoConnect will activate SoftAP at failed initial WiFi.Begin. It SoftAP setting
### <i class="fa fa-caret-right"></i> Relocate the AutoConnect home path ### <i class="fa fa-caret-right"></i> Relocate the AutoConnect home path
A home path of AutoConnect is **\_ac** by default. You can access from the browser with http://IPADDRESS/\_ac. You can change the home path by revising [**AUTOCONNECT_URI**](https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnect.h#L58) macro in the include header file as [AutoConnect.h](https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnect.h). A home path of AutoConnect is **/\_ac** by default. You can access from the browser with http://IPADDRESS/\_ac. You can change the home path by revising [**AUTOCONNECT_URI**](https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnect.h#L58) macro in the include header file as [AutoConnect.h](https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnect.h).
```cpp ```cpp
#define AUTOCONNECT_URI "/_ac" #define AUTOCONNECT_URI "/_ac"

@ -32,6 +32,8 @@
AutoConnect() AutoConnect()
``` ```
<a id="withparameter"></a>
AutoConnect default constructor. This entry activates WebServer internally and the web server is allocated internal. AutoConnect default constructor. This entry activates WebServer internally and the web server is allocated internal.
```cpp ```cpp
@ -166,7 +168,7 @@ Register the function which will call from AutoConnect at the start of the capti
</dl> </dl>
An *fn* specifies the function called when the captive portal starts. Its prototype declaration is defined as "*DetectFunc_ft*". An *fn* specifies the function called when the captive portal starts. Its prototype declaration is defined as "*DetectExit_ft*".
```cpp ```cpp
typedef std::function<bool(IPAddress softapIP)> DetectExit_ft typedef std::function<bool(IPAddress softapIP)> DetectExit_ft
@ -222,12 +224,12 @@ SoftAP's SSID.
Sets IP address for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this. Sets IP address for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd>IPAddress</dd> <dd><span class="apidef" style="width:230px;">IPAddress</span>The default value is **192.168.244.1**</dd>
</dl> </dl>
#### autoReset #### autoReset
Reset ESP8266 module automatically when WLAN disconnected. Reset ESP8266 module automatically after WLAN disconnected.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd>bool</dd> <dd>bool</dd>
@ -254,7 +256,7 @@ The credential saved automatically at the connection establishment.
<dt>**Type**</dt> <dt>**Type**</dt>
<dd>AC_SAVECREDENTIAL_t</dd> <dd>AC_SAVECREDENTIAL_t</dd>
<dt>**Value**</dt> <dt>**Value**</dt>
<dd><span class="apidef" style="width:230px;">AC_SAVECREDENTIAL_AUTO</span>The credential saved automatically.</dd> <dd><span class="apidef" style="width:230px;">AC_SAVECREDENTIAL_AUTO</span>The credential saved automatically. This is the default.</dd>
<dd><span class="apidef" style="width:230px;">AC_SAVECREDENTIAL_NEVER</span>The credential no saved.</dd> <dd><span class="apidef" style="width:230px;">AC_SAVECREDENTIAL_NEVER</span>The credential no saved.</dd>
</dl> </dl>
@ -280,7 +282,7 @@ The channel number of WIFi when SoftAP starts.
<dd>1 ~ 14. The default value is 1.</dd> <dd>1 ~ 14. The default value is 1.</dd>
</dl> </dl>
!!! info "See Application note" !!! info "How do I choose Channel"
Espressif Systems had announced the [application note](https://www.espressif.com/sites/default/files/esp8266_wi-fi_channel_selection_guidelines.pdf) about Wi-Fi channel selection. Espressif Systems had announced the [application note](https://www.espressif.com/sites/default/files/esp8266_wi-fi_channel_selection_guidelines.pdf) about Wi-Fi channel selection.
#### gateway #### gateway
@ -288,7 +290,7 @@ The channel number of WIFi when SoftAP starts.
Sets gateway address for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this. Sets gateway address for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd>IPAddress</dd> <dd><span class="apidef" style="width:230px;">IPAddress</span>The default value is **192.168.244.1**</dd>
</dl> </dl>
#### hidden #### hidden
@ -315,7 +317,7 @@ Sets the home path of user sketch. This path would be linked from 'HOME' in the
Sets subnet mask for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this. Sets subnet mask for Soft AP in captive portal. When AutoConnect fails the initial WiFi.begin, it starts the captive portal with the IP address specified this.
<dl class="apidl"> <dl class="apidl">
<dt>**Type**</dt> <dt>**Type**</dt>
<dd>IPAddress</dd> <dd><span class="apidef" style="width:230px;">IPAddress</span>The default value is **255.255.255.0**</dd>
</dl> </dl>
#### psk #### psk

@ -34,13 +34,13 @@ Replacement the **handleClient** method is not indispensable. AutoConnect can st
1. <strong>Include headers,</strong> `ESP8266WebServer.h` and `AutoConnect.h` 1. <strong>Include headers,</strong> `ESP8266WebServer.h` and `AutoConnect.h`
2. <strong>Declare ESP8266WebServer variable.</strong> 2. <strong>Declare ESP8266WebServer variable.</strong>
3. <strong>Declare AutoConnect variable.</strong> 3. <strong>Declare AutoConnect variable.</strong>
4. <strong>Implements the URL handler *function()*.</strong> 4. <strong>Implements the URL handler with the *function()*.</strong>
5. <strong>setup()</strong> 5. <strong>setup()</strong>
5.1 <strong>Sets URL handler *function()* to ESP8266WebServer by</strong>`ESP8266WebServer::on`<strong>.</strong> 5.1 <strong>Sets URL handler *function()* to ESP8266WebServer by</strong>`ESP8266WebServer::on`<strong>.</strong>
5.2 <strong>Starts </strong>`AutoConnect::begin()`<strong>.</strong> 5.2 <strong>Starts </strong>`AutoConnect::begin()`<strong>.</strong>
5.3 <strong>Check connection status.</strong> 5.3 <strong>Check WiFi connection status.</strong>
6. <strong>loop()</strong> 6. <strong>loop()</strong>
6.1 <strong>Invokes </strong>`AutoConnect::handleClient()`<strong>,<br>or invokes </strong>`ESP8266WebServer::handleClient()`<strong> then </strong>`AutoConnect::handleRequest()`<strong>.</strong> 6.1 <strong>Invokes </strong>`AutoConnect::handleClient()`<strong>, or invokes </strong>`ESP8266WebServer::handleClient()`<strong> then </strong>`AutoConnect::handleRequest()`<strong>.</strong>
6.2 <strong>Do the process for actual sketch.</strong> 6.2 <strong>Do the process for actual sketch.</strong>
#### 2. Declare AutoConnect object #### 2. Declare AutoConnect object
@ -56,20 +56,20 @@ or
AutoConnect VARIABLE; AutoConnect VARIABLE;
``` ```
- **Parameter with ESP8266WebServer variable:** An ESP8266WebServer object variable must be declared in the sketch. AutoConnect uses its variable for handling the [AutoConnect menu](menu.md). - **The parameter with an ESP8266WebServer variable:** An ESP8266WebServer object variable must be declared. AutoConnect uses its variable to handles the [AutoConnect menu](menu.md).
- **With no parameter:** The sketch does not declare ESP8266WebServer object. In this case, AutoConnect allocates an instance of the ESP8266WebServer internally and the logic sequence of the sketch is somewhat different as the above. To register a URL handler function by *ESP8266WebServer::on* should be performed after [*AutoConnect::begin*](api.md#begin). - **With no parameter:** 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 *ESP8266WebServer::on* should be performed after [*AutoConnect::begin*](api.md#begin).
#### 3. No need WiFI.begin(...) #### 3. No need WiFI.begin(...)
AutoConnect performs *WiFi.begin* for establishing a connection with WLAN internally. There is no need for a general process to establish a connection with *WiFi.begin* in a sketch. AutoConnect internally performs *WiFi.begin* to establish a WiFi connection. There is no need for a general process to establish a connection using *WiFi.begin* with a sketch code.
#### 4. Alternate ESP8266WebServer::begin() #### 4. Alternate ESP8266WebServer::begin()
[*AutoConnect::begin*](api.md#begin) internally executes *ESP8266WebServer::begin* too and it starts DNS server to behave as a captive portal. So the sketch does not need to call *ESP8266WebServer::begin*. [*AutoConnect::begin*](api.md#begin) executes *ESP8266WebServer::begin* internally too and it starts the DNS server to behave as a Captive portal. So it is not needed to call *ESP8266WebServer::begin* with the sketch.
!!! info "Why DNS Server Starts" !!! info "Why DNS Server starts"
AutoConnect traps the detection of captive portals and directs them to the AutoConnect menu to achieve a connection with the WLAN interactively. In order to trap, it temporarily responds SoftAP address to all DNS queries. When the connection with the WLAN is successfully established, the DNS server will stop. 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.
#### 5. AutoConnect::begin with SSID and Password #### 5. AutoConnect::begin with SSID and Password
@ -81,16 +81,16 @@ AutoConnect is designed to coexist with the process for handling the web pages b
#### 7. Use either ESP8266WebServer::handleClient() or AutoConnect::handleClient() #### 7. Use either ESP8266WebServer::handleClient() or AutoConnect::handleClient()
Both classes member function name is the same: *handleClient*, but behavior is different. Using the AutoConnect embedded along with ESP8266WebServer::handleClient has limitations. Refer to the below section for details. Both classes member function name is the same: *handleClient*, but the behavior is different. Using the AutoConnect embedded along with ESP8266WebServer::handleClient has limitations. Refer to the below section for details.
### <i class="fa fa-caret-right"></i> ESP8266WebServer hosted or parasitic ### <i class="fa fa-caret-right"></i> ESP8266WebServer hosted or parasitic
The interoperable process with an ESP8266WebServer depends on the parameters of the [AutoConnect constructor](api.md#constructors). The interoperable process with an ESP8266WebServer depends on the parameters of the [AutoConnect constructor](api.md#constructors).
Declaration parameter | Use ESP8266WebServer::handleClient | Use AutoConnect::handleClient Declaration parameter for the constructor | Use ESP8266WebServer::handleClient only | Use AutoConnect::handleClient
----|----|--- ----|----|---
None | AutoConnect menu not available.<br>host() is needed. | AutoConnect menu available.<br>host() is needed. [None](api.md#constructors) | AutoConnect menu not available.<br>To use AutoConnect menu, need [AutoConnect::handleRequest()](api.md#handlerequest).<br>also to use ESP8266WebServer natively, need [AutoConnect::host()](api.md#host). | AutoConnect menu available.<br>To use ESP8266WebServer natively, need [AutoConnect::host()](api.md#host).
Reference to ESP8266WebServer | AutoConnect menu not available.<br>host() not necessary. | AutoConnect menu available.<br>host() not necessary. [Reference to ESP8266WebServer](api.md#withparameter) | AutoConnect menu not available.<br>To use AutoConnect menu, need [AutoConnect::handleRequest()](api.md#handlerequest). | AutoConnect menu available.
- **By declaration for the AutoConnect variable with no parameter**: The ESP8266WebServer instance is hosted by AutoConnect automatically then the sketches use [*AutoConnect::host*](api.md#host) as API to get it after [*AutoConnect::begin*](api.md#begin) performed. - **By declaration for the AutoConnect variable with no parameter**: The ESP8266WebServer instance is hosted by AutoConnect automatically then the sketches use [*AutoConnect::host*](api.md#host) as API to get it after [*AutoConnect::begin*](api.md#begin) performed.

@ -3,13 +3,15 @@
If you can access the **AutoConnect root path** as http://ESP8266IPADDRESS/_ac from browser, probably the sketch uses *ESP8266WebServer::handleClient()* without [*AutoConnect::handleRequest()*](api.md#handlerequest). If you can access the **AutoConnect root path** as http://ESP8266IPADDRESS/_ac from browser, probably the sketch uses *ESP8266WebServer::handleClient()* without [*AutoConnect::handleRequest()*](api.md#handlerequest).
For AutoConnect menus to work properly, call [*AutoConnect::handleRequest()*](api.md#handlerequest) after *ESP8266WebServer::handleClient()* invoked, or use [*AutoConnect::handleClient()*](api.md#handleclient). [*AutoConnect::handleClient()*](api.md#handleclient) is equivalent *ESP8266WebServer::handleClient* combinated [*AutoConnect::handleRequest()*](api.md#handlerequest). For AutoConnect menus to work properly, call [*AutoConnect::handleRequest()*](api.md#handlerequest) after *ESP8266WebServer::handleClient()* invoked, or use [*AutoConnect::handleClient()*](api.md#handleclient). [*AutoConnect::handleClient()*](api.md#handleclient) is equivalent *ESP8266WebServer::handleClient* combinated [*AutoConnect::handleRequest()*](api.md#handlerequest).
See also the explanation [here](basicusage.md#esp8266webserver-hosted-or-parasitic).
## <i class="fa fa-question-circle"></i> An esp8266ap as SoftAP was connected but Captive portal does not start. ## <i class="fa fa-question-circle"></i> An esp8266ap as SoftAP was connected but Captive portal does not start.
Captive portal detection could not be trapped. It is necessary to disconnect and reset ESP8266 to clear memorized connection data in ESP8266. Also, It may be displayed on the smartphone if the connection information of esp8266ap is wrong. In that case, delete the connection information of esp8266ap memorized by the smartphone once. Captive portal detection could not be trapped. It is necessary to disconnect and reset ESP8266 to clear memorized connection data in ESP8266. Also, It may be displayed on the smartphone if the connection information of esp8266ap is wrong. In that case, delete the connection information of esp8266ap memorized by the smartphone once.
## <i class="fa fa-question-circle"></i> Does not appear esp8266ap in smartphone. ## <i class="fa fa-question-circle"></i> Does not appear esp8266ap in smartphone.
Maybe it is successfully connected at the **first WiFi.begin**. ESP8266 remembers the SSID successfully connected and will use at the next. It means SoftAP will only start up when the first *WiFi.begin()* fails. Maybe it is successfully connected at the **first WiFi.begin**. ESP8266 remembers the last SSID successfully connected and will use at the next. It means SoftAP will only start up when the first *WiFi.begin()* fails.
The saved SSID would be cleared by *WiFi.disconnect()* with WIFI_STA mode. If you do not want automatic reconnection, you can erase the memorized SSID with the following simple sketch. The saved SSID would be cleared by *WiFi.disconnect()* with WIFI_STA mode. If you do not want automatic reconnection, you can erase the memorized SSID with the following simple sketch.
@ -40,13 +42,13 @@ void loop() {
<img src="../images/espshaker.gif" /> <img src="../images/espshaker.gif" />
## <i class="fa fa-question-circle"></i> Does not response from \_ac. ## <i class="fa fa-question-circle"></i> Does not response from /\_ac.
Probably **WiFi.begin** failed with the specified SSID. Activating the [debug printing](advancedusage.md#debug-print) will help you to track down the cause. Probably **WiFi.begin** failed with the specified SSID. Activating the [debug printing](advancedusage.md#debug-print) will help you to track down the cause.
## <i class="fa fa-question-circle"></i> How change esp8266ap for SSID name in Captive portal? ## <i class="fa fa-question-circle"></i> How change esp8266ap for SSID name in Captive portal?
An **esp8266** is default SSID name for SoftAP of captive portal and password is **12345678**. You can change both by using [AutoConnectConfig](api.md#autoconnectconfig-api). An **esp8266ap** is default SSID name for SoftAP of captive portal and password is **12345678**. You can change both by using [AutoConnectConfig](api.md#autoconnectconfig-api).
## <i class="fa fa-question-circle"></i> How change HTTP port? ## <i class="fa fa-question-circle"></i> How change HTTP port?
@ -161,11 +163,11 @@ Link button to AutoConnect menu can be embedded into Sketch's web page. The root
<a style="background-color:SteelBlue; display:inline-block; padding:7px 13px; text-decoration:none;" href="/_ac">MENU</a> <a style="background-color:SteelBlue; display:inline-block; padding:7px 13px; text-decoration:none;" href="/_ac">MENU</a>
``` ```
## <i class="fa fa-question-circle"></i> How much memory consumption is AutoConnect? ## <i class="fa fa-question-circle"></i> How much memory does AutoConnect consume?
### Sketch size ### Sketch size
It increases about 53K bytes compared to the case without AutoConnect. A sketch size of the most simple example introduced at the Getting started is about 330K bytes. (270K byte without AutoConnect) It increases about 53K bytes compared to the case without AutoConnect. A sketch size of the most simple example introduced in the Getting started is about 330K bytes. (270K byte without AutoConnect)
### Heap size ### Heap size

@ -56,7 +56,7 @@ Or, "**RESET**" can be selected. The ESP8266 resets and reboots. After that, imm
### <i class="fa fa-play-circle"></i> Run for usually ### <i class="fa fa-play-circle"></i> Run for usually
The IP address of ESP8266 would be displayed on the serial monitor after connection recovered. Please access its address from the browser. The "Hello, world" page will respond. It's the page that was handled by in the sketch with "**on**" function of *ESP8266WebServer*. The IP address of ESP8266 would be displayed on the serial monitor after connection restored. Please access its address from the browser. The "Hello, world" page will respond. It's the page that was handled by in the sketch with "**on**" function of *ESP8266WebServer*.
<img src="../images/serial.png" style="vertical-align:top;" /><img src="../images/arrow_right.svg" style="vertical-align:top;padding-top:60px;width:48px;margin-left:45px;margin-right:30px;" /><img src="../images/hello_world.png" style="border:1px solid lightgrey;width:280px;" /> <img src="../images/serial.png" style="vertical-align:top;" /><img src="../images/arrow_right.svg" style="vertical-align:top;padding-top:60px;width:48px;margin-left:45px;margin-right:30px;" /><img src="../images/hello_world.png" style="border:1px solid lightgrey;width:280px;" />

@ -5,7 +5,7 @@ An Arduino library for ESP8266 WLAN configuration at run time with web interface
## Overview ## Overview
To the dynamic configuration for joining to WLAN with SSID and PSK accordingly. It an Arduino library united with *ESP8266WebServer* class. To the dynamic configuration for joining to WLAN with SSID and PSK accordingly. It an Arduino library united with *ESP8266WebServer* class.
Easily 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. 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.
<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> <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>
@ -23,7 +23,7 @@ Easily implementing the Web interface constituting the WLAN for ESP8266 WiFi con
### <i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Easy to embed in ### <i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Easy to embed in
<span class="lead">AutoConnect can be embedded easily into your sketch, just "**begin**" and "**handleClient**".</span> <span class="lead">AutoConnect can be placed easily in your sketch. It's "**begin**" and "**handleClient**" only.</span>
### <i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Lives with the your sketches ### <i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Lives with the your sketches
@ -63,7 +63,7 @@ Install third-party platform using the *Boards Manager* of Arduino IDE. Package
<i class="fa fa-download"></i> <strong>Additional necessary library</strong> <i class="fa fa-download"></i> <strong>Additional necessary library</strong>
The [PageBuilder](https://github.com/Hieromon/PageBuilder) library to build HTML for ESP8266WebServer is needed. The [PageBuilder](https://github.com/Hieromon/PageBuilder) library to build HTML for ESP8266WebServer is needed.
To install the PageBuilder library into your Arduino IDE, you can use the *Library Manager*. Select the board of ESP8266 series in the Arduino IDE, open the library manager and search keyword '**pagebuilder**' in the topic '**Communication**', then you can see the *PageBuilder*. The latest version or 1.0.0 later is required. To install the PageBuilder library into your Arduino IDE, you can use the *Library Manager*. Select the board of ESP8266 series in the Arduino IDE, open the library manager and search keyword '**pagebuilder**' with the topic '**Communication**', then you can see the *PageBuilder*. The latest version or 1.0.0 later is required.
<img src="./images/lm.png" width="640"/> <img src="./images/lm.png" width="640"/>

@ -3,8 +3,7 @@
## <i class="fa fa-external-link"></i> Where the from ## <i class="fa fa-external-link"></i> Where the from
The AutoConnect menu appears when you access the **AutoConnect root path**. It is assigned to "**/_ac**" located on ESP8266 *local IP address* by default. This location can be changed in the sketch. The following screen will appear at access to `http://{localIP}/_ac` as the root path. This is the statistics of the current WiFi connection. You can access the menu from the here. (e.g. `http://192.168.244.1/_ac` for SoftAP mode.) The AutoConnect menu appears when you access the **AutoConnect root path**. It is assigned "**/_ac**" located on ESP8266 *local IP address* by default. This location can be changed in the sketch. The following screen will appear at access to `http://{localIP}/_ac` as the root path. This is the statistics of the current WiFi connection. You can access the menu from the here, to invoke it tap <i class="fa fa-bars"></i> at right on top. (e.g. `http://192.168.244.1/_ac` for SoftAP mode.)
To invoke the menu tap <i class="fa fa-bars"></i> at right on top.
<img src="../images/ac.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" /> <img src="../images/ac.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" />
@ -13,38 +12,38 @@ To invoke the menu tap <i class="fa fa-bars"></i> at right on top.
## <i class="fa fa-bars"></i> Right on top ## <i class="fa fa-bars"></i> Right on top
Currently, AutoConnect supports four menus. Undermost menu returns to home path of its sketch. Currently, AutoConnect supports four menus. Undermost menu as "HOME" returns to the home path of its sketch.
- **Configure new AP** : Configure SSID and Password for new access point. - **Configure new AP**: Configure SSID and Password for new access point.
- **Open SSIDs** : Opens the past SSID which has been established connection from EEPROM. - **Open SSIDs**: Opens the past SSID which has been established connection from EEPROM.
- **Disconnect** : Disconnects current connection. - **Disconnect**: Disconnects current connection.
- **Reset...** : Rest the ESP8266 module. - **Reset...**: Rest the ESP8266 module.
- **HOME** : Return to user home page. - **HOME**: Return to user home page.
<img src="../images/menu.png" style="width:280px;" /> <img src="../images/menu.png" style="width:280px;" />
## <i class="fa fa-bars"></i> Configure new AP ## <i class="fa fa-bars"></i> Configure new AP
Scan all available access point and display it. Strength and security of the detected AP are marked. The <i class="fa fa-lock"></i> is indicated for the SSID that needs a security key. "**Hidden:**" means the number of hidden SSIDs discovered. Scan all available access point and display it. Strength and security of the detected AP are marked. The <i class="fa fa-lock"></i> is indicated for the SSID that needs a security key. "**Hidden:**" means the number of hidden SSIDs discovered.
Enter SSID and Passphrase and tap "**apply**" to try connection. Enter SSID and Passphrase and tap "**apply**" to starts a connection.
<img src="../images/newap.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" /> <img src="../images/newap.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" />
## <i class="fa fa-bars"></i> Open SSIDs ## <i class="fa fa-bars"></i> Open SSIDs
Once it was established connection, its SSID and Password will be stored to the EEPROM of ESP8266 automatically. The **Open SSIDs** menu reads the saved SSID credentials from the EEPROM. The stored credential data are listed by the SSID as shown below. Its label is a clickable button. To tap the SSID button starts connection it. Once it was established connection, its SSID and Password will be stored to the EEPROM of ESP8266 automatically. The **Open SSIDs** menu reads the saved SSID credentials from the EEPROM. The stored credential data are listed by the SSID as shown below. Its label is a clickable button. Tap the SSID button, starts connection it.
<img src="../images/open.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" /> <img src="../images/open.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" />
## <i class="fa fa-bars"></i> Disconnect ## <i class="fa fa-bars"></i> Disconnect
Disconnect ESP8266 from the current connection. After the menu tapped, AutoConnect menu cannot be accessed. Once disconnected, you will need to set the SSID again to connect to the WLAN. Disconnect ESP8266 from the current connection. It can also reset the ESP8266 automatically after disconnection by instructing with using [API](api.md#autoreset) in the sketch.
It can also reset the ESP8266 automatically after being disconnected from the [API](api.md#autoreset) used in the sketch. After tapping "Disconnect", you will not be able to reach the AutoConnect menu. Once disconnected, you will need to set the SSID again for connecting the WLAN.
## <i class="fa fa-bars"></i> Reset... ## <i class="fa fa-bars"></i> Reset...
Reset the ESP8266, it will be rebooted. After rebooting complete, the ESP8266 begins establishing the previous connection by WIFI_STA mode and the *esp8266ap* as SoftAP disappears from the WLAN. Reset the ESP8266, it will start rebooting. After rebooting complete, the ESP8266 begins establishing the previous connection with WIFI_STA mode, and *esp8266ap* of an access point will disappear from WLAN.
<img src="../images/resetting.png" style="width:280px;" /> <img src="../images/resetting.png" style="width:280px;" />

Loading…
Cancel
Save