You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Being a collection of digital scribbles on my adventures with Adafruit and Mac OS, with many diversions into the nature of serial ports, &c., which may be useful to the less patient practitioner
Because gist file order is ASCIIbetical:
notes on individual Feathers are in files with no prefix
notes on FeatherWings and other boards are prefixed with ~ to push them below the Feather notes
general notes are prefixed with ! to keep them near the top
Note: all cardinal directions here (e.g. north, southeast, etc.) refer to the board in this orientation and assume "north" is "up" towards the top of this pic
I got this board to play with, particularly for the ESP8266 platform. I played with it while waiting for some other CircuitPython gear to arrive. Learned a bit of NodeMCU Lua, and a bit of Arduino IDE. Bricked it, reflashed to NodeMCU, and am setting it aside for a while.
Basic Setup
Needed: micro USB cable, breadboard, Adafruit Feather board
Plug HUZZAH Feather into breadboard for its own protection and your future fun times
Connect micro USB cable from Mac to Feather. Red and blue LEDs will flash to show the Feather has powered up and reset.
OPTIONAL: Press the reset button just southeast of the micro USB port and watch the red and blue LEDs flash some more. This is good practice for later.
OPTIONAL: Ground the RST pin (bottom, furthest left) for a moment and watch the red and blue LEDs flash some more. Congratulations, you don't need no steenkin' switches!
Install CP2104 driver as on adafruit page. I'm not sure if this is actually required if you're using CoolTerm but I'd already installed it, so I'll include it here.
OPTIONAL (but highly recommended): Install HomeBrew if you don't already have it installed. It'll make some things much easier, I promise.
Using NodeMCU Lua
NodeMCU was developed specifically for the ESP8266, so if you'll be playing with ESP8266 boards a lot it probably pays to get comfy in it. It was a board of convenience for me, so I'll make more investment later.
You can choose to use their cloud build facilities; I decided to go the whole way and install a full build toolchain. That was dumb (see second failed attempt, below), so I went back to using the cloud build.
Enter your email. I suffixed mine with +nodemcu (e.g. you**+nodemcu**@example.com) because I'm needlessly paranoid about email lists getting out there, and it's nice to be able to filter or spam-trap them.
Configure which modules you want. I went wild the first time, and the build system sent me to a shame page for enabling too many. In the end, I enabled adc, bit, file, gpio, http, i2c, net, node, rtcfifo, rtcmem, rtctime, sjson, sntp, tmr, uart, wifi, tls
Click the Build button
See the confirmation email in your inbox
OPTIONAL: Donate while waiting by clicking the Donation button
See the "Build Complete" email arrive
Download the float and integer firmware .bin files linked in the email
Open the DMG and copy the application to the Applications folder
Find the app in the Applications folder and ctrl-click (aka right click) to choose Open. This avoids MacOS refusing to open it because it's not a signed app from a known developer.
Configure to pull the firmware you want, etc.
Click the "Flash NodeMCU" button
Note: I tried the integer.bin first and got garbage prompts on reset. This smelled like baud mismatch, so I upped the CoolTerm config to 115200 and reset again, et voila! — a misspent youth playing with modems finally pays off!
Since my purpose was to play with CircuitPython,
Notes from first failed attempt
Install a sha1sum tool; I did brew install md5sha1sum
Once I was this far in and discovered that it didn't in fact install the missing xtensa-lx106-elf-ar but instead xtensa-esp32-elf-ar it became clear I was in over my head (or at least would spend more time learning arcane spells than playing with the board) so I stopped, leaving everything installed to maybe look at another time. If I do, I should start here and here and maybe dig deeper at this.
Using the Arduino IDE
NOTE: THIS WILL REMOVE NodeMCU ... if that bothers you, read on. Arduino IDE essentially compiles your code ("sketch") and uploads it to the firmware of the Feather. This means your code will run immediately upon power up, which is handy; it also means that playing around iteratively is a compile-upload-autoreset process that takes ~20 seconds for trivial examples like the blink test. If you don't mind learning and writing Lua, that provides more immediate gratification. However, the Arduino IDE path has more instant support and better tools, so I'm going this way for a while.
Additional note: I played, reached a config with code that didn't emit, and realized I was going to have to learn all about Arduino IDE and how to debug with it ... which isn't why I came here, so I stopped and reflashed with NodeMCU to leave the board in a happy state for later play. That took a bit, but is now done and relatively documented above.
If you didn't install the CP2104 driver in the Basic Setup section, you'll want to do that now using the instructions from the adafruit page. Go ahead, I'll wait. It takes a while as it has to reindex all drivers afterwards.
Install the Arduino IDE using HomeBrew. brew cask install arduino
Open the "Arduino" app
Add the esp8266 community package to the Boards Manager
Open "Preferences"
Add http://arduino.esp8266.com/stable/package_esp8266com_index.json to "Additional Boards Manager URLs" near bottom of the Preferences dialog
OPTIONAL: Change Sketchbook location if you prefer it elsewhere; it defaults to ~/Documents/Arduino
Add the esp8266 board package
Open Tools -> Board: (ignore the name)" -> Boards Manager
Scroll all the way to the bottom where you'll see "esp8266"
Hover over that entry and you'll see a version menu that defaults to the latest version and an "Install" button
Click the Install button. Wait a long time for the packages and tools to install.
Close the Boards Manager
Quit and restart the Arduino app? (based on "When you've restarted" and the fact that the app initializes packages at startup. Don't know if this is required or not)
Configure the board
Go to "Tools -> Board: (ignore name)" and choose "Adafruit Feather HUZZAH ESP8266"
Click the Tools menu again, and you should see all the board config params in the menu
Check that CPU Frequency is "80 MHz"
Set port to "/dev/cu.SLAB_USBtoUART"
OPTIONAL: Set Upload Speed to something between 115200 and 921600. The article mentions that they had successes and failures at 921Kbaud, so I chose to leave it at the default 115200 for my first flash. Then I realized how this all works and set it to 921Kbaud.
Troubleshooting
My upload fails complaining that there's no python3 but I can type python3 in a terminal and it works. WTF?
I had this problem, and couldn't google my way to a solid solution. I use pyenv which puts python3 in /usr/local/bin; additionally, the pyenv shims in ~/.pyenv/shims/ are first in my $PATH. So this is clearly a path problem.
It turns out that esp8266 installs tools in ~/Library/Arduino15/packages/esp8266/tools/, including an unhelpful python script called (!) ~/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 that looks like this:
Couldn't figure out how to manipulate $PATH so I gave up, and did:
cd ~/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1
mv python3 python3.py
ln -s /usr/local/bin/python3 .
Maybe one day I'll return to this, figure out the path or pyenv incompatibility, and submit a PR. Closest related issue I could find was this one.
Using the Arduino CLI
To come, when I'm smart enough to know how to use it.
TODOs for Future Me (or Current You?)
Which points out the undiscovered country, providing areas as yet unexplored for the intrepid adventurer
HUZZAH ESP8266
Explore the wifi functionality more than just connect and suck down a page
See how long a battery lasts if you wake, collect metrics ~1x/minute, check for threshold, and send data periodically (and check in periodically as well)