pull/205/head
Hieromon Ikasamo 4 years ago
parent 246b607d8e
commit 2818c6cd02
  1. 14
      docs/acelements.html
  2. 28
      docs/achandling.html
  3. 10
      docs/acintro.html
  4. 12
      docs/acjson.html
  5. 12
      docs/acupload.html
  6. 62
      docs/advancedusage.html
  7. 2
      docs/api.html
  8. 4
      docs/apiaux.html
  9. 14
      docs/apiconfig.html
  10. 2
      docs/apiextra.html
  11. 30
      docs/basicusage.html
  12. 2
      docs/colorized.html
  13. 16
      docs/faq.html
  14. 4
      docs/gettingstarted.html
  15. 20
      docs/howtoembed.html
  16. 195
      docs/images/process_begin.svg
  17. 24
      docs/index.html
  18. 5
      docs/lsbegin.html
  19. 10
      docs/menu.html
  20. 6
      docs/menuize.html
  21. 6
      docs/otabrowser.html
  22. 2
      docs/otaserver.html
  23. 2
      docs/search/search_index.json
  24. 60
      docs/sitemap.xml
  25. BIN
      docs/sitemap.xml.gz
  26. 6
      docs/wojson.html

@ -1987,7 +1987,7 @@
<p>All custom Web page styles are limited to the built-in unique CSS embedded in the library code. Direct modification of the CSS affects AutoConnect behavior. You can use dedicated elements to relatively safely modify the style of your custom Web page.
The <a href="#autoconnectstyle">AutoConnectStyle</a> will insert the raw CSS code into the style block in HTML of the custom Web page.</p>
<h2 id="form-and-autoconnectelements">Form and AutoConnectElements<a class="headerlink" href="#form-and-autoconnectelements" title="Permanent link">&para;</a></h2>
<p>All AutoConnectElements placed on custom web pages will be contained into one form. Its form is fixed and created by AutoConnect. The form value (usually the text or checkbox you entered) is sent by <a href="#autoconnectsubmit">AutoConnectSubmit</a> using the <strong>POST</strong> method with HTTP. The post method sends the actual form data which is a query string whose contents are the <strong>name</strong> and <strong>value</strong> of AutoConnectElements. You can retrieve the value for the parameter with the sketch from the query string with <a href="https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer#getting-information-about-request-arguments">ESP8266WebServer::arg</a> function or <a href="https://github.com/Hieromon/PageBuilder#arguments-of-invoked-user-function">PageArgument</a> class of the <a href="api.html#on">AutoConnect::on</a> handler when the form is submitted.</p>
<p>All AutoConnectElements placed on custom web pages will be contained into one form. Its form is fixed and created by AutoConnect. The form value (usually the text or checkbox you entered) is sent by <a href="#autoconnectsubmit">AutoConnectSubmit</a> using the <strong>POST</strong> method with HTTP. The post method sends the actual form data which is a query string whose contents are the <strong>name</strong> and <strong>value</strong> of AutoConnectElements. You can retrieve the value for the parameter with the Sketch from the query string with <a href="https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer#getting-information-about-request-arguments">ESP8266WebServer::arg</a> function or <a href="https://github.com/Hieromon/PageBuilder#arguments-of-invoked-user-function">PageArgument</a> class of the <a href="api.html#on">AutoConnect::on</a> handler when the form is submitted.</p>
<h2 id="autoconnectelement-a-basic-class-of-elements">AutoConnectElement - <small>A basic class of elements</small><a class="headerlink" href="#autoconnectelement-a-basic-class-of-elements" title="Permanent link">&para;</a></h2>
<p>AutoConnectElement is a base class for other element classes and has common attributes for all elements. It can also be used as a <a href="#variant-for-autoconnectelements">variant</a> of each element. The following items are attributes that AutoConnectElement has and are common to other elements.</p>
<p><i class="fa fa-eye"></i> <strong>Sample</strong><br>
@ -2057,7 +2057,7 @@ AutoConnect will not actively be involved in the layout of custom Web pages gene
</tbody>
</table>
<h3 id="type"><i class="fa fa-caret-right"></i> type<a class="headerlink" href="#type" title="Permanent link">&para;</a></h3>
<p>The <strong>type</strong> indicates the type of the element and represented as the <em>ACElement_t</em> enumeration type in the sketch. Since AutoConnectElement also acts as a variant of other elements, it can be applied to handle elements collectively. At that time, the type can be referred to by the <a href="apielements.html#typeof"><strong>typeOf()</strong></a> function. The following example changes the font color of all <a href="#autoconnecttext">AutoConnectText</a> elements of a custom Web page to gray.</p>
<p>The <strong>type</strong> indicates the type of the element and represented as the <em>ACElement_t</em> enumeration type in the Sketch. Since AutoConnectElement also acts as a variant of other elements, it can be applied to handle elements collectively. At that time, the type can be referred to by the <a href="apielements.html#typeof"><strong>typeOf()</strong></a> function. The following example changes the font color of all <a href="#autoconnecttext">AutoConnectText</a> elements of a custom Web page to gray.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">AutoConnectAux</span> <span style="color: #f8f8f2">customPage;</span>
<span style="color: #f8f8f2">AutoConnectElementVT</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">elements</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">customPage.getElements();</span>
@ -2083,7 +2083,7 @@ AutoConnect will not actively be involved in the layout of custom Web pages gene
<li>AutoConnectText: <strong>AC_Text</strong></li>
<li>Uninitialized element: <strong>AC_Unknown</strong></li>
</ul>
<p>Furthermore, to convert an entity that is not an AutoConnectElement to its native type, you must <a href="https://en.cppreference.com/w/cpp/language/reinterpret_cast">re-interpret</a> that type with c++. Or, you can be coding the sketch more easily with using the <a href="apielements.html#ast62"><strong>as&lt;T></strong></a> function.</p>
<p>Furthermore, to convert an entity that is not an AutoConnectElement to its native type, you must <a href="https://en.cppreference.com/w/cpp/language/reinterpret_cast">re-interpret</a> that type with c++. Or, you can be coding the Sketch more easily with using the <a href="apielements.html#ast62"><strong>as&lt;T></strong></a> function.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">AutoConnectAux</span> <span style="color: #f8f8f2">customPage;</span>
<span style="color: #f8f8f2">AutoConnectElementVT</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">elements</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">customPage.getElements();</span>
@ -2173,7 +2173,7 @@ Only <i class="far fa-square"></i> will be displayed if a label is not specified
<ul>
<li><strong><code>AC_File_FS</code></strong> : Save as the SPIFFS file in flash of ESP8266/ESP32 module.</li>
<li><strong><code>AC_File_SD</code></strong> : Save to an external SD device connected to ESP8266/ESP32 module.</li>
<li><strong><code>AC_File_Extern</code></strong> : Pass the content of the uploaded file to the uploader which is declared by the sketch individually. Its uploader must inherit <a href="acupload.html#to-upload-to-a-device-other-than-flash-or-sd"><strong>AutoConnectUploadHandler</strong></a> class and implements <em>_open</em>, <em>_write</em> and <em>_close</em> function.</li>
<li><strong><code>AC_File_Extern</code></strong> : Pass the content of the uploaded file to the uploader which is declared by the Sketch individually. Its uploader must inherit <a href="acupload.html#to-upload-to-a-device-other-than-flash-or-sd"><strong>AutoConnectUploadHandler</strong></a> class and implements <em>_open</em>, <em>_write</em> and <em>_close</em> function.</li>
</ul>
<div class="admonition note">
<p class="admonition-title">Built-in uploader is ready.</p>
@ -2182,7 +2182,7 @@ Only <i class="far fa-square"></i> will be displayed if a label is not specified
<h3 id="post_3"><i class="fa fa-caret-right"></i> post<a class="headerlink" href="#post_3" title="Permanent link">&para;</a></h3>
<p>Specifies a tag to add behind the HTML code generated from the element. The default values is <code>AC_Tag_BR</code>.</p>
<h2 id="autoconnectinput">AutoConnectInput<a class="headerlink" href="#autoconnectinput" title="Permanent link">&para;</a></h2>
<p>AutoConnectInput generates an HTML <code class="codehilite"><span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">input</span> <span style="color: #a6e22e">type</span><span style="color: #f92672">=</span><span style="color: #e6db74">&quot;text&quot;</span><span style="color: #f8f8f2">&gt;</span></code> tag and a <code class="codehilite"><span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">label</span><span style="color: #f8f8f2">&gt;</span></code> tag. It can also have a placeholder. The value of the input box is passed to the destination in the query string and can be retrieved programmatically. You can also update from the sketches.</p>
<p>AutoConnectInput generates an HTML <code class="codehilite"><span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">input</span> <span style="color: #a6e22e">type</span><span style="color: #f92672">=</span><span style="color: #e6db74">&quot;text&quot;</span><span style="color: #f8f8f2">&gt;</span></code> tag and a <code class="codehilite"><span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">label</span><span style="color: #f8f8f2">&gt;</span></code> tag. It can also have a placeholder. The value of the input box is passed to the destination in the query string and can be retrieved programmatically. You can also update from the Sketches.</p>
<p><i class="fa fa-eye"></i> <strong>Sample</strong><br>
<small><strong><code>AutoConnectInput input("input", "", "Server", "MQTT broker server");</code></strong></small></p>
<p><small>On the page:</small><br><img src="images/acinput.png"></p>
@ -2258,7 +2258,7 @@ Therefore, specifying the wrong CSS will modulate the behavior of the custom Web
</code></pre></div>
<h3 id="name_6"><i class="fa fa-caret-right"></i> name<a class="headerlink" href="#name_6" title="Permanent link">&para;</a></h3>
<p>It is the <code>name</code> of the AutoConnectStyle element and is useful only to access this element from the sketch. It does not affect the generated HTML code.</p>
<p>It is the <code>name</code> of the AutoConnectStyle element and is useful only to access this element from the Sketch. It does not affect the generated HTML code.</p>
<h3 id="value_5"><i class="fa fa-caret-right"></i> value<a class="headerlink" href="#value_5" title="Permanent link">&para;</a></h3>
<p>The raw CSS code. It is not necessary to write <code>&lt;style&gt;</code> <code>&lt;/style&gt;</code> tags.</p>
<h2 id="autoconnectselect">AutoConnectSelect<a class="headerlink" href="#autoconnectselect" title="Permanent link">&para;</a></h2>
@ -2309,7 +2309,7 @@ Therefore, specifying the wrong CSS will modulate the behavior of the custom Web
</code></pre></div>
<h3 id="name_9"><i class="fa fa-caret-right"></i> name<a class="headerlink" href="#name_9" title="Permanent link">&para;</a></h3>
<p>A <code>name</code> does not exist in the generated HTML. It provides only a means of accessing elements with the sketches.</p>
<p>A <code>name</code> does not exist in the generated HTML. It provides only a means of accessing elements with the Sketches.</p>
<h3 id="value_7"><i class="fa fa-caret-right"></i> value<a class="headerlink" href="#value_7" title="Permanent link">&para;</a></h3>
<p>It becomes content and also can contain the native HTML code, but remember that your written code is enclosed by the div tag.</p>
<h3 id="style"><i class="fa fa-caret-right"></i> style<a class="headerlink" href="#style" title="Permanent link">&para;</a></h3>

