Add 2.3.0
1
versions/2.3.0/badge.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="138" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="138" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h55v20H0z"/><path fill="#007ec6" d="M55 0h83v20H55z"/><path fill="url(#b)" d="M0 0h138v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="27.5" y="15" fill="#010101" fill-opacity=".3">updated</text><text x="27.5" y="14">updated</text><text x="95.5" y="15" fill="#010101" fill-opacity=".3">Jun 23, 2016</text><text x="95.5" y="14">Jun 23, 2016</text></g></svg>
|
After Width: | Height: | Size: 756 B |
BIN
versions/2.3.0/doc/ESP01_connect.jpg
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
versions/2.3.0/doc/ESP_improved_stability.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
versions/2.3.0/doc/ESP_min.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
versions/2.3.0/doc/ESP_to_serial.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
versions/2.3.0/doc/Troubleshooting/ESP_Exception_Decoderp.png
Normal file
After Width: | Height: | Size: 316 KiB |
BIN
versions/2.3.0/doc/Troubleshooting/debug_level.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
versions/2.3.0/doc/Troubleshooting/debug_port.png
Normal file
After Width: | Height: | Size: 34 KiB |
388
versions/2.3.0/doc/Troubleshooting/debugging.html
Normal file
@ -0,0 +1,388 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
<title>
|
||||
|
||||
Debugging · ESP8266 Arduino Core
|
||||
|
||||
</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/poole.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/syntax.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/hyde.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/icons.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
||||
<!-- Icons -->
|
||||
<link rel="shortcut icon" href="/Arduino/versions/2.3.0/public/favicon.ico">
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="/Arduino/versions/2.3.0/public/js/toc.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#toc').toc({ listType: 'ul', showSpeed: 0, title: '', headers: 'h1, h2', minimumHeaders: 2 });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="version-bar">
|
||||
This documentation is for version 2.3.0. <a href="http://esp8266.github.io/Arduino/versions">Other versions.</a>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about">
|
||||
<h2>
|
||||
<a href="http://esp8266.github.io/Arduino">
|
||||
ESP8266 Arduino Core
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/installing.html">Installation</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/reference.html">Reference</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/libraries.html">Libraries</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/filesystem.html">File System</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/ota_updates/readme.html">OTA Update</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/boards.html">Supported Hardware</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/changes.html">Change Log</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
<p>
|
||||
<a href="https://github.com/esp8266/Arduino"><div id="gh-icon"></div>esp8266/Arduino</a>
|
||||
</p>
|
||||
<p class="lead">Documentation for ESP8266 Arduino Core. Installation instructions, functions and classes reference.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content container">
|
||||
<h2 id="table-of-contents">Table of Contents</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#introduction">Introduction</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#requirements">Requirements</a></li>
|
||||
<li><a href="#Usage">Usage</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#Informations">Informations</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#for-developers">For Developers</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
|
||||
<p>Since 2.1.0-rc1 the core includes a Debugging feature that is controllable over the IDE menu.</p>
|
||||
|
||||
<p>The new menu points manage the real-time Debug messages.</p>
|
||||
|
||||
<h3 id="requirements">Requirements</h3>
|
||||
|
||||
<p>For usage of the debugging a Serial connection is required (Serial or Serial1).</p>
|
||||
|
||||
<p>The Serial Interface need to be initialized in the <code>setup()</code>.</p>
|
||||
|
||||
<p>Set the Serial baud rate as high as possible for your Hardware setup.</p>
|
||||
|
||||
<p>Minimum sketch to use debugging:
|
||||
```cpp
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
}</p>
|
||||
|
||||
<p>void loop() {
|
||||
}
|
||||
```</p>
|
||||
|
||||
<h3 id="usage">Usage</h3>
|
||||
|
||||
<ol>
|
||||
<li><p>Select the Serial interface for the Debugging messages:
|
||||
<img src="debug_port.png" alt="Debug-Port"></p></li>
|
||||
<li><p>Select which type / level you want debug messages for:
|
||||
<img src="debug_level.png" alt="Debug-Level"></p></li>
|
||||
<li><p>Check if the Serial interface is initialized in <code>setup()</code> (see <a href="#requirements">Requirements</a>)</p></li>
|
||||
<li><p>Flash sketch</p></li>
|
||||
<li><p>Check the Serial Output</p></li>
|
||||
</ol>
|
||||
|
||||
<h2 id="informations">Informations</h2>
|
||||
|
||||
<p>It work with every sketch that enables the Serial interface that is selected as debug port.</p>
|
||||
|
||||
<p>The Serial interface can still be used normal in the Sketch.</p>
|
||||
|
||||
<p>The debug output is additional and will not disable any interface from usage in the sketch.</p>
|
||||
|
||||
<h3 id="for-developers">For Developers</h3>
|
||||
|
||||
<p>For the debug handling uses defines.</p>
|
||||
|
||||
<p>The defined are set by command line.</p>
|
||||
|
||||
<h4 id="debug-port">Debug Port</h4>
|
||||
|
||||
<p>The port has the define <code>DEBUG_ESP_PORT</code> possible value:
|
||||
- Disabled: define not existing
|
||||
- Serial: Serial
|
||||
- Serial1: Serial1</p>
|
||||
|
||||
<h4 id="debug-level">Debug Level</h4>
|
||||
|
||||
<p>All defines for the different levels starts with <code>DEBUG_ESP_</code></p>
|
||||
|
||||
<p>a full list can be found here in the <a href="https://github.com/esp8266/Arduino/blob/master/boards.txt#L180">boards.txt</a></p>
|
||||
|
||||
<h4 id="example-for-own-debug-messages">Example for own debug messages</h4>
|
||||
|
||||
<p>The debug messages will be only shown when the Debug Port in the IDE menu is set.</p>
|
||||
<div class="highlight"><pre><code class="language-cpp" data-lang="cpp"><span class="cp">#ifdef DEBUG_ESP_PORT</span>
|
||||
<span class="cp">#define DEBUG_MSG(...) DEBUG_ESP_PORT.printf( __VA_ARGS__ )</span>
|
||||
<span class="cp">#else</span>
|
||||
<span class="cp">#define DEBUG_MSG(...) </span>
|
||||
<span class="cp">#endif</span>
|
||||
|
||||
<span class="kt">void</span> <span class="nf">setup</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="n">Serial</span><span class="p">.</span><span class="n">begin</span><span class="p">(</span><span class="mi">115200</span><span class="p">);</span>
|
||||
|
||||
<span class="n">delay</span><span class="p">(</span><span class="mi">3000</span><span class="p">);</span>
|
||||
<span class="n">DEBUG_MSG</span><span class="p">(</span><span class="s">"bootup...</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="kt">void</span> <span class="nf">loop</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="n">DEBUG_MSG</span><span class="p">(</span><span class="s">"loop %d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">millis</span><span class="p">());</span>
|
||||
<span class="n">delay</span><span class="p">(</span><span class="mi">1000</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
354
versions/2.3.0/doc/Troubleshooting/stack_dump.html
Normal file
@ -0,0 +1,354 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
<title>
|
||||
|
||||
Debugging · ESP8266 Arduino Core
|
||||
|
||||
</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/poole.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/syntax.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/hyde.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/icons.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
||||
<!-- Icons -->
|
||||
<link rel="shortcut icon" href="/Arduino/versions/2.3.0/public/favicon.ico">
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="/Arduino/versions/2.3.0/public/js/toc.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#toc').toc({ listType: 'ul', showSpeed: 0, title: '', headers: 'h1, h2', minimumHeaders: 2 });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="version-bar">
|
||||
This documentation is for version 2.3.0. <a href="http://esp8266.github.io/Arduino/versions">Other versions.</a>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about">
|
||||
<h2>
|
||||
<a href="http://esp8266.github.io/Arduino">
|
||||
ESP8266 Arduino Core
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/installing.html">Installation</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/reference.html">Reference</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/libraries.html">Libraries</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/filesystem.html">File System</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/ota_updates/readme.html">OTA Update</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/boards.html">Supported Hardware</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/changes.html">Change Log</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
<p>
|
||||
<a href="https://github.com/esp8266/Arduino"><div id="gh-icon"></div>esp8266/Arduino</a>
|
||||
</p>
|
||||
<p class="lead">Documentation for ESP8266 Arduino Core. Installation instructions, functions and classes reference.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content container">
|
||||
<h2 id="table-of-contents">Table of Contents</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#introduction">Introduction</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#Decode">Decode</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
|
||||
<p>If the ESP crash the Exception Cause will be shown and the current stack will be dumped.</p>
|
||||
|
||||
<p>example:</p>
|
||||
<div class="highlight"><pre><code class="language-text" data-lang="text">Exception (0): epc1=0x402103f4 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
|
||||
|
||||
ctx: sys
|
||||
sp: 3ffffc10 end: 3fffffb0 offset: 01a0
|
||||
|
||||
>>>stack>>>
|
||||
3ffffdb0: 40223e00 3fff6f50 00000010 60000600
|
||||
3ffffdc0: 00000001 4021f774 3fffc250 4000050c
|
||||
3ffffdd0: 400043d5 00000030 00000016 ffffffff
|
||||
3ffffde0: 400044ab 3fffc718 3ffffed0 08000000
|
||||
3ffffdf0: 60000200 08000000 00000003 00000000
|
||||
3ffffe00: 0000ffff 00000001 04000002 003fd000
|
||||
3ffffe10: 3fff7188 000003fd 3fff2564 00000030
|
||||
3ffffe20: 40101709 00000008 00000008 00000020
|
||||
3ffffe30: c1948db3 394c5e70 7f2060f2 c6ba0c87
|
||||
3ffffe40: 3fff7058 00000001 40238d41 3fff6ff0
|
||||
3ffffe50: 3fff6f50 00000010 60000600 00000020
|
||||
3ffffe60: 402301a8 3fff7098 3fff7014 40238c77
|
||||
3ffffe70: 4022fb6c 40230ebe 3fff1a5b 3fff6f00
|
||||
3ffffe80: 3ffffec8 00000010 40231061 3fff0f90
|
||||
3ffffe90: 3fff6848 3ffed0c0 60000600 3fff6ae0
|
||||
3ffffea0: 3fff0f90 3fff0f90 3fff6848 3fff6d40
|
||||
3ffffeb0: 3fff28e8 40101233 d634fe1a fffeffff
|
||||
3ffffec0: 00000001 00000000 4022d5d6 3fff6848
|
||||
3ffffed0: 00000002 4000410f 3fff2394 3fff6848
|
||||
3ffffee0: 3fffc718 40004a3c 000003fd 3fff7188
|
||||
3ffffef0: 3fffc718 40101510 00000378 3fff1a5b
|
||||
3fffff00: 000003fd 4021d2e7 00000378 000003ff
|
||||
3fffff10: 00001000 4021d37d 3fff2564 000003ff
|
||||
3fffff20: 000003fd 60000600 003fd000 3fff2564
|
||||
3fffff30: ffffff00 55aa55aa 00000312 0000001c
|
||||
3fffff40: 0000001c 0000008a 0000006d 000003ff
|
||||
3fffff50: 4021d224 3ffecf90 00000000 3ffed0c0
|
||||
3fffff60: 00000001 4021c2e9 00000003 3fff1238
|
||||
3fffff70: 4021c071 3ffecf84 3ffecf30 0026a2b0
|
||||
3fffff80: 4021c0b6 3fffdab0 00000000 3fffdcb0
|
||||
3fffff90: 3ffecf40 3fffdab0 00000000 3fffdcc0
|
||||
3fffffa0: 40000f49 40000f49 3fffdab0 40000f49
|
||||
<<<stack<<<
|
||||
</code></pre></div>
|
||||
<p>the first number after <code>Exception</code> gives the cause of the reset.
|
||||
a full ist of all causes can be found <a href="../exception_causes.html">here</a>
|
||||
the hex after are the stack dump.</p>
|
||||
|
||||
<h3 id="decode">Decode</h3>
|
||||
|
||||
<p>it's possible to decode the Stack to readable information.
|
||||
more info see <a href="https://github.com/me-no-dev/EspExceptionDecoder">Esp Exception Decoder</a> tool </p>
|
||||
|
||||
<p><img src="ESP_Exception_Decoderp.png" alt="ESP Exception Decoder"></p>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
816
versions/2.3.0/doc/boards.html
Normal file
@ -0,0 +1,816 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
<title>
|
||||
|
||||
Supported Hardware · ESP8266 Arduino Core
|
||||
|
||||
</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/poole.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/syntax.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/hyde.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/icons.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
||||
<!-- Icons -->
|
||||
<link rel="shortcut icon" href="/Arduino/versions/2.3.0/public/favicon.ico">
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="/Arduino/versions/2.3.0/public/js/toc.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#toc').toc({ listType: 'ul', showSpeed: 0, title: '', headers: 'h1, h2', minimumHeaders: 2 });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="version-bar">
|
||||
This documentation is for version 2.3.0. <a href="http://esp8266.github.io/Arduino/versions">Other versions.</a>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about">
|
||||
<h2>
|
||||
<a href="http://esp8266.github.io/Arduino">
|
||||
ESP8266 Arduino Core
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/installing.html">Installation</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/reference.html">Reference</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/libraries.html">Libraries</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/filesystem.html">File System</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/ota_updates/readme.html">OTA Update</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/boards.html">Supported Hardware</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="toc"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/changes.html">Change Log</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
<p>
|
||||
<a href="https://github.com/esp8266/Arduino"><div id="gh-icon"></div>esp8266/Arduino</a>
|
||||
</p>
|
||||
<p class="lead">Documentation for ESP8266 Arduino Core. Installation instructions, functions and classes reference.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content container">
|
||||
<h2 id="table-of-contents">Table of contents</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#adafruit-huzzah-esp8266-esp-12">Adafruit HUZZAH ESP8266 (ESP-12)</a></li>
|
||||
<li><a href="#espresso-lite-10">ESPresso Lite 1.0</a></li>
|
||||
<li><a href="#espresso-lite-20">ESPresso Lite 2.0</a></li>
|
||||
<li><a href="#nodemcu-09-">NodeMCU 0.9 <a name="user\-content\-nodemcu\-0\-9"></a></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#pin-mapping">Pin mapping</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#nodemcu-10">NodeMCU 1.0</a></li>
|
||||
<li><a href="#olimex-mod-wifi-esp8266-dev">Olimex MOD-WIFI-ESP8266-DEV</a></li>
|
||||
<li><a href="#olimex-mod-wifi-esp8266">Olimex MOD-WIFI-ESP8266</a></li>
|
||||
<li><a href="#olimex-esp8266-evb">Olimex ESP8266-EVB</a></li>
|
||||
<li><a href="#phoenix-10">Phoenix 1.0</a></li>
|
||||
<li><a href="#phoenix-20">Phoenix 2.0</a></li>
|
||||
<li><a href="#sparkfun-esp8266-thing">SparkFun ESP8266 Thing</a></li>
|
||||
<li><a href="#sweetpea-esp-210">SweetPea ESP-210</a></li>
|
||||
<li><a href="#espino">ESPino</a></li>
|
||||
<li><a href="#WifInfo">WifInfo</a></li>
|
||||
<li><a href="#generic-esp8266-modules">Generic ESP8266 modules</a></li>
|
||||
<li><a href="#generic-esp8285-modules">Generic ESP8285 modules</a></li>
|
||||
<li><a href="#serial-adapter">Serial Adapter</a></li>
|
||||
<li><a href="#minimal-hardware-setup-for-bootloading-and-usage">Minimal Hardware Setup for Bootloading and Usage</a></li>
|
||||
<li><a href="#esp-to-serial">ESP to Serial</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#minimal-hardware-setup-for-bootloading-only">Minimal Hardware Setup for Bootloading only</a></li>
|
||||
<li><a href="#minimal-hardware-setup-for-running-only">Minimal Hardware Setup for Running only</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#minimal">Minimal</a></li>
|
||||
<li><a href="#improved-stability">Improved Stability</a></li>
|
||||
<li><a href="#boot-messages-and-modes">Boot Messages and Modes</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#rst-cause">rst cause</a></li>
|
||||
<li><a href="#boot-mode">boot mode</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#wemos-d1">WeMos D1</a></li>
|
||||
<li><a href="#wemos-d1-mini">WeMos D1 mini</a></li>
|
||||
<li><a href="#espinotee">ESPino by ThaiEasyElec</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="adafruit-huzzah-esp8266-esp-12">Adafruit HUZZAH ESP8266 (ESP-12)</h2>
|
||||
|
||||
<p><em>TODO: add notes</em></p>
|
||||
|
||||
<h2 id="espresso-lite-1-0">ESPresso Lite 1.0</h2>
|
||||
|
||||
<p>ESPresso Lite 1.0 (beta version) is an Arduino-compatible Wi-Fi development board powered by Espressif System's own ESP8266 WROOM-02 module. It has breadboard-friendly breakout pins with in-built LED, two reset/flash buttons and a user programmable button . The operating voltage is 3.3VDC, regulated with 800mA maximum current. Special distinctive features include on-board I2C pads that allow direct connection to OLED LCD and sensor boards.</p>
|
||||
|
||||
<h2 id="espresso-lite-2-0">ESPresso Lite 2.0</h2>
|
||||
|
||||
<p>ESPresso Lite 2.0 is an Arduino-compatible Wi-Fi development board based on an earlier V1 (beta version). Re-designed together with Cytron Technologies, the newly-revised ESPresso Lite V2.0 features the auto-load/auto-program function, eliminating the previous need to reset the board manually before flashing a new program. It also feature two user programmable side buttons and a reset button. The special distinctive features of on-board pads for I2C sensor and actuator is retained.</p>
|
||||
|
||||
<h2 id="phoenix-1-0">Phoenix 1.0</h2>
|
||||
|
||||
<p>Product page: <a href="http://www.espert.co">http://www.espert.co</a></p>
|
||||
|
||||
<h2 id="phoenix-2-0">Phoenix 2.0</h2>
|
||||
|
||||
<p>Product page: <a href="http://www.espert.co">http://www.espert.co</a></p>
|
||||
|
||||
<h2 id="nodemcu-0-9">NodeMCU 0.9</h2>
|
||||
|
||||
<h3 id="pin-mapping">Pin mapping</h3>
|
||||
|
||||
<p>Pin numbers written on the board itself do not correspond to ESP8266 GPIO pin numbers. Constants are defined to make using this board easier:</p>
|
||||
<div class="highlight"><pre><code class="language-C++" data-lang="C++"><span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D0</span> <span class="o">=</span> <span class="mi">16</span><span class="p">;</span>
|
||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D1</span> <span class="o">=</span> <span class="mi">5</span><span class="p">;</span>
|
||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D2</span> <span class="o">=</span> <span class="mi">4</span><span class="p">;</span>
|
||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D3</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
|
||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D4</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
|
||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D5</span> <span class="o">=</span> <span class="mi">14</span><span class="p">;</span>
|
||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D6</span> <span class="o">=</span> <span class="mi">12</span><span class="p">;</span>
|
||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D7</span> <span class="o">=</span> <span class="mi">13</span><span class="p">;</span>
|
||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D8</span> <span class="o">=</span> <span class="mi">15</span><span class="p">;</span>
|
||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D9</span> <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>
|
||||
<span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">D10</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
|
||||
</code></pre></div>
|
||||
<p>If you want to use NodeMCU pin 5, use D5 for pin number, and it will be translated to 'real' GPIO pin 14.</p>
|
||||
|
||||
<h2 id="nodemcu-1-0">NodeMCU 1.0</h2>
|
||||
|
||||
<p>This module is sold under many names for around $6.50 on AliExpress and it's one of the cheapest, fully integrated ESP8266 solutions.</p>
|
||||
|
||||
<p>It's an open hardware design with an ESP-12E core and 4 MB of SPI flash.</p>
|
||||
|
||||
<p>Acording to the manufacturer, "with a micro USB cable, you can connect NodeMCU devkit to your laptop and flash it without any trouble". This is more or less true: the board comes with a CP2102 onboard USB to serial adapter which just works, well, the majority of the time. Sometimes flashing fails and you have to reset the board by holding down FLASH + RST, then releasing FLASH, then releasing RST. This forces the CP2102 device to power cycle and to be re-numbered by Linux.</p>
|
||||
|
||||
<p>The board also features a NCP1117 voltage regulator, a blue LED on GPIO16 and a 220k/100k Ohm voltage divider on the ADC input pin.</p>
|
||||
|
||||
<p>Full pinout and PDF schematics can be found <a href="https://github.com/nodemcu/nodemcu-devkit-v1.0">here</a></p>
|
||||
|
||||
<h2 id="olimex-mod-wifi-esp8266-dev">Olimex MOD-WIFI-ESP8266-DEV</h2>
|
||||
|
||||
<p>This board comes with 2 MB of SPI flash and optional accessories (e.g. evaluation board ESP8266-EVB or BAT-BOX for batteries).</p>
|
||||
|
||||
<p>The basic module has three solder jumpers that allow you to switch the operating mode between SDIO, UART and FLASH.</p>
|
||||
|
||||
<p>The board is shipped for FLASH operation mode, with jumpers TD0JP=0, IO0JP=1, IO2JP=1.</p>
|
||||
|
||||
<p>Since jumper IO0JP is tied to GPIO0, which is PIN 21, you'll have to ground it before programming with a USB to serial adapter and reset the board by power cycling it.</p>
|
||||
|
||||
<p>UART pins for programming and serial I/O are GPIO1 (TXD, pin 3) and GPIO3 (RXD, pin 4).</p>
|
||||
|
||||
<p>You can find the board schematics <a href="https://github.com/OLIMEX/ESP8266/blob/master/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WIFI-ESP8266-DEV_schematic.pdf">here</a></p>
|
||||
|
||||
<h2 id="olimex-mod-wifi-esp8266">Olimex MOD-WIFI-ESP8266</h2>
|
||||
|
||||
<p>This is a stripped down version of the above. Behaves identically in terms of jumpers but has less pins readily available for I/O. Still 2 MB of SPI flash.</p>
|
||||
|
||||
<h2 id="olimex-esp8266-evb">Olimex ESP8266-EVB</h2>
|
||||
|
||||
<p>It's a Olimex MOD-WIFI-ESP8266-DEV module installed on the headers of a development board which features some breakout connectors, a button (GPIO0) and a relay (GPIO5).</p>
|
||||
|
||||
<p>Programming is pretty straightforward: the board is supported in the Arduino IDE after <a href="https://github.com/esp8266/Arduino#installing-with-boards-manager">installing it via the Board Manager</a>. To download a program you just have to connect GND/RX/TX from a serial/USB adapter to the UEXT connector and press the only button before applying power to enter UART mode.</p>
|
||||
|
||||
<p>Don't connect 5V from the serial/USB adapter to the board or you won't be able to power cycle it for UART mode.</p>
|
||||
|
||||
<p>You can find the board schematics <a href="https://github.com/OLIMEX/ESP8266/blob/master/HARDWARE/ESP8266-EVB/ESP8266-EVB_Rev_A.pdf">here</a>.</p>
|
||||
|
||||
<p><a href="https://www.olimex.com/Products/IoT/ESP8266-EVB/resources/ESP8266-EVB-how-to-use-Arduino.pdf">This guide</a> is also useful for the first setup, since it contains the UEXT connector pinout.</p>
|
||||
|
||||
<p>Board variants include:
|
||||
* ESP8266-EVB-BAT: comes with built-in LiPo charger and step-up converter
|
||||
* ESP8266-EVB-BAT-BOX: as above, but enclosd in a plastic box (non-weatherproof)</p>
|
||||
|
||||
<h2 id="sparkfun-esp8266-thing">SparkFun ESP8266 Thing</h2>
|
||||
|
||||
<p>Product page: <a href="https://www.sparkfun.com/products/13231">https://www.sparkfun.com/products/13231</a></p>
|
||||
|
||||
<p><em>TODO: add notes</em></p>
|
||||
|
||||
<h2 id="sweetpea-esp-210">SweetPea ESP-210</h2>
|
||||
|
||||
<p><em>TODO: add notes</em></p>
|
||||
|
||||
<h2 id="espino">ESPino</h2>
|
||||
|
||||
<p>ESPino integrates the ESP-12 module with a 3.3v regulator, CP2104 USB-Serial bridge and a micro USB connector for easy programming. It is designed for fitting in a breadboard and has an RGB Led and two buttons for easy prototyping.</p>
|
||||
|
||||
<p>For more information about the hardware, pinout diagram and programming procedures, please see the <a href="https://github.com/makerlabmx/ESPino-tools/raw/master/Docs/ESPino-Datasheet-EN.pdf">datasheet</a>.</p>
|
||||
|
||||
<p>Product page: <a href="http://www.espino.io/en">http://www.espino.io/en</a></p>
|
||||
|
||||
<h2 id="wifinfo">WifInfo</h2>
|
||||
|
||||
<p>WifInfo integrates the ESP-12 or ESP-07+Ext antenna module with a 3.3v regulator and the hardware to be able to measure French telemetry issue from ERDF powering meter serial output. It has a USB connector for powering, an RGB WS2812 Led, 4 pins I2C connector to fit OLED or sensor, and two buttons + FTDI connector and auto reset feature.</p>
|
||||
|
||||
<p>For more information, please see WifInfo related <a href="http://hallard.me/category/wifinfo/">blog</a> entries, <a href="https://github.com/hallard/WifInfo">github</a> and <a href="https://community.hallard.me/category/16/wifinfo">community</a> forum.</p>
|
||||
|
||||
<h2 id="generic-esp8266-modules">Generic ESP8266 modules</h2>
|
||||
|
||||
<p>These modules come in different form factors and pinouts. See the page at ESP8266 community wiki for more info:
|
||||
<a href="http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family">ESP8266 Module Family</a>.</p>
|
||||
|
||||
<p>Usually these modules have no bootstapping resistors on board, insufficient decoupling capacitors, no voltage regulator, no reset circuit, and no USB-serial adapter. This makes using them somewhat tricky, compared to development boards which add these features.</p>
|
||||
|
||||
<p>In order to use these modules, make sure to observe the following:</p>
|
||||
|
||||
<ul>
|
||||
<li><p><strong>Provide sufficient power to the module.</strong> For stable use of the ESP8266 a power supply with 3.3V and >= 250mA is required. Using the power available from USB to Serial adapter is not recommended, these adapters typically do not supply enough current to run ESP8266 reliably in every situation. An external supply or regulator along with filtering capacitors is preferred.</p></li>
|
||||
<li><p><strong>Connect bootstapping resistors</strong> to GPIO0, GPIO2, GPIO15 according to the schematics below.</p></li>
|
||||
<li><p><strong>Put ESP8266 into bootloader mode</strong> before uploading code.</p></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="serial-adapter">Serial Adapter</h2>
|
||||
|
||||
<p>There are many different USB to Serial adapters / boards.
|
||||
To be able to put ESP8266 into bootloader mode using serial handshaking lines, you need the adapter which breaks out RTS and DTR outputs. CTS and DSR are not useful for upload (they are inputs). Make sure the adapter can work with 3.3V IO voltage: it should have a jumper or a switch to select between 5V and 3.3V, or be marked as 3.3V only.</p>
|
||||
|
||||
<p>Adapters based around the following ICs should work:</p>
|
||||
|
||||
<ul>
|
||||
<li>FT232RL</li>
|
||||
<li>CP2102</li>
|
||||
<li>CH340G</li>
|
||||
</ul>
|
||||
|
||||
<p>PL2303-based adapters are known not to work on Mac OS X. See <a href="https://github.com/igrr/esptool-ck/issues/9">https://github.com/igrr/esptool-ck/issues/9</a> for more info.</p>
|
||||
|
||||
<h2 id="minimal-hardware-setup-for-bootloading-and-usage">Minimal Hardware Setup for Bootloading and Usage</h2>
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>PIN</th>
|
||||
<th>Resistor</th>
|
||||
<th>Serial Adapter</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>VCC</td>
|
||||
<td></td>
|
||||
<td>VCC (3.3V)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GND</td>
|
||||
<td></td>
|
||||
<td>GND</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TX or GPIO2*</td>
|
||||
<td></td>
|
||||
<td>RX</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RX</td>
|
||||
<td></td>
|
||||
<td>TX</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GPIO0</td>
|
||||
<td>PullUp</td>
|
||||
<td>DTR</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Reset*</td>
|
||||
<td>PullUp</td>
|
||||
<td>RTS</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GPIO15*</td>
|
||||
<td>PullDown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CH_PD</td>
|
||||
<td>PullUp</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<ul>
|
||||
<li>Note
|
||||
|
||||
<ul>
|
||||
<li>GPIO15 is also named MTDO</li>
|
||||
<li>Reset is also named RSBT or REST (adding PullUp improves the stability of the module)</li>
|
||||
<li>GPIO2 is alternative TX for the boot loader mode</li>
|
||||
<li><strong>Directly connecting a pin to VCC or GND is not a substitute for a PullUp or PullDown resistor, doing this can break upload management and the serial console, instability has also been noted in some cases.</strong></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="esp-to-serial">ESP to Serial</h2>
|
||||
|
||||
<p><img src="ESP_to_serial.png" alt="ESP to Serial"></p>
|
||||
|
||||
<h3 id="minimal-hardware-setup-for-bootloading-only">Minimal Hardware Setup for Bootloading only</h3>
|
||||
|
||||
<p>ESPxx Hardware</p>
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>PIN</th>
|
||||
<th>Resistor</th>
|
||||
<th>Serial Adapter</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>VCC</td>
|
||||
<td></td>
|
||||
<td>VCC (3.3V)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GND</td>
|
||||
<td></td>
|
||||
<td>GND</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TX or GPIO2</td>
|
||||
<td></td>
|
||||
<td>RX</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RX</td>
|
||||
<td></td>
|
||||
<td>TX</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GPIO0</td>
|
||||
<td></td>
|
||||
<td>GND</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Reset</td>
|
||||
<td></td>
|
||||
<td>RTS*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GPIO15</td>
|
||||
<td>PullDown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CH_PD</td>
|
||||
<td>PullUp</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<ul>
|
||||
<li>Note
|
||||
|
||||
<ul>
|
||||
<li>if no RTS is used a manual power toggle is needed</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
<h3 id="minimal-hardware-setup-for-running-only">Minimal Hardware Setup for Running only</h3>
|
||||
|
||||
<p>ESPxx Hardware</p>
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>PIN</th>
|
||||
<th>Resistor</th>
|
||||
<th>Power supply</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>VCC</td>
|
||||
<td></td>
|
||||
<td>VCC (3.3V)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GND</td>
|
||||
<td></td>
|
||||
<td>GND</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GPIO0</td>
|
||||
<td>PullUp</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GPIO15</td>
|
||||
<td>PullDown</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CH_PD</td>
|
||||
<td>PullUp</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<h2 id="minimal">Minimal</h2>
|
||||
|
||||
<p><img src="ESP_min.png" alt="ESP min"></p>
|
||||
|
||||
<h2 id="improved-stability">Improved Stability</h2>
|
||||
|
||||
<p><img src="ESP_improved_stability.png" alt="ESP improved stability"></p>
|
||||
|
||||
<h2 id="boot-messages-and-modes">Boot Messages and Modes</h2>
|
||||
|
||||
<p>The ESP module checks at every boot the Pins 0, 2 and 15.
|
||||
based on them its boots in different modes:</p>
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>GPIO15</th>
|
||||
<th>GPIO0</th>
|
||||
<th>GPIO2</th>
|
||||
<th>Mode</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>0V</td>
|
||||
<td>0V</td>
|
||||
<td>3.3V</td>
|
||||
<td>Uart Bootloader</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>0V</td>
|
||||
<td>3.3V</td>
|
||||
<td>3.3V</td>
|
||||
<td>Boot sketch (SPI flash)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3.3V</td>
|
||||
<td>x</td>
|
||||
<td>x</td>
|
||||
<td>SDIO mode (not used for Arduino)</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<p>at startup the ESP prints out the current boot mode example:
|
||||
<code>
|
||||
rst cause:2, boot mode:(3,6)
|
||||
</code></p>
|
||||
|
||||
<p>note:
|
||||
- GPIO2 is used as TX output and the internal Pullup is enabled on boot.</p>
|
||||
|
||||
<h3 id="rst-cause">rst cause</h3>
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>Number</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>0</td>
|
||||
<td>unknown</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>normal boot</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>reset pin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>software reset</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>4</td>
|
||||
<td>watchdog reset</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<h3 id="boot-mode">boot mode</h3>
|
||||
|
||||
<p>the first value respects the pin setup of the Pins 0, 2 and 15.</p>
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>Number</th>
|
||||
<th>GPIO15</th>
|
||||
<th>GPIO0</th>
|
||||
<th>GPIO2</th>
|
||||
<th>Mode</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>0</td>
|
||||
<td>0V</td>
|
||||
<td>0V</td>
|
||||
<td>0V</td>
|
||||
<td>Not valid</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>0V</td>
|
||||
<td>0V</td>
|
||||
<td>3.3V</td>
|
||||
<td>Uart</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>0V</td>
|
||||
<td>3.3V</td>
|
||||
<td>0V</td>
|
||||
<td>Not valid</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>0V</td>
|
||||
<td>3.3V</td>
|
||||
<td>3.3V</td>
|
||||
<td>Flash</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>4</td>
|
||||
<td>3.3V</td>
|
||||
<td>0V</td>
|
||||
<td>0V</td>
|
||||
<td>SDIO</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>5</td>
|
||||
<td>3.3V</td>
|
||||
<td>0V</td>
|
||||
<td>3.3V</td>
|
||||
<td>SDIO</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>6</td>
|
||||
<td>3.3V</td>
|
||||
<td>3.3V</td>
|
||||
<td>0V</td>
|
||||
<td>SDIO</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>7</td>
|
||||
<td>3.3V</td>
|
||||
<td>3.3V</td>
|
||||
<td>3.3V</td>
|
||||
<td>SDIO</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<p>note:
|
||||
- number = ((GPIO15 << 2) | (GPIO0 << 1) | GPIO2);</p>
|
||||
|
||||
<h2 id="generic-esp8285-modules">Generic ESP8285 modules</h2>
|
||||
|
||||
<p>ESP8285 (<a href="http://espressif.com/sites/default/files/documentation/0a-esp8285_datasheet_en_v1.0_20160422.pdf">datasheet</a>) is a multi-chip package which contains ESP8266 and 1MB flash.
|
||||
All points related to bootstrapping resistors and recommended circuits listed above apply to ESP8285 as well.</p>
|
||||
|
||||
<p>Note that since ESP8285 has SPI flash memory internally connected in DOUT mode, pins 9 and 10 may be used as GPIO / I2C / PWM pins.</p>
|
||||
|
||||
<h2 id="wemos-d1">WeMos D1</h2>
|
||||
|
||||
<p>Product page: <a href="http://wemos.cc">http://wemos.cc</a></p>
|
||||
|
||||
<h2 id="wemos-d1-mini">WeMos D1 mini</h2>
|
||||
|
||||
<p>Product page: <a href="http://wemos.cc">http://wemos.cc</a></p>
|
||||
|
||||
<h2 id="espino-wroom-02-module-by-thaieasyelec">ESPino (WROOM-02 Module) by ThaiEasyElec</h2>
|
||||
|
||||
<p>ESPino by ThaiEasyElec using WROOM-02 module from Espressif Systems with 4 MB Flash.</p>
|
||||
|
||||
<p>We will update an English description soon.
|
||||
- Product page: <a href="http://thaieasyelec.com/products/wireless-modules/wifi-modules/espino-wifi-development-board-detail.html">http://thaieasyelec.com/products/wireless-modules/wifi-modules/espino-wifi-development-board-detail.html</a>
|
||||
- Schematics: <a href="http://www.thaieasyelec.com/downloads/ETEE052/ETEE052_ESPino_Schematic.pdf">www.thaieasyelec.com/downloads/ETEE052/ETEE052_ESPino_Schematic.pdf</a>
|
||||
- Dimensions: <a href="http://thaieasyelec.com/downloads/ETEE052/ETEE052_ESPino_Dimension.pdf">http://thaieasyelec.com/downloads/ETEE052/ETEE052_ESPino_Dimension.pdf</a>
|
||||
- Pinouts: <a href="http://thaieasyelec.com/downloads/ETEE052/ETEE052_ESPino_User_Manual_TH_v1_0_20160204.pdf">http://thaieasyelec.com/downloads/ETEE052/ETEE052_ESPino_User_Manual_TH_v1_0_20160204.pdf</a> (Please see pg. 8)</p>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
699
versions/2.3.0/doc/changes.html
Normal file
@ -0,0 +1,699 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
<title>
|
||||
|
||||
Change Log · ESP8266 Arduino Core
|
||||
|
||||
</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/poole.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/syntax.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/hyde.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/icons.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
||||
<!-- Icons -->
|
||||
<link rel="shortcut icon" href="/Arduino/versions/2.3.0/public/favicon.ico">
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="/Arduino/versions/2.3.0/public/js/toc.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#toc').toc({ listType: 'ul', showSpeed: 0, title: '', headers: 'h1, h2', minimumHeaders: 2 });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="version-bar">
|
||||
This documentation is for version 2.3.0. <a href="http://esp8266.github.io/Arduino/versions">Other versions.</a>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about">
|
||||
<h2>
|
||||
<a href="http://esp8266.github.io/Arduino">
|
||||
ESP8266 Arduino Core
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/installing.html">Installation</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/reference.html">Reference</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/libraries.html">Libraries</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/filesystem.html">File System</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/ota_updates/readme.html">OTA Update</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/boards.html">Supported Hardware</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/changes.html">Change Log</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="toc"></div>
|
||||
|
||||
|
||||
</nav>
|
||||
<p>
|
||||
<a href="https://github.com/esp8266/Arduino"><div id="gh-icon"></div>esp8266/Arduino</a>
|
||||
</p>
|
||||
<p class="lead">Documentation for ESP8266 Arduino Core. Installation instructions, functions and classes reference.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content container">
|
||||
<h2 id="2-3-0">2.3.0</h2>
|
||||
|
||||
<p>June 23, 2016</p>
|
||||
|
||||
<p>Package link: <code>http://arduino.esp8266.com/versions/2.3.0/package_esp8266com_index.json</code>.</p>
|
||||
|
||||
<h3 id="core">Core</h3>
|
||||
|
||||
<ul>
|
||||
<li>Fix NMI interrupt handler alignment</li>
|
||||
<li>Update SDK to 1.5.3</li>
|
||||
<li>umm_malloc: print block start address before heap corruption callback is triggered</li>
|
||||
<li>If GDBStub library is used, break into gdb on assert and panic</li>
|
||||
<li>Add option to keep FS classes in namespace (#2030)</li>
|
||||
<li>Add SPIFFS::end (#1657)</li>
|
||||
<li>Add ArduinoOTA::getHostname() interface</li>
|
||||
<li>Add _<em>throw_out_of</em>range</li>
|
||||
<li>Add support for RTC user memory in ESP-specific APIs. (#1836)</li>
|
||||
<li>Expose RTC_USER_MEM in esp8266_peri.h</li>
|
||||
<li>Remove DISABLED macro (#2072)</li>
|
||||
<li>Execute global constructors in correct order (#2074)</li>
|
||||
<li>Real board name available in Sketch/MDNS/OTA (#2054)</li>
|
||||
<li>Add DOUT/QOUT flash modes</li>
|
||||
<li>Add ESP8285 entry in boards menu</li>
|
||||
<li>Move timer detachInterrupt functions into IRAM (#2083)</li>
|
||||
<li>Make Updater be able to run inside async callbacks (#2096)</li>
|
||||
<li>Add new boards Phoenix 1.0 & Phoenix 2.0 (#2088)</li>
|
||||
<li>Store git version of the core in the compiled binary (#2099)</li>
|
||||
<li>Rebuild libstdc++ with mlongcalls and link against it (#1983)</li>
|
||||
<li>Add mechanism for posting functions to the main loop (#2082)</li>
|
||||
<li>MD5Builder::addStream: fixed falsy calculated hash for len > filelength (#2126)</li>
|
||||
<li>Fix SPIFFS.openDir("") (#2143)</li>
|
||||
<li>Bring back old semantics to random and randomSeed, add secureRandom (#1710) (#2142)</li>
|
||||
<li>Add missing pgm_read_ptr{_near/_far} macros (#2160)</li>
|
||||
<li>Add macro for maximum open SPIFFS files, settings it to 1 saves about 1k heap. (#2167)</li>
|
||||
<li>Fix UART pins setting (#2098)</li>
|
||||
<li>Fix ESP.getSketchSize, add ESP.getSketchMD5 (#2158)</li>
|
||||
<li>Add Serial.baudRate() to get current baud rate (#2079)</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="libraries">Libraries</h3>
|
||||
|
||||
<ul>
|
||||
<li>SNI support in WiFiClientSecure (#1285)</li>
|
||||
<li>Update axTLS to 139914f</li>
|
||||
<li>HTTPClient: return error when HTTPClient::begin is called with HTTPS URL without certificate fingerprint (#1941)</li>
|
||||
<li>HTTPClient: fix default port not being set</li>
|
||||
<li>HTTPClient: fix handling of chunked transfer encoding (#1975)</li>
|
||||
<li>ESP8266SSDP: switch SSDP send arguments around</li>
|
||||
<li>ESP8266WiFi: fix UdpContext::peek to return int (#1946)</li>
|
||||
<li>ESP8266WiFi: fix WiFiSleepType_t values to match SDK ones</li>
|
||||
<li>LwIP: use gcc-built LwIP by default (#1926)</li>
|
||||
<li>LwIP: fix crash in igmp_start_timer (#1826)</li>
|
||||
<li>HTTPClient: include non-standard ports in Host: header</li>
|
||||
<li>ESP8266WiFi: Prevent WiFi config corruption (#1997 #1856 #1699 #1675)</li>
|
||||
<li>GDBStub: fix section attribute for core gdbstub functions</li>
|
||||
<li>Wire: I2C bus reset with info to user</li>
|
||||
<li>ESP8266HTTPClient: allow HTTP header value without LWS</li>
|
||||
<li>ESP8266mDNS: Fix mDNS doesn't accept queryService responses from avahi-daemon (#2015)</li>
|
||||
<li>Add MFRC522 to supported libraries (#2044)</li>
|
||||
<li>Update axTLS to ab516f7 (1.5.3+)</li>
|
||||
<li>Mention ESP8266Ping library</li>
|
||||
<li>ESP8266HTTPClient: fix duplicate Content-Length headers (#1902)</li>
|
||||
<li>ESP8266HTTPUpdateServer: make HTTP Update Server more secure (#2104)</li>
|
||||
<li>ESP8266WiFi: add virtual destructor to WiFiServer class (#2116)</li>
|
||||
<li>ESP8266WiFi: fix error when calling <code>WiFiServer::close</code> more than once</li>
|
||||
<li>ESP8266WiFi: WiFi event handling refactoring (#2119)</li>
|
||||
<li>ESP8266mDNS: restart listening when WiFi STA is connected/disconnected (#1828)</li>
|
||||
<li>ESP8266WiFi: allow DHCP client to be re-enabled using WiFi.config(0U, 0U, 0U) (#1896)</li>
|
||||
<li>ESP8266WiFi: enable SO_REUSE in LwIP and WiFiServer (#1431)</li>
|
||||
<li>ESP8266WebServer: make ESP8266WebServer::urlDecode public (#1419)</li>
|
||||
<li>LwIP: sntp_localtime: return -1 in tm_isdst field (#2010)</li>
|
||||
<li>ESP8266WiFi: fix for crash in WiFiClientSecure when WiFi is disconnected (#2139)</li>
|
||||
<li>SD: Prevent WDT resets in SD library (#1815)</li>
|
||||
<li>ESP8266WiFi: Fix issue when WiFi.begin(ssid, pass) is called right after WiFi.mode(WIFI_OFF)</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="tools">Tools</h3>
|
||||
|
||||
<ul>
|
||||
<li>Python 3 compatibility for get.py</li>
|
||||
<li>Device side test library and test runner</li>
|
||||
<li>Fix ARM toolchain files permissions (#2004)</li>
|
||||
<li>Update esptool to 0.4.9</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="2-2-0">2.2.0</h2>
|
||||
|
||||
<p>April 18, 2016</p>
|
||||
|
||||
<p>Package link: <code>http://arduino.esp8266.com/versions/2.2.0/package_esp8266com_index.json</code>.</p>
|
||||
|
||||
<h3 id="core">Core</h3>
|
||||
|
||||
<ul>
|
||||
<li>Leverage realloc() in String::changeBuffer()</li>
|
||||
<li>Clean up core files</li>
|
||||
<li>Add host side tests</li>
|
||||
<li>Fix possible null pointer in umm_malloc</li>
|
||||
<li>Remove "Upload Using" option from Tools menu</li>
|
||||
<li>Move attachInterrupt and detachInterrupt into IRAM (#1734)</li>
|
||||
<li>Implement strstr_P</li>
|
||||
<li>Allow indefinite duration for tone()</li>
|
||||
<li>Fix crashes when using tone()</li>
|
||||
<li>Fix RF_MODE and ADC_MODE</li>
|
||||
<li>Move micros, delayMicroseconds, millis to IRAM (#1326)</li>
|
||||
<li>Fix pulseIn (#1072, #1149)</li>
|
||||
<li>Accept both named constant and ADC channel number in analogRead (#1766)</li>
|
||||
<li>Enable heap poisoning only when debug options are enabled (#1800)</li>
|
||||
<li>Bootloader: don't touch RTC memory if it doesn't contain a valid command (#619)</li>
|
||||
<li>Update SDK to 1.5.2 (#1653)</li>
|
||||
<li>Clean up variants, fix digitalPinHasPWM definition (#1831)</li>
|
||||
<li>Don't set RF mode on boot unless it was overridden</li>
|
||||
<li>Change build.board property for boards which renumber pins like NodeMCU (#1878)</li>
|
||||
<li>Fix Exception 2 when using printf or vprintf</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="libraries">Libraries</h3>
|
||||
|
||||
<ul>
|
||||
<li>Update axTLS to 5b4be7d</li>
|
||||
<li>WiFiClientSecure: implement connection timeout, fix connected method behavior</li>
|
||||
<li>WiFiClient: fix write behavior when connection is closed by remote side</li>
|
||||
<li>ESP8266HTTPServer: add font MIME types, fix #1601</li>
|
||||
<li>ESP8266mDNS: add client support</li>
|
||||
<li>Update SPIFFS to 82aeac6</li>
|
||||
<li>Servo: move some functions into IRAM (#1742)</li>
|
||||
<li>Update SoftwareSerial to version 3.1.0</li>
|
||||
<li>ESP8266SSDP: change templates to include deviceType</li>
|
||||
<li>ESP8266WebServer: handle more file types</li>
|
||||
<li>SPI: add CPOL setting</li>
|
||||
<li>ESP8266WebServer: Fix buffer overflow in ESP8266WebServer::authenticate (#1790)</li>
|
||||
<li>ESP8266WiFi: fix undefined behavior in WiFiServer::setNoDelay (#1695)</li>
|
||||
<li>Servo: use peripheral clock frequency when calculating FRC1 tick count (#1789)</li>
|
||||
<li>ESP8266WiFi: avoid multiple instances of INADDR_NONE</li>
|
||||
<li>Add LwIP binary built with gcc</li>
|
||||
<li>ESP8266WiFi: Allow PSK instead of passphrase in WiFiSTA::begin</li>
|
||||
<li>SPI: Fix SPI.transfer16() using wrong endianness</li>
|
||||
<li>HTTPClient: decouple transport layer handling + save some RAM</li>
|
||||
<li>ESP8266httpUpdate: decouple HTTPS overloads + save some RAM</li>
|
||||
<li>Update and move lwIP headers, add options to use different lwIP build</li>
|
||||
<li>ESP8266WebServer: wait for data to arrive</li>
|
||||
<li>ESP8266WebServer: save RAM by moving response strings to flash (#1732)</li>
|
||||
<li>SPI: Speed up SPI.writePattern()</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="tools">Tools</h3>
|
||||
|
||||
<ul>
|
||||
<li>Add ARM tools (#269)</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2 id="2-1-0">2.1.0</h2>
|
||||
|
||||
<p>February 27, 2016</p>
|
||||
|
||||
<p>Package link: <code>http://arduino.esp8266.com/versions/2.1.0/package_esp8266com_index.json</code>.</p>
|
||||
|
||||
<h3 id="core">Core</h3>
|
||||
|
||||
<ul>
|
||||
<li>Add function to know last reset reason.</li>
|
||||
<li>Allow control of enabling debug and debug level from IDE</li>
|
||||
<li>Add espduino board</li>
|
||||
<li>Rework StreamString::write to use String internal buffer directly (#1289)</li>
|
||||
<li>Add function to measure stack high water mark</li>
|
||||
<li>Fix RAM corruption caused by our hook of register_chipv6_phy(init_data*).</li>
|
||||
<li>Optimize PWM interrupt handler for better precision</li>
|
||||
<li>Add warning levels configurable through Preferences</li>
|
||||
<li>SPIFFS: check if path length is valid (#1089)</li>
|
||||
<li>Set CPU frequency before running setup</li>
|
||||
<li>Add core_esp8266_features.h to be able to detect the features and libraries included in the ESP core</li>
|
||||
<li>Add ESPino to supported boards</li>
|
||||
<li>Fix pwm first step getting skipped</li>
|
||||
<li>Update SDK to 1.5.1_16_01_08</li>
|
||||
<li>Bufferless and interruptless HardwareSerial</li>
|
||||
<li>HardwareSerial: allow mapping of UART0 TX to GPIO2</li>
|
||||
<li>Add 128K SPIFFS for 512KB modules</li>
|
||||
<li>Reduce stack usage by Print::printf</li>
|
||||
<li>Fix a crash in String::changeBuffer()</li>
|
||||
<li>Implement static initialization guards (#500)</li>
|
||||
<li>Implementation of Tone API using timer1</li>
|
||||
<li>Use umm_malloc for heap management</li>
|
||||
<li>Configurable I2C clock stretching limit</li>
|
||||
<li>Add a new board entry for the SparkFun Thing Dev</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="libraries">Libraries</h3>
|
||||
|
||||
<ul>
|
||||
<li>ESP8266HTTPClient: add CHUNKED encoding support (#1324)</li>
|
||||
<li>Fixed crash bug with mDNS where a string buffer could be used uninitialized</li>
|
||||
<li>Add WiFi TX power control</li>
|
||||
<li>Add WiFi sleep management</li>
|
||||
<li>Allow to hook into WiFi events from sketch</li>
|
||||
<li>Allow setting TCP timeout</li>
|
||||
<li>Add setSleepMode + getSleepMode and setPhyMode + getPhyMode to WiFi</li>
|
||||
<li>Update GDBStub library with the source of esp-gdbstub</li>
|
||||
<li>Servo: fix detach and attach</li>
|
||||
<li>ESP8266mDNS: refactoring, add TXT support</li>
|
||||
<li>Add HTTP Basic Auth to WebServer and libb64 (base64) to core</li>
|
||||
<li>Fix link-time dependency of ESP8266WebServer on SPIFFS (#862)</li>
|
||||
<li>Allow setting client side TLS key and certificate</li>
|
||||
<li>Replace chain of UDP pbufs with a single pbuf before sending (#1009)</li>
|
||||
<li>Unique Built-In libraries library.properties name</li>
|
||||
<li>Improvements for MD5Builder with Stream</li>
|
||||
<li>ESP8266SSDP: fixing TTL to 2 per spec</li>
|
||||
<li>ESP8266WebServer: a content length of zero should also be sent</li>
|
||||
<li>Use SoftwareSerial version 2.2</li>
|
||||
<li>EEPROM: optimised <code>_dirty</code> flag</li>
|
||||
<li>ESP8266mDNS: advertise all hosted services</li>
|
||||
<li>Remove bundled OneWire - ESP8266 support has been merged in the official OneWire sources</li>
|
||||
<li>WiFiClientSecure: don't panic if memory allocation fails</li>
|
||||
<li>Verify domain name in WiFiClientSecure::verify</li>
|
||||
<li>Speed up WiFi.hostByName when the hostname is actually an IP</li>
|
||||
<li>Fix WiFi scan issue (#1355)</li>
|
||||
<li>Workaround for LwIP not handling ERR_ABRT</li>
|
||||
<li>Servo value read and write fixes</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="tools">Tools</h3>
|
||||
|
||||
<ul>
|
||||
<li>espota.py: add support for manually selecting ip and port for host side</li>
|
||||
<li>Update esptool to 0.4.8</li>
|
||||
<li>Make espota compatible with python 3.5</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2 id="2-0-0">2.0.0</h2>
|
||||
|
||||
<p>November 30, 2015</p>
|
||||
|
||||
<p>Package link: <code>http://arduino.esp8266.com/versions/2.0.0/package_esp8266com_index.json</code>.</p>
|
||||
|
||||
<h3 id="core">Core</h3>
|
||||
|
||||
<ul>
|
||||
<li>Add file system APIs and documentation</li>
|
||||
<li>Add ConfigFile example</li>
|
||||
<li>Allow user to run code in user_rf_pre_init</li>
|
||||
<li>Add strtoul and strtol, fix strtod</li>
|
||||
<li>Update documentation for NodeMCU and Olimex boards</li>
|
||||
<li>Disable interrupts inside ESP.getVcc (#567)</li>
|
||||
<li>Erase RTC RAM only if RF mode looks invalid (#619)</li>
|
||||
<li>Get pin levels at time of interrupt, rather than the time of calling the handler.</li>
|
||||
<li>Move interrupt handlers to ram.</li>
|
||||
<li>Improve debug output on critical errors</li>
|
||||
<li>Add ArduinoOTA library and docs</li>
|
||||
<li>Add WeMos D1 & D1 mini boards</li>
|
||||
<li>Add documentation about boot messages and mode meaning</li>
|
||||
<li>Disable sleep mode before doing OTA (#1005)</li>
|
||||
<li>Add the ability to be called back when the device is about to reset</li>
|
||||
<li>Add "Reset Method" menu</li>
|
||||
<li>Add MD5 to core</li>
|
||||
<li>I2C: generate STOP in case of NACK (fix #698, #254)</li>
|
||||
<li>Add libc time functions</li>
|
||||
<li>Fix linker script for 512k(no SPIFFS) variant (#966)</li>
|
||||
<li>I2S optimizations</li>
|
||||
<li>Support Sketch > Export compiled binary</li>
|
||||
<li>Update SPIFFS wrapper for 0.3.3</li>
|
||||
<li>Fix placement of code into RAM, enable gc-sections</li>
|
||||
<li>Make soft wdt reset more obvious</li>
|
||||
<li>Force disable IOSWAP for UART0 in HardwareSerial initialization (#744)</li>
|
||||
<li>Add IPAddress::toString()</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="libraries">Libraries</h3>
|
||||
|
||||
<ul>
|
||||
<li>ESP8266WebServer: support for sending of PROGMEM strings</li>
|
||||
<li>ESP8266WebServer: support for serving files from file system</li>
|
||||
<li>ESP8266WiFi: fix mode selection (#529)</li>
|
||||
<li>ESP8266mDNS: allow to work on SoftAP interface</li>
|
||||
<li>EEPROM: round requested size to 4 bytes (#659)</li>
|
||||
<li>Add ESP8266AVRISP library</li>
|
||||
<li>Add ESP8266HTTPUpdate library</li>
|
||||
<li>Add HTTPClient library</li>
|
||||
<li>Add WiFiClientSecure</li>
|
||||
<li>ESP8266WiFi library: add persistent option, fix #1054</li>
|
||||
<li>Make RequestHandler handle uploads</li>
|
||||
<li>Add Digest Authentication to OTA and espota.py</li>
|
||||
<li>Don't close UDP pcbs when WiFi connection drops (#969)</li>
|
||||
<li>Add espsoftwareserial library</li>
|
||||
<li>Add HTTP Updater library</li>
|
||||
<li>Add Ethernet library for W5100</li>
|
||||
<li>Add SPIFFS WebServer Example</li>
|
||||
<li>add dnsIP() to ESP8266WiFi class</li>
|
||||
<li>OTA support encapsulated to ArduinoOTA class</li>
|
||||
<li>Add gdb stub library</li>
|
||||
<li>Extracted the WebUpdate example into a library.</li>
|
||||
<li>Fix to Servo allowing write() to be called before attach()</li>
|
||||
<li>ESP8266WiFi: add function <code>begin</code> without any parameters and add <code>psk</code> function to return current PSK form sdk config</li>
|
||||
<li>Fix a crash due to abort() called from TCP error callback (#428)</li>
|
||||
<li>Adding support for OPTIONS requests to ESP8266WebServer</li>
|
||||
<li>Add HTTPS request sample (#43)</li>
|
||||
<li>Fix _useClientMode & _useApMode in SDK auto connect mode (#754)</li>
|
||||
<li>Add ESP8266WebServer::sendContent_P with 'size_t size' argument for binary content</li>
|
||||
<li>Fix bug in WiFiClient::write_P when content was binary</li>
|
||||
<li>Add WiFiClient::write_P to be used with PROGMEM</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="tools">Tools</h3>
|
||||
|
||||
<ul>
|
||||
<li>Update SDK to 1.3.0_15_08_10_p1</li>
|
||||
<li>Update esptool to 0.4.6</li>
|
||||
<li>Bump toolchain version to force libm update on Windows</li>
|
||||
<li>ESP8266FS tool update</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2 id="1-6-5-947-g39819f0">1.6.5-947-g39819f0</h2>
|
||||
|
||||
<p>July 23, 2015</p>
|
||||
|
||||
<p>Package link: <code>http://arduino.esp8266.com/versions/1.6.5-947-g39819f0/package_esp8266com_index.json</code>.</p>
|
||||
|
||||
<h3 id="core">Core</h3>
|
||||
|
||||
<ul>
|
||||
<li>I2C library updated to better handle repeated start for certain devices,
|
||||
improved waveforms, higher frequencies for 160MHz core clock, fix case where
|
||||
using different pins would not work with libs calling begin internally.</li>
|
||||
<li>Add Adafruit HUZZAH board</li>
|
||||
<li>Add SparkFun Thing board</li>
|
||||
<li>Add SweetPea ESP-210 board</li>
|
||||
<li>Add eboot bootloader</li>
|
||||
<li>Timer0 support</li>
|
||||
<li>Add PWM range and frequency control</li>
|
||||
<li>Add ESP.eraseConfig method</li>
|
||||
<li>Fix pin change interrupt handling (#322)</li>
|
||||
<li>Add SLC and I2S register definitions</li>
|
||||
<li>Fix math functions calling themselves recursively (#233, #354)</li>
|
||||
<li>Print stack on exception and soft WDT reset</li>
|
||||
<li>Add Updater class</li>
|
||||
<li>Remove implementations of WDT-related functions</li>
|
||||
<li>Provide selection between A0 and VCC (#443, #338)</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="libraries">Libraries</h3>
|
||||
|
||||
<ul>
|
||||
<li>ESP8266WebServer: add gzip streaming, fix sendContent behaviour,
|
||||
add setContentSize method.</li>
|
||||
<li>ESP8266WiFi: add BSSID, channel, isHidden methods, fix AP/STA mode
|
||||
selection (#28).</li>
|
||||
<li>Better handling of WiFi disconnect (#231)</li>
|
||||
<li>Add API to set the beginning of local ports range for WiFiClient.</li>
|
||||
<li>Add RSSI function</li>
|
||||
<li>Add function to get the MAC / BSSID as String</li>
|
||||
<li>Servo library support</li>
|
||||
<li>Add ESP8266WiFiMesh library</li>
|
||||
<li>Add ESP8266SSDP library</li>
|
||||
<li>Add DNS-SD support to ESP8266mDNS library</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="tools">Tools</h3>
|
||||
|
||||
<ul>
|
||||
<li>Update SDK to v1.2.0_15_07_03</li>
|
||||
<li>Better sketch size reporting (#314)</li>
|
||||
<li>Update esptool to 0.4.5</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2 id="1-6-4-673-g8cd3697">1.6.4-673-g8cd3697</h2>
|
||||
|
||||
<p>May 22, 2015</p>
|
||||
|
||||
<p>Package link: <code>http://arduino.esp8266.com/versions/1.6.4-673-g8cd3697/package_esp8266com_index.json</code>.</p>
|
||||
|
||||
<h3 id="tools">Tools</h3>
|
||||
|
||||
<ul>
|
||||
<li>Add 32-bit Linux toolchain.</li>
|
||||
<li>Rebuild toolchain and esptool with support for OS X down to 10.6.</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="libraries">Libraries</h3>
|
||||
|
||||
<ul>
|
||||
<li>Better connection handling in ESP8266WebServer.
|
||||
The server now sends Content-Length and Connection: close headers,
|
||||
then waits for the client to disconnect. By not closing the connection
|
||||
actively, server avoids TIME_WAIT TCP state, and TCP stack is able to
|
||||
release the memory immediately, without waiting for 2xMSL period.
|
||||
If the client doesn't disconnect in 2000ms, the server closes the connection
|
||||
actively.</li>
|
||||
<li>Add Hash library, which has a function to calculate SHA1 hash.</li>
|
||||
<li>SD, Adafruit_ILI9341, and OneWire libraries are now bundled.</li>
|
||||
<li>Fix incorrect sector calculation in EEPROM library.</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2 id="1-6-4-628-g545ffde">1.6.4-628-g545ffde</h2>
|
||||
|
||||
<p>May 19, 2015</p>
|
||||
|
||||
<ul>
|
||||
<li>Initial release of Boards Manager package for ESP8266 platform.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
versions/2.3.0/doc/eclipse/1_Install_New_Software.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
versions/2.3.0/doc/eclipse/2_Install_software.png
Normal file
After Width: | Height: | Size: 62 KiB |
38
versions/2.3.0/doc/eclipse/eclipse.md
Normal file
@ -0,0 +1,38 @@
|
||||
using Eclipse with Arduino ESP8266
|
||||
===========================================
|
||||
|
||||
### What to Download ###
|
||||
- [arduino IDE](https://www.arduino.cc/en/Main/Software)
|
||||
- [Eclipse IDE for C/C++ Developers](http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/marsr)
|
||||
- [Java](http://www.java.com/)
|
||||
|
||||
### Setup Arduino ###
|
||||
see the [Readme](https://github.com/esp8266/Arduino#installing-with-boards-manager)
|
||||
|
||||
### Setup Eclipse ###
|
||||
- [step 1](http://www.baeyens.it/eclipse/how_to.shtml#/c)
|
||||
- [step 2](http://www.baeyens.it/eclipse/how_to.shtml#/e)
|
||||
- go to Window --> preferences --> Arduino
|
||||
- add as private hardware path the Part to the ESP8266
|
||||
|
||||
###### example private hardware path
|
||||
Windows: C:\Users\[username]\AppData\Roaming\Arduino15\packages\esp8266\hardware
|
||||
Linux: /home/[username]/.arduino15/packages/esp8266/hardware
|
||||
|
||||
### Eclipse wont build ###
|
||||
if eclipse dont find the path to the Compiler add to the platform.txt
|
||||
after:
|
||||
```
|
||||
version=1.6.4
|
||||
```
|
||||
this:
|
||||
```
|
||||
runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/../../../tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9
|
||||
runtime.tools.esptool.path={runtime.platform.path}/../../../tools/esptool/0.4.4
|
||||
```
|
||||
Note:
|
||||
- the path may changed, check the current version.
|
||||
- each update over the Arduino IDE will remove the fix
|
||||
- may not needed in future if Eclipse Plugin get an Update
|
||||
|
||||
|
39
versions/2.3.0/doc/eclipse/makefile.init
Normal file
@ -0,0 +1,39 @@
|
||||
vecho := @echo
|
||||
Q := @
|
||||
|
||||
PROJECT_NAME=project_name
|
||||
|
||||
OTA_IP=192.168.254.100
|
||||
OTA_PORT=8266
|
||||
|
||||
SERIAL_PORT=COM3
|
||||
SERIAL_BAUD=230400
|
||||
|
||||
ARDUINO_BASE = D:/Coding/avr/Programme/arduino-nightly
|
||||
ESP8266_BASE = $(ARDUINO_BASE)/hardware/esp8266com/esp8266
|
||||
ESP8266_TOOLS = $(ESP8266_BASE)/tools
|
||||
XTENSA_TOOLS_ROOT = $(ESP8266_TOOLS)/xtensa-lx106-elf/bin
|
||||
|
||||
PYTHON_BIN = python
|
||||
ESPTOOL_PY_BIN = $(ESP8266_TOOLS)/esptool.py
|
||||
ESPOTA_PY_BIN = $(ESP8266_TOOLS)/espota.py
|
||||
ESPTOOL_BIN = $(ESP8266_TOOLS)/esptool/esptool.exe
|
||||
|
||||
ota:
|
||||
$(vecho) ota...
|
||||
$(PYTHON_BIN) $(ESPOTA_PY_BIN) -i $(OTA_IP) -p $(OTA_PORT) --auth= -f ./$(PROJECT_NAME).bin
|
||||
|
||||
ota_spiffs:
|
||||
$(vecho) ota spiffs...
|
||||
$(PYTHON_BIN) $(ESPOTA_PY_BIN) -i $(OTA_IP) -p $(OTA_PORT) --auth= -s -f ./$(PROJECT_NAME)_spiffs.bin
|
||||
|
||||
erase_flash:
|
||||
$(vecho) "Erase Flash"
|
||||
$(PYTHON_BIN) $(ESPTOOL_PY_BIN) -p $(SERIAL_PORT) -b $(SERIAL_BAUD) erase_flash
|
||||
|
||||
dumpmem:
|
||||
$(vecho) "Read Flash need some time..."
|
||||
$(PYTHON_BIN) $(ESPTOOL_PY_BIN) -p $(SERIAL_PORT) -b $(SERIAL_BAUD) read_flash 0 4194304 dump.bin
|
||||
|
||||
objdump:
|
||||
"$(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-objdump" -S $(PROJECT_NAME).elf > $(PROJECT_NAME).dobj
|
BIN
versions/2.3.0/doc/esp12.png
Normal file
After Width: | Height: | Size: 44 KiB |
1187
versions/2.3.0/doc/esp12.svg
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
versions/2.3.0/doc/esp8266_tcp_active_close.png
Normal file
After Width: | Height: | Size: 130 KiB |
38
versions/2.3.0/doc/exception_causes.md
Normal file
@ -0,0 +1,38 @@
|
||||
Exception Causes (EXCCAUSE)
|
||||
===========================================
|
||||
|
||||
| EXC-CAUSE Code | Cause Name | Cause Description | Required Option | EXC-VADDR Loaded |
|
||||
|:--------------:|:---------------------------|:------------------------------------------------------------------------------------------------------------|:-------------------------|:----------------:|
|
||||
| 0 | IllegalInstructionCause | Illegal instruction | Exception | No |
|
||||
| 1 | SyscallCause | SYSCALL instruction | Exception | No |
|
||||
| 2 | InstructionFetchErrorCause | Processor internal physical address or data error during instruction fetch | Exception | Yes |
|
||||
| 3 | LoadStoreErrorCause | Processor internal physical address or data error during load or store | Exception | Yes |
|
||||
| 4 | Level1InterruptCause | Level-1 interrupt as indicated by set level-1 bits in the INTERRUPT register | Interrupt | No |
|
||||
| 5 | AllocaCause | MOVSP instruction, if caller’s registers are not in the register file | Windowed Register | No |
|
||||
| 6 | IntegerDivideByZeroCause | QUOS, QUOU, REMS, or REMU divisor operand is zero | 32-bit Integer Divide | No |
|
||||
| 7 | Reserved for Tensilica | | | |
|
||||
| 8 | PrivilegedCause | Attempt to execute a privileged operation when CRING ? 0 | MMU | No |
|
||||
| 9 | LoadStoreAlignmentCause | Load or store to an unaligned address | Unaligned Exception | Yes |
|
||||
| 10..11 | Reserved for Tensilica | | | |
|
||||
| 12 | InstrPIFDataErrorCause | PIF data error during instruction fetch | Processor Interface | Yes |
|
||||
| 13 | LoadStorePIFDataErrorCause | Synchronous PIF data error during LoadStore access | Processor Interface | Yes |
|
||||
| 14 | InstrPIFAddrErrorCause | PIF address error during instruction fetch | Processor Interface | Yes |
|
||||
| 15 | LoadStorePIFAddrErrorCause | Synchronous PIF address error during LoadStore access | Processor Interface | Yes |
|
||||
| 16 | InstTLBMissCause | Error during Instruction TLB refill | MMU | Yes |
|
||||
| 17 | InstTLBMultiHitCause | Multiple instruction TLB entries matched | MMU | Yes |
|
||||
| 18 | InstFetchPrivilegeCause | An instruction fetch referenced a virtual address at a ring level less than CRING | MMU | Yes |
|
||||
| 19 | Reserved for Tensilica | | | |
|
||||
| 20 | InstFetchProhibitedCause | An instruction fetch referenced a page mapped with an attribute that does not permit instruction fetch | Region Protection or MMU | Yes |
|
||||
| 21..23 | Reserved for Tensilica | | | |
|
||||
| 24 | LoadStoreTLBMissCause | Error during TLB refill for a load or store | MMU | Yes |
|
||||
| 25 | LoadStoreTLBMultiHitCause | Multiple TLB entries matched for a load or store | MMU | Yes |
|
||||
| 26 | LoadStorePrivilegeCause | A load or store referenced a virtual address at a ring level less than CRING | MMU | Yes |
|
||||
| 27 | Reserved for Tensilica | | | |
|
||||
| 28 | LoadProhibitedCause | A load referenced a page mapped with an attribute that does not permit loads | Region Protection or MMU | Yes |
|
||||
| 29 | StoreProhibitedCause | A store referenced a page mapped with an attribute that does not permit stores | Region Protection or MMU | Yes |
|
||||
| 30..31 | Reserved for Tensilica | | | |
|
||||
| 32..39 | CoprocessornDisabled | Coprocessor n instruction when cpn disabled. n varies 0..7 as the cause varies 32..39 | Coprocessor | No |
|
||||
| 40..63 | Reserved | | | |
|
||||
|
||||
|
||||
Infos from Xtensa Instruction Set Architecture (ISA) Reference Manual
|
593
versions/2.3.0/doc/filesystem.html
Normal file
@ -0,0 +1,593 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
<title>
|
||||
|
||||
File System · ESP8266 Arduino Core
|
||||
|
||||
</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/poole.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/syntax.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/hyde.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/icons.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
||||
<!-- Icons -->
|
||||
<link rel="shortcut icon" href="/Arduino/versions/2.3.0/public/favicon.ico">
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="/Arduino/versions/2.3.0/public/js/toc.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#toc').toc({ listType: 'ul', showSpeed: 0, title: '', headers: 'h1, h2', minimumHeaders: 2 });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="version-bar">
|
||||
This documentation is for version 2.3.0. <a href="http://esp8266.github.io/Arduino/versions">Other versions.</a>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about">
|
||||
<h2>
|
||||
<a href="http://esp8266.github.io/Arduino">
|
||||
ESP8266 Arduino Core
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/installing.html">Installation</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/reference.html">Reference</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/libraries.html">Libraries</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/filesystem.html">File System</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="toc"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/ota_updates/readme.html">OTA Update</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/boards.html">Supported Hardware</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/changes.html">Change Log</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
<p>
|
||||
<a href="https://github.com/esp8266/Arduino"><div id="gh-icon"></div>esp8266/Arduino</a>
|
||||
</p>
|
||||
<p class="lead">Documentation for ESP8266 Arduino Core. Installation instructions, functions and classes reference.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content container">
|
||||
<h2 id="table-of-contents">Table of Contents</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#flash-layout">Flash layout</a></li>
|
||||
<li><a href="#uploading-files-to-file-system">Uploading files to file system</a></li>
|
||||
<li><a href="#file-system-object-spiffs">File system object (SPIFFS)</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#begin">begin</a></li>
|
||||
<li><a href="#end">end</a></li>
|
||||
<li><a href="#format">format</a></li>
|
||||
<li><a href="#open">open</a></li>
|
||||
<li><a href="#exists">exists</a></li>
|
||||
<li><a href="#opendir">openDir</a></li>
|
||||
<li><a href="#remove">remove</a></li>
|
||||
<li><a href="#rename">rename</a></li>
|
||||
<li><a href="#info">info</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#filesystem-information-structure">Filesystem information structure</a></li>
|
||||
<li><a href="#directory-object-dir">Directory object (Dir)</a></li>
|
||||
<li><a href="#file-object">File object</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#seek">seek</a></li>
|
||||
<li><a href="#position">position</a></li>
|
||||
<li><a href="#size">size</a></li>
|
||||
<li><a href="#name">name</a></li>
|
||||
<li><a href="#close">close</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="flash-layout">Flash layout</h2>
|
||||
|
||||
<p>Even though file system is stored on the same flash chip as the program, programming new sketch will not modify file system contents. This allows to use file system to store sketch data, configuration files, or content for Web server.</p>
|
||||
|
||||
<p>The following diagram illustrates flash layout used in Arduino environment:</p>
|
||||
<div class="highlight"><pre><code class="language-text" data-lang="text">|--------------|-------|---------------|--|--|--|--|--|
|
||||
^ ^ ^ ^ ^
|
||||
Sketch OTA update File system EEPROM WiFi config (SDK)
|
||||
</code></pre></div>
|
||||
<p>File system size depends on the flash chip size. Depending on the board which is selected in IDE, you have the following options for flash size:</p>
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>Board</th>
|
||||
<th>Flash chip size, bytes</th>
|
||||
<th>File system size, bytes</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>Generic module</td>
|
||||
<td>512k</td>
|
||||
<td>64k, 128k</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Generic module</td>
|
||||
<td>1M</td>
|
||||
<td>64k, 128k, 256k, 512k</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Generic module</td>
|
||||
<td>2M</td>
|
||||
<td>1M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Generic module</td>
|
||||
<td>4M</td>
|
||||
<td>3M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Adafruit HUZZAH</td>
|
||||
<td>4M</td>
|
||||
<td>1M, 3M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ESPresso Lite 1.0</td>
|
||||
<td>4M</td>
|
||||
<td>1M, 3M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ESPresso Lite 2.0</td>
|
||||
<td>4M</td>
|
||||
<td>1M, 3M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>NodeMCU 0.9</td>
|
||||
<td>4M</td>
|
||||
<td>1M, 3M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>NodeMCU 1.0</td>
|
||||
<td>4M</td>
|
||||
<td>1M, 3M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Olimex MOD-WIFI-ESP8266(-DEV)</td>
|
||||
<td>2M</td>
|
||||
<td>1M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SparkFun Thing</td>
|
||||
<td>512k</td>
|
||||
<td>64k</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SweetPea ESP-210</td>
|
||||
<td>4M</td>
|
||||
<td>1M, 3M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>WeMos D1 & D1 mini</td>
|
||||
<td>4M</td>
|
||||
<td>1M, 3M</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ESPDuino</td>
|
||||
<td>4M</td>
|
||||
<td>1M, 3M</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<p><strong>Note:</strong> to use any of file system functions in the sketch, add the following include to the sketch:</p>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="cp">#include "FS.h"</span>
|
||||
</code></pre></div>
|
||||
<h2 id="uploading-files-to-file-system">Uploading files to file system</h2>
|
||||
|
||||
<p><em>ESP8266FS</em> is a tool which integrates into the Arduino IDE. It adds a menu item to <em>Tools</em> menu for uploading the contents of sketch data directory into ESP8266 flash file system.</p>
|
||||
|
||||
<ul>
|
||||
<li>Download the tool: <a href="https://github.com/esp8266/arduino-esp8266fs-plugin/releases/download/0.2.0/ESP8266FS-0.2.0.zip">https://github.com/esp8266/arduino-esp8266fs-plugin/releases/download/0.2.0/ESP8266FS-0.2.0.zip</a>.</li>
|
||||
<li>In your Arduino sketchbook directory, create <code>tools</code> directory if it doesn't exist yet</li>
|
||||
<li>Unpack the tool into <code>tools</code> directory (the path will look like <code><home_dir>/Arduino/tools/ESP8266FS/tool/esp8266fs.jar</code>)</li>
|
||||
<li>Restart Arduino IDE</li>
|
||||
<li>Open a sketch (or create a new one and save it)</li>
|
||||
<li>Go to sketch directory (choose Sketch > Show Sketch Folder)</li>
|
||||
<li>Create a directory named <code>data</code> and any files you want in the file system there</li>
|
||||
<li>Make sure you have selected a board, port, and closed Serial Monitor</li>
|
||||
<li>Select Tools > ESP8266 Sketch Data Upload. This should start uploading the files into ESP8266 flash file system. When done, IDE status bar will display <code>SPIFFS Image Uploaded</code> message.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="file-system-object-spiffs">File system object (SPIFFS)</h2>
|
||||
|
||||
<h3 id="begin">begin</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">SPIFFS</span><span class="p">.</span><span class="n">begin</span><span class="p">()</span>
|
||||
</code></pre></div>
|
||||
<p>This method mounts SPIFFS file system. It must be called before any other
|
||||
FS APIs are used. Returns <em>true</em> if file system was mounted successfully, false
|
||||
otherwise.</p>
|
||||
|
||||
<h3 id="end">end</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">SPIFFS</span><span class="p">.</span><span class="n">end</span><span class="p">()</span>
|
||||
</code></pre></div>
|
||||
<p>This method unmounts SPIFFS file system. Use this method before updating SPIFFS using OTA.</p>
|
||||
|
||||
<h3 id="format">format</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">SPIFFS</span><span class="p">.</span><span class="n">format</span><span class="p">()</span>
|
||||
</code></pre></div>
|
||||
<p>Formats the file system. May be called either before or after calling <code>begin</code>.
|
||||
Returns <em>true</em> if formatting was successful.</p>
|
||||
|
||||
<h3 id="open">open</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">SPIFFS</span><span class="p">.</span><span class="n">open</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">mode</span><span class="p">)</span>
|
||||
</code></pre></div>
|
||||
<p>Opens a file. <code>path</code> should be an absolute path starting with a slash
|
||||
(e.g. <code>/dir/filename.txt</code>). <code>mode</code> is a string specifying access mode. It can be
|
||||
one of "r", "w", "a", "r+", "w+", "a+". Meaning of these modes is the same as
|
||||
for <code>fopen</code> C function.</p>
|
||||
<div class="highlight"><pre><code class="language-text" data-lang="text"> r Open text file for reading. The stream is positioned at the
|
||||
beginning of the file.
|
||||
|
||||
r+ Open for reading and writing. The stream is positioned at the
|
||||
beginning of the file.
|
||||
|
||||
w Truncate file to zero length or create text file for writing.
|
||||
The stream is positioned at the beginning of the file.
|
||||
|
||||
w+ Open for reading and writing. The file is created if it does
|
||||
not exist, otherwise it is truncated. The stream is
|
||||
positioned at the beginning of the file.
|
||||
|
||||
a Open for appending (writing at end of file). The file is
|
||||
created if it does not exist. The stream is positioned at the
|
||||
end of the file.
|
||||
|
||||
a+ Open for reading and appending (writing at end of file). The
|
||||
file is created if it does not exist. The initial file
|
||||
position for reading is at the beginning of the file, but
|
||||
output is always appended to the end of the file.
|
||||
</code></pre></div>
|
||||
<p>Returns <em>File</em> object. To check whether the file was opened successfully, use
|
||||
the boolean operator.</p>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">File</span> <span class="n">f</span> <span class="o">=</span> <span class="n">SPIFFS</span><span class="p">.</span><span class="n">open</span><span class="p">(</span><span class="s">"/f.txt"</span><span class="p">,</span> <span class="s">"w"</span><span class="p">);</span>
|
||||
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">f</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">"file open failed"</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre></div>
|
||||
<h3 id="exists">exists</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">SPIFFS</span><span class="p">.</span><span class="n">exists</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>
|
||||
</code></pre></div>
|
||||
<p>Returns <em>true</em> if a file with given path exists, <em>false</em> otherwise.</p>
|
||||
|
||||
<h3 id="opendir">openDir</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">SPIFFS</span><span class="p">.</span><span class="n">openDir</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>
|
||||
</code></pre></div>
|
||||
<p>Opens a directory given its absolute path. Returns a <em>Dir</em> object.</p>
|
||||
|
||||
<h3 id="remove">remove</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">SPIFFS</span><span class="p">.</span><span class="n">remove</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>
|
||||
</code></pre></div>
|
||||
<p>Deletes the file given its absolute path. Returns <em>true</em> if file was deleted successfully.</p>
|
||||
|
||||
<h3 id="rename">rename</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">SPIFFS</span><span class="p">.</span><span class="n">rename</span><span class="p">(</span><span class="n">pathFrom</span><span class="p">,</span> <span class="n">pathTo</span><span class="p">)</span>
|
||||
</code></pre></div>
|
||||
<p>Renames file from <code>pathFrom</code> to <code>pathTo</code>. Paths must be absolute. Returns <em>true</em>
|
||||
if file was renamed successfully.</p>
|
||||
|
||||
<h3 id="info">info</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">FSInfo</span> <span class="n">fs_info</span><span class="p">;</span>
|
||||
<span class="n">SPIFFS</span><span class="p">.</span><span class="n">info</span><span class="p">(</span><span class="n">fs_info</span><span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<p>Fills <a href="#filesystem-information-structure">FSInfo structure</a> with information about
|
||||
the file system. Returns <code>true</code> is successful, <code>false</code> otherwise.</p>
|
||||
|
||||
<h2 id="filesystem-information-structure">Filesystem information structure</h2>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="k">struct</span> <span class="n">FSInfo</span> <span class="p">{</span>
|
||||
<span class="kt">size_t</span> <span class="n">totalBytes</span><span class="p">;</span>
|
||||
<span class="kt">size_t</span> <span class="n">usedBytes</span><span class="p">;</span>
|
||||
<span class="kt">size_t</span> <span class="n">blockSize</span><span class="p">;</span>
|
||||
<span class="kt">size_t</span> <span class="n">pageSize</span><span class="p">;</span>
|
||||
<span class="kt">size_t</span> <span class="n">maxOpenFiles</span><span class="p">;</span>
|
||||
<span class="kt">size_t</span> <span class="n">maxPathLength</span><span class="p">;</span>
|
||||
<span class="p">};</span>
|
||||
</code></pre></div>
|
||||
<p>This is the structure which may be filled using FS::info method.
|
||||
- <code>totalBytes</code> — total size of useful data on the file system
|
||||
- <code>usedBytes</code> — number of bytes used by files
|
||||
- <code>blockSize</code> — SPIFFS block size
|
||||
- <code>pageSize</code> — SPIFFS logical page size
|
||||
- <code>maxOpenFiles</code> — max number of files which may be open simultaneously
|
||||
- <code>maxPathLength</code> — max file name length (including one byte for zero termination)</p>
|
||||
|
||||
<h2 id="directory-object-dir">Directory object (Dir)</h2>
|
||||
|
||||
<p>The purpose of <em>Dir</em> object is to iterate over files inside a directory.
|
||||
It provides three methods: <code>next()</code>, <code>fileName()</code>, and <code>openFile(mode)</code>.</p>
|
||||
|
||||
<p>The following example shows how it should be used:</p>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">Dir</span> <span class="n">dir</span> <span class="o">=</span> <span class="n">SPIFFS</span><span class="p">.</span><span class="n">openDir</span><span class="p">(</span><span class="s">"/data"</span><span class="p">);</span>
|
||||
<span class="k">while</span> <span class="p">(</span><span class="n">dir</span><span class="p">.</span><span class="n">next</span><span class="p">())</span> <span class="p">{</span>
|
||||
<span class="n">Serial</span><span class="p">.</span><span class="n">print</span><span class="p">(</span><span class="n">dir</span><span class="p">.</span><span class="n">fileName</span><span class="p">());</span>
|
||||
<span class="n">File</span> <span class="n">f</span> <span class="o">=</span> <span class="n">dir</span><span class="p">.</span><span class="n">openFile</span><span class="p">(</span><span class="s">"r"</span><span class="p">);</span>
|
||||
<span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">f</span><span class="p">.</span><span class="n">size</span><span class="p">());</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre></div>
|
||||
<p><code>dir.next()</code> returns true while there are files in the directory to iterate over.
|
||||
It must be called before calling <code>fileName</code> and <code>openFile</code> functions.</p>
|
||||
|
||||
<p><code>openFile</code> method takes <em>mode</em> argument which has the same meaning as for <code>SPIFFS.open</code> function.</p>
|
||||
|
||||
<h2 id="file-object">File object</h2>
|
||||
|
||||
<p><code>SPIFFS.open</code> and <code>dir.openFile</code> functions return a <em>File</em> object. This object
|
||||
supports all the functions of <em>Stream</em>, so you can use <code>readBytes</code>, <code>findUntil</code>,
|
||||
<code>parseInt</code>, <code>println</code>, and all other <em>Stream</em> methods.</p>
|
||||
|
||||
<p>There are also some functions which are specific to <em>File</em> object.</p>
|
||||
|
||||
<h3 id="seek">seek</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">file</span><span class="p">.</span><span class="n">seek</span><span class="p">(</span><span class="n">offset</span><span class="p">,</span> <span class="n">mode</span><span class="p">)</span>
|
||||
</code></pre></div>
|
||||
<p>This function behaves like <code>fseek</code> C function. Depending on the value of <code>mode</code>,
|
||||
it moves current position in a file as follows:</p>
|
||||
|
||||
<ul>
|
||||
<li>if <code>mode</code> is <code>SeekSet</code>, position is set to <code>offset</code> bytes from the beginning.</li>
|
||||
<li>if <code>mode</code> is <code>SeekCur</code>, current position is moved by <code>offset</code> bytes.</li>
|
||||
<li>if <code>mode</code> is <code>SeekEnd</code>, position is set to <code>offset</code> bytes from the end of the
|
||||
file.</li>
|
||||
</ul>
|
||||
|
||||
<p>Returns <em>true</em> if position was set successfully.</p>
|
||||
|
||||
<h3 id="position">position</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">file</span><span class="p">.</span><span class="n">position</span><span class="p">()</span>
|
||||
</code></pre></div>
|
||||
<p>Returns the current position inside the file, in bytes.</p>
|
||||
|
||||
<h3 id="size">size</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">file</span><span class="p">.</span><span class="n">size</span><span class="p">()</span>
|
||||
</code></pre></div>
|
||||
<p>Returns file size, in bytes.</p>
|
||||
|
||||
<h3 id="name">name</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">String</span> <span class="n">name</span> <span class="o">=</span> <span class="n">file</span><span class="p">.</span><span class="n">name</span><span class="p">();</span>
|
||||
</code></pre></div>
|
||||
<p>Returns file name, as <code>const char*</code>. Convert it to <em>String</em> for storage.</p>
|
||||
|
||||
<h3 id="close">close</h3>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">file</span><span class="p">.</span><span class="n">close</span><span class="p">()</span>
|
||||
</code></pre></div>
|
||||
<p>Close the file. No other operations should be performed on <em>File</em> object after <code>close</code> function was called.</p>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
369
versions/2.3.0/doc/installing.html
Normal file
@ -0,0 +1,369 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
<title>
|
||||
|
||||
Installation · ESP8266 Arduino Core
|
||||
|
||||
</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/poole.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/syntax.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/hyde.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/icons.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
||||
<!-- Icons -->
|
||||
<link rel="shortcut icon" href="/Arduino/versions/2.3.0/public/favicon.ico">
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="/Arduino/versions/2.3.0/public/js/toc.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#toc').toc({ listType: 'ul', showSpeed: 0, title: '', headers: 'h1, h2', minimumHeaders: 2 });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="version-bar">
|
||||
This documentation is for version 2.3.0. <a href="http://esp8266.github.io/Arduino/versions">Other versions.</a>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about">
|
||||
<h2>
|
||||
<a href="http://esp8266.github.io/Arduino">
|
||||
ESP8266 Arduino Core
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/installing.html">Installation</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="toc"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/reference.html">Reference</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/libraries.html">Libraries</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/filesystem.html">File System</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/ota_updates/readme.html">OTA Update</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/boards.html">Supported Hardware</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/changes.html">Change Log</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
<p>
|
||||
<a href="https://github.com/esp8266/Arduino"><div id="gh-icon"></div>esp8266/Arduino</a>
|
||||
</p>
|
||||
<p class="lead">Documentation for ESP8266 Arduino Core. Installation instructions, functions and classes reference.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content container">
|
||||
<h2 id="boards-manager">Boards Manager</h2>
|
||||
|
||||
<p>This is the suggested installation method for end users.</p>
|
||||
|
||||
<h3 id="prerequisites">Prerequisites</h3>
|
||||
|
||||
<ul>
|
||||
<li>Arduino 1.6.8, get it from <a href="https://www.arduino.cc/en/Main/OldSoftwareReleases#previous">Arduino website</a>.</li>
|
||||
<li>Internet connection</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="instructions">Instructions</h3>
|
||||
|
||||
<ul>
|
||||
<li>Start Arduino and open Preferences window.</li>
|
||||
<li>Enter <code>http://arduino.esp8266.com/stable/package_esp8266com_index.json</code> into <em>Additional Board Manager URLs</em> field. You can add multiple URLs, separating them with commas.</li>
|
||||
<li>Open Boards Manager from Tools > Board menu and find <em>esp8266</em> platform.</li>
|
||||
<li>Select the version you need from a drop-down box.</li>
|
||||
<li>Click <em>install</em> button.</li>
|
||||
<li>Don't forget to select your ESP8266 board from Tools > Board menu after installation.</li>
|
||||
</ul>
|
||||
|
||||
<p>You may optionally use <em>staging</em> boards manager package link:
|
||||
<code>http://arduino.esp8266.com/staging/package_esp8266com_index.json</code>. This may contain some new features, but at the same time, some things might be broken.</p>
|
||||
|
||||
<h2 id="using-git-version">Using git version</h2>
|
||||
|
||||
<p>This is the suggested installation method for contributors and library developers.</p>
|
||||
|
||||
<h3 id="prerequisites">Prerequisites</h3>
|
||||
|
||||
<ul>
|
||||
<li>Arduino 1.6.8 (or newer, if you know what you are doing)</li>
|
||||
<li>git</li>
|
||||
<li>python 2.7</li>
|
||||
<li>terminal, console, or command prompt (depending on you OS)</li>
|
||||
<li>Internet connection</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="instructions">Instructions</h3>
|
||||
|
||||
<ul>
|
||||
<li>Open the console and go to Arduino directory. This can be either your <em>sketchbook</em> directory (usually <code><Documents>/Arduino</code>), or the directory of Arduino application itself, the choice is up to you.</li>
|
||||
<li><p>Clone this repository into hardware/esp8266com/esp8266 directory. Alternatively, clone it elsewhere and create a symlink, if your OS supports them.</p>
|
||||
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nb">cd </span>hardware
|
||||
mkdir esp8266com
|
||||
<span class="nb">cd </span>esp8266com
|
||||
git clone https://github.com/esp8266/Arduino.git esp8266
|
||||
</code></pre></div>
|
||||
<p>You should end up with the following directory structure:</p>
|
||||
<div class="highlight"><pre><code class="language-bash" data-lang="bash">Arduino
|
||||
<span class="p">|</span>
|
||||
--- hardware
|
||||
<span class="p">|</span>
|
||||
--- esp8266com
|
||||
<span class="p">|</span>
|
||||
--- esp8266
|
||||
<span class="p">|</span>
|
||||
--- bootloaders
|
||||
--- cores
|
||||
--- doc
|
||||
--- libraries
|
||||
--- package
|
||||
--- tests
|
||||
--- tools
|
||||
--- variants
|
||||
--- platform.txt
|
||||
--- programmers.txt
|
||||
--- README.md
|
||||
--- boards.txt
|
||||
--- LICENSE
|
||||
</code></pre></div></li>
|
||||
<li><p>Download binary tools</p>
|
||||
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nb">cd </span>esp8266/tools
|
||||
python get.py
|
||||
</code></pre></div></li>
|
||||
<li><p>Restart Arduino</p></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
465
versions/2.3.0/doc/libraries.html
Normal file
@ -0,0 +1,465 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
<title>
|
||||
|
||||
Libraries · ESP8266 Arduino Core
|
||||
|
||||
</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/poole.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/syntax.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/hyde.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/icons.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
||||
<!-- Icons -->
|
||||
<link rel="shortcut icon" href="/Arduino/versions/2.3.0/public/favicon.ico">
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="/Arduino/versions/2.3.0/public/js/toc.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#toc').toc({ listType: 'ul', showSpeed: 0, title: '', headers: 'h1, h2', minimumHeaders: 2 });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="version-bar">
|
||||
This documentation is for version 2.3.0. <a href="http://esp8266.github.io/Arduino/versions">Other versions.</a>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about">
|
||||
<h2>
|
||||
<a href="http://esp8266.github.io/Arduino">
|
||||
ESP8266 Arduino Core
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/installing.html">Installation</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/reference.html">Reference</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/libraries.html">Libraries</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="toc"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/filesystem.html">File System</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/ota_updates/readme.html">OTA Update</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/boards.html">Supported Hardware</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/changes.html">Change Log</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
<p>
|
||||
<a href="https://github.com/esp8266/Arduino"><div id="gh-icon"></div>esp8266/Arduino</a>
|
||||
</p>
|
||||
<p class="lead">Documentation for ESP8266 Arduino Core. Installation instructions, functions and classes reference.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content container">
|
||||
<h2 id="table-of-contents">Table of Contents</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#wifiesp8266wifi-library">WiFi(ESP8266WiFi library)</a></li>
|
||||
<li><a href="#ticker">Ticker</a></li>
|
||||
<li><a href="#eeprom">EEPROM</a></li>
|
||||
<li><a href="#i2c-wire-library">I2C (Wire library)</a></li>
|
||||
<li><a href="#spi">SPI</a></li>
|
||||
<li><a href="#softwareserial">SoftwareSerial</a></li>
|
||||
<li><a href="#esp-specific-apis">ESP-specific APIs</a></li>
|
||||
<li><a href="#mdns-and-dns-sd-responder-esp8266mdns-library">mDNS and DNS-SD responder (ESP8266mDNS library)</a></li>
|
||||
<li><a href="#ssdp-responder-esp8266ssdp">SSDP responder (ESP8266SSDP)</a></li>
|
||||
<li><a href="#dns-server-dnsserver-library">DNS server (DNSServer library)</a></li>
|
||||
<li><a href="#servo">Servo</a></li>
|
||||
<li><a href="#other-libraries-not-included-with-the-ide">Other libraries (not included with the IDE)</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="wifi-esp8266wifi-library">WiFi(ESP8266WiFi library)</h2>
|
||||
|
||||
<p>This is mostly similar to WiFi shield library. Differences include:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>WiFi.mode(m)</code>: set mode to <code>WIFI_AP</code>, <code>WIFI_STA</code>, <code>WIFI_AP_STA</code> or <code>WIFI_OFF</code>.</li>
|
||||
<li>call <code>WiFi.softAP(ssid)</code> to set up an open network</li>
|
||||
<li>call <code>WiFi.softAP(ssid, password)</code> to set up a WPA2-PSK network (password should be at least 8 characters)</li>
|
||||
<li><code>WiFi.macAddress(mac)</code> is for STA, <code>WiFi.softAPmacAddress(mac)</code> is for AP.</li>
|
||||
<li><code>WiFi.localIP()</code> is for STA, <code>WiFi.softAPIP()</code> is for AP.</li>
|
||||
<li><code>WiFi.printDiag(Serial)</code> will print out some diagnostic info</li>
|
||||
<li><code>WiFiUDP</code> class supports sending and receiving multicast packets on STA interface.
|
||||
When sending a multicast packet, replace <code>udp.beginPacket(addr, port)</code> with
|
||||
<code>udp.beginPacketMulticast(addr, port, WiFi.localIP())</code>.
|
||||
When listening to multicast packets, replace <code>udp.begin(port)</code> with
|
||||
<code>udp.beginMulticast(WiFi.localIP(), multicast_ip_addr, port)</code>.
|
||||
You can use <code>udp.destinationIP()</code> to tell whether the packet received was
|
||||
sent to the multicast or unicast address.</li>
|
||||
</ul>
|
||||
|
||||
<p><code>WiFiServer</code>, <code>WiFiClient</code>, and <code>WiFiUDP</code> behave mostly the same way as with WiFi shield library.
|
||||
Four samples are provided for this library.
|
||||
You can see more commands here: <a href="http://www.arduino.cc/en/Reference/WiFi">http://www.arduino.cc/en/Reference/WiFi</a></p>
|
||||
|
||||
<h2 id="ticker">Ticker</h2>
|
||||
|
||||
<p>Library for calling functions repeatedly with a certain period. Two examples included.</p>
|
||||
|
||||
<p>It is currently not recommended to do blocking IO operations (network, serial, file) from Ticker
|
||||
callback functions. Instead, set a flag inside the ticker callback and check for that flag inside the loop function.</p>
|
||||
|
||||
<p>Here is library to simplificate <code>Ticker</code> usage and avoid WDT reset: <a href="https://github.com/Toshik/TickerScheduler">TickerScheduler</a></p>
|
||||
|
||||
<h2 id="eeprom">EEPROM</h2>
|
||||
|
||||
<p>This is a bit different from standard EEPROM class. You need to call <code>EEPROM.begin(size)</code>
|
||||
before you start reading or writing, size being the number of bytes you want to use.
|
||||
Size can be anywhere between 4 and 4096 bytes.</p>
|
||||
|
||||
<p><code>EEPROM.write</code> does not write to flash immediately, instead you must call <code>EEPROM.commit()</code>
|
||||
whenever you wish to save changes to flash. <code>EEPROM.end()</code> will also commit, and will
|
||||
release the RAM copy of EEPROM contents.</p>
|
||||
|
||||
<p>EEPROM library uses one sector of flash located just after the SPIFFS.</p>
|
||||
|
||||
<p>Three examples included.</p>
|
||||
|
||||
<h2 id="i2c-wire-library">I2C (Wire library)</h2>
|
||||
|
||||
<p>Wire library currently supports master mode up to approximately 450KHz.
|
||||
Before using I2C, pins for SDA and SCL need to be set by calling
|
||||
<code>Wire.begin(int sda, int scl)</code>, i.e. <code>Wire.begin(0, 2)</code> on ESP-01,
|
||||
else they default to pins 4(SDA) and 5(SCL).</p>
|
||||
|
||||
<h2 id="spi">SPI</h2>
|
||||
|
||||
<p>SPI library supports the entire Arduino SPI API including transactions, including setting phase (CPHA).
|
||||
Setting the Clock polarity (CPOL) is not supported, yet (SPI_MODE2 and SPI_MODE3 not working).</p>
|
||||
|
||||
<h2 id="softwareserial">SoftwareSerial</h2>
|
||||
|
||||
<p>An ESP8266 port of SoftwareSerial library done by Peter Lerup (@plerup) supports baud rate up to 115200 and multiples SoftwareSerial instances. See <a href="https://github.com/plerup/espsoftwareserial">https://github.com/plerup/espsoftwareserial</a> if you want to suggest an improvement or open an issue related to SoftwareSerial.</p>
|
||||
|
||||
<h2 id="esp-specific-apis">ESP-specific APIs</h2>
|
||||
|
||||
<p>APIs related to deep sleep and watchdog timer are available in the <code>ESP</code> object, only available in Alpha version.</p>
|
||||
|
||||
<p><code>ESP.deepSleep(microseconds, mode)</code> will put the chip into deep sleep. <code>mode</code> is one of <code>WAKE_RF_DEFAULT</code>, <code>WAKE_RFCAL</code>, <code>WAKE_NO_RFCAL</code>, <code>WAKE_RF_DISABLED</code>. (GPIO16 needs to be tied to RST to wake from deepSleep.)</p>
|
||||
|
||||
<p><code>ESP.rtcUserMemoryWrite(offset, &data, sizeof(data))</code> and <code>ESP.rtcUserMemoryRead(offset, &data, sizeof(data))</code> allow data to be stored in and retrieved from the RTC user memory of the chip respectively. Total size of RTC user memory is 512 bytes, so offset + sizeof(data) shouldn't exceed 512. Data should be 4-byte aligned. The stored data can be retained between deep sleep cycles. However, the data might be lost after power cycling the chip.</p>
|
||||
|
||||
<p><code>ESP.restart()</code> restarts the CPU.</p>
|
||||
|
||||
<p><code>ESP.getResetReason()</code> returns String containing the last reset resaon in human readable format.</p>
|
||||
|
||||
<p><code>ESP.getFreeHeap()</code> returns the free heap size.</p>
|
||||
|
||||
<p><code>ESP.getChipId()</code> returns the ESP8266 chip ID as a 32-bit integer.</p>
|
||||
|
||||
<p>Several APIs may be used to get flash chip info:</p>
|
||||
|
||||
<p><code>ESP.getFlashChipId()</code> returns the flash chip ID as a 32-bit integer.</p>
|
||||
|
||||
<p><code>ESP.getFlashChipSize()</code> returns the flash chip size, in bytes, as seen by the SDK (may be less than actual size).</p>
|
||||
|
||||
<p><code>ESP.getFlashChipSpeed(void)</code> returns the flash chip frequency, in Hz.</p>
|
||||
|
||||
<p><code>ESP.getCycleCount()</code> returns the cpu instruction cycle count since start as an unsigned 32-bit. This is useful for accurate timing of very short actions like bit banging.</p>
|
||||
|
||||
<p><code>ESP.getVcc()</code> may be used to measure supply voltage. ESP needs to reconfigure the ADC
|
||||
at startup in order for this feature to be available. Add the following line to the top
|
||||
of your sketch to use <code>getVcc</code>:</p>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">ADC_MODE</span><span class="p">(</span><span class="n">ADC_VCC</span><span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<p>TOUT pin has to be disconnected in this mode.</p>
|
||||
|
||||
<p>Note that by default ADC is configured to read from TOUT pin using <code>analogRead(A0)</code>, and
|
||||
<code>ESP.getVCC()</code> is not available.</p>
|
||||
|
||||
<h2 id="mdns-and-dns-sd-responder-esp8266mdns-library">mDNS and DNS-SD responder (ESP8266mDNS library)</h2>
|
||||
|
||||
<p>Allows the sketch to respond to multicast DNS queries for domain names like "foo.local", and DNS-SD (service dicovery) queries.
|
||||
See attached example for details.</p>
|
||||
|
||||
<h2 id="ssdp-responder-esp8266ssdp">SSDP responder (ESP8266SSDP)</h2>
|
||||
|
||||
<p>SSDP is another service discovery protocol, supported on Windows out of the box. See attached example for reference.</p>
|
||||
|
||||
<h2 id="dns-server-dnsserver-library">DNS server (DNSServer library)</h2>
|
||||
|
||||
<p>Implements a simple DNS server that can be used in both STA and AP modes. The DNS server currently supports only one domain (for all other domains it will reply with NXDOMAIN or custom status code). With it clients can open a web server running on ESP8266 using a domain name, not an IP address.
|
||||
See attached example for details.</p>
|
||||
|
||||
<h2 id="servo">Servo</h2>
|
||||
|
||||
<p>This library exposes the ability to control RC (hobby) servo motors. It will support upto 24 servos on any available output pin. By defualt the first 12 servos will use Timer0 and currently this will not interfere with any other support. Servo counts above 12 will use Timer1 and features that use it will be effected.
|
||||
While many RC servo motors will accept the 3.3V IO data pin from a ESP8266, most will not be able to run off 3.3v and will require another power source that matches their specifications. Make sure to connect the grounds between the ESP8266 and the servo motor power supply.</p>
|
||||
|
||||
<h2 id="other-libraries-not-included-with-the-ide">Other libraries (not included with the IDE)</h2>
|
||||
|
||||
<p>Libraries that don't rely on low-level access to AVR registers should work well. Here are a few libraries that were verified to work:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://github.com/Links2004/Adafruit_ILI9341">Adafruit_ILI9341</a> - Port of the Adafruit ILI9341 for the ESP8266 </li>
|
||||
<li><a href="https://github.com/Links2004/arduinoVNC">arduinoVNC</a> - VNC Client for Arduino</li>
|
||||
<li><a href="https://github.com/Links2004/arduinoWebSockets">arduinoWebSockets</a> - WebSocket Server and Client compatible with ESP8266 (RFC6455)</li>
|
||||
<li><a href="https://github.com/marcoschwartz/aREST">aREST</a> - REST API handler library.</li>
|
||||
<li><a href="https://github.com/blynkkk/blynk-library">Blynk</a> - easy IoT framework for Makers (check out the <a href="http://tiny.cc/blynk-kick">Kickstarter page</a>).</li>
|
||||
<li><a href="https://github.com/milesburton/Arduino-Temperature-Control-Library.git">DallasTemperature</a></li>
|
||||
<li><a href="https://github.com/adafruit/DHT-sensor-library">DHT-sensor-library</a> - Arduino library for the DHT11/DHT22 temperature and humidity sensors. Download latest v1.1.1 library and no changes are necessary. Older versions should initialize DHT as follows: <code>DHT dht(DHTPIN, DHTTYPE, 15)</code></li>
|
||||
<li><a href="https://github.com/krzychb/DimSwitch">DimSwitch</a> - Control electronic dimmable ballasts for fluorescent light tubes remotely as if using a wall switch.</li>
|
||||
<li><a href="https://github.com/PaulStoffregen/Encoder">Encoder</a> - Arduino library for rotary encoders. Version 1.4 supports ESP8266.</li>
|
||||
<li><a href="https://github.com/mrdunk/esp8266_mdns">esp8266_mdns</a> - mDNS queries and responses on esp8266. Or to describe it another way: An mDNS Client or Bonjour Client library for the esp8266.</li>
|
||||
<li><a href="https://github.com/me-no-dev/ESPAsyncTCP">ESPAsyncTCP</a> - Asynchronous TCP Library for ESP8266 and ESP32/31B</li>
|
||||
<li><a href="https://github.com/me-no-dev/ESPAsyncWebServer">ESPAsyncWebServer</a> - Asynchronous Web Server Library for ESP8266 and ESP32/31B</li>
|
||||
<li><a href="https://github.com/marvinroger/homie-esp8266">Homie for ESP8266</a> - Arduino framework for ESP8266 implementing Homie, an MQTT convention for the IoT.</li>
|
||||
<li><a href="https://github.com/adafruit/Adafruit_NeoPixel">NeoPixel</a> - Adafruit's NeoPixel library, now with support for the ESP8266 (use version 1.0.2 or higher from Arduino's library manager).</li>
|
||||
<li><a href="https://github.com/Makuna/NeoPixelBus">NeoPixelBus</a> - Arduino NeoPixel library compatible with ESP8266. Use the "DmaDriven" or "UartDriven" branches for ESP8266. Includes HSL color support and more.</li>
|
||||
<li><a href="https://github.com/Imroy/pubsubclient">PubSubClient</a> - MQTT library by @Imroy.</li>
|
||||
<li><a href="https://github.com/Makuna/Rtc">RTC</a> - Arduino Library for Ds1307 & Ds3231 compatible with ESP8266.</li>
|
||||
<li><a href="https://github.com/souliss/souliss">Souliss, Smart Home</a> - Framework for Smart Home based on Arduino, Android and openHAB.</li>
|
||||
<li><a href="https://github.com/nzmichaelh/Adafruit-ST7735-Library">ST7735</a> - Adafruit's ST7735 library modified to be compatible with ESP8266. Just make sure to modify the pins in the examples as they are still AVR specific.</li>
|
||||
<li><a href="https://github.com/Makuna/Task">Task</a> - Arduino Nonpreemptive multitasking library. While similiar to the included Ticker library in the functionality provided, this library was meant for cross Arduino compatibility.</li>
|
||||
<li><a href="https://github.com/Toshik/TickerScheduler">TickerScheduler</a> - Library provides simple scheduler for <code>Ticker</code> to avoid WDT reset</li>
|
||||
<li><a href="https://github.com/hallard/LibTeleinfo">Teleinfo</a> - Generic French Power Meter library to read Teleinfo energy monitoring data such as consuption, contract, power, period, ... This library is cross platform, ESP8266, Arduino, Particle, and simple C++. French dedicated <a href="https://hallard.me/libteleinfo/">post</a> on author's blog and all related information about <a href="https://hallard.me/category/tinfo/">Teleinfo</a> also available.</li>
|
||||
<li><a href="https://github.com/gnulabis/UTFT-ESP8266">UTFT-ESP8266</a> - UTFT display library with support for ESP8266. Only serial interface (SPI) displays are supported for now (no 8-bit parallel mode, etc). Also includes support for the hardware SPI controller of the ESP8266.</li>
|
||||
<li><a href="https://github.com/tzapu/WiFiManager">WiFiManager</a> - WiFi Connection manager with web captive portal. If it can't connect, it starts AP mode and a configuration portal so you can choose and enter WiFi credentials.</li>
|
||||
<li><a href="https://github.com/PaulStoffregen/OneWire">OneWire</a> - Library for Dallas/Maxim 1-Wire Chips.</li>
|
||||
<li><a href="https://github.com/WereCatf/Adafruit-PCD8544-Nokia-5110-LCD-library">Adafruit-PCD8544-Nokia-5110-LCD-Library</a> - Port of the Adafruit PCD8544 - library for the ESP8266.</li>
|
||||
<li><a href="https://github.com/WereCatf/PCF8574_ESP">PCF8574_ESP</a> - A very simplistic library for using the PCF8574/PCF8574A I2C 8-pin GPIO-expander.</li>
|
||||
<li><a href="https://github.com/freetronics/DMD2">Dot Matrix Display Library 2</a> - Freetronics DMD & Generic 16 x 32 P10 style Dot Matrix Display Library</li>
|
||||
<li><a href="https://github.com/greiman/SdFat-beta">SdFat-beta</a> - SD-card library with support for long filenames, software- and hardware-based SPI and lots more.</li>
|
||||
<li><a href="https://github.com/FastLED/FastLED">FastLED</a> - a library for easily & efficiently controlling a wide variety of LED chipsets, like the Neopixel (WS2812B), DotStar, LPD8806 and many more. Includes fading, gradient, color conversion functions.</li>
|
||||
<li><a href="https://github.com/klarsys/esp8266-OLED">OLED</a> - a library for controlling I2C connected OLED displays. Tested with 0.96 inch OLED graphics display.</li>
|
||||
<li><a href="https://github.com/miguelbalboa/rfid">MFRC522</a> - A library for using the Mifare RC522 RFID-tag reader/writer.</li>
|
||||
<li><a href="https://github.com/dancol90/ESP8266Ping">Ping</a> - lets the ESP8266 ping a remote machine.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 60 KiB |
BIN
versions/2.3.0/doc/ota_updates/a-ota-network-terminal.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
versions/2.3.0/doc/ota_updates/a-ota-ota-port-selection.png
Normal file
After Width: | Height: | Size: 142 KiB |
BIN
versions/2.3.0/doc/ota_updates/a-ota-ota-upload-complete.png
Normal file
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 86 KiB |
BIN
versions/2.3.0/doc/ota_updates/a-ota-python-configuration.png
Normal file
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 97 KiB |
BIN
versions/2.3.0/doc/ota_updates/a-ota-sketch-selection.png
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
versions/2.3.0/doc/ota_updates/a-ota-ssid-pass-entry.png
Normal file
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 115 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 83 KiB |
BIN
versions/2.3.0/doc/ota_updates/a-ota-upload-password-prompt.png
Normal file
After Width: | Height: | Size: 96 KiB |
BIN
versions/2.3.0/doc/ota_updates/ota-web-browser-form-ok.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
versions/2.3.0/doc/ota_updates/ota-web-browser-form.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
versions/2.3.0/doc/ota_updates/ota-web-path-to-binary.png
Normal file
After Width: | Height: | Size: 103 KiB |
BIN
versions/2.3.0/doc/ota_updates/ota-web-serial-monitor-ready.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
versions/2.3.0/doc/ota_updates/ota-web-serial-monitor-reboot.png
Normal file
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 40 KiB |
757
versions/2.3.0/doc/ota_updates/readme.html
Normal file
@ -0,0 +1,757 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
<title>
|
||||
|
||||
OTA Update · ESP8266 Arduino Core
|
||||
|
||||
</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/poole.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/syntax.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/hyde.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/icons.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
||||
<!-- Icons -->
|
||||
<link rel="shortcut icon" href="/Arduino/versions/2.3.0/public/favicon.ico">
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="/Arduino/versions/2.3.0/public/js/toc.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#toc').toc({ listType: 'ul', showSpeed: 0, title: '', headers: 'h1, h2', minimumHeaders: 2 });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="version-bar">
|
||||
This documentation is for version 2.3.0. <a href="http://esp8266.github.io/Arduino/versions">Other versions.</a>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about">
|
||||
<h2>
|
||||
<a href="http://esp8266.github.io/Arduino">
|
||||
ESP8266 Arduino Core
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/installing.html">Installation</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/reference.html">Reference</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/libraries.html">Libraries</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/filesystem.html">File System</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/ota_updates/readme.html">OTA Update</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="toc"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/boards.html">Supported Hardware</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/changes.html">Change Log</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
<p>
|
||||
<a href="https://github.com/esp8266/Arduino"><div id="gh-icon"></div>esp8266/Arduino</a>
|
||||
</p>
|
||||
<p class="lead">Documentation for ESP8266 Arduino Core. Installation instructions, functions and classes reference.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content container">
|
||||
<h2 id="table-of-contents">Table of Contents</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#introduction">Introduction</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#security">Security</a></li>
|
||||
<li><a href="#safety">Safety</a></li>
|
||||
<li><a href="#basic-requirements">Basic Requirements</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#arduino-ide">Arduino IDE</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#requirements">Requirements</a></li>
|
||||
<li><a href="#application-example">Application Example</a></li>
|
||||
<li><a href="#password-protection">Password Protection</a></li>
|
||||
<li><a href="#troubleshooting">Troubleshooting</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#web-browser">Web Browser</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#requirements-1">Requirements</a></li>
|
||||
<li><a href="#implementation-overview">Implementation Overview</a></li>
|
||||
<li><a href="#application-example-1">Application Example</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#http-server">HTTP Server</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#requirements-2">Requirements</a></li>
|
||||
<li><a href="#arduino-code">Arduino code</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#simple-updater">Simple updater</a></li>
|
||||
<li><a href="#advanced-updater">Advanced updater</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#server-request-handling">Server request handling</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#simple-updater-1">Simple updater</a></li>
|
||||
<li><a href="#advanced-updater-1">Advanced updater</a></li>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
<li><a href="#stream-interface">Stream Interface</a></li>
|
||||
<li><a href="#updater-class">Updater class</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
|
||||
<p>OTA (Over the Air) update is the process of loading the firmware to ESP module using Wi-Fi connection rather that a serial port. Such functionality became extremely useful in case of limited or no physical access to the module.</p>
|
||||
|
||||
<p>OTA may be done using:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="#arduino-ide">Arduino IDE</a></li>
|
||||
<li><a href="#web-browser">Web Browser</a></li>
|
||||
<li><a href="#http-server">HTTP Server</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Arduino IDE option is intended primarily for software development phase. The two other options would be more useful after deployment, to provide module with application updates manually with a web browser or automatically using a http server.</p>
|
||||
|
||||
<p>In any case first firmware upload have to be done over a serial port. If OTA routines are correctly implemented in a sketch, then all subsequent uploads may be done over the air.</p>
|
||||
|
||||
<p>There is no imposed security on OTA process from being hacked. It is up to developer to ensure that updates are allowed only from legitimate / trusted source. Once update is complete, module restarts and new code is executed. Developer should ensure that application running on module is shut down and restarted in a safe manner. Chapters below provide additional information regarding security and safety of OTA process.</p>
|
||||
|
||||
<h3 id="security">Security</h3>
|
||||
|
||||
<p>Module has to be exposed wirelessly to get it updated with a new sketch. That poses chances of module being violently hacked and loaded with some other code. To reduce likelihood of being hacked consider protecting your uploads with a password, selecting certain OTA port, etc.</p>
|
||||
|
||||
<p>Check functionality provided with <a href="https://github.com/esp8266/Arduino/tree/master/libraries/ArduinoOTA">ArduinoOTA</a> library that may improve security:</p>
|
||||
<div class="highlight"><pre><code class="language-cpp" data-lang="cpp"><span class="kt">void</span> <span class="nf">setPort</span><span class="p">(</span><span class="kt">uint16_t</span> <span class="n">port</span><span class="p">);</span>
|
||||
<span class="kt">void</span> <span class="nf">setHostname</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">hostname</span><span class="p">);</span>
|
||||
<span class="kt">void</span> <span class="nf">setPassword</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">password</span><span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<p>Certain protection functionality is already built in and do not require any additional coding by developer. <a href="https://github.com/esp8266/Arduino/tree/master/libraries/ArduinoOTA">ArduinoOTA</a> and espota.py use <a href="https://en.wikipedia.org/wiki/Digest_access_authentication">Digest-MD5</a> to authenticate upload. Integrity of transferred data is verified on ESP side using <a href="https://en.wikipedia.org/wiki/MD5">MD5</a> checksum.</p>
|
||||
|
||||
<p>Make your own risk analysis and depending on application decide what library functions to implement. If required consider implementation of other means of protection from being hacked, e.g. exposing module for uploads only according to specific schedule, trigger OTA only be user pressing dedicated “Update” button, etc.</p>
|
||||
|
||||
<h3 id="safety">Safety</h3>
|
||||
|
||||
<p>OTA process takes ESP’s resources and bandwidth during upload. Then module is restarted and a new sketch executed. Analyse and test how it affects functionality of your existing and new sketch.</p>
|
||||
|
||||
<p>If ESP is placed in remote location and controlling some equipment, you should put additional attention what happens if operation of this equipment is suddenly interrupted by update process. Therefore decide how to put this equipment into safe state before starting the update. For instance your module may be controlling a garden watering system in a sequence. If this sequence is not properly shut down and a water valve left open, your garden may be flooded if this valve is not closed after OTA is finished and module restarts. </p>
|
||||
|
||||
<p>The following functions are provided with <a href="https://github.com/esp8266/Arduino/tree/master/libraries/ArduinoOTA">ArduinoOTA</a> library and intended to handle functionality of your application during specific stages of OTA or on an OTA error:</p>
|
||||
<div class="highlight"><pre><code class="language-cpp" data-lang="cpp"><span class="kt">void</span> <span class="nf">onStart</span><span class="p">(</span><span class="n">OTA_CALLBACK</span><span class="p">(</span><span class="n">fn</span><span class="p">));</span>
|
||||
<span class="kt">void</span> <span class="nf">onEnd</span><span class="p">(</span><span class="n">OTA_CALLBACK</span><span class="p">(</span><span class="n">fn</span><span class="p">));</span>
|
||||
<span class="kt">void</span> <span class="nf">onProgress</span><span class="p">(</span><span class="n">OTA_CALLBACK_PROGRESS</span><span class="p">(</span><span class="n">fn</span><span class="p">));</span>
|
||||
<span class="kt">void</span> <span class="nf">onError</span><span class="p">(</span><span class="n">OTA_CALLBACK_ERROR</span> <span class="p">(</span><span class="n">fn</span><span class="p">));</span>
|
||||
</code></pre></div>
|
||||
<h3 id="basic-requirements">Basic Requirements</h3>
|
||||
|
||||
<p>Flash chip size needs a size that is able to hold the old sketch (currently running) and the new sketch (OTA) at the same time.
|
||||
Keep in mind that the File system and EEPROM for example needs space too (one time) see <a href="../filesystem.md#flash-layout">flash layout</a>.
|
||||
<code>cpp
|
||||
ESP.getFreeSketchSpace();
|
||||
</code>
|
||||
can be used for checking the free space for the new sketch.</p>
|
||||
|
||||
<p>For overview of memory layout, where new sketch is stored and how it is copied during OTA process see <a href="#update-process---memory-view">Update process - memory view</a>.</p>
|
||||
|
||||
<p>The following chapters provide more details and specific methods of doing OTA.</p>
|
||||
|
||||
<h2 id="arduino-ide">Arduino IDE</h2>
|
||||
|
||||
<p>Uploading modules wirelessly from Arduino IDE is intended for the following typical scenarios:
|
||||
- during firmware development as a quicker alternative to loading over a serial
|
||||
- for updating small quantity of modules
|
||||
- only if modules are available on the same network as the computer with Arduino IDE</p>
|
||||
|
||||
<h3 id="requirements">Requirements</h3>
|
||||
|
||||
<ul>
|
||||
<li>The ESP and the computer must be connected to the same network.</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="application-example">Application Example</h3>
|
||||
|
||||
<p>Instructions below show configuration of OTA on NodeMCU 1.0 (ESP-12E Module) board. You can use any other board assuming that it meets <a href="#basic-requirements">requirements</a> described above. This instruction is valid for all operating systems supported by Arduino IDE. Screen captures have been made on Windows 7 and you may see small differences (like name of serial port) if you are using Linux and MacOS.</p>
|
||||
|
||||
<ol>
|
||||
<li><p>Before you begin, please make sure that you have the following s/w installed:</p>
|
||||
|
||||
<ul>
|
||||
<li>Arduino IDE 1.6.7 or newer - <a href="https://www.arduino.cc/en/Main/Software">https://www.arduino.cc/en/Main/Software</a></li>
|
||||
<li>esp8266/Arduino platform package 2.0.0 or newer - for instructions follow <a href="https://github.com/esp8266/Arduino#installing-with-boards-manager">https://github.com/esp8266/Arduino#installing-with-boards-manager</a></li>
|
||||
<li><p>Python 2.7 (do not install Python 3.5 that is not supported) - <a href="https://www.python.org/">https://www.python.org/</a></p>
|
||||
|
||||
<p><strong>Note:</strong> Windows users should select “Add python.exe to Path” (see below – this option is not selected by default).</p>
|
||||
|
||||
<p><img src="a-ota-python-configuration.png" alt="Python installation set up"></p></li>
|
||||
</ul></li>
|
||||
<li><p>Now prepare the sketch and configuration for the upload over a serial port.</p>
|
||||
|
||||
<ul>
|
||||
<li>Start Arduino IDE and load sketch BasicOTA.ino available under File > Examples > ArduinoOTA
|
||||
<img src="a-ota-sketch-selection.png" alt="selection of example OTA sketch"></li>
|
||||
</ul></li>
|
||||
</ol>
|
||||
<div class="highlight"><pre><code class="language-text" data-lang="text">- Update SSID and password in the sketch so the module can join your Wi-Fi network
|
||||

|
||||
|
||||
- Configure upload parameters as below (you may need to adjust configuration if you are using a different module):
|
||||

|
||||
|
||||
**Note:** Depending on version of platform package and board you have, you may see ``` Upload Using: ``` in the menu above. This option is inactive and it does not matter what you select. It has been left for compatibility with older implementation of OTA and is targeted for removal in platform package version 2.2.0.
|
||||
</code></pre></div>
|
||||
<ol>
|
||||
<li><p>Upload the sketch (Ctrl+U). Once done, open Serial Monitor (Ctrl+Shift+M) and check if module has joined your Wi-Fi network:</p>
|
||||
|
||||
<p><img src="a-ota-upload-complete-and-joined-wifi.png" alt="check if module joined network"></p></li>
|
||||
<li><p>Only if module is connected to network, after a couple of seconds, the esp8266-ota port will show up in Arduino IDE. Select port with IP adress shown in Serial Monitor in previus step:</p>
|
||||
|
||||
<p><img src="a-ota-ota-port-selection.png" alt="selection of OTA port"></p>
|
||||
|
||||
<p><strong>Note:</strong> If OTA port does not show up, exit Arduino IDE, open it again and check if port is there. If it does not help check your firewall settings.</p></li>
|
||||
<li><p>Now get ready for your first OTA upload by selecting the OTA port:</p>
|
||||
|
||||
<p><img src="a-ota-ota-upload-configuration.png" alt="configuration of OTA upload"></p>
|
||||
|
||||
<p><strong>Note:</strong> The menu entry <code>Upload Speed:</code> does not matter at this point as it concerns the serial port. Just left it unchanged.</p></li>
|
||||
<li><p>If you have successfully completed all the above steps, you can upload (Ctrl+U) the same (or any other) sketch over OTA:</p>
|
||||
|
||||
<p><img src="a-ota-ota-upload-complete.png" alt="OTA upload complete"></p></li>
|
||||
</ol>
|
||||
|
||||
<p><strong>Note:</strong> To be able to upload your sketch over and over again using OTA, you need to embed OTA routines inside. Please use BasicOTA.ino as an example.</p>
|
||||
|
||||
<h4 id="password-protection">Password Protection</h4>
|
||||
|
||||
<p>Protecting your OTA uploads with password is really straightforward. All you need to do, is to include the following statement in your code:</p>
|
||||
<div class="highlight"><pre><code class="language-cpp" data-lang="cpp"><span class="n">ArduinoOTA</span><span class="p">.</span><span class="n">setPassword</span><span class="p">((</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="p">)</span><span class="s">"123"</span><span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<p>Where <code>123</code> is a sample password that you should replace with your own.</p>
|
||||
|
||||
<p>Before implementing it in your sketch, it is a good idea to check how it works using <em>BasicOTA.ino</em> sketch available under <em>File > Examples > ArduinoOTA</em>. Go ahead, open <em>BasicOTA.ino</em>, uncomment the above statement that is already there, and upload the sketch. To make troubleshooting easier, do not modify example sketch besides what is absolutely required. This is including original simple <code>123</code> OTA password. Then attempt to upload sketch again (using OTA). After compilation is complete, once upload is about to begin, you should see prompt for password as follows:</p>
|
||||
|
||||
<p><img src="a-ota-upload-password-prompt.png" alt="Password prompt for OTA upload"></p>
|
||||
|
||||
<p>Enter the password and upload should be initiated as usual with the only difference being <code>Authenticating...OK</code> message visible in upload log.</p>
|
||||
|
||||
<p><img src="a-ota-upload-password-authenticating-ok.png" alt=" Authenticating...OK during OTA upload"></p>
|
||||
|
||||
<p>You will not be prompted for a reentering the same password next time. Arduino IDE will remember it for you. You will see prompt for password only after reopening IDE, or if you change it in your sketch, upload the sketch and then try to upload it again.</p>
|
||||
|
||||
<p>Please note, it is possible to reveal password entered previously in Arduino IDE, if IDE has not been closed since last upload. This can be done by enabling <em>Show verbose output during: upload</em> in <em>File > Preferences</em> and attempting to upload the module.</p>
|
||||
|
||||
<p><img src="a-ota-upload-password-passing-upload-ok.png" alt="Verbose upload output with password passing in plan text"></p>
|
||||
|
||||
<p>The picture above shows that the password is visible in log as it is passed to <em>espota.py</em> upload script.</p>
|
||||
|
||||
<p>Another example below shows situation when password is changed between uploads. </p>
|
||||
|
||||
<p><img src="a-ota-upload-password-passing-again-upload-ok.png" alt="Verbose output when OTA password has been changed between uploads"></p>
|
||||
|
||||
<p>When uploading, Arduino IDE used previously entered password, so the upload failed and that has been clearly reported by IDE. Only then IDE prompted for a new password. That was entered correctly and second attempt to upload has been successful.</p>
|
||||
|
||||
<h4 id="troubleshooting">Troubleshooting</h4>
|
||||
|
||||
<p>If OTA update fails, first step is to check for error messages that may be shown in upload window of Arduino IDE. If this is not providing any useful hints try to upload again while checking what is shown by ESP on serial port. Serial Monitor from IDE will not be useful in that case. When attempting to open it, you will likely see the following:</p>
|
||||
|
||||
<p><img src="a-ota-network-terminal.png" alt="Arduino IDE network terminal window"></p>
|
||||
|
||||
<p>This window is for Arduino Yún and not yet implemented for esp8266/Arduino. It shows up because IDE is attempting to open Serial Monitor using network port you have selected for OTA upload.</p>
|
||||
|
||||
<p>Instead you need an external serial monitor. If you are a Windows user check out <a href="http://www.compuphase.com/software_termite.htm">Termite</a>. This is handy, slick and simple RS232 terminal that does not impose RTS or DTR flow control. Such flow control may cause issues if you are using respective lines to toggle GPIO0 and RESET pins on ESP for upload. </p>
|
||||
|
||||
<p>Select COM port and baud rate on external terminal program as if you were using Arduino Serial Monitor. Please see typical settings for <a href="http://www.compuphase.com/software_termite.htm">Termite</a> below:</p>
|
||||
|
||||
<p><img src="termite-configuration.png" alt="Termite settings"></p>
|
||||
|
||||
<p>Then run OTA from IDE and look what is displayed on terminal. Successful <a href="#arduinoota">ArduinoOTA</a> process using BasicOTA.ino sketch looks like below (IP address depends on your network configuration):</p>
|
||||
|
||||
<p><img src="a-ota-external-serial-terminal-output.png" alt="OTA upload successful - output on an external serial terminal"></p>
|
||||
|
||||
<p>If upload fails you will likely see errors caught by the uploader, exception and the stack dump, or both. </p>
|
||||
|
||||
<p>The most common causes of OTA failure are as follows:
|
||||
* not enough physical memory on the chip (e.g. ESP01 with 512K flash memory is not enough for OTA),
|
||||
* too much memory declared for SPIFFS so new sketch will not fit between existing sketch and SPIFFS – see <a href="#update-process---memory-view">Update process - memory view</a>,
|
||||
* too little memory declared in Arduino IDE for your selected board (i.e. less than physical size). </p>
|
||||
|
||||
<p>For more details regarding flash memory layout please check <a href="https://github.com/esp8266/Arduino/blob/master/doc/filesystem.md">File system</a>.
|
||||
For overview where new sketch is stored, how it is copied and how memory is organized for the purpose of OTA see <a href="#update-process---memory-view">Update process - memory view</a>.</p>
|
||||
|
||||
<h2 id="web-browser">Web Browser</h2>
|
||||
|
||||
<p>Updates described in this chapter are done with a web browser that can be useful in the following typical scenarios:</p>
|
||||
|
||||
<ul>
|
||||
<li>after application deployment if loading directly from Arduino IDE is inconvenient or not possible</li>
|
||||
<li>after deployment if user is unable to expose module for OTA from external update server</li>
|
||||
<li>to provide updates after deployment to small quantity of modules when setting an update server is not practicable</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="requirements">Requirements</h3>
|
||||
|
||||
<ul>
|
||||
<li>The ESP and the computer must be connected to the same network.</li>
|
||||
</ul>
|
||||
|
||||
<h3 id="implementation-overview">Implementation Overview</h3>
|
||||
|
||||
<p>Updates with a web browser are implemented using <code>ESP8266HTTPUpdateServer</code> class together with <code>ESP8266WebServer</code> and <code>ESP8266mDNS</code> classes. The following code is required to get it work:</p>
|
||||
|
||||
<p>setup()</p>
|
||||
<div class="highlight"><pre><code class="language-cpp" data-lang="cpp"> <span class="n">MDNS</span><span class="p">.</span><span class="n">begin</span><span class="p">(</span><span class="n">host</span><span class="p">);</span>
|
||||
|
||||
<span class="n">httpUpdater</span><span class="p">.</span><span class="n">setup</span><span class="p">(</span><span class="o">&</span><span class="n">httpServer</span><span class="p">);</span>
|
||||
<span class="n">httpServer</span><span class="p">.</span><span class="n">begin</span><span class="p">();</span>
|
||||
|
||||
<span class="n">MDNS</span><span class="p">.</span><span class="n">addService</span><span class="p">(</span><span class="s">"http"</span><span class="p">,</span> <span class="s">"tcp"</span><span class="p">,</span> <span class="mi">80</span><span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<p>loop()</p>
|
||||
<div class="highlight"><pre><code class="language-cpp" data-lang="cpp"> <span class="n">httpServer</span><span class="p">.</span><span class="n">handleClient</span><span class="p">();</span>
|
||||
</code></pre></div>
|
||||
<h3 id="application-example">Application Example</h3>
|
||||
|
||||
<p>The sample implementation provided below has been done using:</p>
|
||||
|
||||
<ul>
|
||||
<li>example sketch WebUpdater.ino available in <code>ESP8266HTTPUpdateServer</code> library</li>
|
||||
<li>NodeMCU 1.0 (ESP-12E Module)</li>
|
||||
</ul>
|
||||
|
||||
<p>You can use another module if it meets previously desribed <a href="#basic-requirements">requirements</a>.</p>
|
||||
|
||||
<ol>
|
||||
<li><p>Before you begin, please make sure that you have the following software installed:</p>
|
||||
|
||||
<ul>
|
||||
<li>Arduino IDE and 2.0.0-rc1 (of Nov 17, 2015) version of platform package as described under <a href="https://github.com/esp8266/Arduino#installing-with-boards-manager">https://github.com/esp8266/Arduino#installing-with-boards-manager</a></li>
|
||||
<li>Host software depending on O/S you use:
|
||||
|
||||
<ol>
|
||||
<li>Avahi <a href="http://avahi.org/">http://avahi.org/</a> for Linux</li>
|
||||
<li>Bonjour <a href="http://www.apple.com/support/bonjour/">http://www.apple.com/support/bonjour/</a> for Windows</li>
|
||||
<li>Mac OSX and iOS - support is already built in / no any extra s/w is required</li>
|
||||
</ol></li>
|
||||
</ul></li>
|
||||
<li><p>Prepare the sketch and configuration for initial upload with a serial port.</p>
|
||||
|
||||
<ul>
|
||||
<li>Start Arduino IDE and load sketch WebUpdater.ino available under File > Examples > ESP8266HTTPUpdateServer.</li>
|
||||
<li>Update SSID and password in the sketch so the module can join your Wi-Fi network.</li>
|
||||
<li><p>Open File > Preferences, look for “Show verbose output during:” and check out “compilation” option.</p>
|
||||
|
||||
<p><img src="ota-web-show-verbose-compilation.png" alt="Preferences - enabling verbose output during compilation"></p>
|
||||
|
||||
<p><strong>Note:</strong> This setting will be required in step 5 below. You can uncheck this setting afterwards.</p></li>
|
||||
</ul></li>
|
||||
<li><p>Upload sketch (Ctrl+U). Once done open Serial Monitor (Ctrl+Shift+M) and check if you see the following message displayed, that contains url for OTA update.</p>
|
||||
|
||||
<p><img src="ota-web-serial-monitor-ready.png" alt="Serial Monitor - after first load using serial"></p>
|
||||
|
||||
<p><strong>Note:</strong> Such message will be shown only after module successfully joins network and is ready for an OTA upload.</p></li>
|
||||
<li><p>Now open web browser and enter the url provided on Serial Monitor, i.e. <a href="http://esp8266-webupdate.local/update">http://esp8266-webupdate.local/update</a>. Once entered, browser should display a form like below that has been served by your module. The form invites you to choose a file for update.</p>
|
||||
|
||||
<p><img src="ota-web-browser-form.png" alt="OTA update form in web browser"></p>
|
||||
|
||||
<p><strong>Note:</strong> If entering <code>http://esp8266-webupdate.local/update</code> does not work, try replacing <code>esp8266-webupdate</code> with module’s IP address. For example, if your module IP is <code>192.168.1.100</code> then url should be <code>http://192.168.1.100/update</code>. This workaround is useful in case the host software installed in step 2 does not work. If still nothing works and there are no clues on Serial Monitor, try to diagnose issue by opening provided url in Google Chrome, pressing F12 and checking contents of “Console” and “Network” tabs. Chrome provides some advanced logging on these tabs.</p></li>
|
||||
<li><p>To obtain the file navigate to directory used by Arduino IDE to store results of compilation. You can check the path to this file in compilation log shown in IDE debug window as marked below.</p>
|
||||
|
||||
<p><img src="ota-web-path-to-binary.png" alt="Compilation complete - path to binary file"></p></li>
|
||||
<li><p>Now press “Choose File” in web browser, go to directory identified in step 5 above, find the file “WebUpdater.cpp.bin” and upload it. If upload is successful you will see “OK” on web browser like below.</p>
|
||||
|
||||
<p><img src="ota-web-browser-form-ok.png" alt="OTA update complete"></p>
|
||||
|
||||
<p>Module will reboot that should be visible on Serial Monitor:</p>
|
||||
|
||||
<p><img src="ota-web-serial-monitor-reboot.png" alt="Serial Monitor - after OTA update"></p>
|
||||
|
||||
<p>Just after reboot you should see exactly the same message <code>HTTPUpdateServer ready! Open http:// esp8266-webupdate.local /update in your browser</code> like in step 3. This is because module has been loaded again with the same code – first using serial port, and then using OTA.</p></li>
|
||||
</ol>
|
||||
|
||||
<p>Once you are comfortable with this procedure go ahead and modify WebUpdater.ino sketch to print some additional messages, compile it, locate new binary file and upload it using web browser to see entered changes on a Serial Monitor.</p>
|
||||
|
||||
<p>You can also add OTA routines to your own sketch following guidelines in <a href="#implementation-overview">Implementation Overview</a> above. If this is done correctly you should be always able to upload new sketch over the previous one using a web browser.</p>
|
||||
|
||||
<p>In case OTA update fails dead after entering modifications in your sketch, you can always recover module by loading it over a serial port. Then diagnose the issue with sketch using Serial Monitor. Once the issue is fixed try OTA again.</p>
|
||||
|
||||
<h2 id="http-server">HTTP Server</h2>
|
||||
|
||||
<p><code>ESPhttpUpdate</code> class can check for updates and download a binary file from HTTP web server.
|
||||
It is possible to download updates from every IP or domain address on the network or Internet.</p>
|
||||
|
||||
<h4 id="requirements">Requirements</h4>
|
||||
|
||||
<ul>
|
||||
<li>web server</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="arduino-code">Arduino code</h4>
|
||||
|
||||
<h5 id="simple-updater">Simple updater</h5>
|
||||
|
||||
<p>Simple updater downloads the file every time the function is called.</p>
|
||||
<div class="highlight"><pre><code class="language-cpp" data-lang="cpp"><span class="n">ESPhttpUpdate</span><span class="p">.</span><span class="n">update</span><span class="p">(</span><span class="s">"192.168.0.2"</span><span class="p">,</span> <span class="mi">80</span><span class="p">,</span> <span class="s">"/arduino.bin"</span><span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<h5 id="advanced-updater">Advanced updater</h5>
|
||||
|
||||
<p>Its possible to point update function to a script at the server.
|
||||
If version string argument is given, it will be sent to the server.
|
||||
Server side script can use this to check if update should be performed.</p>
|
||||
|
||||
<p>Server side script can respond as follows:
|
||||
- response code 200, and send the firmware image,
|
||||
- or response code 304 to notify ESP that no update is required.</p>
|
||||
<div class="highlight"><pre><code class="language-cpp" data-lang="cpp"><span class="n">t_httpUpdate_return</span> <span class="n">ret</span> <span class="o">=</span> <span class="n">ESPhttpUpdate</span><span class="p">.</span><span class="n">update</span><span class="p">(</span><span class="s">"192.168.0.2"</span><span class="p">,</span> <span class="mi">80</span><span class="p">,</span> <span class="s">"/esp/update/arduino.php"</span><span class="p">,</span> <span class="s">"optional current version string here"</span><span class="p">);</span>
|
||||
<span class="k">switch</span><span class="p">(</span><span class="n">ret</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">case</span> <span class="nl">HTTP_UPDATE_FAILED</span><span class="p">:</span>
|
||||
<span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">"[update] Update failed."</span><span class="p">);</span>
|
||||
<span class="k">break</span><span class="p">;</span>
|
||||
<span class="k">case</span> <span class="nl">HTTP_UPDATE_NO_UPDATES</span><span class="p">:</span>
|
||||
<span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">"[update] Update no Update."</span><span class="p">);</span>
|
||||
<span class="k">break</span><span class="p">;</span>
|
||||
<span class="k">case</span> <span class="nl">HTTP_UPDATE_OK</span><span class="p">:</span>
|
||||
<span class="n">Serial</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="s">"[update] Update ok."</span><span class="p">);</span> <span class="c1">// may not called we reboot the ESP</span>
|
||||
<span class="k">break</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre></div>
|
||||
<h4 id="server-request-handling">Server request handling</h4>
|
||||
|
||||
<h5 id="simple-updater">Simple updater</h5>
|
||||
|
||||
<p>For the simple updater the server only needs to deliver the binary file for update.</p>
|
||||
|
||||
<h5 id="advanced-updater">Advanced updater</h5>
|
||||
|
||||
<p>For advanced update management a script needs to run at the server side, for example a PHP script.
|
||||
At every update request the ESP sends some information in HTTP headers to the server.</p>
|
||||
|
||||
<p>Example header data:
|
||||
<code>
|
||||
[HTTP_USER_AGENT] => ESP8266-http-Update
|
||||
[HTTP_X_ESP8266_STA_MAC] => 18:FE:AA:AA:AA:AA
|
||||
[HTTP_X_ESP8266_AP_MAC] => 1A:FE:AA:AA:AA:AA
|
||||
[HTTP_X_ESP8266_FREE_SPACE] => 671744
|
||||
[HTTP_X_ESP8266_SKETCH_SIZE] => 373940
|
||||
[HTTP_X_ESP8266_CHIP_SIZE] => 4194304
|
||||
[HTTP_X_ESP8266_SDK_VERSION] => 1.3.0
|
||||
[HTTP_X_ESP8266_VERSION] => DOOR-7-g14f53a19
|
||||
</code></p>
|
||||
|
||||
<p>With this information the script now can check if an update is needed. It is also possible to deliver different binaries based on the MAC address for example.</p>
|
||||
|
||||
<p>Script example:</p>
|
||||
<div class="highlight"><pre><code class="language-php" data-lang="php"><span class="cp"><?PHP</span>
|
||||
|
||||
<span class="nb">header</span><span class="p">(</span><span class="s1">'Content-type: text/plain; charset=utf8'</span><span class="p">,</span> <span class="k">true</span><span class="p">);</span>
|
||||
|
||||
<span class="k">function</span> <span class="nf">check_header</span><span class="p">(</span><span class="nv">$name</span><span class="p">,</span> <span class="nv">$value</span> <span class="o">=</span> <span class="k">false</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="nv">$name</span><span class="p">]))</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="k">false</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">if</span><span class="p">(</span><span class="nv">$value</span> <span class="o">&&</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="nv">$name</span><span class="p">]</span> <span class="o">!=</span> <span class="nv">$value</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="k">false</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">return</span> <span class="k">true</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">function</span> <span class="nf">sendFile</span><span class="p">(</span><span class="nv">$path</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="nb">header</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s2">"SERVER_PROTOCOL"</span><span class="p">]</span><span class="o">.</span><span class="s1">' 200 OK'</span><span class="p">,</span> <span class="k">true</span><span class="p">,</span> <span class="mi">200</span><span class="p">);</span>
|
||||
<span class="nb">header</span><span class="p">(</span><span class="s1">'Content-Type: application/octet-stream'</span><span class="p">,</span> <span class="k">true</span><span class="p">);</span>
|
||||
<span class="nb">header</span><span class="p">(</span><span class="s1">'Content-Disposition: attachment; filename='</span><span class="o">.</span><span class="nb">basename</span><span class="p">(</span><span class="nv">$path</span><span class="p">));</span>
|
||||
<span class="nb">header</span><span class="p">(</span><span class="s1">'Content-Length: '</span><span class="o">.</span><span class="nb">filesize</span><span class="p">(</span><span class="nv">$path</span><span class="p">),</span> <span class="k">true</span><span class="p">);</span>
|
||||
<span class="nb">header</span><span class="p">(</span><span class="s1">'x-MD5: '</span><span class="o">.</span><span class="nb">md5_file</span><span class="p">(</span><span class="nv">$path</span><span class="p">),</span> <span class="k">true</span><span class="p">);</span>
|
||||
<span class="nb">readfile</span><span class="p">(</span><span class="nv">$path</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">check_header</span><span class="p">(</span><span class="s1">'HTTP_USER_AGENT'</span><span class="p">,</span> <span class="s1">'ESP8266-http-Update'</span><span class="p">))</span> <span class="p">{</span>
|
||||
<span class="nb">header</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s2">"SERVER_PROTOCOL"</span><span class="p">]</span><span class="o">.</span><span class="s1">' 403 Forbidden'</span><span class="p">,</span> <span class="k">true</span><span class="p">,</span> <span class="mi">403</span><span class="p">);</span>
|
||||
<span class="k">echo</span> <span class="s2">"only for ESP8266 updater!</span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span>
|
||||
<span class="k">exit</span><span class="p">();</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">if</span><span class="p">(</span>
|
||||
<span class="o">!</span><span class="nx">check_header</span><span class="p">(</span><span class="s1">'HTTP_X_ESP8266_STA_MAC'</span><span class="p">)</span> <span class="o">||</span>
|
||||
<span class="o">!</span><span class="nx">check_header</span><span class="p">(</span><span class="s1">'HTTP_X_ESP8266_AP_MAC'</span><span class="p">)</span> <span class="o">||</span>
|
||||
<span class="o">!</span><span class="nx">check_header</span><span class="p">(</span><span class="s1">'HTTP_X_ESP8266_FREE_SPACE'</span><span class="p">)</span> <span class="o">||</span>
|
||||
<span class="o">!</span><span class="nx">check_header</span><span class="p">(</span><span class="s1">'HTTP_X_ESP8266_SKETCH_SIZE'</span><span class="p">)</span> <span class="o">||</span>
|
||||
<span class="o">!</span><span class="nx">check_header</span><span class="p">(</span><span class="s1">'HTTP_X_ESP8266_CHIP_SIZE'</span><span class="p">)</span> <span class="o">||</span>
|
||||
<span class="o">!</span><span class="nx">check_header</span><span class="p">(</span><span class="s1">'HTTP_X_ESP8266_SDK_VERSION'</span><span class="p">)</span> <span class="o">||</span>
|
||||
<span class="o">!</span><span class="nx">check_header</span><span class="p">(</span><span class="s1">'HTTP_X_ESP8266_VERSION'</span><span class="p">)</span>
|
||||
<span class="p">)</span> <span class="p">{</span>
|
||||
<span class="nb">header</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s2">"SERVER_PROTOCOL"</span><span class="p">]</span><span class="o">.</span><span class="s1">' 403 Forbidden'</span><span class="p">,</span> <span class="k">true</span><span class="p">,</span> <span class="mi">403</span><span class="p">);</span>
|
||||
<span class="k">echo</span> <span class="s2">"only for ESP8266 updater! (header)</span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span>
|
||||
<span class="k">exit</span><span class="p">();</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="nv">$db</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
|
||||
<span class="s2">"18:FE:AA:AA:AA:AA"</span> <span class="o">=></span> <span class="s2">"DOOR-7-g14f53a19"</span><span class="p">,</span>
|
||||
<span class="s2">"18:FE:AA:AA:AA:BB"</span> <span class="o">=></span> <span class="s2">"TEMP-1.0.0"</span>
|
||||
<span class="p">);</span>
|
||||
|
||||
<span class="k">if</span><span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$db</span><span class="p">[</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">'HTTP_X_ESP8266_STA_MAC'</span><span class="p">]]))</span> <span class="p">{</span>
|
||||
<span class="k">if</span><span class="p">(</span><span class="nv">$db</span><span class="p">[</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">'HTTP_X_ESP8266_STA_MAC'</span><span class="p">]]</span> <span class="o">!=</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">'HTTP_X_ESP8266_VERSION'</span><span class="p">])</span> <span class="p">{</span>
|
||||
<span class="nx">sendFile</span><span class="p">(</span><span class="s2">"./bin/"</span><span class="o">.</span><span class="nv">$db</span><span class="p">[</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">'HTTP_X_ESP8266_STA_MAC'</span><span class="p">]]</span><span class="o">.</span><span class="s2">"bin"</span><span class="p">);</span>
|
||||
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
|
||||
<span class="nb">header</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s2">"SERVER_PROTOCOL"</span><span class="p">]</span><span class="o">.</span><span class="s1">' 304 Not Modified'</span><span class="p">,</span> <span class="k">true</span><span class="p">,</span> <span class="mi">304</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
<span class="k">exit</span><span class="p">();</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="nb">header</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s2">"SERVER_PROTOCOL"</span><span class="p">]</span><span class="o">.</span><span class="s1">' 500 no version for ESP MAC'</span><span class="p">,</span> <span class="k">true</span><span class="p">,</span> <span class="mi">500</span><span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<h2 id="stream-interface">Stream Interface</h2>
|
||||
|
||||
<p>TODO describe Stream Interface</p>
|
||||
|
||||
<p>The Stream Interface is the base for all other update modes like OTA, http Server / client.</p>
|
||||
|
||||
<h2 id="updater-class">Updater class</h2>
|
||||
|
||||
<p>Updater is in the Core and deals with writing the firmware to the flash,
|
||||
checking its integrity and telling the bootloader to load the new firmware on the next boot.</p>
|
||||
|
||||
<h3 id="update-process-memory-view">Update process - memory view</h3>
|
||||
|
||||
<ul>
|
||||
<li>The new sketch will be stored in the space between the old sketch and the spiff.</li>
|
||||
<li>on the next reboot the "eboot" bootloader check for commands.</li>
|
||||
<li>the new sketch is now copied "over" the old one.</li>
|
||||
<li>the new sketch is started.</li>
|
||||
</ul>
|
||||
|
||||
<p><img src="update_memory_copy.png" alt="Memory Copy"></p>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
versions/2.3.0/doc/ota_updates/termite-configuration.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
versions/2.3.0/doc/ota_updates/update_memory_copy.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
versions/2.3.0/doc/pin_functions.png
Normal file
After Width: | Height: | Size: 174 KiB |
412
versions/2.3.0/doc/reference.html
Normal file
@ -0,0 +1,412 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
<title>
|
||||
|
||||
Reference · ESP8266 Arduino Core
|
||||
|
||||
</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/poole.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/syntax.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/hyde.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/icons.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
||||
<!-- Icons -->
|
||||
<link rel="shortcut icon" href="/Arduino/versions/2.3.0/public/favicon.ico">
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="/Arduino/versions/2.3.0/public/js/toc.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#toc').toc({ listType: 'ul', showSpeed: 0, title: '', headers: 'h1, h2', minimumHeaders: 2 });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="version-bar">
|
||||
This documentation is for version 2.3.0. <a href="http://esp8266.github.io/Arduino/versions">Other versions.</a>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about">
|
||||
<h2>
|
||||
<a href="http://esp8266.github.io/Arduino">
|
||||
ESP8266 Arduino Core
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/installing.html">Installation</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/reference.html">Reference</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="toc"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/libraries.html">Libraries</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/filesystem.html">File System</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/ota_updates/readme.html">OTA Update</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/boards.html">Supported Hardware</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/changes.html">Change Log</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
<p>
|
||||
<a href="https://github.com/esp8266/Arduino"><div id="gh-icon"></div>esp8266/Arduino</a>
|
||||
</p>
|
||||
<p class="lead">Documentation for ESP8266 Arduino Core. Installation instructions, functions and classes reference.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content container">
|
||||
<h2 id="table-of-contents">Table of Contents</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#table-of-contents">Table of Contents</a></li>
|
||||
<li><a href="#digital-io">Digital IO</a></li>
|
||||
<li><a href="#analog-input">Analog input</a></li>
|
||||
<li><a href="#analog-output">Analog output</a></li>
|
||||
<li><a href="#timing-and-delays">Timing and delays</a></li>
|
||||
<li><a href="#serial">Serial</a></li>
|
||||
<li><a href="#progmem">Progmem</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="digital-io">Digital IO</h2>
|
||||
|
||||
<p>Pin numbers in Arduino correspond directly to the ESP8266 GPIO pin numbers. <code>pinMode</code>, <code>digitalRead</code>, and <code>digitalWrite</code> functions work as usual, so to read GPIO2, call <code>digitalRead(2)</code>.</p>
|
||||
|
||||
<p>Digital pins 0—15 can be <code>INPUT</code>, <code>OUTPUT</code>, or <code>INPUT_PULLUP</code>.
|
||||
Pin 16 can be <code>INPUT</code>, <code>OUTPUT</code> or <code>INPUT_PULLDOWN_16</code>. At startup, pins are configured as <code>INPUT</code>.</p>
|
||||
|
||||
<p>Pins may also serve other functions, like Serial, I2C, SPI. These functions are normally activated by the corresponding library. The diagram below shows pin mapping for the popular ESP-12 module.</p>
|
||||
|
||||
<p><img src="esp12.png" alt="Pin Functions"></p>
|
||||
|
||||
<p>Digital pins 6—11 are not shown on this diagram because they are used to connect flash memory chip on most modules. Trying to use these pins as IOs will likely cause the program to crash.</p>
|
||||
|
||||
<p>Note that some boards and modules (ESP-12ED, NodeMCU 1.0) also break out pins 9 and 11. These may be used as IO if flash chip works in DIO mode (as opposed to QIO, which is the default one).</p>
|
||||
|
||||
<p>Pin interrupts are supported through <code>attachInterrupt</code>, <code>detachInterrupt</code> functions.
|
||||
Interrupts may be attached to any GPIO pin, except GPIO16. Standard Arduino interrupt
|
||||
types are supported: <code>CHANGE</code>, <code>RISING</code>, <code>FALLING</code>.</p>
|
||||
|
||||
<h2 id="analog-input">Analog input</h2>
|
||||
|
||||
<p>ESP8266 has a single ADC channel available to users. It may be used either to read voltage at ADC pin, or to read module supply voltage (VCC).</p>
|
||||
|
||||
<p>To read external voltage applied to ADC pin, use <code>analogRead(A0)</code>. Input voltage range is 0 — 1.0V.</p>
|
||||
|
||||
<p>To read VCC voltage, use <code>ESP.getVcc()</code> and ADC pin must be kept unconnected. Additionally, the following line has to be added to the sketch:</p>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">ADC_MODE</span><span class="p">(</span><span class="n">ADC_VCC</span><span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<p>This line has to appear outside of any functions, for instance right after the <code>#include</code> lines of your sketch.</p>
|
||||
|
||||
<h2 id="analog-output">Analog output</h2>
|
||||
|
||||
<p><code>analogWrite(pin, value)</code> enables software PWM on the given pin. PWM may be used on pins 0 to 16.
|
||||
Call <code>analogWrite(pin, 0)</code> to disable PWM on the pin. <code>value</code> may be in range from 0 to <code>PWMRANGE</code>, which is equal to 1023 by default. PWM range may be changed by calling <code>analogWriteRange(new_range)</code>.</p>
|
||||
|
||||
<p>PWM frequency is 1kHz by default. Call <code>analogWriteFreq(new_frequency)</code> to change the frequency.</p>
|
||||
|
||||
<h2 id="timing-and-delays">Timing and delays</h2>
|
||||
|
||||
<p><code>millis()</code> and <code>micros()</code> return the number of milliseconds and microseconds elapsed after reset, respectively.</p>
|
||||
|
||||
<p><code>delay(ms)</code> pauses the sketch for a given number of milliseconds and allows WiFi and TCP/IP tasks to run.
|
||||
<code>delayMicroseconds(us)</code> pauses for a given number of microseconds.</p>
|
||||
|
||||
<p>Remember that there is a lot of code that needs to run on the chip besides the sketch
|
||||
when WiFi is connected. WiFi and TCP/IP libraries get a chance to handle any pending
|
||||
events each time the <code>loop()</code> function completes, OR when <code>delay</code> is called.
|
||||
If you have a loop somewhere in your sketch that takes a lot of time (>50ms) without
|
||||
calling <code>delay</code>, you might consider adding a call to <code>delay</code> function to keep the WiFi
|
||||
stack running smoothly.</p>
|
||||
|
||||
<p>There is also a <code>yield()</code> function which is equivalent to <code>delay(0)</code>. The <code>delayMicroseconds</code>
|
||||
function, on the other hand, does not yield to other tasks, so using it for delays
|
||||
more than 20 milliseconds is not recommended.</p>
|
||||
|
||||
<h2 id="serial">Serial</h2>
|
||||
|
||||
<p><code>Serial</code> object works much the same way as on a regular Arduino. Apart from hardware FIFO (128 bytes for TX and RX) HardwareSerial has additional 256-byte TX and RX buffers. Both transmit and receive is interrupt-driven. Write and read functions only block the sketch execution when the respective FIFO/buffers are full/empty.</p>
|
||||
|
||||
<p><code>Serial</code> uses UART0, which is mapped to pins GPIO1 (TX) and GPIO3 (RX). Serial may be remapped to GPIO15 (TX) and GPIO13 (RX) by calling <code>Serial.swap()</code> after <code>Serial.begin</code>. Calling <code>swap</code> again maps UART0 back to GPIO1 and GPIO3.</p>
|
||||
|
||||
<p><code>Serial1</code> uses UART1, TX pin is GPIO2. UART1 can not be used to receive data because normally it's RX pin is occupied for flash chip connection. To use <code>Serial1</code>, call <code>Serial1.begin(baudrate)</code>.</p>
|
||||
|
||||
<p>If <code>Serial1</code> is not used and <code>Serial</code> is not swapped - TX for UART0 can be mapped to GPIO2 instead by calling <code>Serial.set_tx(2)</code> after <code>Serial.begin</code> or directly with <code>Serial.begin(baud, config, mode, 2)</code>.</p>
|
||||
|
||||
<p>By default the diagnostic output from WiFi libraries is disabled when you call <code>Serial.begin</code>. To enable debug output again, call <code>Serial.setDebugOutput(true)</code>. To redirect debug output to <code>Serial1</code> instead, call <code>Serial1.setDebugOutput(true)</code>.</p>
|
||||
|
||||
<p>You also need to use <code>Serial.setDebugOutput(true)</code> to enable output from <code>printf()</code> function.</p>
|
||||
|
||||
<p>Both <code>Serial</code> and <code>Serial1</code> objects support 5, 6, 7, 8 data bits, odd (O), even (E), and no (N) parity, and 1 or 2 stop bits. To set the desired mode, call <code>Serial.begin(baudrate, SERIAL_8N1)</code>, <code>Serial.begin(baudrate, SERIAL_6E2)</code>, etc.</p>
|
||||
|
||||
<p>A new method has been implemented on both <code>Serial</code> and <code>Serial1</code> to get current baud rate setting. To get the current baud rate, call <code>Serial.baudRate()</code>, <code>Serial1.baudRate()</code>. Return a <code>int</code> of current speed. For example
|
||||
```cpp
|
||||
// Set Baud rate to 57600
|
||||
Serial.begin(57600);</p>
|
||||
|
||||
<p>// Get current baud rate
|
||||
int br = Serial.baudRate();</p>
|
||||
|
||||
<p>// Will print "Serial is 57600 bps"
|
||||
Serial.printf("Serial is %d bps", br);
|
||||
```</p>
|
||||
|
||||
<p>I've done this also for official ESP8266 <a href="https://github.com/esp8266/Arduino/blob/master/doc/libraries.md#softwareserial">Software Serial</a> library, see this <a href="https://github.com/plerup/espsoftwareserial/pull/22">pull request</a>.<br>
|
||||
Note that this implementation is <strong>only for ESP8266 based boards</strong>, and will not works with other Arduino boards.</p>
|
||||
|
||||
<h2 id="progmem">Progmem</h2>
|
||||
|
||||
<p>The Program memory features work much the same way as on a regular Arduino; placing read only data and strings in read only memory and freeing heap for your application.
|
||||
The important difference is that on the ESP8266 the literal strings are not pooled. This means that the same literal string defined inside a <code>F("")</code> and/or <code>PSTR("")</code> will take up space for each instance in the code. So you will need to manage the duplicate strings yourself.</p>
|
||||
|
||||
<p>There is one additional helper macro to make it easier to pass <code>const PROGMEM</code> strings to methods that take a <code>__FlashStringHelper</code> called <code>FPSTR()</code>. The use of this will help make it easier to pool strings.
|
||||
Not pooling strings...</p>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="n">String</span> <span class="n">response1</span><span class="p">;</span>
|
||||
<span class="n">response1</span> <span class="o">+=</span> <span class="n">F</span><span class="p">(</span><span class="s">"http:"</span><span class="p">);</span>
|
||||
<span class="p">...</span>
|
||||
<span class="n">String</span> <span class="n">response2</span><span class="p">;</span>
|
||||
<span class="n">response2</span> <span class="o">+=</span> <span class="n">F</span><span class="p">(</span><span class="s">"http:"</span><span class="p">);</span>
|
||||
</code></pre></div>
|
||||
<p>using FPSTR would become...</p>
|
||||
<div class="highlight"><pre><code class="language-c++" data-lang="c++"><span class="k">const</span> <span class="kt">char</span> <span class="n">HTTP</span><span class="p">[]</span> <span class="n">PROGMEM</span> <span class="o">=</span> <span class="s">"http:"</span><span class="p">;</span>
|
||||
<span class="p">...</span>
|
||||
<span class="p">{</span>
|
||||
<span class="n">String</span> <span class="n">response1</span><span class="p">;</span>
|
||||
<span class="n">response1</span> <span class="o">+=</span> <span class="n">FPSTR</span><span class="p">(</span><span class="n">HTTP</span><span class="p">);</span>
|
||||
<span class="p">...</span>
|
||||
<span class="n">String</span> <span class="n">response2</span><span class="p">;</span>
|
||||
<span class="n">response2</span> <span class="o">+=</span> <span class="n">FPSTR</span><span class="p">(</span><span class="n">HTTP</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1156
versions/2.3.0/doc/rgisters_dump.txt
Normal file
294
versions/2.3.0/index.html
Normal file
@ -0,0 +1,294 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
<title>
|
||||
|
||||
· ESP8266 Arduino Core
|
||||
|
||||
</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/poole.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/syntax.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/hyde.css">
|
||||
<link rel="stylesheet" href="/Arduino/versions/2.3.0/public/css/icons.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
||||
<!-- Icons -->
|
||||
<link rel="shortcut icon" href="/Arduino/versions/2.3.0/public/favicon.ico">
|
||||
|
||||
<!-- RSS -->
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<script src="/Arduino/versions/2.3.0/public/js/toc.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#toc').toc({ listType: 'ul', showSpeed: 0, title: '', headers: 'h1, h2', minimumHeaders: 2 });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="version-bar">
|
||||
This documentation is for version 2.3.0. <a href="http://esp8266.github.io/Arduino/versions">Other versions.</a>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about">
|
||||
<h2>
|
||||
<a href="http://esp8266.github.io/Arduino">
|
||||
ESP8266 Arduino Core
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-nav">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/installing.html">Installation</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/reference.html">Reference</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/libraries.html">Libraries</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/filesystem.html">File System</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/ota_updates/readme.html">OTA Update</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/boards.html">Supported Hardware</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a class="sidebar-nav-item" href="/Arduino/versions/2.3.0/doc/changes.html">Change Log</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
<p>
|
||||
<a href="https://github.com/esp8266/Arduino"><div id="gh-icon"></div>esp8266/Arduino</a>
|
||||
</p>
|
||||
<p class="lead">Documentation for ESP8266 Arduino Core. Installation instructions, functions and classes reference.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content container">
|
||||
<p>Welcome to the ESP8266 Arduino core documentation, version 2.3.0.</p>
|
||||
|
||||
<p>Links on the left will take you to various sections.</p>
|
||||
|
||||
<p>Source code of this version is available from GitHub: <a href="https://github.com/esp8266/Arduino/archive/2.3.0.zip">https://github.com/esp8266/Arduino/archive/2.3.0.zip</a></p>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
265
versions/2.3.0/public/css/hyde.css
Normal file
@ -0,0 +1,265 @@
|
||||
/*
|
||||
* __ __
|
||||
* /\ \ /\ \
|
||||
* \ \ \___ __ __ \_\ \ __
|
||||
* \ \ _ `\/\ \/\ \ /'_` \ /'__`\
|
||||
* \ \ \ \ \ \ \_\ \/\ \_\ \/\ __/
|
||||
* \ \_\ \_\/`____ \ \___,_\ \____\
|
||||
* \/_/\/_/`/___/> \/__,_ /\/____/
|
||||
* /\___/
|
||||
* \/__/
|
||||
*
|
||||
* Designed, built, and released under MIT license by @mdo. Learn more at
|
||||
* https://github.com/poole/hyde.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Contents
|
||||
*
|
||||
* Global resets
|
||||
* Sidebar
|
||||
* Container
|
||||
* Reverse layout
|
||||
* Themes
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Global resets
|
||||
*
|
||||
* Update the foundational and global aspects of the page.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: "PT Sans", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
@media (min-width: 48em) {
|
||||
html {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 58em) {
|
||||
html {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sidebar
|
||||
*
|
||||
* Flexible banner for housing site name, intro, and "footer" content. Starts
|
||||
* out above content in mobile and later moves to the side with wider viewports.
|
||||
*/
|
||||
|
||||
.sidebar {
|
||||
text-align: left;
|
||||
padding: 2rem 1rem;
|
||||
color: rgba(0,0,0,.5);
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
@media (min-width: 48em) {
|
||||
.sidebar {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 18rem;
|
||||
}
|
||||
}
|
||||
|
||||
.version-bar {
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
background-color: #f0f0f0;
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
/* Sidebar links */
|
||||
.sidebar a {
|
||||
color: #a33;
|
||||
}
|
||||
|
||||
/* About section */
|
||||
.sidebar-about h1 {
|
||||
margin-top: 0;
|
||||
font-family: "Abril Fatface", serif;
|
||||
font-size: 3.25rem;
|
||||
}
|
||||
|
||||
/* Sidebar nav */
|
||||
.sidebar-nav {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.sidebar-nav-item {
|
||||
display: block;
|
||||
line-height: 1.75;
|
||||
}
|
||||
a.sidebar-nav-item:hover,
|
||||
a.sidebar-nav-item:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.sidebar-nav-item.active {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Sticky sidebar
|
||||
*
|
||||
* Add the `sidebar-sticky` class to the sidebar's container to affix it the
|
||||
* contents to the bottom of the sidebar in tablets and up.
|
||||
*/
|
||||
|
||||
@media (min-width: 48em) {
|
||||
.sidebar-sticky {
|
||||
position: absolute;
|
||||
right: 1rem;
|
||||
bottom: 1rem;
|
||||
left: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Container
|
||||
*
|
||||
* Align the contents of the site above the proper threshold with some margin-fu
|
||||
* with a 25%-wide `.sidebar`.
|
||||
*/
|
||||
|
||||
.content {
|
||||
padding-top: 4rem;
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
|
||||
@media (min-width: 48em) {
|
||||
.content {
|
||||
max-width: 38rem;
|
||||
margin-left: 20rem;
|
||||
margin-right: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 64em) {
|
||||
.content {
|
||||
margin-left: 22rem;
|
||||
margin-right: 4rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Reverse layout
|
||||
*
|
||||
* Flip the orientation of the page by placing the `.sidebar` on the right.
|
||||
*/
|
||||
|
||||
@media (min-width: 48em) {
|
||||
.layout-reverse .sidebar {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
.layout-reverse .content {
|
||||
margin-left: 2rem;
|
||||
margin-right: 20rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 64em) {
|
||||
.layout-reverse .content {
|
||||
margin-left: 4rem;
|
||||
margin-right: 22rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Themes
|
||||
*
|
||||
* As of v1.1, Hyde includes optional themes to color the sidebar and links
|
||||
* within blog posts. To use, add the class of your choosing to the `body`.
|
||||
*/
|
||||
|
||||
/* Base16 (http://chriskempson.github.io/base16/#default) */
|
||||
|
||||
/* Red */
|
||||
.theme-base-xx .sidebar {
|
||||
background-color: #ac4142;
|
||||
}
|
||||
.theme-base-xx .content a,
|
||||
.theme-base-xx .related-posts li a:hover {
|
||||
color: #ac4142;
|
||||
}
|
||||
|
||||
|
||||
/* Red */
|
||||
.theme-base-08 .sidebar {
|
||||
background-color: #ac4142;
|
||||
}
|
||||
.theme-base-08 .content a,
|
||||
.theme-base-08 .related-posts li a:hover {
|
||||
color: #ac4142;
|
||||
}
|
||||
|
||||
/* Orange */
|
||||
.theme-base-09 .sidebar {
|
||||
background-color: #d28445;
|
||||
}
|
||||
.theme-base-09 .content a,
|
||||
.theme-base-09 .related-posts li a:hover {
|
||||
color: #d28445;
|
||||
}
|
||||
|
||||
/* Yellow */
|
||||
.theme-base-0a .sidebar {
|
||||
background-color: #f4bf75;
|
||||
}
|
||||
.theme-base-0a .content a,
|
||||
.theme-base-0a .related-posts li a:hover {
|
||||
color: #f4bf75;
|
||||
}
|
||||
|
||||
/* Green */
|
||||
.theme-base-0b .sidebar {
|
||||
background-color: #90a959;
|
||||
}
|
||||
.theme-base-0b .content a,
|
||||
.theme-base-0b .related-posts li a:hover {
|
||||
color: #90a959;
|
||||
}
|
||||
|
||||
/* Cyan */
|
||||
.theme-base-0c .sidebar {
|
||||
background-color: #75b5aa;
|
||||
}
|
||||
.theme-base-0c .content a,
|
||||
.theme-base-0c .related-posts li a:hover {
|
||||
color: #75b5aa;
|
||||
}
|
||||
|
||||
/* Blue */
|
||||
.theme-base-0d .sidebar {
|
||||
background-color: #6a9fb5;
|
||||
}
|
||||
.theme-base-0d .content a,
|
||||
.theme-base-0d .related-posts li a:hover {
|
||||
color: #6a9fb5;
|
||||
}
|
||||
|
||||
/* Magenta */
|
||||
.theme-base-0e .sidebar {
|
||||
background-color: #aa759f;
|
||||
}
|
||||
.theme-base-0e .content a,
|
||||
.theme-base-0e .related-posts li a:hover {
|
||||
color: #aa759f;
|
||||
}
|
||||
|
||||
/* Brown */
|
||||
.theme-base-0f .sidebar {
|
||||
background-color: #8f5536;
|
||||
}
|
||||
.theme-base-0f .content a,
|
||||
.theme-base-0f .related-posts li a:hover {
|
||||
color: #8f5536;
|
||||
}
|
32
versions/2.3.0/public/css/icons.css
Normal file
@ -0,0 +1,32 @@
|
||||
#gh-icon {
|
||||
background: url("/Arduino/versions/2.3.0/public/gh.png") no-repeat top left;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
@media
|
||||
(-webkit-min-device-pixel-ratio: 2),
|
||||
(min-resolution: 192dpi) {
|
||||
#gh-icon {
|
||||
background-image: url("/Arduino/versions/2.3.0/public/gh@2.png");
|
||||
background-size: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.clickable-header {
|
||||
cursor:pointer;
|
||||
}
|
||||
.clickable-header:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
.top-level-header {
|
||||
display:inline;
|
||||
}
|
||||
.back-to-top {
|
||||
margin-left:5px;
|
||||
cursor:pointer;
|
||||
vertical-align: top;
|
||||
}
|
430
versions/2.3.0/public/css/poole.css
Normal file
@ -0,0 +1,430 @@
|
||||
/*
|
||||
* ___
|
||||
* /\_ \
|
||||
* _____ ___ ___\//\ \ __
|
||||
* /\ '__`\ / __`\ / __`\\ \ \ /'__`\
|
||||
* \ \ \_\ \/\ \_\ \/\ \_\ \\_\ \_/\ __/
|
||||
* \ \ ,__/\ \____/\ \____//\____\ \____\
|
||||
* \ \ \/ \/___/ \/___/ \/____/\/____/
|
||||
* \ \_\
|
||||
* \/_/
|
||||
*
|
||||
* Designed, built, and released under MIT license by @mdo. Learn more at
|
||||
* https://github.com/poole/poole.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Contents
|
||||
*
|
||||
* Body resets
|
||||
* Custom type
|
||||
* Messages
|
||||
* Container
|
||||
* Masthead
|
||||
* Posts and pages
|
||||
* Pagination
|
||||
* Reverse layout
|
||||
* Themes
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Body resets
|
||||
*
|
||||
* Update the foundational and global aspects of the page.
|
||||
*/
|
||||
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
@media (min-width: 38em) {
|
||||
html {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
color: #515151;
|
||||
background-color: #fff;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
/* No `:visited` state is required by default (browsers will use `a`) */
|
||||
a {
|
||||
color: #b03030;
|
||||
text-decoration: none;
|
||||
}
|
||||
a strong {
|
||||
color: inherit;
|
||||
}
|
||||
/* `:focus` is linked to `:hover` for basic accessibility */
|
||||
a:hover,
|
||||
a:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Headings */
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin-bottom: .5rem;
|
||||
font-weight: bold;
|
||||
line-height: 1.25;
|
||||
color: #313131;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
h2 {
|
||||
margin-top: 1rem;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
h3 {
|
||||
margin-top: 1.5rem;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
h4, h5, h6 {
|
||||
margin-top: 1rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
/* Body text */
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
strong {
|
||||
color: #303030;
|
||||
}
|
||||
|
||||
|
||||
/* Lists */
|
||||
ul, ol, dl {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
dd {
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
|
||||
/* Misc */
|
||||
hr {
|
||||
position: relative;
|
||||
margin: 1.5rem 0;
|
||||
border: 0;
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
|
||||
abbr {
|
||||
font-size: 85%;
|
||||
font-weight: bold;
|
||||
color: #555;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
abbr[title] {
|
||||
cursor: help;
|
||||
border-bottom: 1px dotted #e5e5e5;
|
||||
}
|
||||
|
||||
/* Code */
|
||||
code,
|
||||
pre {
|
||||
font-family: Menlo, Monaco, "Courier New", monospace;
|
||||
}
|
||||
code {
|
||||
padding: .25em .5em;
|
||||
font-size: 85%;
|
||||
color: #000;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 3px;
|
||||
}
|
||||
pre {
|
||||
display: block;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
padding: 1rem;
|
||||
font-size: .8rem;
|
||||
line-height: 1.4;
|
||||
white-space: pre;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
pre code {
|
||||
padding: 0;
|
||||
font-size: 100%;
|
||||
color: inherit;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/* Pygments via Jekyll */
|
||||
.highlight {
|
||||
margin-bottom: 1rem;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.highlight pre {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Gist via GitHub Pages */
|
||||
.gist .gist-file {
|
||||
font-family: Menlo, Monaco, "Courier New", monospace !important;
|
||||
}
|
||||
.gist .markdown-body {
|
||||
padding: 15px;
|
||||
}
|
||||
.gist pre {
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
}
|
||||
.gist .gist-file .gist-data {
|
||||
font-size: .8rem !important;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.gist code {
|
||||
padding: 0;
|
||||
color: inherit;
|
||||
background-color: transparent;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* Quotes */
|
||||
blockquote {
|
||||
padding: .5rem 1rem;
|
||||
margin: .8rem 0;
|
||||
color: #7a7a7a;
|
||||
border-left: .25rem solid #e5e5e5;
|
||||
}
|
||||
blockquote p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@media (min-width: 30em) {
|
||||
blockquote {
|
||||
padding-right: 5rem;
|
||||
padding-left: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
margin: 0 0 1rem;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
table {
|
||||
margin-bottom: 1rem;
|
||||
width: 100%;
|
||||
border: 1px solid #e5e5e5;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
td,
|
||||
th {
|
||||
padding: .25rem .5rem;
|
||||
border: 1px solid #e5e5e5;
|
||||
}
|
||||
tbody tr:nth-child(odd) td,
|
||||
tbody tr:nth-child(odd) th {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Custom type
|
||||
*
|
||||
* Extend paragraphs with `.lead` for larger introductory text.
|
||||
*/
|
||||
|
||||
.lead {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Messages
|
||||
*
|
||||
* Show alert messages to users. You may add it to single elements like a `<p>`,
|
||||
* or to a parent if there are multiple elements to show.
|
||||
*/
|
||||
|
||||
.message {
|
||||
margin-bottom: 1rem;
|
||||
padding: 1rem;
|
||||
color: #717171;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Container
|
||||
*
|
||||
* Center the page content.
|
||||
*/
|
||||
|
||||
.container {
|
||||
max-width: 38rem;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Masthead
|
||||
*
|
||||
* Super small header above the content for site name and short description.
|
||||
*/
|
||||
|
||||
.masthead {
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
.masthead-title {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
color: #505050;
|
||||
}
|
||||
.masthead-title a {
|
||||
color: #505050;
|
||||
}
|
||||
.masthead-title small {
|
||||
font-size: 75%;
|
||||
font-weight: 400;
|
||||
color: #c0c0c0;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Posts and pages
|
||||
*
|
||||
* Each post is wrapped in `.post` and is used on default and post layouts. Each
|
||||
* page is wrapped in `.page` and is only used on the page layout.
|
||||
*/
|
||||
|
||||
.page,
|
||||
.post {
|
||||
margin-bottom: 4em;
|
||||
}
|
||||
|
||||
/* Blog post or page title */
|
||||
.page-title,
|
||||
.post-title,
|
||||
.post-title a {
|
||||
color: #303030;
|
||||
}
|
||||
.page-title,
|
||||
.post-title {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* Meta data line below post title */
|
||||
.post-date {
|
||||
display: block;
|
||||
margin-top: -.5rem;
|
||||
margin-bottom: 1rem;
|
||||
color: #9a9a9a;
|
||||
}
|
||||
|
||||
/* Related posts */
|
||||
.related {
|
||||
padding-top: 2rem;
|
||||
padding-bottom: 2rem;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
.related-posts {
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.related-posts h3 {
|
||||
margin-top: 0;
|
||||
}
|
||||
.related-posts li small {
|
||||
font-size: 75%;
|
||||
color: #999;
|
||||
}
|
||||
.related-posts li a:hover {
|
||||
color: #268bd2;
|
||||
text-decoration: none;
|
||||
}
|
||||
.related-posts li a:hover small {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Pagination
|
||||
*
|
||||
* Super lightweight (HTML-wise) blog pagination. `span`s are provide for when
|
||||
* there are no more previous or next posts to show.
|
||||
*/
|
||||
|
||||
.pagination {
|
||||
overflow: hidden; /* clearfix */
|
||||
margin-left: -1rem;
|
||||
margin-right: -1rem;
|
||||
font-family: "PT Sans", Helvetica, Arial, sans-serif;
|
||||
color: #ccc;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Pagination items can be `span`s or `a`s */
|
||||
.pagination-item {
|
||||
display: block;
|
||||
padding: 1rem;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.pagination-item:first-child {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
/* Only provide a hover state for linked pagination items */
|
||||
a.pagination-item:hover {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
@media (min-width: 30em) {
|
||||
.pagination {
|
||||
margin: 3rem 0;
|
||||
}
|
||||
.pagination-item {
|
||||
float: left;
|
||||
width: 50%;
|
||||
}
|
||||
.pagination-item:first-child {
|
||||
margin-bottom: 0;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
.pagination-item:last-child {
|
||||
margin-left: -1px;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
}
|
65
versions/2.3.0/public/css/syntax.css
Normal file
@ -0,0 +1,65 @@
|
||||
.highlight .hll { background-color: #ffc; }
|
||||
.highlight .c { color: #999; } /* Comment */
|
||||
.highlight .err { color: #a00; background-color: #faa } /* Error */
|
||||
.highlight .k { color: #069; } /* Keyword */
|
||||
.highlight .o { color: #555 } /* Operator */
|
||||
.highlight .cm { color: #09f; font-style: italic } /* Comment.Multiline */
|
||||
.highlight .cp { color: #099 } /* Comment.Preproc */
|
||||
.highlight .c1 { color: #999; } /* Comment.Single */
|
||||
.highlight .cs { color: #999; } /* Comment.Special */
|
||||
.highlight .gd { background-color: #fcc; border: 1px solid #c00 } /* Generic.Deleted */
|
||||
.highlight .ge { font-style: italic } /* Generic.Emph */
|
||||
.highlight .gr { color: #f00 } /* Generic.Error */
|
||||
.highlight .gh { color: #030; } /* Generic.Heading */
|
||||
.highlight .gi { background-color: #cfc; border: 1px solid #0c0 } /* Generic.Inserted */
|
||||
.highlight .go { color: #aaa } /* Generic.Output */
|
||||
.highlight .gp { color: #009; } /* Generic.Prompt */
|
||||
.highlight .gs { } /* Generic.Strong */
|
||||
.highlight .gu { color: #030; } /* Generic.Subheading */
|
||||
.highlight .gt { color: #9c6 } /* Generic.Traceback */
|
||||
.highlight .kc { color: #069; } /* Keyword.Constant */
|
||||
.highlight .kd { color: #069; } /* Keyword.Declaration */
|
||||
.highlight .kn { color: #069; } /* Keyword.Namespace */
|
||||
.highlight .kp { color: #069 } /* Keyword.Pseudo */
|
||||
.highlight .kr { color: #069; } /* Keyword.Reserved */
|
||||
.highlight .kt { color: #078; } /* Keyword.Type */
|
||||
.highlight .m { color: #f60 } /* Literal.Number */
|
||||
.highlight .s { color: #d44950 } /* Literal.String */
|
||||
.highlight .na { color: #4f9fcf } /* Name.Attribute */
|
||||
.highlight .nb { color: #366 } /* Name.Builtin */
|
||||
.highlight .nc { color: #0a8; } /* Name.Class */
|
||||
.highlight .no { color: #360 } /* Name.Constant */
|
||||
.highlight .nd { color: #99f } /* Name.Decorator */
|
||||
.highlight .ni { color: #999; } /* Name.Entity */
|
||||
.highlight .ne { color: #c00; } /* Name.Exception */
|
||||
.highlight .nf { color: #c0f } /* Name.Function */
|
||||
.highlight .nl { color: #99f } /* Name.Label */
|
||||
.highlight .nn { color: #0cf; } /* Name.Namespace */
|
||||
.highlight .nt { color: #2f6f9f; } /* Name.Tag */
|
||||
.highlight .nv { color: #033 } /* Name.Variable */
|
||||
.highlight .ow { color: #000; } /* Operator.Word */
|
||||
.highlight .w { color: #bbb } /* Text.Whitespace */
|
||||
.highlight .mf { color: #f60 } /* Literal.Number.Float */
|
||||
.highlight .mh { color: #f60 } /* Literal.Number.Hex */
|
||||
.highlight .mi { color: #f60 } /* Literal.Number.Integer */
|
||||
.highlight .mo { color: #f60 } /* Literal.Number.Oct */
|
||||
.highlight .sb { color: #c30 } /* Literal.String.Backtick */
|
||||
.highlight .sc { color: #c30 } /* Literal.String.Char */
|
||||
.highlight .sd { color: #c30; font-style: italic } /* Literal.String.Doc */
|
||||
.highlight .s2 { color: #c30 } /* Literal.String.Double */
|
||||
.highlight .se { color: #c30; } /* Literal.String.Escape */
|
||||
.highlight .sh { color: #c30 } /* Literal.String.Heredoc */
|
||||
.highlight .si { color: #a00 } /* Literal.String.Interpol */
|
||||
.highlight .sx { color: #c30 } /* Literal.String.Other */
|
||||
.highlight .sr { color: #3aa } /* Literal.String.Regex */
|
||||
.highlight .s1 { color: #c30 } /* Literal.String.Single */
|
||||
.highlight .ss { color: #fc3 } /* Literal.String.Symbol */
|
||||
.highlight .bp { color: #366 } /* Name.Builtin.Pseudo */
|
||||
.highlight .vc { color: #033 } /* Name.Variable.Class */
|
||||
.highlight .vg { color: #033 } /* Name.Variable.Global */
|
||||
.highlight .vi { color: #033 } /* Name.Variable.Instance */
|
||||
.highlight .il { color: #f60 } /* Literal.Number.Integer.Long */
|
||||
|
||||
.css .o,
|
||||
.css .o + .nt,
|
||||
.css .nt + .nt { color: #999; }
|
BIN
versions/2.3.0/public/favicon.ico
Normal file
After Width: | Height: | Size: 162 KiB |
BIN
versions/2.3.0/public/gh.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
versions/2.3.0/public/gh@2.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
94
versions/2.3.0/public/js/toc.js
Normal file
@ -0,0 +1,94 @@
|
||||
// https://github.com/ghiculescu/jekyll-table-of-contents
|
||||
(function($){
|
||||
$.fn.toc = function(options) {
|
||||
var defaults = {
|
||||
noBackToTopLinks: false,
|
||||
title: '<i>Jump to...</i>',
|
||||
minimumHeaders: 3,
|
||||
headers: 'h1, h2, h3, h4, h5, h6',
|
||||
listType: 'ol', // values: [ol|ul]
|
||||
showEffect: 'show', // values: [show|slideDown|fadeIn|none]
|
||||
showSpeed: 'slow' // set to 0 to deactivate effect
|
||||
},
|
||||
settings = $.extend(defaults, options);
|
||||
|
||||
function fixedEncodeURIComponent (str) {
|
||||
return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
|
||||
return '%' + c.charCodeAt(0).toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
var headers = $(settings.headers).filter(function() {
|
||||
// get all headers with an ID
|
||||
var previousSiblingName = $(this).prev().attr( "name" );
|
||||
if (!this.id && previousSiblingName) {
|
||||
this.id = $(this).attr( "id", previousSiblingName.replace(/\./g, "-") );
|
||||
}
|
||||
if (this.id == 'table-of-contents') {
|
||||
$(this).hide();
|
||||
$(this).next().hide();
|
||||
return false;
|
||||
}
|
||||
return this.id;
|
||||
}), output = $(this);
|
||||
if (!headers.length || headers.length < settings.minimumHeaders || !output.length) {
|
||||
$(this).hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if (0 === settings.showSpeed) {
|
||||
settings.showEffect = 'none';
|
||||
}
|
||||
|
||||
var render = {
|
||||
show: function() { output.hide().html(html).show(settings.showSpeed); },
|
||||
slideDown: function() { output.hide().html(html).slideDown(settings.showSpeed); },
|
||||
fadeIn: function() { output.hide().html(html).fadeIn(settings.showSpeed); },
|
||||
none: function() { output.html(html); }
|
||||
};
|
||||
|
||||
var get_level = function(ele) { return parseInt(ele.nodeName.replace("H", ""), 10); }
|
||||
var highest_level = headers.map(function(_, ele) { return get_level(ele); }).get().sort()[0];
|
||||
var return_to_top = '<i class="fa fa-chevron-up back-to-top"> </i>';
|
||||
|
||||
var level = get_level(headers[0]),
|
||||
this_level,
|
||||
html = settings.title + " <"+settings.listType+">";
|
||||
headers.on('click', function() {
|
||||
if (!settings.noBackToTopLinks) {
|
||||
window.location.hash = this.id;
|
||||
}
|
||||
})
|
||||
.addClass('clickable-header')
|
||||
.each(function(_, header) {
|
||||
this_level = get_level(header);
|
||||
if (!settings.noBackToTopLinks && this_level === highest_level) {
|
||||
$(header).addClass('top-level-header').after(return_to_top);
|
||||
}
|
||||
if (this_level === level) // same level as before; same indenting
|
||||
html += "<li><a href='#" + fixedEncodeURIComponent(header.id) + "'>" + header.innerHTML + "</a>";
|
||||
else if (this_level <= level){ // higher level than before; end parent ol
|
||||
for(i = this_level; i < level; i++) {
|
||||
html += "</li></"+settings.listType+">"
|
||||
}
|
||||
html += "<li><a href='#" + fixedEncodeURIComponent(header.id) + "'>" + header.innerHTML + "</a>";
|
||||
}
|
||||
else if (this_level > level) { // lower level than before; expand the previous to contain a ol
|
||||
for(i = this_level; i > level; i--) {
|
||||
html += "<"+settings.listType+"><li>"
|
||||
}
|
||||
html += "<a href='#" + fixedEncodeURIComponent(header.id) + "'>" + header.innerHTML + "</a>";
|
||||
}
|
||||
level = this_level; // update for the next one
|
||||
});
|
||||
html += "</"+settings.listType+">";
|
||||
if (!settings.noBackToTopLinks) {
|
||||
$(document).on('click', '.back-to-top', function() {
|
||||
$(window).scrollTop(0);
|
||||
window.location.hash = '';
|
||||
});
|
||||
}
|
||||
|
||||
render[settings.showEffect]();
|
||||
};
|
||||
})(jQuery);
|