{"id":13312,"date":"2016-09-19T23:26:56","date_gmt":"2016-09-20T03:26:56","guid":{"rendered":"http:\/\/scruss.com\/blog\/?p=13312"},"modified":"2016-09-19T23:26:56","modified_gmt":"2016-09-20T03:26:56","slug":"esp8266-basic-is-seriously-neat","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2016\/09\/19\/esp8266-basic-is-seriously-neat\/","title":{"rendered":"ESP8266 BASIC is seriously neat!"},"content":{"rendered":"<p><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-27-57.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13316\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-27-57.png\" alt=\"screenshot-from-2016-09-19-22-27-57\" width=\"527\" height=\"701\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-27-57.png 527w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-27-57-120x160.png 120w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-27-57-241x320.png 241w\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" \/><\/a>That picture might not look much, but it&#8217;s doing something rather wonderful. It&#8217;s a tiny <a href=\"https:\/\/www.esp8266basic.com\/\">ESP8266 BASIC<\/a> script running on a super-cheap ESP8266 wifi module. The code draws a clock that&#8217;s synced to an NTP server. ESP8266 BASIC graphic commands are built from SVG, so anything you can draw on the screen can also be saved as a vector graphic:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/saved0.svg\" width=\"500\" \/><\/p>\n<p>The runtime includes a simple textarea editor that saves code to the board&#8217;s flash:<\/p>\n<p><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-28-53.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13314\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-28-53.png\" alt=\"screenshot-from-2016-09-19-22-28-53\" width=\"527\" height=\"701\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-28-53.png 527w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-28-53-120x160.png 120w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-28-53-241x320.png 241w\" sizes=\"auto, (max-width: 527px) 100vw, 527px\" \/><\/a>(and yes, that first line is all you need to set up NTP sync)<\/p>\n<p>Among other features, ESP8266 BASIC has a simple but useful variable display:<\/p>\n<p><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-30-17.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13313\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-30-17.png\" alt=\"screenshot-from-2016-09-19-22-30-17\" width=\"657\" height=\"701\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-30-17.png 657w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-30-17-150x160.png 150w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/09\/Screenshot-from-2016-09-19-22-30-17-300x320.png 300w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/a>I&#8217;d picked up a <em>(<a href=\"http:\/\/www.dx.com\/p\/esp8266-esp-12e-development-board-module-usable-with-arduino-ide-w-built-in-ch340g-driver-ic-412487\">possible knock-off<\/a> of a)<\/em> <a href=\"http:\/\/www.wemos.cc\/Products\/d1.html\">WeMos D1<\/a> ESP8266 board in Arduino form factor a few months ago. The <a href=\"https:\/\/www.arduino.cc\/en\/Main\/Software\">Arduino.cc Software<\/a> now supports ESP8266 directly, so it&#8217;s much easier to program. Flashing the BASIC code to the board was very simple, as I&#8217;d noticed that the Arduino IDE printed all of its commands to the console. All I needed to do was <a href=\"https:\/\/github.com\/esp8266\/Basic\/tree\/NewWebSockets\/Flasher\/Build\">download an ESP8266 BASIC Binary<\/a>, and then run a modified Arduino upload line from the terminal:<\/p>\n<pre>~\/.arduino15\/packages\/esp8266\/tools\/esptool\/0.4.9\/esptool -vv -cd nodemcu -cb 921600 -cp \/dev\/ttyUSB2 -ca 0x00000 -cf ESP8266Basic.cpp.bin<\/pre>\n<p>ESP8266 BASIC starts in wireless access point mode, so you&#8217;ll have to connect to the network it provides initially. Under <strong>Settings<\/strong> you can enter your normal network details, and it will join your wifi network on next reboot. I just hope it doesn&#8217;t wander around my network looking for things to steal \u00e2\u20ac\u00a6<\/p>\n","protected":false},"excerpt":{"rendered":"<p>That picture might not look much, but it&#8217;s doing something rather wonderful. It&#8217;s a tiny ESP8266 BASIC script running on a super-cheap ESP8266 wifi module. The code draws a clock that&#8217;s synced to an NTP server. ESP8266 BASIC graphic commands are built from SVG, so anything you can draw on the screen can also be [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[2207,2062,1946,3009,3010],"class_list":["post-13312","post","type-post","status-publish","format-standard","hentry","category-computers-suck","tag-arduino","tag-basic","tag-clock","tag-esp8266","tag-ntp"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-3sI","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/13312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=13312"}],"version-history":[{"count":2,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/13312\/revisions"}],"predecessor-version":[{"id":13318,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/13312\/revisions\/13318"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=13312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=13312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=13312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}