@ -407,7 +407,7 @@
<li class="md-nav__item">
<a href="#handing-autoconnectelements-with-the-sketches" class="md-nav__link">
Handing AutoConnectElements with the sketches
Handing AutoConnectElements with the Sketches
</a>
<nav class="md-nav">
@ -429,7 +429,7 @@
<li class="md-nav__item">
<a href="#enable-autoconnectelements-during-the-sketch-execution" class="md-nav__link">
Enable AutoConnectElements during the sketch execution
Enable AutoConnectElements during the Sketch execution
</a>
</li>
@ -967,7 +967,7 @@
<li class="md-nav__item">
<a href="#handing-autoconnectelements-with-the-sketches" class="md-nav__link">
Handing AutoConnectElements with the sketches
Handing AutoConnectElements with the Sketches
</a>
<nav class="md-nav">
@ -989,7 +989,7 @@
<li class="md-nav__item">
<a href="#enable-autoconnectelements-during-the-sketch-execution" class="md-nav__link">
Enable AutoConnectElements during the sketch execution
Enable AutoConnectElements during the Sketch execution
</a>
</li>
@ -1158,7 +1158,7 @@
<h2 id="page-container-component">Page, Container, Component<a class="headerlink" href="#page-container-component" title="Permanent link">&para;</a></h2>
<p>AutoConnectAux is the container for a custom Web page, AutoConnectElement is the component of a page. AutoConnectElements must be contained in AutoConnectAux object. (ie. they are the elements displayed on the custom Web page.) Then AutoConnect makes an AutoConnectAux to a page.</p>
<p>AutoConnectElements declared in sketch must be programmed to add to AutoConnectAux one after another. Elements are automatically included in AutoConnectAux by AutoConnect if you load it from the JSON document. In either method, it is common to use the function of AutoConnectAux to access an element with a sketch.</p>
<h2 id="handing-autoconnectelements-with-the-sketches">Handing AutoConnectElements with the sketches<a class="headerlink" href="#handing-autoconnectelements-with-the-sketches" title="Permanent link">&para;</a></h2>
<h2 id="handing-autoconnectelements-with-the-sketches">Handing AutoConnectElements with the Sketches<a class="headerlink" href="#handing-autoconnectelements-with-the-sketches" title="Permanent link">&para;</a></h2>
<p>The AutoConnectAux class has several functions to manipulate AutoConnectElements. The functions can add, delete, retrieve elements, and get and set values.</p>
<h3 id="add-autoconnectelements-to-the-autoconnectaux-object"><i class="fa fa-edit"></i> Add AutoConnectElements to the AutoConnectAux object<a class="headerlink" href="#add-autoconnectelements-to-the-autoconnectaux-object" title="Permanent link">&para;</a></h3>
<p>To add AutoConnectElment(s) to an AutoConnectAux object, use the add function.</p>
@ -1166,7 +1166,7 @@
</code></pre></div>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #66d9ef">void</span> <span style="color: #f8f8f2">AutoConnectAux</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">add(AutoConnectElementVT</span> <span style="color: #f8f8f2">addons)</span>
</code></pre></div></p>
<p>The add function adds the specified AutoConnectElement to AutoConnectAux. The AutoConnectElementVT type is the <a href="https://en.cppreference.com/w/cpp/container/vector"><em>std::vector</em></a> of the <a href="https://en.cppreference.com/w/cpp/utility/functional/reference_wrapper"><em>reference wrapper</em></a> to AutoConnectElements, and you can add these elements in bulk by using the <a href="https://en.cppreference.com/w/cpp/language/list_initialization"><em>list initialization</em></a> with the sketch.</p>
<p>The add function adds the specified AutoConnectElement to AutoConnectAux. The AutoConnectElementVT type is the <a href="https://en.cppreference.com/w/cpp/container/vector"><em>std::vector</em></a> of the <a href="https://en.cppreference.com/w/cpp/utility/functional/reference_wrapper"><em>reference wrapper</em></a> to AutoConnectElements, and you can add these elements in bulk by using the <a href="https://en.cppreference.com/w/cpp/language/list_initialization"><em>list initialization</em></a> with the Sketch.</p>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #66d9ef">typedef</span> <span style="color: #f8f8f2">std</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">vector</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">std</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">reference_wrapper</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">AutoConnectElement</span><span style="color: #f92672">&gt;&gt;</span> <span style="color: #f8f8f2">AutoConnectElementVT;</span>
</code></pre></div>
AutoConnectElements contained in AutoConnectAux object are uniquely identified by name. When adding an AutoConnectElement, if an element with the same name already exists in the AutoConnectAux, checking the type, and if it is the same, the value will be replaced. If another type of AutoConnectElement exists with the same name, that add operation will be invalid.<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup> In the following example, AutoConnectButton <code>button</code> addition will invalid because <code>hello</code> with the same name already exists as AutoConnectText.</p>
@ -1202,7 +1202,7 @@ AutoConnectElements contained in AutoConnectAux object are uniquely identified b
<p>If you load all AutoConnectElements from JSON document into AutoConnect, you do not need to sketch the population process of the AutoConnectElements. It is managed by the AutoConnect library automatically.</p>
</div>
<h3 id="get-autoconnectelement-from-the-autoconnectaux"><i class="fa fa-edit"></i> Get AutoConnectElement from the AutoConnectAux<a class="headerlink" href="#get-autoconnectelement-from-the-autoconnectaux" title="Permanent link">&para;</a></h3>
<p>To retrieve an element from AutoConnectAux, use the getElement or getElements function. Normally, the getElement is needed when accessing the value of AutoConnectElement in the sketch.</p>
<p>To retrieve an element from AutoConnectAux, use the getElement or getElements function. Normally, the getElement is needed when accessing the value of AutoConnectElement in the Sketch.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">AutoConnectElement</span><span style="color: #f92672">*</span> <span style="color: #f8f8f2">AutoConnectAux</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">getElement(</span><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">name)</span>
</code></pre></div>
@ -1235,7 +1235,7 @@ AutoConnectElements contained in AutoConnectAux object are uniquely identified b
<span style="color: #f8f8f2">AutoConnectText</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">text</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">aux.getElement</span><span style="color: #f92672">&lt;</span><span style="color: #f8f8f2">AutoConnectText</span><span style="color: #f92672">&gt;</span><span style="color: #f8f8f2">(</span><span style="color: #e6db74">&quot;TEXT_ELEMENT_NAME&quot;</span><span style="color: #f8f8f2">);</span>
</code></pre></div>
<p>The AutoConnectElement type behaves as a variant of other element types. Therefore use cast or template to convert to actual type as above. In the sketch, you access the real type of AutoConnectElement after casting it and storing into the variable.</p>
<p>The AutoConnectElement type behaves as a variant of other element types. Therefore use cast or template to convert to actual type as above. In the Sketch, you access the real type of AutoConnectElement after casting it and storing into the variable.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span> <span style="color: #f8f8f2">auxJson</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">String(</span><span style="color: #e6db74">&quot;{</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">title</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">:</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">Page 1 title</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">,</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">uri</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">:</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">/page1</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">,</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">menu</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">:true,</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">element</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">:[{</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">name</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">:</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">caption</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">,</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">type</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">:</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">ACText</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">,</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">value</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">:</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">hello, world</span><span style="color: #ae81ff">\&quot;</span><span style="color: #e6db74">}]}&quot;</span><span style="color: #f8f8f2">);</span>
<span style="color: #f8f8f2">AutoConnect</span> <span style="color: #f8f8f2">portal;</span>
<span style="color: #f8f8f2">portal.load(auxJson);</span>
@ -1244,7 +1244,7 @@ AutoConnectElements contained in AutoConnectAux object are uniquely identified b
<span style="color: #f8f8f2">Serial.println(text.value);</span>
</code></pre></div>
<p>You can also use the <a href="apiaux.html#operator">operator <strong><code>[]</code></strong> of AutoConnectAux</a> as another way to get the desired element. An operator <strong><code>[]</code></strong> is a shortcut for <a href="apiaux.html#getelement">getElement</a> function with the reference casting and makes simplify the sketch code and treats like an array with the elements placed on a custom Web page. Its argument is the name of the element to be acquired similarly to getElement function. In the sketch, by combining the <a href="apielements.html#ast62"><strong>AutoConnectElement::as&lt;T></strong></a> function with the operator <code>[]</code>, you can access the AutoConnectElements reference according to its actual type. For example, the following sketch code returns the same as a reference of AutoConnectText element as the <code>caption</code>.</p>
<p>You can also use the <a href="apiaux.html#operator">operator <strong><code>[]</code></strong> of AutoConnectAux</a> as another way to get the desired element. An operator <strong><code>[]</code></strong> is a shortcut for <a href="apiaux.html#getelement">getElement</a> function with the reference casting and makes simplify the Sketch code and treats like an array with the elements placed on a custom Web page. Its argument is the name of the element to be acquired similarly to getElement function. In the Sketch, by combining the <a href="apielements.html#ast62"><strong>AutoConnectElement::as&lt;T></strong></a> function with the operator <code>[]</code>, you can access the AutoConnectElements reference according to its actual type. For example, the following sketch code returns the same as a reference of AutoConnectText element as the <code>caption</code>.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">AutoConnect</span> <span style="color: #f8f8f2">portal;</span>
<span style="color: #f8f8f2">portal.load(auxJson);</span>
<span style="color: #f8f8f2">AutoConnectAux</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">aux</span> <span style="color: #f92672">=</span> <span style="color: #f92672">*</span><span style="color: #f8f8f2">portal.aux(</span><span style="color: #e6db74">&quot;/page1&quot;</span><span style="color: #f8f8f2">);</span>
@ -1270,7 +1270,7 @@ AutoConnectElements contained in AutoConnectAux object are uniquely identified b
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">AutoConnectElementVT</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">AutoConnectAux</span><span style="color: #f92672">::</span><span style="color: #f8f8f2">getElements(</span><span style="color: #66d9ef">void</span><span style="color: #f8f8f2">)</span>
</code></pre></div>
<h3 id="enable-autoconnectelements-during-the-sketch-execution"><i class="fa fa-edit"></i> Enable AutoConnectElements during the sketch execution<a class="headerlink" href="#enable-autoconnectelements-during-the-sketch-execution" title="Permanent link">&para;</a></h3>
<h3 id="enable-autoconnectelements-during-the-sketch-execution"><i class="fa fa-edit"></i> Enable AutoConnectElements during the Sketch execution<a class="headerlink" href="#enable-autoconnectelements-during-the-sketch-execution" title="Permanent link">&para;</a></h3>
<p>AutoConnectElemets have an enable attribute to activate its own HTML generation. Sketches can change the HTMLization of their elements dynamically by setting or resetting the enable value. An element whose the enable attribute is true will generate itself HTML and place on the custom Web page. And conversely, it will not generate the HTML when the value is false.</p>
<p>For example, to enable the submit button only when the ESP module is connected to the access point in STA mode, you can sketch the following:</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WiFi.h&gt;</span>
@ -1323,7 +1323,7 @@ AutoConnectElements contained in AutoConnectAux object are uniquely identified b
<div class="admonition hint">
<p class="admonition-title">Desirable to set or reset the enable attribute in the page handler</p>
<p>The enable attribute can be set at any time during the sketch execution. The page handler with the <a href="apiaux.html#on">AC_EXIT_AHEAD</a> option is sure to handle it.</p>
<p>The enable attribute can be set at any time during the Sketch execution. The page handler with the <a href="apiaux.html#on">AC_EXIT_AHEAD</a> option is sure to handle it.</p>
</div>
<h2 id="loading-saving-autoconnectelements-with-json">Loading &amp; saving AutoConnectElements with JSON<a class="headerlink" href="#loading-saving-autoconnectelements-with-json" title="Permanent link">&para;</a></h2>
<p>AutoConnect supports reading the custom Web page definitions written in JSON and also supports loading and saving of AutoConnectAux or AutoConnectElements. In both cases, the target object is a <a href="acjson.html">JSON document for AutoConnect</a>. However, it can not save all AutoConnectElements contained in the page as a custom Web page. (ie. AutoConnectAux)</p>
@ -1751,7 +1751,7 @@ ESP8266WebServer class will parse the query string and rebuilds its arguments wh
</div>
<h3 id="retrieve-the-values-with-webserveron-handler"><i class="fa fa-wrench"></i> Retrieve the values with WebServer::on handler<a class="headerlink" href="#retrieve-the-values-with-webserveron-handler" title="Permanent link">&para;</a></h3>
<p>ESP8266WebServer class and the WebServer class assume that the implementation of the ReqestHandler class contained in the WebServer library will handle the URL requests. Usually, it is sketch code registered by ESP8266WebServer::on function.</p>
<p>When a page transition from a custom Web page created by AutoConnectAux to a handler registered with ESP2866WebServer::on function, a little trick is needed to retrieve the values of AutoConnectElements. (i.e. the URI of the ESP8266WebServer::on handler is specified in the <a href="acelements.html#uri">uri</a> attribute of <a href="acelements.html#autoconnectsubmit">AutoConnectSubmit</a>) AutoConnect cannot intervene in the procedure in which the ESP8266WebServer class calls the on-page handler coded with the sketch. Therefore, it is necessary to retrieve preliminary the values of AutoConnectElements using the <a href="apiaux.html#fetchelement">AutoConnectAux::fetchElement</a> function for value processing with the on-page handler.</p>
<p>When a page transition from a custom Web page created by AutoConnectAux to a handler registered with ESP2866WebServer::on function, a little trick is needed to retrieve the values of AutoConnectElements. (i.e. the URI of the ESP8266WebServer::on handler is specified in the <a href="acelements.html#uri">uri</a> attribute of <a href="acelements.html#autoconnectsubmit">AutoConnectSubmit</a>) AutoConnect cannot intervene in the procedure in which the ESP8266WebServer class calls the on-page handler coded with the Sketch. Therefore, it is necessary to retrieve preliminary the values of AutoConnectElements using the <a href="apiaux.html#fetchelement">AutoConnectAux::fetchElement</a> function for value processing with the on-page handler.</p>
<p>The following sketch is an example of extracting values inputted on a custom web page with an on-page handler and then processing it.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">ESP8266WebServer</span> <span style="color: #f8f8f2">server;</span>
<span style="color: #f8f8f2">AutoConnect</span> <span style="color: #a6e22e">portal</span><span style="color: #f8f8f2">(server);</span>
@ -1802,7 +1802,7 @@ ESP8266WebServer class will parse the query string and rebuilds its arguments wh
<h3 id="overwrite-the-autoconnectelements"><i class="fa fa-wpforms"></i> Overwrite the AutoConnectElements<a class="headerlink" href="#overwrite-the-autoconnectelements" title="Permanent link">&para;</a></h3>
<p>Sketches can update the attributes of AutoConnectElements with two approaches. A one is to assign directly to the attributes of a member variable of its element. The other is to overwrite them with loading the element by <a href="apiaux.html#loadelement">AutoConnectAux::loadElement</a>. </p>
<p>The elements for attributes described in the JSON document for AutoConnectElements overwrites the member variables of the target AutoConnectElements. However, AutoConnectAux::loadElement keeps the member variables unchanged if there is no element in the JSON document. This overwriting behavior is the same for the <a href="api.html#load">AutoConnect::load</a> function.</p>
<p>For example, the combination of the sketch and JSON document as follows updates only the style while keeping Caption (ie. "Hello, world") as AutoConnectText value.</p>
<p>For example, the combination of the Sketch and JSON document as follows updates only the style while keeping Caption (ie. "Hello, world") as AutoConnectText value.</p>
<p><i class="fab fa-js-square"></i> External JSON document for the below sketch to modify the text style.
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">{</span>
<span style="color: #f92672">&quot;name&quot;</span> <span style="color: #f8f8f2">:</span> <span style="color: #e6db74">&quot;Caption&quot;</span><span style="color: #f8f8f2">,</span>
@ -1811,7 +1811,7 @@ ESP8266WebServer class will parse the query string and rebuilds its arguments wh
</span><span style="color: #f8f8f2">}</span>
</code></pre></div></p>
<p><i class="fa fa-arrow-down"></i><br>
<i class="fa fa-code"></i> The sketch (a part of code), load above JSON.
<i class="fa fa-code"></i> the Sketch (a part of code), load above JSON.
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="background-color: #49483e"><span style="color: #f8f8f2">ACText(Caption,</span> <span style="color: #e6db74">&quot;Hello, world&quot;</span><span style="color: #f8f8f2">);</span>
</span><span style="color: #f8f8f2">AutoConnectAux</span> <span style="color: #a6e22e">helloPage</span><span style="color: #f8f8f2">(</span><span style="color: #e6db74">&quot;/hello&quot;</span><span style="color: #f8f8f2">,</span> <span style="color: #e6db74">&quot;Hello&quot;</span><span style="color: #f8f8f2">,</span> <span style="color: #f8f8f2">true,</span> <span style="color: #f8f8f2">{</span> <span style="color: #f8f8f2">Caption</span> <span style="color: #f8f8f2">});</span>
<span style="color: #f8f8f2">AutoConnect</span> <span style="color: #f8f8f2">portal;</span>

@ -907,7 +907,7 @@ AutoConnect can handle custom Web pages prepared by user sketches individually.
<p align="center"><img align="center" width="560px" src="images/ac_objects.svg"></p>
AutoConnectAux is a container for AutoConnectElements. To make a custom Web page, create elements that make up the page and put it in the AutoConnectAux object. Joining its AutoConnectAux object to AutoConnect will integrate the custom Web page into the AutoConnect menu.</p>
<p><img src="images/ac_declaration.svg"></p>
<p>The above figure shows a code sequence that declares AutoConnectElements and put in the AutoConnectAux container and integrates those into AutoConnect. It declares two text elements named <em>header</em> and <em>caption</em>, adds them to the AutoConnectAux object as <em>aux</em>, binds to an AutoConnect object named <em>portal</em>. This sequence is the basic procedure for creating custom Web pages with the sketch. The further explanation is available in section <a href="acelements.html">AutoConnectElements</a> also.</p>
<p>The above figure shows a code sequence that declares AutoConnectElements and put in the AutoConnectAux container and integrates those into AutoConnect. It declares two text elements named <em>header</em> and <em>caption</em>, adds them to the AutoConnectAux object as <em>aux</em>, binds to an AutoConnect object named <em>portal</em>. This sequence is the basic procedure for creating custom Web pages with the Sketch. The further explanation is available in section <a href="acelements.html">AutoConnectElements</a> also.</p>
<h2 id="custom-web-pages-in-autoconnect-menu">Custom Web pages in AutoConnect menu<a class="headerlink" href="#custom-web-pages-in-autoconnect-menu" title="Permanent link">&para;</a></h2>
<ul class="horizontal-list">
<li><img style="margin:0 20px 0 -20px;float:left;width:300px;" src="images/ac_auxmenu.png">
@ -918,7 +918,7 @@ AutoConnectAux is a container for AutoConnectElements. To make a custom Web page
<p>You can create multiple custom Web pages and specify pages that can be called from the menu. The following sketch shows a code sequence for integrating three custom Web pages into one and embedding them in a menu.</p>
<p><img align="center" width="520px" src="images/ac_auxjoin_multi.svg"></p>
<ul class="horizontal-list">
<li><p style="margin:0 20px 0 -20px"><span style="margin-left:20px;float:right;width:280px;height:497px;border:1px solid lightgrey;"><img data-gifffer="images/aux_menu.gif" data-gifffer-width="278" data-gifffer-height="495" /></span>In the above code, the third parameter of <i>aux2</i> is <b>false</b>. The third parameter of the AutoConnectAux constructor is an indicator for whether it's shown to the AutoConnect menu. Right animation is an execution result of the above code. You will see that the menu applies only two items for three custom Web pages. The sketch of this animation is written to transition to <i>aux2</i> by the utility of the <a href="acelements.html#autoconnectsubmit"><b>AutoConnectSubmit</b></a> element owned by <i>aux1</i>.<sup id="fnref:2"><a class="footnote-ref" href="#fn:2" rel="footnote">2</a></sup><br>The <i>aux2</i> page transitions only from the <i>aux1</i> page. As shown in mqttRSSI in the library example, its page replies the saving result for the parameters entered on the previous page. It can not be invoked directly from the menu and want to hide them with AutoConnect menu items. The utility of the third parameter of the AutoConnectAux constructor is that.</p></li>
<li><p style="margin:0 20px 0 -20px"><span style="margin-left:20px;float:right;width:280px;height:497px;border:1px solid lightgrey;"><img data-gifffer="images/aux_menu.gif" data-gifffer-width="278" data-gifffer-height="495" /></span>In the above code, the third parameter of <i>aux2</i> is <b>false</b>. The third parameter of the AutoConnectAux constructor is an indicator for whether it's shown to the AutoConnect menu. Right animation is an execution result of the above code. You will see that the menu applies only two items for three custom Web pages. the Sketch of this animation is written to transition to <i>aux2</i> by the utility of the <a href="acelements.html#autoconnectsubmit"><b>AutoConnectSubmit</b></a> element owned by <i>aux1</i>.<sup id="fnref:2"><a class="footnote-ref" href="#fn:2" rel="footnote">2</a></sup><br>The <i>aux2</i> page transitions only from the <i>aux1</i> page. As shown in mqttRSSI in the library example, its page replies the saving result for the parameters entered on the previous page. It can not be invoked directly from the menu and want to hide them with AutoConnect menu items. The utility of the third parameter of the AutoConnectAux constructor is that.</p></li>
</ul>
<h2 id="basic-steps-to-use-custom-web-pages">Basic steps to use custom Web pages<a class="headerlink" href="#basic-steps-to-use-custom-web-pages" title="Permanent link">&para;</a></h2>
@ -935,7 +935,7 @@ AutoConnectAux is a container for AutoConnectElements. To make a custom Web page
</ol>
<h2 id="write-the-custom-web-page-with-json">Write the custom Web page with JSON<a class="headerlink" href="#write-the-custom-web-page-with-json" title="Permanent link">&para;</a></h2>
<p>You can write the custom Web page in JSON without using sketch codes.<sup id="fnref:3"><a class="footnote-ref" href="#fn:3">3</a></sup> It is possible to describe the entire page in JSON and can be described for each element also. The JSON document can be saved in SPIFFS or SD and read using AutoConnect's <a href="api.html#load"><strong>load</strong></a> function. you can reduce the steps of the basic procedure with this approach, but this way consumes a lot of memory.
The following JSON code and sketch will execute the custom Web page as an example in the above figure. That is, the sketch of this code and footnote<sup id="fnref:2"><a class="footnote-ref" href="#fn:2">2</a></sup> is equivalent.</p>
The following JSON code and sketch will execute the custom Web page as an example in the above figure. That is, the Sketch of this code and footnote<sup id="fnref:2"><a class="footnote-ref" href="#fn:2">2</a></sup> is equivalent.</p>
<p><strong>custom_page.json</strong>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">[</span>
<span style="color: #f8f8f2">{</span>
@ -987,7 +987,7 @@ The following JSON code and sketch will execute the custom Web page as an exampl
<span style="color: #f8f8f2">}</span>
<span style="color: #f8f8f2">]</span>
</code></pre></div></p>
<p><strong>The sketch</strong>
<p><strong>the Sketch</strong>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WiFi.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WebServer.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;FS.h&gt;</span>
@ -1026,7 +1026,7 @@ The following JSON code and sketch will execute the custom Web page as an exampl
<p>There is no overlay in the actual menu.&#160;<a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">&#8617;</a></p>
</li>
<li id="fn:2">
<p>The sketch is actually this:
<p>the Sketch is actually this:
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WiFi.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WebServer.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;AutoConnect.h&gt;</span>

