{"id":354,"date":"2018-01-29T21:36:48","date_gmt":"2018-01-30T02:36:48","guid":{"rendered":"http:\/\/factormystic.net\/blog\/?p=354"},"modified":"2018-02-03T14:09:09","modified_gmt":"2018-02-03T19:09:09","slug":"hello-world-with-a-wemos-d1-esp8266","status":"publish","type":"post","link":"https:\/\/factormystic.net\/blog\/hello-world-with-a-wemos-d1-esp8266","title":{"rendered":"&#8220;Hello World&#8221; with a WeMos D1 ESP8266"},"content":{"rendered":"<p>I thought it might be fun to play around with programmable microcontrollers, so I bought some to play with. One of the most popular chips right now is the ESP8266 which I first saw pop up <a href=\"https:\/\/hackaday.com\/2014\/08\/26\/new-chip-alert-the-esp8266-wifi-module-its-5\/\">on Hack-a-day in 2014<\/a>. I had to search backwards through 47 pages of blog posts that have been made in the meantime &#8212; that might give you a sense of its popularity.<\/p>\n<p>I played around with PIC16\/PIC18s in the early 2000s but never actually made anything, but the interest has been there. It&#8217;s also been my long time desire to create an E-ink weather display (once again thanks to <a href=\"https:\/\/hackaday.com\/2012\/10\/21\/hacked-kobo-becomes-a-weather-display\/\">an old Hack-a-day post<\/a>, this one from 2012. That&#8217;s how far behind on projects I am). Recently I noticed some inexpensive E-ink development boards on Aliexpress and decided to jump into a less shallow end of the pool. I had also been following the <a href=\"https:\/\/github.com\/esp8266\/Arduino\/\">ESP8266 for Arduino<\/a> repo on Github, so I vaguely knew where to begin.<\/p>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 50%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div id='gallery-1' class='gallery galleryid-354 gallery-columns-2 gallery-size-thumbnail'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/factormystic.net\/blog\/hello-world-with-a-wemos-d1-esp8266\/front-2018-01-29-at-7-29-51-pm'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/front-2018-01-29-at-7.29.51-PM-150x150.jpeg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/><\/a>\n\t\t\t<\/dt><\/dl><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/factormystic.net\/blog\/hello-world-with-a-wemos-d1-esp8266\/back-2018-01-29-at-7-29-51-pm'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/back-2018-01-29-at-7.29.51-PM-150x150.jpeg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" aria-describedby=\"gallery-1-356\" \/><\/a>\n\t\t\t<\/dt>\n\t\t\t\t<dd class='wp-caption-text gallery-caption' id='gallery-1-356'>\n\t\t\t\tWeMos D1 ESP8266\n\t\t\t\t<\/dd><\/dl><br style=\"clear: both\" \/>\n\t\t<\/div>\n\n<p>This evening I received the hardware (specifically, three of <a href=\"https:\/\/www.aliexpress.com\/item\/1PCS-D1-mini-V2-Mini-NodeMcu-4M-bytes-Lua-WIFI-development-ESP8266-by-WeMos\/32754697134.html\">these<\/a>) and decided to see if I could get a basic program deployed, just to get started. I don&#8217;t really know what I&#8217;m doing but I&#8217;m pretty good at reading &amp; following directions (that counts for a lot in life).<\/p>\n<p>The basics are:<\/p>\n<p>1. Follow the &#8220;Installing with Boards Manager&#8221; directions here: <a href=\"https:\/\/github.com\/esp8266\/Arduino\/\">https:\/\/github.com\/esp8266\/Arduino\/<\/a> (which includes grabbing the latest Arduino IDE software, then pulling in the ESP8266 chip configuration, which includes the WeMos D1 mini board configuration.<\/p>\n<p>2. From WeMos&#8217; website, grab the driver for the on-board USB\/programmer chip, which for me was the CH240G (<a href=\"https:\/\/wiki.wemos.cc\/tutorials:get_started:get_started_in_arduino\">https:\/\/wiki.wemos.cc\/tutorials:get_started:get_started_in_arduino<\/a>). Nothing more &#8220;exciting&#8221; than installing Chinese device driver software!<\/p>\n<p>3. I got a little tripped up here, but later figured it out- when you plug one of the D1 boards into your PC via USB, it&#8217;ll show up as a COM Port in Device Manager. You have to pick that same COM Port in the Arduino IDE or it can&#8217;t find your board to deploy to. This was a little confusing because it won&#8217;t show up until you&#8217;re plugged in. <a href=\"https:\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/esp8266-com-port-picker.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-355\" src=\"\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/esp8266-com-port-picker.png\" alt=\"picking the right com port in the arduino ide\" width=\"1420\" height=\"950\" srcset=\"https:\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/esp8266-com-port-picker.png 1420w, https:\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/esp8266-com-port-picker-300x200.png 300w, https:\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/esp8266-com-port-picker-1024x685.png 1024w, https:\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/esp8266-com-port-picker-624x417.png 624w\" sizes=\"auto, (max-width: 1420px) 100vw, 1420px\" \/><\/a><\/p>\n<p>4. The Arduino IDE comes with the ability to load in example programs from the board configuration, loaded in Step 1. I wanted the simplest possible thing to make sure everything was working, so picked the &#8220;Hello World&#8221; of microcontroller programs: &#8220;Blink&#8221;, which toggles the power LED in an infinite loop.<\/p>\n<div style=\"width: 480px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-354-1\" width=\"480\" height=\"848\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/hello-world-2018-01-29-8.52.07-PM.mp4?_=1\" \/><a href=\"https:\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/hello-world-2018-01-29-8.52.07-PM.mp4\">https:\/\/factormystic.net\/blog\/wp-content\/uploads\/2018\/01\/hello-world-2018-01-29-8.52.07-PM.mp4<\/a><\/video><\/div>\n<p>So far, so good! All told, this took about an hour from opening the package to getting the light to blink (which includes scrounging around for a good USB cable and trying to get a in-focus pictures).<\/p>\n<p>As you can see, I didn&#8217;t even bother to solder on the headers yet. I will do that, but I think next I will look into getting some wifi code up and running.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I thought it might be fun to play around with programmable microcontrollers, so I bought some to play with. One of the most popular chips right now is the ESP8266 which I first saw pop up on Hack-a-day in 2014. I had to search backwards through 47 pages of blog posts that have been made [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"class_list":["post-354","post","type-post","status-publish","format-standard","hentry","category-esp8266"],"_links":{"self":[{"href":"https:\/\/factormystic.net\/blog\/wp-json\/wp\/v2\/posts\/354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/factormystic.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/factormystic.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/factormystic.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/factormystic.net\/blog\/wp-json\/wp\/v2\/comments?post=354"}],"version-history":[{"count":7,"href":"https:\/\/factormystic.net\/blog\/wp-json\/wp\/v2\/posts\/354\/revisions"}],"predecessor-version":[{"id":385,"href":"https:\/\/factormystic.net\/blog\/wp-json\/wp\/v2\/posts\/354\/revisions\/385"}],"wp:attachment":[{"href":"https:\/\/factormystic.net\/blog\/wp-json\/wp\/v2\/media?parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/factormystic.net\/blog\/wp-json\/wp\/v2\/categories?post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/factormystic.net\/blog\/wp-json\/wp\/v2\/tags?post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}