diff options
Diffstat (limited to 'public/esp8266-and-micropython-guide.html')
| -rwxr-xr-x | public/esp8266-and-micropython-guide.html | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/public/esp8266-and-micropython-guide.html b/public/esp8266-and-micropython-guide.html index d0d007f..e894226 100755 --- a/public/esp8266-and-micropython-guide.html +++ b/public/esp8266-and-micropython-guide.html | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <!doctype html><html lang=en-us><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="JBMAFP - github.com/mitjafelicijan/jbmafp"><link href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL69vf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv76+/8LBwQkAAAAAAAAAAAAAAAC+vb3/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL+9vf/Bv78JAAAAAAAAAAAAAAAAu7q6/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC7ubr/vr29CAAAAAAAAAAAy8nJAZ6foP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnqGj/6GipAoAAAAAHLjU/xcXHf/BwsL/I8XY/yPK3v8XGiD/IbjL/yPF2f8XGiD/Fxkf/yLF2f8gnK3/Fxog/62ztv8fwNf/FRcd/x271v8mz93/GRsi/xkXHf8p097/GiIp/xobIv8p0t3/KdPe/xocIv8fYmr/KNPe/xoZH/8aHCL/J87c/xy81/8VFxz/IsPZ/8zS0/8XGiD/Ir/R/yPH2/8XGiD/Fxkf/yPH2/8dd4T/GBog/yPJ3f8jyNr/uru9/xcUGv8cudb/EhITDKi5vRKlvMP/RUpOERwcHRAdOj4QHTk8EBwdHRAdNTgQHTo/EBwcHRAcHB0QSGduEKW4vf+koqQfHzg+EBqz0ewSFRv7EyMr/xq51vsTERb7ExUb+xq41fsau9j7ExUb+xiPp/sZudb7ExUb+xMVG/sZuNX/GKvI/BIUGfMdvdn/IrfL/xcaIP8n1eb/J9Dh/xkcIf8ZGR7/J8/f/xxCSv8ZGyH/J9Dg/ybQ4P8ZHCL/FSQs/yPK3/8UExj/GE1b/ybS5P8ZGB7/Ghwj/ynW5P8p2Ob/Ghwi/yWrtv8p1eH/Ghwi/xocIv8p1uT/J8XT/xkcIv8m1un/Hb7d/xUYH/8hzOr/HtHu/xcaIf8XGB//I8vi/xgxOv8XGSD/I8rg/yPK4P8XGiD/GUFL/yPP6f8SERj/Fhkh/x3A4f8AAAAAJ2f9/ydr//8mZPH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlYu38J2v//ydo/f8AAAAAAAAAAAd8/fkFqf//Iob8sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMY39awWr//8FfP3/AAAAAAAAAAAFm/7/SfD//wR+/f8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOB/f9B7v//BaX+/wAAAAAAAAAAQ878SAyZ/v9n1v4KAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADu9v8DDJb+/z3N/XgAAAAA3/sAAN/7AADf+wAA3/sAAAAAAAAAAAAAAAAAAN/7AAAAAAAAAAAAAAAAAAAAAAAAj/EAAI/5AACP8QAA3/sAAA==" rel=icon type=image/x-icon><title>Getting started with MicroPython and ESP8266</title><meta name=description content="IntroductionA while ago I bought someESP8266 andESP32 dev boards to playaround with and I finally found a project to try it out."><link rel=alternate type=application/rss+xml title="Mitja Felicijan's posts" href=https://mitjafelicijan.com/index.xml><link rel=alternate type=application/rss+xml title="Mitja Felicijan's notes" href=https://mitjafelicijan.com/notes.xml><style>:root{--border-color:gainsboro;--border-size:2px;--link-color:blue;--bg-color:#eee}body{padding:2.5rem;max-width:1900px;background:#fff;font-family:sans-serif;line-height:1.35rem;font-size:16px}hr{border:0;border-bottom:var(--border-size)solid var(--border-color);margin-block-start:1.5rem}a{color:var(--link-color);text-decoration:none}h1,h2,h3{line-height:initial}h1{font-size:xx-large}footer{margin-block-start:2rem}cap{text-transform:capitalize}blockquote{font-style:italic}table{max-width:100%;border:var(--border-size)solid var(--border-color);border-collapse:separate;border-spacing:0}table thead tr th{border-bottom:var(--border-size)solid var(--border-color);text-align:left}table th,table td{padding:.5em .8em}ul.list li{padding:.2em 0}ul{line-height:1.35em}pre{text-wrap:nowrap;overflow-x:auto;padding:0 1em;border:var(--border-size)solid var(--border-color)}code{padding:0 3px;font-size:14px;border:0;background:var(--bg-color)}pre code{line-height:1.3em;background:#fff}pre,code,pre *,code *{font-family:monospace}figure{margin-inline-start:0;margin-inline-end:0}figcaption{text-align:center}figcaption p{margin:.3em 0 0}img,video,audio{width:800px;max-width:100%}header nav{display:flex;gap:.9rem}audio::-webkit-media-controls-enclosure{border-radius:0}@media only screen and (max-width:600px){body{padding:.5em;word-wrap:break-word}header nav{gap:.7rem}header nav .hob{display:none}a{word-wrap:break-word}}</style><header><nav class=main itemscope itemtype=http://schema.org/SiteNavigationElement role=toolbar><a href=/>Home</a> | 1 | <!doctype html><html lang=en-us><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="JBMAFP - github.com/mitjafelicijan/jbmafp"><link href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL69vf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv76+/8LBwQkAAAAAAAAAAAAAAAC+vb3/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL+9vf/Bv78JAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOB/f9B7v//BaX+/wAAAAAAAAAAQ878SAyZ/v9n1v4KAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADu9v8DDJb+/z3N/XgAAAAA3/sAAN/7AADf+wAA3/sAAAAAAAAAAAAAAAAAAN/7AAAAAAAAAAAAAAAAAAAAAAAAj/EAAI/5AACP8QAA3/sAAA==" rel=icon type=image/x-icon><title>Getting started with MicroPython and ESP8266</title><meta name=description content="IntroductionA while ago I bought someESP8266 andESP32 dev boards to playaround with and I finally found a project to try it out."><meta name=author content="Mitja Felicijan"><link rel=alternate type=application/rss+xml title="Mitja Felicijan's posts" href=https://mitjafelicijan.com/index.xml><link rel=alternate type=application/rss+xml title="Mitja Felicijan's notes" href=https://mitjafelicijan.com/notes.xml><style>:root{--border-color:gainsboro;--border-size:2px;--link-color:blue;--bg-color:#eee}body{padding:2.5rem;max-width:1900px;background:#fff;font-family:sans-serif;line-height:1.35rem;font-size:16px}hr{border:0;border-bottom:var(--border-size)solid var(--border-color);margin-block-start:1.5rem}a{color:var(--link-color);text-decoration:none}h1,h2,h3{line-height:initial}h1{font-size:xx-large}footer{margin-block-start:2rem}cap{text-transform:capitalize}blockquote{font-style:italic}table{max-width:100%;border:var(--border-size)solid var(--border-color);border-collapse:separate;border-spacing:0}table thead tr th{border-bottom:var(--border-size)solid var(--border-color);text-align:left}table th,table td{padding:.5em .8em}ul.list li{padding:.2em 0}ul{line-height:1.35em}pre{text-wrap:nowrap;overflow-x:auto;padding:0 1em;border:var(--border-size)solid var(--border-color)}code{padding:0 3px;font-size:14px;border:0;background:var(--bg-color)}pre code{line-height:1.3em;background:#fff}pre,code,pre *,code *{font-family:monospace}figure{margin-inline-start:0;margin-inline-end:0}figure img{}figcaption{text-align:center}figcaption p{margin:.3em 0 0}img,video,audio{width:800px;max-width:100%;border:var(--border-size)solid var(--border-color);padding:.5em}header nav{display:flex;gap:.9rem}article iframe{margin:0!important}audio::-webkit-media-controls-enclosure{border-radius:0}@media only screen and (max-width:600px){body{padding:.5em;word-wrap:break-word}header nav{gap:.7rem}header nav .hob{display:none}a{word-wrap:break-word}}</style><header><nav class=main itemscope itemtype=http://schema.org/SiteNavigationElement role=toolbar><a href=/>Home</a> |
| 2 | <a href=/#posts>Posts</a> | 2 | <a href=/#posts>Posts</a> |
| 3 | <a href=/#notes>Notes</a> | 3 | <a href=/#notes>Notes</a> |
| 4 | <a href=/#sideprojects class=hob>Side Projects</a> | 4 | <a href=/#sideprojects class=hob>Side Projects</a> |
| @@ -13,7 +13,7 @@ around with and I finally found a project to try it out.<p>For my project, I use | |||
| 13 | but I could easily choose | 13 | but I could easily choose |
| 14 | <a href=https://www.espressif.com/en/products/socs/esp8266>ESP8266</a>. This guide | 14 | <a href=https://www.espressif.com/en/products/socs/esp8266>ESP8266</a>. This guide |
| 15 | contains which tools I use and how I prepared my workspace to code for | 15 | contains which tools I use and how I prepared my workspace to code for |
| 16 | <a href=https://www.espressif.com/en/products/socs/esp8266>ESP8266</a>.<figure><img loading="lazy" src=/posts/esp8366-micropython/boards.jpg alt="ESP8266 and ESP32 boards"></figure><p>This guide covers:<ul><li>flashing SOC<li>install proper tooling<li>deploying a simple script</ul><blockquote><p>Make sure that you are using <strong>a good USB cable</strong>. I had some problems with | 16 | <a href=https://www.espressif.com/en/products/socs/esp8266>ESP8266</a>.<figure><img src=/posts/esp8366-micropython/boards.jpg alt="ESP8266 and ESP32 boards"></figure><p>This guide covers:<ul><li>flashing SOC<li>install proper tooling<li>deploying a simple script</ul><blockquote><p>Make sure that you are using <strong>a good USB cable</strong>. I had some problems with |
| 17 | mine and once I replaced it everything started to work.</blockquote><h2 id=flashing-the-soc>Flashing the SOC</h2><p>Plug your ESP8266 to USB port and check if the device was recognized with | 17 | mine and once I replaced it everything started to work.</blockquote><h2 id=flashing-the-soc>Flashing the SOC</h2><p>Plug your ESP8266 to USB port and check if the device was recognized with |
| 18 | executing <code>dmesg | grep ch341-uart</code>.<p>Then check if the device is available under <code>/dev/</code> by running <code>ls /dev/ttyUSB*</code>.<blockquote><p><strong>Linux users</strong>: if a device is not available be sure you are in <code>dialout</code> | 18 | executing <code>dmesg | grep ch341-uart</code>.<p>Then check if the device is available under <code>/dev/</code> by running <code>ls /dev/ttyUSB*</code>.<blockquote><p><strong>Linux users</strong>: if a device is not available be sure you are in <code>dialout</code> |
| 19 | group. You can check this by executing <code>groups $USER</code>. You can add a user to | 19 | group. You can check this by executing <code>groups $USER</code>. You can add a user to |
| @@ -36,8 +36,7 @@ REPL.</blockquote><p>When you are in REPL you can test if all is working properl | |||
| 36 | <code>80000000</code>).<p>When you are in <code>screen</code> or <code>picocom</code> these can help you a bit.<table><thead><tr><th>Key<th>Command<tbody><tr><td>CTRL+d<td>preforms soft reboot<tr><td>CTRL+a x<td>exits picocom<tr><td>CTRL+a \<td>exits screen</table><h2 id=install-better-tooling>Install better tooling</h2><p>Now, to make our lives a little bit easier there are couple of additional tools | 36 | <code>80000000</code>).<p>When you are in <code>screen</code> or <code>picocom</code> these can help you a bit.<table><thead><tr><th>Key<th>Command<tbody><tr><td>CTRL+d<td>preforms soft reboot<tr><td>CTRL+a x<td>exits picocom<tr><td>CTRL+a \<td>exits screen</table><h2 id=install-better-tooling>Install better tooling</h2><p>Now, to make our lives a little bit easier there are couple of additional tools |
| 37 | that will make this whole experience a little more bearable.<p>There are twq cool ways of uploading local files to SOC flash.<ul><li>ampy → <a href=https://github.com/scientifichackers/ampy>https://github.com/scientifichackers/ampy</a><li>rshell → <a href=https://github.com/dhylands/rshell>https://github.com/dhylands/rshell</a></ul><h3 id=ampy>ampy</h3><pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:green># installing ampy</span> | 37 | that will make this whole experience a little more bearable.<p>There are twq cool ways of uploading local files to SOC flash.<ul><li>ampy → <a href=https://github.com/scientifichackers/ampy>https://github.com/scientifichackers/ampy</a><li>rshell → <a href=https://github.com/dhylands/rshell>https://github.com/dhylands/rshell</a></ul><h3 id=ampy>ampy</h3><pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:green># installing ampy</span> |
| 38 | </span></span><span style=display:flex><span>sudo pip3 install adafruit-ampy | 38 | </span></span><span style=display:flex><span>sudo pip3 install adafruit-ampy |
| 39 | </span></span></code></pre><p>Listed below are some common commands I used.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span> | 39 | </span></span></code></pre><p>Listed below are some common commands I used.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:green># uploads file to flash</span> |
| 40 | </span></span><span style=display:flex><span><span style=color:green># uploads file to flash</span> | ||
| 41 | </span></span><span style=display:flex><span>ampy --delay 2 --port /dev/ttyUSB0 put boot.py | 40 | </span></span><span style=display:flex><span>ampy --delay 2 --port /dev/ttyUSB0 put boot.py |
| 42 | </span></span><span style=display:flex><span> | 41 | </span></span><span style=display:flex><span> |
| 43 | </span></span><span style=display:flex><span><span style=color:green># lists file on flash</span> | 42 | </span></span><span style=display:flex><span><span style=color:green># lists file on flash</span> |