@ -1265,12 +1265,12 @@
<h1>Custom Web pages with JSON</h1>
<p>You can embed custom Web pages written in <a href="https://www.json.org/index.html"><strong>JSON</strong></a> into AutoConnect without AutoConnectAux &amp; AutoConnectElements declaration. Custom Web page declaration by JSON can embed in the sketch as a fixed string or can store in the external file such as SPIFFS for stream loading. Also, you can also load and save AutoConnectElements objects individually.<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup></p>
<p>You can embed custom Web pages written in <a href="https://www.json.org/index.html"><strong>JSON</strong></a> into AutoConnect without AutoConnectAux &amp; AutoConnectElements declaration. Custom Web page declaration by JSON can embed in the Sketch as a fixed string or can store in the external file such as SPIFFS for stream loading. Also, you can also load and save AutoConnectElements objects individually.<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup></p>
<p>By providing the following JSON document to AutoConnect, you can include the custom Web page like the below:</p>
<div style="float:left;width:50%;height:470px;overflow:auto"><img src="images/ac_json.png"></div>
<p><img style="margin-left:30px;width:40%;height:470px;" src="images/ac_mqtt_setting.png"></p>
<p>A JSON document for AutoConnect can contain the custom Web page multiple. You can further reduce the sketch process by loading multiple pages of JSON document at once.</p>
<p>A JSON document for AutoConnect can contain the custom Web page multiple. You can further reduce the Sketch process by loading multiple pages of JSON document at once.</p>
<div class="admonition caution">
<p class="admonition-title">Adopt ArduinoJson v5 or v6</p>
<p>To handle AutoConnectAux and AutoConnectElements written in JSON, you need to install the ArduinoJson library. You can adopt either <a href="https://arduinojson.org/v5/doc/installation/">version 5</a> or <a href="https://arduinojson.org/v6/doc/installation/">version 6</a> for the ArduinoJson. AutoConnect supports both versions.</p>
@ -1485,7 +1485,7 @@
<li><strong>store</strong> : Specifies the destination to save the uploaded file. Its value accepts one of the following:<p>
<b>fs</b>&nbsp;: Save as the SPIFFS file in flash of ESP8266/ESP32 module.<br>
<b>sd</b>&nbsp;: Save to an external SD device connected to ESP8266/ESP32 module.<br>
<b>extern</b>&nbsp;: Pass the content of the uploaded file to the uploader which is declared by the sketch individually. Its uploader must inherit <a href="acupload.html#to-upload-to-a-device-other-than-flash-or-sd"><strong>AutoConnectUploadHandler</strong></a> class and implements <em>_open</em>, <em>_write</em> and <em>_close</em> function.</p></li>
<b>extern</b>&nbsp;: Pass the content of the uploaded file to the uploader which is declared by the Sketch individually. Its uploader must inherit <a href="acupload.html#to-upload-to-a-device-other-than-flash-or-sd"><strong>AutoConnectUploadHandler</strong></a> class and implements <em>_open</em>, <em>_write</em> and <em>_close</em> function.</p></li>
</ul>
</dd>
</dl>
@ -1595,7 +1595,7 @@
<li>
<p>Load directly into AutoConnect</p>
<p>This way does not require an explicit declaration of AutoConnectAux objects with sketches and is also useful when importing the custom Web pages JSON document from an external file such as SPIFFS because the page definition and sketch coding structure can be separated.</p>
<p>Using the <a href="api.html#load">AutoCoonnect::load</a> function, AutoConnect dynamically generates the necessary AutoConnectAux objects internally based on the custom Web page definition of the imported JSON document content. In the sketch, the generated AutoConnectAux object can be referenced using the <a href="api.html#aux">AutoConnect::aux</a> function. You can reach the AutoConnectElements you desired using the <a href="apiaux.html#getelement">AutoConnectAux::getElement</a> function of its AutoConnectAux.</p>
<p>Using the <a href="api.html#load">AutoCoonnect::load</a> function, AutoConnect dynamically generates the necessary AutoConnectAux objects internally based on the custom Web page definition of the imported JSON document content. In the Sketch, the generated AutoConnectAux object can be referenced using the <a href="api.html#aux">AutoConnect::aux</a> function. You can reach the AutoConnectElements you desired using the <a href="apiaux.html#getelement">AutoConnectAux::getElement</a> function of its AutoConnectAux.</p>
<p>In the following example, it loads in a batch a JSON document of custom Web pages stored in SPIFFS and accesses to the AutoConnectInput element.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">[</span>
<span style="color: #f8f8f2">{</span>
@ -1634,7 +1634,7 @@
</li>
<li>
<p>Load to AutoConnectAux and join to AutoConnect</p>
<p>This way declares AutoConnectAux in the sketch and loads the custom Web pages JSON document there. It has an advantage for if you want to define each page of a custom Web page individually or allocate AutoConnectAux objects dynamically on the sketch side.</p>
<p>This way declares AutoConnectAux in the Sketch and loads the custom Web pages JSON document there. It has an advantage for if you want to define each page of a custom Web page individually or allocate AutoConnectAux objects dynamically on the Sketch side.</p>
<p>After loading a JSON document using the <a href="apiaux.html#load">AutoConnectAux::load</a> function by each, integrate those into AutoConnect using the <a href="api.html#join">AutoConnect::join</a> function.</p>
<p>In the following example, you can see the difference between two sketches in a sketch modified using the AutoConnectAux::load.</p>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">{</span>
@ -1734,7 +1734,7 @@ An example of using each function is as follows.
<h4 id="autoconnect_jsonpsram_size">AUTOCONNECT_JSONPSRAM_SIZE<a class="headerlink" href="#autoconnect_jsonpsram_size" title="Permanent link">&para;</a></h4>
<p>For ESP32 module equips with PSRAM, you can allocate the JSON document buffer to PSRAM. Buffer allocation to PSRAM will enable when <strong>PSRAM:Enabled</strong> option selected in the Arduino IDE's Board Manager menu. It is available since ArduinoJson 6.10.0.</p>
<h2 id="saving-json-document">Saving JSON document<a class="headerlink" href="#saving-json-document" title="Permanent link">&para;</a></h2>
<p>The sketch can persist AutoConnectElements as a JSON document and also uses <a href="achandling.html#saving-autoconnectelements-with-json">this function</a> to save the values entered on the custom Web page. And you can reload the saved JSON document into AutoConnectElements as the field in a custom Web page using the <a href="achandling.html#loading-autoconnectaux-autoconnectelements-with-json">load function</a>. </p>
<p>the Sketch can persist AutoConnectElements as a JSON document and also uses <a href="achandling.html#saving-autoconnectelements-with-json">this function</a> to save the values entered on the custom Web page. And you can reload the saved JSON document into AutoConnectElements as the field in a custom Web page using the <a href="achandling.html#loading-autoconnectaux-autoconnectelements-with-json">load function</a>. </p>
<div class="footnote">
<hr />
<ol>

@ -964,12 +964,12 @@
<h1>File upload handler</h1>
<h2 id="uploading-file-from-web-browser">Uploading file from Web Browser<a class="headerlink" href="#uploading-file-from-web-browser" title="Permanent link">&para;</a></h2>
<p>If you have to write some data individually to the ESP8266/ESP32 module for the sketch behavior, the <a href="acelements.html#autoconnectfile">AutoConnectFile</a> element will assist with your wants implementation. The AutoConnectFile element produces an HTML <code>&lt;input type="file"&gt;</code> tag and can save uploaded file to the flash or external SD of the ESP8266/ESP32 module. The handler for saving is built into AutoConnect. You can use it to inject any sketch data such as the initial values for the custom Web page into the ESP module via OTA without using the sketch data upload tool of Arduino-IDE.
<p>If you have to write some data individually to the ESP8266/ESP32 module for the Sketch behavior, the <a href="acelements.html#autoconnectfile">AutoConnectFile</a> element will assist with your wants implementation. The AutoConnectFile element produces an HTML <code>&lt;input type="file"&gt;</code> tag and can save uploaded file to the flash or external SD of the ESP8266/ESP32 module. The handler for saving is built into AutoConnect. You can use it to inject any sketch data such as the initial values for the custom Web page into the ESP module via OTA without using the Sketch data upload tool of Arduino-IDE.
<p style="display:block;margin-left:auto;margin-right:auto;width:603px;height:368px;border:1px solid lightgray;"><img data-gifffer="images/upload.gif" data-gifffer-width="601" data-gifffer-height="366""/></p></p>
<h2 id="basic-steps-of-the-file-upload-sketch">Basic steps of the file upload sketch<a class="headerlink" href="#basic-steps-of-the-file-upload-sketch" title="Permanent link">&para;</a></h2>
<p>Here is the basic procedure of the sketch which can upload files from the client browser using AutoConnectFile:<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup></p>
<p>Here is the basic procedure of the Sketch which can upload files from the client browser using AutoConnectFile:<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup></p>
<ol>
<li>Place AutoConnectFile on a custom Web page by writing JSON or constructor code directly with the sketch.</li>
<li>Place AutoConnectFile on a custom Web page by writing JSON or constructor code directly with the Sketch.</li>
<li>Place other AutoConnectElements as needed.</li>
<li>Place AutoConnectSubmit on the same custom Web page.</li>
<li>Perform the following process in the on-handler of submitting destination:<ul>
@ -1099,7 +1099,7 @@
<p><code>AUTOCONNECT_SD_SPEED</code> defines SPI clock speed depending on the connected device.</p>
<div class="admonition info">
<p class="admonition-title">Involves both the begin() and the end()</p>
<p>The built-in uploader executes the begin and end functions regardless of the sketch whence the file system of the device will terminate with the uploader termination. Therefore, to use the device in the sketch after uploading, you need to <strong>restart it with the begin</strong> function.</p>
<p>The built-in uploader executes the begin and end functions regardless of the Sketch whence the file system of the device will terminate with the uploader termination. Therefore, to use the device in the Sketch after uploading, you need to <strong>restart it with the begin</strong> function.</p>
</div>
<h2 id="when-it-will-be-uploaded">When it will be uploaded<a class="headerlink" href="#when-it-will-be-uploaded" title="Permanent link">&para;</a></h2>
<p>Upload handler will be launched by ESP8266WebServer/WebServer(as ESP32) library which is triggered by receiving an HTTP stream of POST BODY including file content. Its launching occurs before invoking the page handler.</p>
@ -1112,7 +1112,7 @@
<p>You can output the file to any device using a custom uploader by specifying <a href="acjson.html#acfile"><strong>extern</strong></a> with the <a href="acjson.html#acfile"><strong>store</strong></a> attribute of <a href="acjson.html#acfile">AutoConnectFile</a> (or specifying <a href="acelements.html#store"><strong>AC_File_Extern</strong></a> for the <a href="apielements.html#store"><strong>store</strong></a> member variable) and can customize the uploader according to the need to upload files to other than Flash or SD. Implements your own uploader with inheriting the <a href="#upload-handler-base-class"><strong>AutoConnectUploadHandler</strong></a> class which is the base class of the upload handler.</p>
<div class="admonition note">
<p class="admonition-title">It's not so difficult</p>
<p>Implementing the custom uploader requires a little knowledge of the c++ language. If you are less attuned to programming c++, you may find it difficult. But don't worry. You can make it in various situations by just modifying the sketch skeleton that appears at the end of this page.</p>
<p>Implementing the custom uploader requires a little knowledge of the c++ language. If you are less attuned to programming c++, you may find it difficult. But don't worry. You can make it in various situations by just modifying the Sketch skeleton that appears at the end of this page.</p>
</div>
<h3 id="upload-handler-base-class"><i class="fa fa-code"></i> Upload handler base class<a class="headerlink" href="#upload-handler-base-class" title="Permanent link">&para;</a></h3>
<p>AutoConnectUploadHandler is a base class of upload handler and It has one public member function and three protected functions. </p>
@ -1218,7 +1218,7 @@
<dd><span class="apidef">T</span><span class="apidesc">Specifies a class name of the custom uploader. This class name is a class that you implemented by inheriting AutoConnectUploadHandler for custom upload.</span></dd>
<dd><span class="apidef">uploadClass</span><span class="apidesc">Specifies the custom upload class instance.</span></dd>
</dl></p>
<p>The rough structure of the sketches that completed these implementations will be as follows:</p>
<p>The rough structure of the Sketches that completed these implementations will be as follows:</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WiFi.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WebServer.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;AutoConnect.h&gt;</span>

@ -370,6 +370,13 @@
Captive portal start detection
</a>
</li>
<li class="md-nav__item">
<a href="#captive-portal-starting-control" class="md-nav__link">
Captive portal starting control
</a>
</li>
<li class="md-nav__item">
@ -1041,6 +1048,13 @@
Captive portal start detection
</a>
</li>
<li class="md-nav__item">
<a href="#captive-portal-starting-control" class="md-nav__link">
Captive portal starting control
</a>
</li>
<li class="md-nav__item">
@ -1245,7 +1259,7 @@
<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 (WebServer as ESP32). 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.html#onnotfound"><em>AutoConnect::onNotFound</em></a>.</p>
<h3 id="access-to-saved-credentials"><i class="fa fa-caret-right"></i> Access to saved credentials<a class="headerlink" href="#access-to-saved-credentials" title="Permanent link">&para;</a></h3>
<p>AutoConnect stores the established WiFi connection in the flash of the ESP8266/ESP32 module and equips the class to access it from the sketch. You can read, write or erase the credentials using this class individually. It's <a href="credit.html#autoconnectcredential">AutoConnectCredential</a> class which provides the access method to the saved credentials in the flash. Refer to section <a href="credit.html">Saved credentials access</a> for details.</p>
<p>AutoConnect stores the established WiFi connection in the flash of the ESP8266/ESP32 module and equips the class to access it from the Sketch. You can read, write or erase the credentials using this class individually. It's <a href="credit.html#autoconnectcredential">AutoConnectCredential</a> class which provides the access method to the saved credentials in the flash. Refer to section <a href="credit.html">Saved credentials access</a> for details.</p>
<div class="admonition note">
<p class="admonition-title">Where to store credentials in ESP32 with AutoConnect v1.0.0 or later</p>
<p>Since v1.0.0, credentials are stored in nvs of ESP32. AutoConnect v1.0.0 or later accesses the credentials area using the <strong>Preferences</strong> class with the arduino esp-32 core. So in ESP32, the credentials are not in the EEPROM, it is in the namespace <strong>AC_CREDT</strong> of the nvs. See <a href="credit.html">Saved credentials access</a> for details.<br />
@ -1304,7 +1318,7 @@ See the <a href="credit.html">Saved credentials access</a> chapter for details o
</table></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.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>
<p>The captive portal will only be activated if 1<sup>st</sup>-WiFi::begin fails. Sketch can detect with the <a href="api.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" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">AutoConnect</span> <span style="color: #f8f8f2">Portal;</span>
<span style="background-color: #49483e"><span style="color: #66d9ef">bool</span> <span style="color: #a6e22e">startCP</span><span style="color: #f8f8f2">(IPAddress</span> <span style="color: #f8f8f2">ip)</span> <span style="color: #f8f8f2">{</span>
@ -1328,8 +1342,32 @@ See the <a href="credit.html">Saved credentials access</a> chapter for details o
<span style="color: #f8f8f2">}</span>
</code></pre></div>
<h3 id="captive-portal-starting-control"><i class="fa fa-caret-right"></i> Captive portal starting control<a class="headerlink" href="#captive-portal-starting-control" title="Permanent link">&para;</a></h3>
<p>Basically, the captive portal launch is subject to 1<sup>st</sup>-WiFi.begin result, but Sketch can control it. The Sketch can direct the following four actions by configuring AutoConnect with two parameters, <a href="apiconfig.html#immediatestart"><em>AutoConnectConfig::immediateStart</em></a> and <a href="apiconfig.html#autorise"><em>AutoConnectConfig::autoRise</em></a>.</p>
<table>
<tr>
<th rowspan="2" align="center">AutoConnectConfig<br>::immediateStart</th>
<th colspan="2" align="center">AutoConnectConfig::autoRise</th>
</tr>
<tr>
<td>true</td>
<td>false</td>
</tr>
<tr>
<td>true</td>
<td>Skip 1st-WiFi.begin<br>ESP module becomes SoftAP and the captive portal starts immediately.<br></td>
<td>Not attempt WiFi connection.<br>Only WebServer will start in STA mode.</td>
</tr>
<tr>
<td>false</td>
<td>Attempts WiFi connection in STA mode.<br>In some cases, the autoReconnect may restore the connection even if 1st-WiFiBeing fails.<br>If the connection is completely lost, the captive portal will be launched.<br><b>This is the default.</b></td>
<td>Attempts WiFi connection in STA mode.<br>In some cases, the autoReconnect may restore the connection even if 1st-WiFiBeing fails.<br>ESP module stays in STA mode and WebServer will start.</td>
</tr>
</table>
<h3 id="captive-portal-timeout-control"><i class="fa fa-caret-right"></i> Captive portal timeout control<a class="headerlink" href="#captive-portal-timeout-control" title="Permanent link">&para;</a></h3>
<p>AutoConnect has two parameters for timeout control. One is a timeout value used when trying to connect to the specified AP. It behaves the same as general timeout control in connection attempt by WiFi.begin. This control is specified by the third parameter of <a href="api.html#begin"><em>AutoConnect::begin</em></a>. The default value is macro defined by <a href="api.html#defined-macros"><strong>AUTOCONNECT_TIMEOUT</strong></a> in the <strong>AutoConnectDefs.h</strong> file.</p>
<p>Once AutoConnect has entered the captive portal state due to the above conditions, it will not exit until a WiFi connection can be established. (But that is the default behavior)</p>
<p>The Sketch can abort the <a href="api.html#begin"><em>AutoConnect::begin</em></a> by setting the captive portal timeout and returns control to Sketch. AutoConnect has two parameters for timeout control. One is a timeout value used when trying to connect to the specified AP. It behaves the same as general timeout control in connection attempt by WiFi.begin. This control is specified by the third parameter of <a href="api.html#begin"><em>AutoConnect::begin</em></a>. The default value is macro defined by <a href="api.html#defined-macros"><strong>AUTOCONNECT_TIMEOUT</strong></a> in the <strong>AutoConnectDefs.h</strong> file.</p>
<p>The other timeout control is for the captive portal itself. It is useful when you want to continue sketch execution with offline even if the WiFi connection is not possible. You can also combine it with the <a href="#on-demand-start-the-captive-portal"><strong>immediateStart</strong></a> option to create sketches with high mobility.</p>
<p>The timeout of the captive portal is specified together with <a href="apiconfig.html#portaltimeout"><em>AutoConnectConfig::portalTimeout</em></a> as follows.</p>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WiFi.h&gt;</span>
@ -1380,7 +1418,7 @@ Also, if you want to stop AutoConnect completely when the captive portal is time
<span style="color: #f8f8f2">}</span>
</code></pre></div>
<p>There is another option related to timeout in AutoConnectConfig. It can make use of the captive portal function even after a timeout. The <a href="apiconfig.html#retainportal"><em>AutoConnectConfig::retainPortal</em></a> option will not stop the SoftAP when the captive portal is timed out. If you enable the ratainPortal option, you can try to connect to the AP at any time while continuing to sketch execution with offline even after the captive portal timed-out. Compared to the above code specified no option with the following example code, the captive portal will remain available even after a timeout without changing the logic of the sketch.</p>
<p>There is another option related to timeout in AutoConnectConfig. It can make use of the captive portal function even after a timeout. The <a href="apiconfig.html#retainportal"><em>AutoConnectConfig::retainPortal</em></a> option will not stop the SoftAP when the captive portal is timed out. If you enable the ratainPortal option, you can try to connect to the AP at any time while continuing to sketch execution with offline even after the captive portal timed-out. Compared to the above code specified no option with the following example code, the captive portal will remain available even after a timeout without changing the logic of the Sketch.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WiFi.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WebServer.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;AutoConnect.h&gt;</span>
@ -1464,7 +1502,7 @@ Also, if you want to stop AutoConnect completely when the captive portal is time
<ol>
<li>
<p>Overwrite the label literal of library source code directly.</p>
<p>You can change the label of the AutoConnect menu item by rewriting the default label literal in <a href="https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnectLabels.h">AutoConnectLabels.h</a> macros. However, changing menu items literal influences all the sketch's build scenes.</p>
<p>You can change the label of the AutoConnect menu item by rewriting the default label literal in <a href="https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnectLabels.h">AutoConnectLabels.h</a> macros. However, changing menu items literal influences all the Sketch's build scenes.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #7a7a7a">#define AUTOCONNECT_MENULABEL_CONFIGNEW &quot;Configure new AP&quot;</span>
<span style="color: #7a7a7a">#define AUTOCONNECT_MENULABEL_OPENSSIDS &quot;Open SSIDs&quot;</span>
<span style="color: #7a7a7a">#define AUTOCONNECT_MENULABEL_DISCONNECT &quot;Disconnect&quot;</span>
@ -1489,7 +1527,7 @@ And PlatformIO is a build system. Library sources will not be compiled unless Au
</li>
</ol>
<h3 id="combination-with-mdns"><i class="fa fa-caret-right"></i> Combination with mDNS<a class="headerlink" href="#combination-with-mdns" title="Permanent link">&para;</a></h3>
<p>With <a href="https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266mDNS">mDNS library</a>, you can access to ESP8266 by name instead of IP address after connection. The sketch can start the MDNS responder after <a href="api.html#begin"><em>AutoConnect::begin</em></a>.</p>
<p>With <a href="https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266mDNS">mDNS library</a>, you can access to ESP8266 by name instead of IP address after connection. The Sketch can start the MDNS responder after <a href="api.html#begin"><em>AutoConnect::begin</em></a>.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WiFi.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266mDNS.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WebServer.h&gt;</span>
@ -1536,7 +1574,7 @@ Combining these two parameters allows you to filter the destination AP when mult
<td>Restoring static IPs suitable for the SSID from saved credentials</td>
</tr>
<tr>
<td>Specified with the sketch</td>
<td>Specified with the Sketch</td>
<td>Not efective</td>
<td>By AutoConnect::begin parameters</td>
<td>Use the specified value of AutoConnectConfig</td>
@ -1560,7 +1598,7 @@ Combining these two parameters allows you to filter the destination AP when mult
</code></pre></div>
<h3 id="disable-the-captive-portal"><i class="fa fa-caret-right"></i> Disable the captive portal<a class="headerlink" href="#disable-the-captive-portal" title="Permanent link">&para;</a></h3>
<p>It can also prevent the captive portal from starting even if the connection at the first <em>WiFi.begin</em> fails. In this case, <a href="api.html#begin"><em>AutoConnect::begin</em></a> behaves same as <em>WiFi.begin</em>.</p>
<p>It can also prevent the captive portal from starting even if the connection at the 1<sup>st</sup>-WiFi.begin fails. In this case, <a href="api.html#begin"><em>AutoConnect::begin</em></a> behaves same as <em>WiFi.begin</em>.</p>
<p>For disabling the captive portal, <a href="apiconfig.html#autorise"><strong>autoRise</strong></a> sets to false with <a href="apiconfig.html">AutoConnectConfig</a>.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">AutoConnect</span> <span style="color: #f8f8f2">portal;</span>
<span style="color: #f8f8f2">AutoConnectConfig</span> <span style="color: #f8f8f2">acConfig;</span>
@ -1704,7 +1742,7 @@ Known access point credentials are saved by AutoConnect, to the ESP module can u
<p>The host() can be referred at after <em>AutoConnect::begin</em>.</p>
</div>
<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.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>
<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.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" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WiFi.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;ESP8266WebServer.h&gt;</span>
<span style="color: #7a7a7a">#include</span> <span style="color: #7a7a7a">&lt;AutoConnect.h&gt;</span>
@ -1741,7 +1779,7 @@ Known access point credentials are saved by AutoConnect, to the ESP module can u
<div class="admonition note">
<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>
<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 or WebServer::begin</p>
@ -1774,7 +1812,7 @@ Known access point credentials are saved by AutoConnect, to the ESP module can u
<h3 id="assign-user-sketchs-home-path"><i class="fa fa-caret-right"></i> Assign user sketch's home path<a class="headerlink" href="#assign-user-sketchs-home-path" title="Permanent link">&para;</a></h3>
<p><strong>HOME</strong> for returning to the user's sketch homepage will display at the bottom of the AutoConnect menu. It could be set using the <a href="api.html#home"><em>AutoConnect::home</em></a> function.</p>
<p><img src="images/menu_home.png" /></p>
<p>The sketch HOME path is closely related to the <a href="apiconfig.html#booturi">bootUri</a> that specifies the access path on module restart. AutoConnect has the following three parameters concerning control the URIs:</p>
<p>The Sketch HOME path is closely related to the <a href="apiconfig.html#booturi">bootUri</a> that specifies the access path on module restart. AutoConnect has the following three parameters concerning control the URIs:</p>
<ul>
<li><strong>AUTOCONNECT_URI</strong><br />
The <strong>ROOT</strong> of AutoConnect. It is defined in <code>AutoConnectDefs.h</code> and is assigned an <a href="menu.html#where-the-from">AutoConnect statistics screen</a> by default.</li>
@ -1872,7 +1910,7 @@ See the <a href="otabrowser.html">Updates with the Web Browser</a> chapter for d
<p>You can also assign no password to SoftAP launched as a captive portal. Assigning a null string as <code>String("")</code> to <a href="apiconfig.html#psk"><em>AutoConnectConfig::psk</em></a> does not require a password when connecting to SoftAP.<br />
But this method is not recommended. The broadcast radio of SSID emitted from SoftAP will leak and reach several tens of meters.</p>
<h3 id="configuration-for-soft-ap-and-captive-portal"><i class="fa fa-caret-right"></i> Configuration for Soft AP and captive portal<a class="headerlink" href="#configuration-for-soft-ap-and-captive-portal" title="Permanent link">&para;</a></h3>
<p>AutoConnect will activate SoftAP at failed the first <em>WiFi.begin</em>. It SoftAP settings are stored in <a href="apiconfig.html#autoconnectconfig"><strong>AutoConnectConfig</strong></a> as the following parameters. The sketch could be configured SoftAP using these parameters, refer the <a href="apiconfig.html#public-member-variables">AutoConnectConfig API</a> for details.</p>
<p>AutoConnect will activate SoftAP at failed the 1<sup>st</sup>-WiFi.begin. It SoftAP settings are stored in <a href="apiconfig.html#autoconnectconfig"><strong>AutoConnectConfig</strong></a> as the following parameters. The Sketch could be configured SoftAP using these parameters, refer the <a href="apiconfig.html#public-member-variables">AutoConnectConfig API</a> for details.</p>
<h3 id="configure-wifi-channel"><i class="fa fa-caret-right"></i> Configure WiFi channel<a class="headerlink" href="#configure-wifi-channel" title="Permanent link">&para;</a></h3>
<p>Appropriately specifying the WiFi channel to use for ESP8266 and ESP32 is essential for a stable connection with the access point. AutoConnect remembers the WiFi channel with a credential of the access point once connected and reuses it.</p>
<p>The default channel when a captive portal starts and AutoConnect itself becomes an access point is the <a href="apiconfig.html#channel"><em>AutoConnectConfig::channel</em></a> member. If this channel is different from the channel of the access point you will attempt to connect, WiFi.begin may fail. The cause is that the ESP module shares the same channel in AP mode and STA mode. If the connection attempt is not stable, specifying a proper channel using AutoConnectConfig::channel may result in a stable connection.</p>

@ -1194,7 +1194,7 @@
</code></pre></div>
<p>Run the AutoConnect site using the externally ensured ESP8266WebServer for ESP8266 or WebServer for ESP32.</p>
<p>The <a href="api.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.html#host"><strong>host</strong></a> function.
<p>The <a href="api.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.html#host"><strong>host</strong></a> function.
<dl class="apidl">
<dt><strong>Parameter</strong></dt>
<dd><span class="apidef">webServer</span><span class="apidesc">A reference of ESP8266WebServer or WebServer instance.</span></dd>

@ -1315,7 +1315,7 @@ Register the upload handler of the AutoConnectAux.
<h3 id="release"><i class="fa fa-caret-right"></i> release<a class="headerlink" href="#release" title="Permanent link">&para;</a></h3>
<p><div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #66d9ef">bool</span> <span style="color: #f8f8f2">release(</span><span style="color: #66d9ef">const</span> <span style="color: #f8f8f2">String</span><span style="color: #f92672">&amp;</span> <span style="color: #f8f8f2">name)</span>
</code></pre></div>
Release a specified AutoConnectElement from AutoConnectAux. The release function is provided to dynamically change the structure of the custom Web pages with the sketch. By combining the release function and the <a href="apiaux.html#add">add</a> function or the <a href="apiaux.html#loadelement">loadElement</a> function, the sketch can change the style of the custom Web page according to its behavior.
Release a specified AutoConnectElement from AutoConnectAux. The release function is provided to dynamically change the structure of the custom Web pages with the Sketch. By combining the release function and the <a href="apiaux.html#add">add</a> function or the <a href="apiaux.html#loadelement">loadElement</a> function, the Sketch can change the style of the custom Web page according to its behavior.
<dl class="apidl">
<dt><strong>Parameter</strong></dt>
<dd><span class="apidef">name</span><span class="apidesc">Specifies the name of AutoConnectElements to be released.</span></dd>
@ -1359,7 +1359,7 @@ Sets the value of the specified AutoConnectElement. If values is specified
</dl></p>
<div class="admonition hint">
<p class="admonition-title">You can directly access the value member variable.</p>
<p>If you are gripping with the sketch to the AutoConnectElements of the target that sets the value, you can access the value member variable directly. The following sketch code has the same effect.
<p>If you are gripping with the Sketch to the AutoConnectElements of the target that sets the value, you can access the value member variable directly. The following sketch code has the same effect.
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">AutoConnectAux</span> <span style="color: #f8f8f2">aux;</span>
<span style="color: #7a7a7a">// ... Griping the AutoConnectText here.</span>
<span style="color: #f8f8f2">aux.setElementValue(</span><span style="color: #e6db74">&quot;TEXT_FIELD&quot;</span><span style="color: #f8f8f2">,</span> <span style="color: #e6db74">&quot;New value&quot;</span><span style="color: #f8f8f2">);</span>

@ -1368,7 +1368,7 @@ If the connection fails, starts the captive portal in SoftAP+STA mode.<br />
<dd><span class="apidef">false</span><span class="apidesc">No reset.</span></dd>
</dl></p>
<h3 id="autorise"><i class="fa fa-caret-right"></i> autoRise<a class="headerlink" href="#autorise" title="Permanent link">&para;</a></h3>
<p>Captive portal activation switch. False for disabling the captive portal. It prevents starting the captive portal even if the connection at the first <em>WiFi.begin</em> fails.
<p>Captive portal activation switch. False for disabling the captive portal. It prevents starting the captive portal even if the connection at the 1<sup>st</sup>-WiFi.begin fails.
<dl class="apidl">
<dt><strong>Type</strong></dt>
<dd>bool</dd>
@ -1404,7 +1404,7 @@ This option is valid only for ESP8266 or ESP32 arduino core 1.0.2 earlier.
</dl></p>
<div class="admonition warning">
<p class="admonition-title">It will conflict with user data.</p>
<p>If the sketch leaves this offset at zero, it will conflict the storage area of credentials with the user sketch owned data. It needs to use the behind of credential area.</p>
<p>If the Sketch leaves this offset at zero, it will conflict the storage area of credentials with the user sketch owned data. It needs to use the behind of credential area.</p>
</div>
<h3 id="channel"><i class="fa fa-caret-right"></i> channel<a class="headerlink" href="#channel" title="Permanent link">&para;</a></h3>
<p>The channel number of WIFi when SoftAP starts.
@ -1458,13 +1458,13 @@ This option is valid only for ESP8266 or ESP32 arduino core 1.0.2 earlier.
<dd>String</dd>
</dl></p>
<h3 id="immediatestart"><i class="fa fa-caret-right"></i> immediateStart<a class="headerlink" href="#immediatestart" title="Permanent link">&para;</a></h3>
<p>Disable the first WiFi.begin() and start the captive portal. If this option is enabled, the module will be in AP_STA mode and the captive portal will be activated regardless of <a href="apiconfig.html#autorise"><strong>AutoConnectConfig::autoRise</strong></a> specification.
<p>Disable the 1<sup>st</sup>-WiFi.begin and start the captive portal. If this option is enabled, the module will be in AP_STA mode and the captive portal. The evaluation rank of this parameter is lower than the <a href="apiconfig.html#autorise"><strong>AutoConnectConfig::autoRise</strong></a>. Even if immediateStart is true, the captive portal will not launch if autoRise is false.
<dl class="apidl">
<dt><strong>Type</strong></dt>
<dd>bool</dd>
<dt><strong>Value</strong></dt>
<dd><span class="apidef">true</span><span class="apidesc">Start the captive portal with <a href="api.html#begin"><strong>AutoConnect::begin</strong></a>.</span></dd>
<dd><span class="apidef">false</span><span class="apidesc">Enable the first WiFi.begin() and it will start captive portal when connection failed. This is default.</span></dd>
<dd><span class="apidef">false</span><span class="apidesc">Enable the 1<sup>st</sup>-WiFi.begin and it will start captive portal when connection failed. This is default.</span></dd>
</dl></p>
<h3 id="menuitems"><i class="fa fa-caret-right"></i> menuItems<a class="headerlink" href="#menuitems" title="Permanent link">&para;</a></h3>
<p>Configure applying items of the <a href="menu.html">AutoConnect menu</a>. You can arbitrarily combine valid menus by coordinating the menuItems value.
@ -1502,7 +1502,7 @@ However, even if you specify like the above, the AutoConnectAux page items still
<dd><span class="apidef">IPAddress</span><span class="apidesc">The default value is <strong>255.255.255.0</strong></span></dd>
</dl></p>
<h3 id="ota"><i class="fa fa-caret-right"></i> ota<a class="headerlink" href="#ota" title="Permanent link">&para;</a></h3>
<p>Specifies to import the built-in OTA update class into the sketch. When this option is enabled, an <strong>Update</strong> item will appear in the AutoConnect menu, and the OTA update via Web browser will be automatically embedded to the Sketch.
<p>Specifies to import the built-in OTA update class into the Sketch. When this option is enabled, an <strong>Update</strong> item will appear in the AutoConnect menu, and the OTA update via Web browser will be automatically embedded to the Sketch.
<dl class="apidl">
<dt><strong>Type</strong></dt>
<dd>AC_OTA_t</dd>
@ -1542,7 +1542,7 @@ However, even if you specify like the above, the AutoConnectAux page items still
</dl></p>
<div class="admonition hint">
<p class="admonition-title">Connection request after timed-out</p>
<p>With the <strong>retainPortal</strong>, even if AutoConnect::begin in the setup() is timed out, you can execute the sketch and the portal function as a WiFi connection attempt by calling AutoConnect::handleClient in the loop().</p>
<p>With the <strong>retainPortal</strong>, even if AutoConnect::begin in the setup() is timed out, you can execute the Sketch and the portal function as a WiFi connection attempt by calling AutoConnect::handleClient in the loop().</p>
</div>
<div class="admonition info">
<p class="admonition-title">All unresolved addresses redirects to /_ac</p>
@ -1608,7 +1608,7 @@ However, even if you specify like the above, the AutoConnectAux page items still
<span style="color: #f8f8f2">Config.boundaryOffset</span> <span style="color: #f92672">=</span> <span style="color: #ae81ff">64</span><span style="color: #f8f8f2">;</span> <span style="color: #7a7a7a">// Reserve 64 bytes for the user data in EEPROM.</span>
<span style="color: #f8f8f2">Config.portalTimeout</span> <span style="color: #f92672">=</span> <span style="color: #ae81ff">60000</span><span style="color: #f8f8f2">;</span> <span style="color: #7a7a7a">// Sets timeout value for the captive portal</span>
<span style="color: #f8f8f2">Config.retainPortal</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">true;</span> <span style="color: #7a7a7a">// Retains the portal function after timed-out</span>
<span style="color: #f8f8f2">Config.homeUri</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">&quot;/index.html&quot;</span><span style="color: #f8f8f2">;</span> <span style="color: #7a7a7a">// Sets home path of the sketch application</span>
<span style="color: #f8f8f2">Config.homeUri</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">&quot;/index.html&quot;</span><span style="color: #f8f8f2">;</span> <span style="color: #7a7a7a">// Sets home path of Sketch application</span>
<span style="color: #f8f8f2">Config.title</span> <span style="color: #f92672">=</span><span style="color: #e6db74">&quot;My menu&quot;</span><span style="color: #f8f8f2">;</span> <span style="color: #7a7a7a">// Customize the menu title</span>
<span style="color: #f8f8f2">Config.staip</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">IPAddress(</span><span style="color: #ae81ff">192</span><span style="color: #f8f8f2">,</span><span style="color: #ae81ff">168</span><span style="color: #f8f8f2">,</span><span style="color: #ae81ff">10</span><span style="color: #f8f8f2">,</span><span style="color: #ae81ff">10</span><span style="color: #f8f8f2">);</span> <span style="color: #7a7a7a">// Sets static IP</span>
<span style="color: #f8f8f2">Config.staGateway</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">IPAddress(</span><span style="color: #ae81ff">192</span><span style="color: #f8f8f2">,</span><span style="color: #ae81ff">168</span><span style="color: #f8f8f2">,</span><span style="color: #ae81ff">10</span><span style="color: #f8f8f2">,</span><span style="color: #ae81ff">1</span><span style="color: #f8f8f2">);</span> <span style="color: #7a7a7a">// Sets WiFi router address</span>

@ -819,7 +819,7 @@
<li>Bar type <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAApklEQVRYR2NkGGDAOMD2M4w6YDQEkEMgEJggZwCxGI0T5mug+alAvBFkD7IDXtLBcpjfXgEZ4ugOeAETpHEIgIwHeVYC3QH+0CgAS9AQgCwHRcFmdAfQ0E7cRo9mw0EVAqPlAKhwEKVTVsBZDsyiQ2k4Wg6gxPKgyoZ0Sn+o1iCHQBBQaiYQi9DYJTjbAyAJWluOtz0wWg7QOOqxGz+aDUdDYMBDAACA0x4hs/MPrwAAAABJRU5ErkJggg==" title="AutoConnect menu" alt="AutoConnect menu" /></li>
<li>Cog type <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAC2klEQVRIS61VvWsUQRSfmU2pon9BUIkQUaKFaCBKgooSb2d3NSSFKbQR/KrEIiIKBiGF2CgRxEpjQNHs7mwOUcghwUQ7g58IsbGxEBWsb2f8zR177s3t3S2cA8ftzPu993vzvoaSnMu2vRKlaqgKp74Q/tE8qjQPyHGcrUrRjwlWShmDbFMURd/a6TcQwNiYUmpFCPElUebcuQ2vz6aNATMVReHEPwzfSSntDcNwNo2rI+DcvQzhpAbA40VKyV0p1Q9snzBG1qYVcYufXV1sREraDcxpyHdXgkfpRBj6Uwm2RsC5dxxmZ9pdOY9cKTISRcHTCmGiUCh4fYyplTwG2mAUbtMTBMHXOgK9QfyXEZr+TkgQ1oUwDA40hEgfIAfj+HuQRaBzAs9eKyUZ5Htx+T3ZODKG8DzOJMANhmGomJVMXPll+hx9UUAlzZrJJ4QNCDG3VEfguu7mcpmcB/gkBOtShhQhchAlu5jlLUgc9ENgyP5gf9+y6LTv+58p5zySkgwzLNOIGc8sEoT1Lc53NMlbCQQuvMxeCME1NNPVVkmH/i3IzzXDtCSA0qQQwZWOCJDY50jsQRjJmkslEOxvTcDRO6zPxOh5xZglKkYLhWM9jMVnkIsTyMT6NBj7IbOCEjm6HxNVVTo2WXqEWJZ1T8rytB6GxizyDkPhWVpBqfiXUtbo/HywYJSpA9kMamNNPZ71R9Hcm+TMHHZNGw3EuraXEUldbfvw25UdOjqOt+JhMwJd7+jSTpZaEiIcaCDwPK83jtWnTkwnunFMtxeL/ge9r4XItt1RNNaj/0GAcV2bR3U5sG3nEh6M61US+Qrfd9Bs31GGulI2GOS/8dgcQZV1w+ApjIxB7TDwF9GcNzJzoA+rD0/8HvPnXQJCt2qFCwbBTfRI7UyXumWVt+HJ9NO4XI++bdsb0YyrqXmlh+AWOLHaLqS5CLQR5EggR3YlcVS9gKeH2hnX8r8Kmi1CAsl36QAAAABJRU5ErkJggg==" title="AutoConnect menu" alt="AutoConnect menu" /></li>
</ul>
<p>To reference the icon, use the <strong>AUTOCONNECT_LINK</strong> macro in the sketch. It expands into the string literal as an HTML <code>&lt;a&gt;&lt;/a&gt;</code> tag with PNG embedded of the AutoConnect menu hyperlinks. Icon type is specified by the parameter of the macro.</p>
<p>To reference the icon, use the <strong>AUTOCONNECT_LINK</strong> macro in the Sketch. It expands into the string literal as an HTML <code>&lt;a&gt;&lt;/a&gt;</code> tag with PNG embedded of the AutoConnect menu hyperlinks. Icon type is specified by the parameter of the macro.</p>
<dl class="apidl">
<dd><span class="apidef">BAR_24</span>Bars icon, 24x24.</dd>
<dd><span class="apidef">BAR_32</span>Bars icon, 32x32.</dd>

@ -327,7 +327,7 @@
<li class="md-nav__item">
<a href="#embed-to-the-sketches" class="md-nav__link">
Embed to the sketches
Embed to the Sketches
</a>
</li>
@ -347,7 +347,7 @@
<li class="md-nav__item">
<a href="#basic-logic-sequence-for-the-user-sketches" class="md-nav__link">
Basic logic sequence for the user sketches
Basic logic sequence for the user Sketches
</a>
<nav class="md-nav">
@ -890,7 +890,7 @@
<li class="md-nav__item">
<a href="#embed-to-the-sketches" class="md-nav__link">
Embed to the sketches
Embed to the Sketches
</a>
</li>
@ -910,7 +910,7 @@
<li class="md-nav__item">
<a href="#basic-logic-sequence-for-the-user-sketches" class="md-nav__link">
Basic logic sequence for the user sketches
Basic logic sequence for the user Sketches
</a>
<nav class="md-nav">
@ -1002,8 +1002,8 @@
<h1>Basic usage</h1>
<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. The below sketch is for ESP8266. For ESP32, replace <code>ESP8266WebServer</code> with <code>WebServer</code> and <code>ESP8266WiFi.h</code> with <code>WiFi.h</code> respectively.</p>
<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. The below Sketch is for ESP8266. For ESP32, replace <code>ESP8266WebServer</code> with <code>WebServer</code> and <code>ESP8266WiFi.h</code> with <code>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>
@ -1015,7 +1015,7 @@
</ul>
<h2 id="basic-usage">Basic usage<a class="headerlink" href="#basic-usage" title="Permanent link">&para;</a></h2>
<h3 id="basic-logic-sequence-for-the-user-sketches"><i class="fa fa-caret-right"></i> Basic logic sequence for the user sketches<a class="headerlink" href="#basic-logic-sequence-for-the-user-sketches" title="Permanent link">&para;</a></h3>
<h3 id="basic-logic-sequence-for-the-user-sketches"><i class="fa fa-caret-right"></i> Basic logic sequence for the user Sketches<a class="headerlink" href="#basic-logic-sequence-for-the-user-sketches" title="Permanent link">&para;</a></h3>
<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>
@ -1028,7 +1028,7 @@
5.2 <strong>Starts </strong><code>AutoConnect::begin()</code><strong>.</strong><br />
5.3 <strong>Check WiFi connection status.</strong> </li>
<li><strong>loop()</strong><br />
6.1 <strong>Do the process for actual sketch.</strong><br />
6.1 <strong>Do the process for actual Sketch.</strong><br />
6.2 <strong>Invokes </strong><code>AutoConnect::handleClient()</code><strong>, or invokes </strong><code>ESP8266WebServer::handleClient()</code><strong>/</strong><code>WebServer::handleClient</code><strong> then </strong><code>AutoConnect::handleRequest()</code><strong>.</strong> </li>
</ol>
</div>
@ -1046,13 +1046,13 @@ or</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.html">AutoConnect menu</a>.</p>
</li>
<li>
<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.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.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>
<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-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.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> in the sketch.</p>
<p><a href="api.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> in 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. Once a WiFi connection establishes, the DNS server contributed by AutoConnect stops.</p>
@ -1060,7 +1060,7 @@ or</p>
<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.html#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>
<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>
@ -1088,10 +1088,10 @@ or</p>
</table>
<ul>
<li>
<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.html#host"><em>AutoConnect::host</em></a> as API to get it after <a href="api.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.html#host"><em>AutoConnect::host</em></a> as API to get it after <a href="api.html#begin"><em>AutoConnect::begin</em></a> performed.</p>
</li>
<li>
<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>
<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()/WebServer::handleClient()</strong>: AutoConnect menu can be dispatched but not works normally. It is necessary to call <a href="api.html#void-handlerequest"><em>AutoConnect::handleRequest</em></a> after <em>ESP8255WebServer::handleClient</em>/<em>WebServer::handleClient</em> invoking.</p>
@ -1109,7 +1109,7 @@ or</p>
<hr />
<ol>
<li id="fn:1">
<p>Each <em>VARIABLE</em> conforms to the actual declaration in the sketches.&#160;<a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">&#8617;</a></p>
<p>Each <em>VARIABLE</em> conforms to the actual declaration in the Sketches.&#160;<a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">&#8617;</a></p>
</li>
<li id="fn:2">
<p>WiFi SSID and Password can be specified AutoConnect::begin() too.&#160;<a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text">&#8617;</a></p>

@ -882,7 +882,7 @@
<h1>Custom colorized</h1>
<h2 id="autoconnect-menu-colorizing">AutoConnect menu colorizing<a class="headerlink" href="#autoconnect-menu-colorizing" title="Permanent link">&para;</a></h2>
<p>You can easily change the color of the AutoConnect menu. Menu colors can be changed statically by the AutoConnect menu color definition determined at compile time. You cannot change the color while the sketch is running.</p>
<p>You can easily change the color of the AutoConnect menu. Menu colors can be changed statically by the AutoConnect menu color definition determined at compile time. You cannot change the color while the Sketch is running.</p>
<p>The menu color scheme has been separated to <code>AutoConnectLabels.h</code> placed the AutoConnect library folder.<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup> You can change the color scheme of the menu with the following three color codes. The color code also accepts CSS standard color names.<sup id="fnref:2"><a class="footnote-ref" href="#fn:2">2</a></sup></p>
<p>In <code>AutoConnectLabels.h</code> you can find three definition macros for menu colors:</p>
<ul>

@ -1268,7 +1268,7 @@
<h1>FAQ</h1>
<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 <a href="http://ESP8266IPADDRESS/_ac">http://ESP8266IPADDRESS/_ac</a> from browser, probably the sketch uses <em>ESP8266WebServer::handleClient()</em> without <a href="api.html#handlerequest"><em>AutoConnect::handleRequest()</em></a>.<br />
<p>If you can access the <strong>AutoConnect root path</strong> as <a href="http://ESP8266IPADDRESS/_ac">http://ESP8266IPADDRESS/_ac</a> from browser, probably the Sketch uses <em>ESP8266WebServer::handleClient()</em> without <a href="api.html#handlerequest"><em>AutoConnect::handleRequest()</em></a>.<br />
For AutoConnect menus to work properly, call <a href="api.html#handlerequest"><em>AutoConnect::handleRequest()</em></a> after <em>ESP8266WebServer::handleClient()</em> invoked, or use <a href="api.html#handleclient"><em>AutoConnect::handleClient()</em></a>. <a href="api.html#handleclient"><em>AutoConnect::handleClient()</em></a> is equivalent <em>ESP8266WebServer::handleClient</em> combined <a href="api.html#handlerequest"><em>AutoConnect::handleRequest()</em></a>.</p>
<p>See also the explanation <a href="basicusage.html#esp8266webserver-hosted-or-parasitic">here</a>.</p>
<h2 id="after-updating-to-autoconnect-v100-established-aps-disappear-from-open-ssids-with-esp32"><i class="fa fa-question-circle"></i> After updating to AutoConnect v1.0.0, established APs disappear from Open SSIDs with ESP32.<a class="headerlink" href="#after-updating-to-autoconnect-v100-established-aps-disappear-from-open-ssids-with-esp32" title="Permanent link">&para;</a></h2>
@ -1295,7 +1295,7 @@ For AutoConnect menus to work properly, call <a href="api.html#handlerequest"><e
</li>
<li>
<p>Change the order of <code>#include</code> directives.</p>
<p>With the sketch, <code>#include &lt;ESP8266httpUpdate.h&gt;</code> before <code>#include &lt;AutoConnect.h&gt;</code>.</p>
<p>With the Sketch, <code>#include &lt;ESP8266httpUpdate.h&gt;</code> before <code>#include &lt;AutoConnect.h&gt;</code>.</p>
</li>
</ol>
<h2 id="connection-lost-immediately-after-establishment-with-ap"><i class="fa fa-question-circle"></i> Connection lost immediately after establishment with AP<a class="headerlink" href="#connection-lost-immediately-after-establishment-with-ap" title="Permanent link">&para;</a></h2>
@ -1356,14 +1356,14 @@ You have the following two options to avoid this conflict:</p>
<h2 id="does-not-response-from-_ac"><i class="fa fa-question-circle"></i> Does not response from /_ac.<a class="headerlink" href="#does-not-response-from-_ac" title="Permanent link">&para;</a></h2>
<p>Probably <strong>WiFi.begin</strong> failed with the specified SSID. Activating the <a href="advancedusage.html#debug-print">debug printing</a> will help you to track down the cause.</p>
<h2 id="hang-up-after-reset"><i class="fa fa-question-circle"></i> Hang up after Reset?<a class="headerlink" href="#hang-up-after-reset" title="Permanent link">&para;</a></h2>
<p>If ESP8266 hang up after reset by AutoConnect menu, perhaps manual reset is not yet. Especially if it is not manual reset yet after uploading the sketch, the boot mode will stay 'Uart Download'. There is some discussion about this on the Github's ESP8266 core: <a href="https://github.com/esp8266/Arduino/issues/1017">https://github.com/esp8266/Arduino/issues/1017</a> <sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup></p>
<p>If ESP8266 hang up after reset by AutoConnect menu, perhaps manual reset is not yet. Especially if it is not manual reset yet after uploading the Sketch, the boot mode will stay 'Uart Download'. There is some discussion about this on the Github's ESP8266 core: <a href="https://github.com/esp8266/Arduino/issues/1017">https://github.com/esp8266/Arduino/issues/1017</a> <sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup></p>
<p>If you received the following message, the boot mode is still sketch uploaded. It needs to the manual reset once.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">ets</span> <span style="color: #f8f8f2">Jan</span> <span style="color: #f8f8f2">8</span> <span style="color: #f8f8f2">2013,rst</span> <span style="color: #f8f8f2">cause</span><span style="color: #960050; background-color: #1e0010">:</span><span style="color: #f8f8f2">2,</span> <span style="color: #f8f8f2">boot</span> <span style="color: #f8f8f2">mode</span><span style="color: #960050; background-color: #1e0010">:</span><span style="color: #f8f8f2">(1,6)</span> <span style="color: #f8f8f2">or</span> <span style="color: #f8f8f2">(1,7)</span>
<span style="color: #f8f8f2">ets</span> <span style="color: #f8f8f2">Jan</span> <span style="color: #f8f8f2">8</span> <span style="color: #f8f8f2">2013,rst</span> <span style="color: #f8f8f2">cause</span><span style="color: #960050; background-color: #1e0010">:</span><span style="color: #f8f8f2">4,</span> <span style="color: #f8f8f2">boot</span> <span style="color: #f8f8f2">mode</span><span style="color: #960050; background-color: #1e0010">:</span><span style="color: #f8f8f2">(1,6)</span> <span style="color: #f8f8f2">or</span> <span style="color: #f8f8f2">(1,7)</span>
<span style="color: #f8f8f2">wdt</span> <span style="color: #f8f8f2">reset</span>
</code></pre></div>
<p>The correct boot mode for starting the sketch is <strong>(3, x)</strong>.</p>
<p>The correct boot mode for starting the Sketch is <strong>(3, x)</strong>.</p>
<div class="admonition info">
<p class="admonition-title">ESP8266 Boot Messages</p>
<p>It is described by <a href="https://www.espressif.com/en/products/hardware/esp8266ex/resources">ESP8266 Non-OS SDK API Reference</a>, section A.5.</p>
@ -1407,7 +1407,7 @@ To completely remove ArduinoJson at compile-time from the binary, you need to de
</code></pre></div>
<h2 id="how-erase-the-credentials-saved-in-eeprom"><i class="fa fa-question-circle"></i> How erase the credentials saved in EEPROM?<a class="headerlink" href="#how-erase-the-credentials-saved-in-eeprom" title="Permanent link">&para;</a></h2>
<p>Make some sketches for erasing the EEPROM area, or some erasing utility is needed. You can prepare the sketch to erase the saved credential with <em>AutoConnectCredential</em>. The <em>AutoConnectCrendential</em> class provides the access method to the saved credential in EEPROM and library source file is including it. Refer to '<a href="credit.html#saved-credential-in-eeprom">Saved credential access</a>' on section <a href="credit.html">Appendix</a> for details.</p>
<p>Make some sketches for erasing the EEPROM area, or some erasing utility is needed. You can prepare the Sketch to erase the saved credential with <em>AutoConnectCredential</em>. The <em>AutoConnectCrendential</em> class provides the access method to the saved credential in EEPROM and library source file is including it. Refer to '<a href="credit.html#saved-credential-in-eeprom">Saved credential access</a>' on section <a href="credit.html">Appendix</a> for details.</p>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>With the <a href="https://github.com/Hieromon/ESPShaker"><strong>ESPShaker</strong></a>, you can access EEPROM interactively from the serial monitor, and of course you can erase saved credentials.</p>
@ -1425,7 +1425,7 @@ To completely remove ArduinoJson at compile-time from the binary, you need to de
<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>
<p>Because AutoConnect does not send a login success response to the captive portal requests from the smartphone. The login success response varies iOS, Android and Windows. By analyzing the request URL of different login success inquiries for each OS, the correct behavior can be implemented, but not yet. Please resets ESP8266 from the AutoConnect menu.</p>
<h2 id="i-cannot-see-the-custom-web-page"><i class="fa fa-question-circle"></i> I cannot see the custom Web page.<a class="headerlink" href="#i-cannot-see-the-custom-web-page" title="Permanent link">&para;</a></h2>
<p>If the sketch is correct, a JSON syntax error may have occurred. In this case, activate the <a href="faq.html#3-turn-on-the-debug-log-options">AC_DEBUG</a> and rerun. If you take the message of JSON syntax error, the <a href="https://arduinojson.org/v5/assistant/">Json Assistant</a> helps syntax checking. This online tool is provided by the author of ArduinoJson and is most consistent for the AutoConnect. </p>
<p>If the Sketch is correct, a JSON syntax error may have occurred. In this case, activate the <a href="faq.html#3-turn-on-the-debug-log-options">AC_DEBUG</a> and rerun. If you take the message of JSON syntax error, the <a href="https://arduinojson.org/v5/assistant/">Json Assistant</a> helps syntax checking. This online tool is provided by the author of ArduinoJson and is most consistent for the AutoConnect. </p>
<h2 id="saved-credentials-are-wrong-or-lost"><i class="fa fa-question-circle"></i> Saved credentials are wrong or lost.<a class="headerlink" href="#saved-credentials-are-wrong-or-lost" title="Permanent link">&para;</a></h2>
<p>A structure of AutoConnect saved credentials has changed two times throughout enhancement with v1.0.3 and v1.1.0. In particular, due to enhancements in v1.1.0, AutoConnectCredential data structure has lost the backward compatibility with previous versions. You must erase the flash of the ESP module using the esptool completely to save the credentials correctly with v1.1.0.
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">esptool</span> <span style="color: #f8f8f2">-c</span> <span style="color: #f8f8f2">esp8266</span> <span style="color: #f8f8f2">(or</span> <span style="color: #f8f8f2">esp32)</span> <span style="color: #f8f8f2">-p</span> <span style="color: #66d9ef">[COM_PORT]</span> <span style="color: #f8f8f2">erase_flash</span>
@ -1437,7 +1437,7 @@ To completely remove ArduinoJson at compile-time from the binary, you need to de
<li>Heap is insufficient memory. AutoConnect entrusts HTML generation to PageBuilder that makes heavy use the String::concatenate function and causes memory fragmentation. This is a structural problem with PageBuilder, but it is difficult to solve immediately.</li>
</ol>
<p>If this issue produces with your sketch, Reloading the page may recover.<br />
Also, you can check the memory running out status by rebuilding the sketch with <a href="faq.html#fn:2">PageBuilder's debug log option</a> turned on.</p>
Also, you can check the memory running out status by rebuilding the Sketch with <a href="faq.html#fn:2">PageBuilder's debug log option</a> turned on.</p>
<p>If the heap memory is insufficient, the following message is displayed on the serial console.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #66d9ef">[PB]</span> <span style="color: #f8f8f2">Failed</span> <span style="color: #f8f8f2">building,</span> <span style="color: #f8f8f2">free</span> <span style="color: #f8f8f2">heap</span><span style="color: #960050; background-color: #1e0010">:</span><span style="color: #f8f8f2">&lt;Size</span> <span style="color: #f8f8f2">of</span> <span style="color: #f8f8f2">free</span> <span style="color: #f8f8f2">heap&gt;</span>
</code></pre></div>
@ -1488,7 +1488,7 @@ Also, you can check the memory running out status by rebuilding the sketch with
<li class="task-list-item"><input type="checkbox" disabled/> lwIP variant</li>
<li class="task-list-item"><input type="checkbox" disabled/> Problem description</li>
<li class="task-list-item"><input type="checkbox" disabled/> If you have a STACK DUMP decoded result with formatted by the code block tag</li>
<li class="task-list-item"><input type="checkbox" disabled/> The sketch code with formatted by the code block tag (Reduce to the reproducible minimum code for the problem)</li>
<li class="task-list-item"><input type="checkbox" disabled/> the Sketch code with formatted by the code block tag (Reduce to the reproducible minimum code for the problem)</li>
<li class="task-list-item"><input type="checkbox" disabled/> Debug messages output (Including arduino core)</li>
</ul>
<p>I will make efforts to solve as quickly as possible. But I would like you to know that it is not always possible.</p>

@ -925,11 +925,11 @@
</div>
<h3 id="connection-establishment"><i class="fa fa-rss"></i> Connection establishment<a class="headerlink" href="#connection-establishment" title="Permanent link">&para;</a></h3>
<p>After connection established, the current status screen will appear. It is already connected to WLAN with WiFi mode as WIFI_AP_STA and the IP connection status is displayed there including the SSID. Then at this screen, you have two options for the next step.</p>
<p>For one, continues execution of the sketch while keeping this connection. You can access ESP8266 via browser through the established IP address after cancel to "<strong>Log in</strong>" by upper right on the screen.<br />
<p>For one, continues execution of the Sketch while keeping this connection. You can access ESP8266 via browser through the established IP address after cancel to "<strong>Log in</strong>" by upper right on the screen.<br />
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>
<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 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>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>
<script>
window.onload = function() {

@ -592,7 +592,7 @@
<li class="md-nav__item">
<a href="#embed-the-autoconnect-to-the-sketch" class="md-nav__link">
Embed the AutoConnect to the sketch
Embed the AutoConnect to the Sketch
</a>
</li>
@ -668,7 +668,7 @@
<li class="md-nav__item">
<a href="#the-sketch-publishes-messages" class="md-nav__link">
The sketch, Publishes messages
the Sketch, Publishes messages
</a>
</li>
@ -884,7 +884,7 @@
<li class="md-nav__item">
<a href="#embed-the-autoconnect-to-the-sketch" class="md-nav__link">
Embed the AutoConnect to the sketch
Embed the AutoConnect to the Sketch
</a>
</li>
@ -960,7 +960,7 @@
<li class="md-nav__item">
<a href="#the-sketch-publishes-messages" class="md-nav__link">
The sketch, Publishes messages
the Sketch, Publishes messages
</a>
</li>
@ -1003,8 +1003,8 @@
<h1>How to embed</h1>
<h2 id="embed-the-autoconnect-to-the-sketch">Embed the AutoConnect to the sketch<a class="headerlink" href="#embed-the-autoconnect-to-the-sketch" title="Permanent link">&para;</a></h2>
<p>Here hold two case examples. Both examples perform the same function. Only how to incorporate the <strong>AutoConnect</strong> into the sketch differs. Also included in the sample folder, HandlePortal.ino also shows how to use the <a href="https://github.com/Hieromon/PageBuilder">PageBuilder</a> library for HTML assemblies.</p>
<h2 id="embed-the-autoconnect-to-the-sketch">Embed the AutoConnect to the Sketch<a class="headerlink" href="#embed-the-autoconnect-to-the-sketch" title="Permanent link">&para;</a></h2>
<p>Here hold two case examples. Both examples perform the same function. Only how to incorporate the <strong>AutoConnect</strong> into the Sketch differs. Also included in the sample folder, HandlePortal.ino also shows how to use the <a href="https://github.com/Hieromon/PageBuilder">PageBuilder</a> library for HTML assemblies.</p>
<h2 id="what-does-this-example-do">What does this example do?<a class="headerlink" href="#what-does-this-example-do" title="Permanent link">&para;</a></h2>
<p>Uses the web interface to light the LED connected to the D0 (sometimes called <em>BUILTIN_LED</em>) port of the <strong><a href="https://github.com/nodemcu/nodemcu-devkit-v1.0">NodeMCU</a></strong> module like the following animation.</p>
<p>Access to the ESP8266 module connected WiFi from the browser then the page contains the current value of the D0 port would be displayed. The page has the buttons to switch the port value. The LED will blink according to the value with clicked by the button. This example is a typical sketch of manipulating ESP8266's GPIO via WLAN.</p>
@ -1022,14 +1022,14 @@
<p>Declare only AutoConnect, performs handleClient.</p>
<p><img src="images/handlePortal.svg" /></p>
<h2 id="used-with-mqtt-as-a-client-application">Used with MQTT as a client application<a class="headerlink" href="#used-with-mqtt-as-a-client-application" title="Permanent link">&para;</a></h2>
<p>The effect of AutoConnect is not only for ESP8266/ESP32 as the web server. It has advantages for something WiFi client as well. For example, AutoConnect is also convenient for publishing MQTT messages from various measurement points. Even if the SSID is different for each measurement point, it is not necessary to modify the sketch.</p>
<p>The effect of AutoConnect is not only for ESP8266/ESP32 as the web server. It has advantages for something WiFi client as well. For example, AutoConnect is also convenient for publishing MQTT messages from various measurement points. Even if the SSID is different for each measurement point, it is not necessary to modify the Sketch.</p>
<p>This example tries to publish the WiFi signal strength of ESP8266 with MQTT. It uses the <a href="https://thingspeak.com/">ThingSpeak</a> for MQTT broker. ESP8266 publishes the RSSI value to the channel created on ThingSpeak as <a href="https://github.com/knolleary/pubsubclient">MQTT client</a>. This example is well suited to demonstrate the usefulness of AutoConnect, as RSSI values are measured at each access point usually. Just adding a few lines of code makes it unnecessary to upload sketches with the different SSIDs rewrite for each access point.</p>
<p><img src="images/ChannelStatus.png" width="70%"/></p>
<h3 id="advance-procedures">Advance procedures<a class="headerlink" href="#advance-procedures" title="Permanent link">&para;</a></h3>
<ul>
<li>Arduino Client for MQTT - It's the <a href="https://github.com/knolleary/pubsubclient">PubSubClient</a>, install it to Arduino IDE. If you have the latest version already, this step does not need.</li>
<li>Create a channel on ThingSpeak.</li>
<li>Get the Channel API Keys from ThingSpeak, put its keys to the sketch.</li>
<li>Get the Channel API Keys from ThingSpeak, put its keys to the Sketch.</li>
</ul>
<p>The ThingSpeak is the open IoT platform. It is capable of sending data privately to the cloud and analyzing, visualizing its data. If you do not have an account of ThingSpeak, you need that account to proceed further. ThingSpeak has the free plan for the account which uses within the scope of this example.<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup> You can sign up with the <a href="https://thingspeak.com/users/sign_up">ThingSpeak sign-up page</a>.</p>
<div class="admonition warning">
@ -1052,8 +1052,8 @@
<p><img src="images/APIKeys.png" width="70%"/></p>
<p>The last key you need is the <strong>User API Key</strong> and can be confirmed it in the user profile. Pull down <strong>Account</strong> from the top menu, select <strong>My profile</strong>. Then you can see the ThingSpeak settings and the <strong>User API Key</strong> is displayed middle of this screen.</p>
<p><img src="images/USERKey.png" width="70%"/></p>
<h3 id="the-sketch-publishes-messages">The sketch, Publishes messages<a class="headerlink" href="#the-sketch-publishes-messages" title="Permanent link">&para;</a></h3>
<p>The complete code of the sketch is <a href="https://github.com/Hieromon/AutoConnect/blob/master/examples/mqttRSSI/mqttRSSI.ino">mqttRSSI.ino</a> in the <a href="https://github.com/Hieromon/AutoConnect">AutoConnect repository</a>. Replace the following #define in a sketch with <strong>User API Key</strong>, <strong>Write API Key</strong> and <strong>Channel ID</strong>. After Keys updated, compile the sketch and upload it.</p>
<h3 id="the-sketch-publishes-messages">the Sketch, Publishes messages<a class="headerlink" href="#the-sketch-publishes-messages" title="Permanent link">&para;</a></h3>
<p>The complete code of the Sketch is <a href="https://github.com/Hieromon/AutoConnect/blob/master/examples/mqttRSSI/mqttRSSI.ino">mqttRSSI.ino</a> in the <a href="https://github.com/Hieromon/AutoConnect">AutoConnect repository</a>. Replace the following #define in a sketch with <strong>User API Key</strong>, <strong>Write API Key</strong> and <strong>Channel ID</strong>. After Keys updated, compile the Sketch and upload it.</p>
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #7a7a7a">#define MQTT_USER_KEY &quot;****************&quot; // Replace to User API Key.</span>
<span style="color: #7a7a7a">#define CHANNEL_ID &quot;******&quot; // Replace to Channel ID.</span>
<span style="color: #7a7a7a">#define CHANNEL_API_KEY_WR &quot;****************&quot; // Replace to the write API Key.</span>

@ -10,11 +10,11 @@
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="104.57415mm"
height="371.83472mm"
viewBox="0 0 104.57414 371.83472"
height="387.70978mm"
viewBox="0 0 104.57414 387.70978"
version="1.1"
id="svg8776"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
sodipodi:docname="process_begin.svg">
<defs
id="defs8770">
@ -247,9 +247,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4142136"
inkscape:cx="305.90966"
inkscape:cy="637.13379"
inkscape:zoom="0.7071068"
inkscape:cx="-27.323778"
inkscape:cy="441.74167"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
@ -265,9 +265,9 @@
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:window-width="1920"
inkscape:window-height="1013"
inkscape:window-x="2551"
inkscape:window-y="-9"
inkscape:window-height="1029"
inkscape:window-x="1272"
inkscape:window-y="-8"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
@ -277,8 +277,8 @@
<inkscape:grid
type="xygrid"
id="grid9104"
originx="-23.664533"
originy="15.544253" />
originx="-23.664531"
originy="31.419329" />
</sodipodi:namedview>
<metadata
id="metadata8773">
@ -317,8 +317,8 @@
transform="translate(-15.875002,-48.749459)">
<rect
transform="matrix(0.94594599,0.32432418,-0.94594599,0.32432418,0,0)"
ry="3.6888673e-06"
rx="3.6888673e-06"
ry="3.6888673e-006"
rx="3.6888673e-006"
y="159.70068"
x="238.01735"
height="18.355465"
@ -342,8 +342,8 @@
transform="translate(-42.333331,28.77345)">
<rect
transform="matrix(0.945946,0.32432418,-0.945946,0.32432418,0,0)"
ry="3.6888673e-06"
rx="3.6888673e-06"
ry="3.6888673e-006"
rx="3.6888673e-006"
y="50.674988"
x="156.96188"
height="18.355465"
@ -444,8 +444,8 @@
transform="translate(-15.875002,18.719279)">
<rect
transform="matrix(0.94594599,0.32432418,-0.94594599,0.32432418,0,0)"
ry="3.6888673e-06"
rx="3.6888673e-06"
ry="3.6888673e-006"
rx="3.6888673e-006"
y="159.70068"
x="238.01735"
height="18.355465"
@ -466,7 +466,7 @@
</g>
<g
id="g9622"
transform="translate(-68.285876,50.564436)">
transform="translate(-68.285876,66.439446)">
<rect
ry="0.26458257"
rx="0.26458332"
@ -514,7 +514,7 @@
</g>
<g
id="g9714"
transform="translate(-78.07551,36.012307)">
transform="translate(-78.07551,51.887317)">
<rect
ry="0.26458257"
rx="0.26458332"
@ -542,23 +542,23 @@
width="34.395828"
height="7.9375019"
x="88.635422"
y="167.68488"
y="183.55966"
rx="0.26458332"
ry="0.26458257" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="90.597054"
y="172.83572"
y="188.71051"
id="text9138-7-3-9-0-6"><tspan
sodipodi:role="line"
id="tspan9136-4-0-9-8-9"
x="90.597054"
y="172.83572"
y="188.71051"
style="stroke-width:0.26458332">START Web Server</tspan></text>
<g
id="g9778"
transform="translate(-43.656245,30.757831)">
transform="translate(-43.656245,46.632841)">
<rect
ry="0.26458257"
rx="0.26458332"
@ -582,7 +582,7 @@
</g>
<g
id="g9746-3"
transform="translate(-67.492182,16.16855)">
transform="translate(-67.492182,32.04356)">
<rect
ry="0.26458257"
rx="0.26458332"
@ -606,11 +606,11 @@
</g>
<g
id="g9834"
transform="translate(-79.374976,29.567202)">
transform="translate(-79.374976,45.442212)">
<rect
transform="matrix(0.94594599,0.32432418,-0.94594599,0.32432418,0,0)"
ry="3.6888673e-06"
rx="3.6888673e-06"
ry="3.6888673e-006"
rx="3.6888673e-006"
y="219.95329"
x="365.3985"
height="18.355465"
@ -631,7 +631,7 @@
</g>
<g
id="g1006"
transform="translate(0,31.948452)">
transform="translate(0,47.823462)">
<rect
ry="0.26458257"
rx="0.26458332"
@ -670,11 +670,11 @@
</g>
<g
id="g9353-2-8"
transform="translate(-15.875002,120.84858)">
transform="translate(-15.875002,136.72368)">
<rect
transform="matrix(0.94594599,0.32432418,-0.94594599,0.32432418,0,0)"
ry="3.6888673e-06"
rx="3.6888673e-06"
ry="3.6888673e-006"
rx="3.6888673e-006"
y="159.70068"
x="238.01735"
height="18.355465"
@ -695,11 +695,11 @@
</g>
<g
id="g11043"
transform="translate(0,31.948452)">
transform="translate(0,47.823462)">
<rect
transform="matrix(0.94594599,0.32432418,-0.94594599,0.32432418,0,0)"
ry="3.6888673e-06"
rx="3.6888673e-06"
ry="3.6888673e-006"
rx="3.6888673e-006"
y="335.73843"
x="397.27298"
height="18.355465"
@ -720,7 +720,7 @@
</g>
<g
id="g9980"
transform="translate(-9.2604205,23.084915)">
transform="translate(-9.2604205,38.959925)">
<rect
ry="0.26458257"
rx="0.26458332"
@ -744,7 +744,7 @@
</g>
<g
id="g10054"
transform="translate(-1.3229224,97.697415)">
transform="translate(-1.3229224,113.5725)">
<rect
ry="0.26458257"
rx="0.26458332"
@ -802,13 +802,13 @@
</g>
<path
style="fill:none;stroke:#000000;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 105.83318,175.75505 V 297.53597 H 92.575102"
d="M 105.83318,191.63015 V 313.41107 H 92.575102"
id="path9639-1-3-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458329px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 75.513505,86.193127 30.107915,-0.06083 0.0306,81.420513"
d="m 75.513505,86.21746 30.107915,-0.07268 0.0306,97.2838"
id="path10088"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
@ -844,12 +844,12 @@
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.184947,175.58545 v 3.96875"
d="m 58.184947,191.46055 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.184947,187.4917 v 3.96875"
d="m 58.184947,203.3668 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9"
inkscape:connector-curvature="0" />
<path
@ -871,69 +871,69 @@
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,199.4351 v 3.96875"
d="m 58.208333,215.3102 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9-5"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,211.47363 v 3.96875"
d="m 58.208333,227.34873 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9-5-1"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,231.31741 v 3.96875"
d="m 58.208333,247.19251 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9-5-1-3"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,245.86949 v 3.96875"
d="m 58.208333,261.74459 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9-5-1-3-9"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow2Mstart)"
d="m 57.676398,215.1778 -33.837442,0.13255 0.0074,40.48128 H 40.75779"
d="m 57.676398,231.0529 -33.837442,0.13255 0.0074,40.48128 H 40.75779"
id="path10088-92-6"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,215.44238 v 3.96875"
d="m 58.208333,231.31748 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9-5-1-9"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,261.74446 v 3.96875"
d="m 58.208333,277.61956 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9-5-1-9-8"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,265.71321 v 3.96875"
d="m 58.208333,281.58831 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9-5-1-5"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#marker10931)"
d="m 58.570889,265.97716 33.866674,-0.13255 -0.0073,-40.48128 H 75.504222"
d="m 58.570889,281.85226 33.866674,-0.13255 -0.0073,-40.48128 H 75.504222"
id="path10088-92-6-8"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,293.75905 v 3.96875"
d="m 58.208333,309.63415 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9-5-1-9-8-5"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,281.58821 v 3.96875"
d="m 58.208333,297.46331 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9-5-1-5-8"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,297.7278 v 3.96875"
d="m 58.208333,313.6029 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-9-5-1-9-8-5-4"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#marker10937)"
d="m 58.708562,297.61156 33.734352,-0.0718 -0.007,-21.90474 H 75.509571"
d="m 58.708562,313.48666 33.734352,-0.0718 -0.007,-21.90474 H 75.509571"
id="path10088-92-6-8-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
@ -1029,75 +1029,75 @@
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="60.544109"
y="233.40862"
y="249.2834"
id="text10760-5-5-6-4"><tspan
sodipodi:role="line"
id="tspan10758-9-6-0-0"
x="60.544109"
y="233.40862"
y="249.2834"
style="stroke-width:0.26458332">NO</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="76.719864"
y="224.26886"
y="240.14365"
id="text10760-1-3-5"><tspan
sodipodi:role="line"
id="tspan10758-2-13-1"
x="76.719864"
y="224.26886"
y="240.14365"
style="stroke-width:0.26458332">YES</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="60.844864"
y="263.82974"
y="279.70499"
id="text10760-1-3-7"><tspan
sodipodi:role="line"
id="tspan10758-2-13-5"
x="60.844864"
y="263.82974"
y="279.70499"
style="stroke-width:0.26458332">YES</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="35.860859"
y="254.69594"
y="270.57114"
id="text10760-5-5-6-4-8"><tspan
sodipodi:role="line"
id="tspan10758-9-6-0-0-2"
x="35.860859"
y="254.69594"
y="270.57114"
style="stroke-width:0.26458332">NO</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="76.719864"
y="274.41339"
y="290.28864"
id="text10760-1-3-7-8"><tspan
sodipodi:role="line"
id="tspan10758-2-13-5-2"
x="76.719864"
y="274.41339"
y="290.28864"
style="stroke-width:0.26458332">YES</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="60.544109"
y="283.68027"
y="299.55551"
id="text10760-5-5-6-4-8-0"><tspan
sodipodi:role="line"
id="tspan10758-9-6-0-0-2-9"
x="60.544109"
y="283.68027"
y="299.55551"
style="stroke-width:0.26458332">NO</tspan></text>
<g
id="g2540"
transform="translate(0.132299)">
<rect
transform="matrix(0.94594599,0.32432418,-0.94594599,0.32432418,0,0)"
ry="3.6888673e-06"
rx="3.6888673e-06"
ry="3.6888673e-006"
rx="3.6888673e-006"
y="25.565748"
x="86.960411"
height="18.355465"
@ -1126,8 +1126,8 @@
transform="translate(-25.135403,-186.53117)">
<rect
transform="matrix(0.94594599,0.32432418,-0.94594599,0.32432418,0,0)"
ry="3.6888673e-06"
rx="3.6888673e-06"
ry="3.6888673e-006"
rx="3.6888673e-006"
y="189.47736"
x="277.58359"
height="18.355465"
@ -1303,8 +1303,8 @@
transform="translate(-30.682548,2.7829924)">
<rect
transform="matrix(0.94594599,0.32432418,-0.94594599,0.32432418,0,0)"
ry="3.6888673e-06"
rx="3.6888673e-06"
ry="3.6888673e-006"
rx="3.6888673e-006"
y="-62.503849"
x="31.466501"
height="18.355465"
@ -1426,5 +1426,58 @@
id="tspan1291"
x="79.354843"
y="2.408726">restore it.</tspan></text>
<rect
style="opacity:0.66000001;vector-effect:none;fill:#e7f3ff;fill-opacity:1;stroke:#000000;stroke-width:0.33777273;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
id="rect9184-6-3-8-8-7"
width="18.355474"
height="18.355465"
x="289.07794"
y="227.54343"
rx="3.6888673e-006"
ry="3.6888673e-006"
transform="matrix(0.94594599,0.32432418,-0.94594599,0.32432418,0,0)" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1em;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#d40055;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="51.340534"
y="174.66013"
id="text9188-0-2-80"><tspan
sodipodi:role="line"
id="tspan1081"
x="51.340534"
y="174.66013">autoRise</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="61.347313"
y="181.91884"
id="text10760-1-3-8"><tspan
sodipodi:role="line"
id="tspan10758-2-13-3"
x="61.347313"
y="181.91884"
style="stroke-width:0.26458332">YES</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 58.208333,179.56859 v 3.96875"
id="path9639-1-3-1-7-9-4-4-8-3-6"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 75.510799,173.50592 H 105.66144"
id="path10088-92-2-8"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
x="77.25248"
y="172.6756"
id="text10760-5-5-6-9"><tspan
sodipodi:role="line"
id="tspan10758-9-6-0-1"
x="77.25248"
y="172.6756"
style="stroke-width:0.26458332">NO</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 77 KiB

@ -323,7 +323,7 @@
<li class="md-nav__item">
<a href="#lives-with-your-sketches" class="md-nav__link">
Lives with your sketches
Lives with your Sketches
</a>
</li>
@ -931,7 +931,7 @@
<li class="md-nav__item">
<a href="#lives-with-your-sketches" class="md-nav__link">
Lives with your sketches
Lives with your Sketches
</a>
</li>
@ -1023,18 +1023,18 @@
<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 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>
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/ESP32 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.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 the flash of ESP8266/ESP32 and You can select the past SSID from the <a href="menu.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-your-sketches"><i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Lives with your sketches<a class="headerlink" href="#lives-with-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. This effect also applies to ESP32. The corresponding class for ESP32 will be the WebServer.</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-your-sketches"><i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Lives with your Sketches<a class="headerlink" href="#lives-with-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. This effect also applies to ESP32. The corresponding class for ESP32 will be the WebServer.</span></p>
<h3 id="easy-to-add-the-custom-web-pages-enhanced-wv097"><i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Easy to add the <a href="acintro.html">custom Web pages</a> <sup><sub>ENHANCED w/v0.9.7</sub></sup><a class="headerlink" href="#easy-to-add-the-custom-web-pages-enhanced-wv097" title="Permanent link">&para;</a></h3>
<p><span class="lead">You can easily add your owned web pages that can consist of representative HTML elements and invoke them from the menu. Further it possible importing the custom Web pages declarations described with JSON which stored in PROGMEM, SPIFFS, or SD.</span></p>
<div style="display:block;height:425px;">
@ -1044,7 +1044,7 @@ Easy implementing the Web interface constituting the WLAN for ESP8266/ESP32 WiFi
</div>
<h3 id="quick-and-easy-to-equip-the-ota-update-feature-updated-wv115"><i class="fa fa-arrow-circle-right" aria-hidden="true"></i> Quick and easy to equip the <a href="otaupdate.html">OTA update feature</a> <sup><sub>UPDATED w/v1.1.5</sub></sup><a class="headerlink" href="#quick-and-easy-to-equip-the-ota-update-feature-updated-wv115" title="Permanent link">&para;</a></h3>
<p><span class="lead">You can quickly and easily equip the OTA update feature to your sketch and also you can operate the firmware update process via OTA from AutoConnect menu.</span></p>
<p><span class="lead">You can quickly and easily equip the OTA update feature to your Sketch and also you can operate the firmware update process via OTA from AutoConnect menu.</span></p>
<p><span style="display:block;margin-left:auto;margin-right:auto;width:294px;height:482px;border:1px solid lightgrey;"><img data-gifffer="images/webupdate.gif" data-gifffer-height="480" data-gifffer-width="292" /></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>
@ -1068,14 +1068,14 @@ Easy implementing the Web interface constituting the WLAN for ESP8266/ESP32 WiFi
</ul>
<div class="admonition info">
<p class="admonition-title">About flash size on the module</p>
<p>The AutoConnect sketch size is relatively large. Large flash capacity is necessary. 512Kbyte (4Mbits) flash inclusion module such as ESP-01 is not recommended.</p>
<p>The AutoConnect Sketch size is relatively large. Large flash capacity is necessary. 512Kbyte (4Mbits) flash inclusion module such as ESP-01 is not recommended.</p>
</div>
<h4 id="required-libraries">Required libraries<a class="headerlink" href="#required-libraries" title="Permanent link">&para;</a></h4>
<p>AutoConnect requires the following environment and libraries.</p>
<p><i class="fa fa-download"></i> <strong>Arduino IDE</strong></p>
<p>The current upstream at the 1.8 level or later is needed. Please install from the <a href="https://www.arduino.cc/en/Main/Software">official Arduino IDE download page</a>. This step is not required if you already have a modern version.</p>
<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>. Stable 2.4.0 or higher required and the <a href="https://github.com/esp8266/Arduino/releases/latest">latest release</a> is recommended.<br />
<p>AutoConnect targets Sketches made on the assumption of <a href="https://github.com/esp8266/Arduino">ESP8266 Community's Arduino core</a>. Stable 2.4.0 or higher required and 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. Stable 1.0.1 or required and the <a href="https://github.com/espressif/arduino-esp32/releases/latest">latest release</a> is recommended.<br />
@ -1089,7 +1089,7 @@ Install third-party platform using the <em>Boards Manager</em> of Arduino IDE. Y
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 <strong>1.3.6</strong> <strong>later</strong>.<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup></p>
<p><img src="images/lm.png" width="640"/></p>
<p><i class="fa fa-download"></i> <strong>Additional library (Optional)</strong></p>
<p>By adding the <a href="https://github.com/bblanchon/ArduinoJson">ArduinoJson</a> library, AutoConnect will be able to handle the <a href="acintro.html"><strong>custom Web pages</strong></a> described with JSON. Since AutoConnect v0.9.7 you can insert user-owned web pages that can consist of representative HTML elements as styled TEXT, INPUT, BUTTON, CHECKBOX, SELECT, SUBMIT and invoke them from the AutoConnect menu. These HTML elements can be added by sketches using the AutoConnect API. Further it possible importing the custom Web pages declarations described with JSON which stored in PROGMEM, SPIFFS, or SD. <a href="https://arduinojson.org/">ArduinoJson</a> is required to use this feature.<sup id="fnref:2"><a class="footnote-ref" href="#fn:2">2</a></sup> AutoConnect can work with ArduinoJson both <a href="https://arduinojson.org/v5/doc/">version 5</a> and <a href="https://arduinojson.org/v6/doc/">version 6</a>.</p>
<p>By adding the <a href="https://github.com/bblanchon/ArduinoJson">ArduinoJson</a> library, AutoConnect will be able to handle the <a href="acintro.html"><strong>custom Web pages</strong></a> described with JSON. Since AutoConnect v0.9.7 you can insert user-owned web pages that can consist of representative HTML elements as styled TEXT, INPUT, BUTTON, CHECKBOX, SELECT, SUBMIT and invoke them from the AutoConnect menu. These HTML elements can be added by Sketches using the AutoConnect API. Further it possible importing the custom Web pages declarations described with JSON which stored in PROGMEM, SPIFFS, or SD. <a href="https://arduinojson.org/">ArduinoJson</a> is required to use this feature.<sup id="fnref:2"><a class="footnote-ref" href="#fn:2">2</a></sup> AutoConnect can work with ArduinoJson both <a href="https://arduinojson.org/v5/doc/">version 5</a> and <a href="https://arduinojson.org/v6/doc/">version 6</a>.</p>
<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>
@ -1112,7 +1112,7 @@ To install the PageBuilder library into your Arduino IDE, you can use the <em>Li
<p>Since AutoConnect v1.1.3, PageBuilder v1.3.6 later is required.&#160;<a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">&#8617;</a></p>
</li>
<li id="fn:2">
<p>Using the AutoConnect API natively allows you to sketch custom Web pages without JSON.&#160;<a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text">&#8617;</a></p>
<p>Using the AutoConnect API natively allows you to Sketch custom Web pages without JSON.&#160;<a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text">&#8617;</a></p>
</li>
</ol>
</div>

@ -816,8 +816,9 @@
<h2 id="autoconnectbegin-logic-sequence">AutoConnect::begin logic sequence<a class="headerlink" href="#autoconnectbegin-logic-sequence" title="Permanent link">&para;</a></h2>
<p>The following parameters of <a href="apiconfig.html">AutoConnectConfig</a> affect the behavior and control a logic sequence of <a href="api.html#begin">AutoConnect::begin</a> function. These parameters are evaluated on a case-by-case basis and may not be valid in all situations. The Sketch must consider the role of these parameters and the conditions under which they will work as intended. You need to understand what happens when using these parameters in combination.</p>
<ul>
<li><a href="apiconfig.html#immediatestart">immediateStart</a> : The captive portal start immediately, without the 1<sup>st</sup>-WiFi.begin.</li>
<li><a href="apiconfig.html#autoreconnect">autoReconenct</a> : Attempt re-connect with past SSID by saved credential.</li>
<li><a href="apiconfig.html#autoreconnect">autoReconnect</a> : Attempts re-connect with past SSID by saved credential.</li>
<li><a href="apiconfig.html#autorise">autoRise</a> : Controls starting the captive portal.</li>
<li><a href="apiconfig.html#immediatestart">immediateStart</a> : Starts the captive portal immediately, without the 1<sup>st</sup>-WiFi.begin.</li>
<li><a href="apiconfig.html#portaltimeout">portalTimeout</a> : Time out limit for the portal.</li>
<li><a href="apiconfig.html#retainportal">retainPortal</a> : Keep DNS server functioning for the captive portal.</li>
</ul>

@ -960,7 +960,7 @@
<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">AutoConnect root URL</p>
<p>It is assigned "<strong>/_ac</strong>" located on the <em>local IP address</em> of ESP8266/ESP32 module by default and can be changed with the sketch. A local IP means Local IP at connection established or SoftAP's IP.</p>
<p>It is assigned "<strong>/_ac</strong>" located on the <em>local IP address</em> of ESP8266/ESP32 module by default and can be changed with the Sketch. A local IP means Local IP at connection established or SoftAP's IP.</p>
</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>
<p>Currently, AutoConnect supports six menus. Undermost menu as "HOME" returns to the home path of its sketch.</p>
@ -984,22 +984,22 @@ Enter SSID and Passphrase and tap "<strong>Apply</strong>" to start a WiFi conne
<p><img src="images/open.png" style="border-style:solid;border-width:1px;border-color:lightgrey;width:280px;" /></p>
<div class="admonition note">
<p class="admonition-title">Saved credentials data structure has changed</p>
<p>A structure of AutoConnect saved credentials has changed in v1.1.0 and was lost backward compatibility. Credentials saved by AutoConnect v1.0.3 (or earlier) will not display properly with AutoConnect v1.1.0. You need to erase the flash of the ESP module using the esptool before the sketch uploading.
<p>A structure of AutoConnect saved credentials has changed in v1.1.0 and was lost backward compatibility. Credentials saved by AutoConnect v1.0.3 (or earlier) will not display properly with AutoConnect v1.1.0. You need to erase the flash of the ESP module using the esptool before the Sketch uploading.
<div class="codehilite" style="background: #272822"><pre style="line-height: 125%"><span></span><code><span style="color: #f8f8f2">esptool</span> <span style="color: #f8f8f2">-c</span> <span style="color: #f8f8f2">esp8266</span> <span style="color: #f8f8f2">(or</span> <span style="color: #f8f8f2">esp32)</span> <span style="color: #f8f8f2">-p</span> <span style="color: #66d9ef">[COM_PORT]</span> <span style="color: #f8f8f2">erase_flash</span>
</code></pre></div></p>
</div>
<h2 id="disconnect"><i class="fa fa-bars"></i> Disconnect<a class="headerlink" href="#disconnect" title="Permanent link">&para;</a></h2>
<p>It disconnects ESP8266/ESP32 from the current connection. Also, ESP8266/ESP32 can be automatically reset after WiFi cutting by instructing with the sketch using the <a href="api.html#autoreset">AutoConnect API</a>.</p>
<p>It disconnects ESP8266/ESP32 from the current connection. Also, ESP8266/ESP32 can be automatically reset after WiFi cutting by instructing with the Sketch using the <a href="api.html#autoreset">AutoConnect API</a>.</p>
<p>After tapping the <strong>Disconnect</strong>, you will not be able to reach the AutoConnect menu. Once disconnected, you will need to set the SSID again for connecting to the WLAN. </p>
<h2 id="reset"><i class="fa fa-bars"></i> Reset...<a class="headerlink" href="#reset" title="Permanent link">&para;</a></h2>
<p>Resetting the ESP8266/ESP32 module will initiate a reboot. When the module restarting, the <em>esp8266ap</em> or <em>esp32ap</em> access point will disappear from the WLAN and the ESP8266/ESP32 module will begin to reconnect a previous access point with WIFI_STA mode.</p>
<p><img src="images/resetting.png" style="width:280px;" /></p>
<div class="admonition warning">
<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.html#hang-up-after-reset">FAQ</a>.</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.html#hang-up-after-reset">FAQ</a>.</p>
</div>
<h2 id="custom-menu-items"><i class="fa fa-bars"></i> Custom menu items<a class="headerlink" href="#custom-menu-items" title="Permanent link">&para;</a></h2>
<p>If the sketch has custom Web pages, the AutoConnect menu lines them up with the AutoConnect's items. Details for <a href="acintro.html#custom-web-pages-in-autoconnectmenu">Custom Web pages in AutoConnect menu</a>.</p>
<p>If the Sketch has custom Web pages, the AutoConnect menu lines them up with the AutoConnect's items. Details for <a href="acintro.html#custom-web-pages-in-autoconnectmenu">Custom Web pages in AutoConnect menu</a>.</p>
<h2 id="update"><i class="fa fa-bars"></i> Update<a class="headerlink" href="#update" title="Permanent link">&para;</a></h2>
<p>If you specify <a href="apiconfig.html#ota">AutoConnectConfig::ota</a> to import the OTA update feature into Sketch, an item will appear in the menu list as <strong>Update</strong>.</p>
<div class="admonition note">

@ -842,14 +842,14 @@
<h1>Attach the menu</h1>
<h2 id="what-menus-can-be-made-using-autoconnect">What menus can be made using AutoConnect<a class="headerlink" href="#what-menus-can-be-made-using-autoconnect" title="Permanent link">&para;</a></h2>
<p>AutoConnect generates a menu dynamically depending on the instantiated <a href="acintro.html#how-it-works">AutoConnectAux</a> at the sketch executing time. Usually, it is a collection of <a href="acelements.html">AutoConnectElement</a>. In addition to this, you can generate a menu from only AutoConnectAux, without AutoConnectElements.<br>In other words, you can easily create a built-in menu featuring the WiFi connection facility embedding the legacy web pages.</p>
<p>AutoConnect generates a menu dynamically depending on the instantiated <a href="acintro.html#how-it-works">AutoConnectAux</a> at the Sketch executing time. Usually, it is a collection of <a href="acelements.html">AutoConnectElement</a>. In addition to this, you can generate a menu from only AutoConnectAux, without AutoConnectElements.<br>In other words, you can easily create a built-in menu featuring the WiFi connection facility embedding the legacy web pages.</p>
<h2 id="basic-mechanism-of-menu-generation">Basic mechanism of menu generation<a class="headerlink" href="#basic-mechanism-of-menu-generation" title="Permanent link">&para;</a></h2>
<p>The sketch can display the <a href="menu.html">AutoConnect menu</a> by following three patterns depending on AutoConnect-API usage.</p>
<p>the Sketch can display the <a href="menu.html">AutoConnect menu</a> by following three patterns depending on AutoConnect-API usage.</p>
<dl>
<dt><i class="fa fa-desktop"></i>&ensp;<strong>Basic menu</strong></dt>
<dd>It is the most basic menu for only connecting WiFi. Sketch can automatically display this menu with the basic call sequence of the AutoConnect API which invokes <a href="api.html#begin">AutoConnect::begin</a> and <a href="api.html#handleclient">AutoConnect::handleClient</a>.</dd>
<dt><i class="fa fa-desktop"></i>&ensp;<strong>Extra menu with custom Web pages which is consisted by <a href="acelements.html">AutoConnectElements</a></strong></dt>
<dd>It is an extended menu that appears when the sketch consists of the custom Web pages with <a href="acintro.html#how-it-works">AutoConnectAux</a> and AutoConnectElements. Refer to section <a href="acintro.html#custom-web-pages-in-autoconnect-menu"><em>Custom Web pages section</em></a>.</dd>
<dd>It is an extended menu that appears when the Sketch consists of the custom Web pages with <a href="acintro.html#how-it-works">AutoConnectAux</a> and AutoConnectElements. Refer to section <a href="acintro.html#custom-web-pages-in-autoconnect-menu"><em>Custom Web pages section</em></a>.</dd>
<dt><i class="fa fa-desktop"></i>&ensp;<strong>Extra menu which contains legacy pages</strong></dt>
<dd>It is for the legacy sketches using the <strong>on</strong> handler of ESP8266WebServer/WebServer(for ESP32) class natively and looks the same as the extra menu as above.</dd>
</dl>

@ -934,7 +934,7 @@
<span style="color: #66d9ef">static</span> <span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span> <span style="color: #f8f8f2">HELLO_PAGE[]</span> <span style="color: #f8f8f2">PROGMEM</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">R&quot;(</span>
<span style="color: #e6db74">{ &quot;title&quot;: &quot;Hello world&quot;, &quot;uri&quot;: &quot;/&quot;, &quot;menu&quot;: true, &quot;element&quot;: [</span>
<span style="color: #e6db74"> { &quot;name&quot;: &quot;caption&quot;, &quot;type&quot;: &quot;ACText&quot;, &quot;value&quot;: &quot;&lt;h2&gt;Hello, world&lt;/h2&gt;&quot;, &quot;style&quot;: &quot;text-align:center;color:#2f4f4f;padding:10px;&quot; },</span>
<span style="color: #e6db74"> { &quot;name&quot;: &quot;content&quot;, &quot;type&quot;: &quot;ACText&quot;, &quot;value&quot;: &quot;In this page, place the custom web page handled by the sketch application.&quot; } ]</span>
<span style="color: #e6db74"> { &quot;name&quot;: &quot;content&quot;, &quot;type&quot;: &quot;ACText&quot;, &quot;value&quot;: &quot;In this page, place the custom web page handled by the Sketch application.&quot; } ]</span>
<span style="color: #e6db74">}</span>
<span style="color: #e6db74">)&quot;</span><span style="color: #f8f8f2">;</span> <span style="color: #7a7a7a">// Step #5</span>
@ -1004,7 +1004,7 @@ The AutoConnectOTA activates the ticker constantly regardless of the <a href="ap
<h3 id="how-to-make-the-binary-sketch"><i class="fa fa-wrench"></i> How to make the binary sketch<a class="headerlink" href="#how-to-make-the-binary-sketch" title="Permanent link">&para;</a></h3>
<p>Binary sketch files for updating can be retrieved using the Arduino IDE. Open the <strong>Sketch</strong> menu and select the <strong>Export compiled Binary</strong>, then starts compilation.</p>
<p><img src="images/export_binary.png" width="450" /></p>
<p>When the compilation is complete, a binary sketch will save with the extension <code>.bin</code> in the same folder as the sketch.</p>
<p>When the compilation is complete, a binary sketch will save with the extension <code>.bin</code> in the same folder as the Sketch.</p>
<h3 id="ota-updates-wbrowser-without-using-autoconnectota"><i class="fa fa-edit"></i> OTA updates w/browser without using AutoConnectOTA<a class="headerlink" href="#ota-updates-wbrowser-without-using-autoconnectota" title="Permanent link">&para;</a></h3>
<p>The legacy OTA method based on ESP8266HTTPUpdateServer without AutoConnectOTA is still valid.
To embed the ESP8266HTTPUpdateServer class with AutoConnect into your sketch, basically follow these steps:</p>
@ -1035,7 +1035,7 @@ To embed the ESP8266HTTPUpdateServer class with AutoConnect into your sketch, ba
<span style="color: #66d9ef">static</span> <span style="color: #66d9ef">const</span> <span style="color: #66d9ef">char</span> <span style="color: #f8f8f2">HELLO_PAGE[]</span> <span style="color: #f8f8f2">PROGMEM</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">R&quot;(</span>
<span style="color: #e6db74">{ &quot;title&quot;: &quot;Hello world&quot;, &quot;uri&quot;: &quot;/&quot;, &quot;menu&quot;: true, &quot;element&quot;: [</span>
<span style="color: #e6db74"> { &quot;name&quot;: &quot;caption&quot;, &quot;type&quot;: &quot;ACText&quot;, &quot;value&quot;: &quot;&lt;h2&gt;Hello, world&lt;/h2&gt;&quot;, &quot;style&quot;: &quot;text-align:center;color:#2f4f4f;padding:10px;&quot; },</span>
<span style="color: #e6db74"> { &quot;name&quot;: &quot;content&quot;, &quot;type&quot;: &quot;ACText&quot;, &quot;value&quot;: &quot;In this page, place the custom web page handled by the sketch application.&quot; } ]</span>
<span style="color: #e6db74"> { &quot;name&quot;: &quot;content&quot;, &quot;type&quot;: &quot;ACText&quot;, &quot;value&quot;: &quot;In this page, place the custom web page handled by the Sketch application.&quot; } ]</span>
<span style="color: #e6db74">}</span>
<span style="color: #e6db74">)&quot;</span><span style="color: #f8f8f2">;</span>

@ -936,7 +936,7 @@
<h1>Using Update Server</h1>
<h2 id="updates-with-the-update-server">Updates with the update server<a class="headerlink" href="#updates-with-the-update-server" title="Permanent link">&para;</a></h2>
<p>Since the v1.0.0 release, AutoConnect provides new feature for updating sketch firmware of ESP8266 or ESP32 modules via OTA using the <a href="apiupdate.html#autoconnectupdate">AutoConnectUpdate</a> class that is an implementation of the sketch binary update by the HTTP server mentioned in the <a href="https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#http-server">OTA update</a> of the ESP8266 Arduino Core documentation, which inherits from the ESP8266HTTPUpdate class (as HTTPUpdate class in the case of ESP32). It acts as a client agent for a series of update operations.</p>
<p>Since the v1.0.0 release, AutoConnect provides new feature for updating sketch firmware of ESP8266 or ESP32 modules via OTA using the <a href="apiupdate.html#autoconnectupdate">AutoConnectUpdate</a> class that is an implementation of the Sketch binary update by the HTTP server mentioned in the <a href="https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#http-server">OTA update</a> of the ESP8266 Arduino Core documentation, which inherits from the ESP8266HTTPUpdate class (as HTTPUpdate class in the case of ESP32). It acts as a client agent for a series of update operations.</p>
<p>This method allows you to remotely update the ESP module's firmware beyond the network segments from the update server, as long as you can ensure proper routing and forwarding.</p>
<p><img src="images/updateserver.png" width="380" /></p>
<p>If you choose this update method, you need to prepare the server process as a variant of the HTTP server that supplies the binary sketch files to the updating client agent. Its server requires to be able to handle the HTTP headers extended by ESP8266HTTPUpdate class as described in the <a href="https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#server-request-handling">ESP8266 Arduino Core documentation</a>. There are various implementations of the update server that provide binary sketch files. For example, the ESP8266 Arduino Core documentation suggests an <a href="https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#id5">advanced updater</a> php script that can be fully communicated with the client agent using the ESP8266HTTPUpdate class. That is, the update server for AutoConnect must work with the client agent, and its implementation should make the handshake well with the AutoConnectUpdate class which wraps an ESP8266HTTPUpdate class.<br />

File diff suppressed because one or more lines are too long

@ -1,123 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
<loc>https://Hieromon.github.io/AutoConnect/index.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/gettingstarted.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/menu.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/basicusage.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/advancedusage.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/acintro.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/acelements.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/acjson.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/achandling.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/otaupdate.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/otabrowser.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/otaserver.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/api.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/apiaux.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/apiconfig.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/apielements.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/apiupdate.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/apiextra.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/howtoembed.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/datatips.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/menuize.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/wojson.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/lsbegin.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/credit.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/acupload.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/colorized.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/changelabel.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/faq.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/changelog.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://Hieromon.github.io/AutoConnect/license.html</loc>
<lastmod>2020-04-15</lastmod>
<lastmod>2020-04-16</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

@ -843,7 +843,7 @@
<h2 id="suppress-increase-in-memory-consumption">Suppress increase in memory consumption<a class="headerlink" href="#suppress-increase-in-memory-consumption" title="Permanent link">&para;</a></h2>
<p>Custom Web page processing consumes a lot of memory. AutoConnect will take a whole string of the JSON document for the custom Web pages into memory. The required buffer size for the JSON document of example sketch <em>mqttRSSI</em> reaches approximately 3000 bytes. And actually, it needs twice the heap area. Especially this constraint will be a problem with the ESP8266 which has a heap size poor.</p>
<p>AutoConnect can handle custom Web pages without using JSON. In that case, since the ArduinoJson library will not be bound, the sketch size will also be reduced.</p>
<p>AutoConnect can handle custom Web pages without using JSON. In that case, since the ArduinoJson library will not be bound, the Sketch size will also be reduced.</p>
<h2 id="writing-the-custom-web-pages-without-json">Writing the custom Web pages without JSON<a class="headerlink" href="#writing-the-custom-web-pages-without-json" title="Permanent link">&para;</a></h2>
<p>To handle the custom Web pages without using JSON, follow the steps below.</p>
<ol>
@ -862,7 +862,7 @@
<div class="admonition caution">
<p class="admonition-title">JSON processing will be disabled</p>
<p>Commenting out the <strong>AUTOCONNECT_USE_JSON</strong> macro invalidates all functions related to JSON processing. If the sketch is using the JSON function, it will result in a compile error.</p>
<p>Commenting out the <strong>AUTOCONNECT_USE_JSON</strong> macro invalidates all functions related to JSON processing. If the Sketch is using the JSON function, it will result in a compile error.</p>
</div>
<div class="admonition hint">
<p class="admonition-title">Exclude the ArduinoJson by each compile-time</p>
@ -1041,7 +1041,7 @@
<hr />
<ol>
<li id="fn:1">
<p>Detaching the ArduinoJson library reduces the sketch size by approximately 10K bytes.&#160;<a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">&#8617;</a></p>
<p>Detaching the ArduinoJson library reduces the Sketch size by approximately 10K bytes.&#160;<a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">&#8617;</a></p>
</li>
</ol>
</div>

Loading…
Cancel
Save