As part of my IoT book, I showed how to use both a Raspberry Pi and Tessel to generate data and send it to Azure for processing. The awesome Tech Reviewers of my book suggested that I also show one other common board simply because the other two boards may not be generally available in some countries. One of the boards they suggested was an Arduino board from Adafruit. Adafruit sells several IoT Starter Kits for Microsoft Azure, including this Adafruit Feather HUZZAH board and kit.
Unfortunately, there wasn't time to get the Adafruit example into the chapter for the book, but I did mention in the chapter that I would include the Adafruit example in my blog. Thus, the reason for this post and a few other posts to show how to use an Adafruit board in an Azure IoT scenario.
Like the Tessel blogs, I'll break this up into several posts so there isn't a single massive blog. This post will show how to connect it up to your PC and get it working. The reason for this is that the instructions for doing this on the web is spread out amongst many different web sites (MSDN and Arduino) and so it can take some time to figure it all out. Plus, some of the links on the sites are incorrect and make the setup and configuration confusing. This post will break it all down into a few easy steps. Further blog posts will show how to connect the sensor and send the data to Azure.
To get started, you first need to download a couple of items:
The USB driver is needed to have the COM/Serial port appear and work properly with the Arduino board, and the Arduino IDE is used to configure the Arduino board as well as to author and deploy code to the board.
I don't think it matters when the Arduino needs to be connected, but I installed the software first because it recommends that you restart the PC after installing and configuring everything. Thus, go ahead and install both the Arduino IDE software and the USB driver software. The USB driver install is extremely quick and the Arduino IDE install isn't much longer.
Once the installs complete, launch the Arduino IDE program because you need to select and configure the appropriate board. From the Tools menu, you'll notice that the Adafruit feather HAZZAH ESP8266 board is not listed.
Thus, the next step is to install the ESP8266 Board package which includes all the necessary drivers to communicate with the HAZZAH board. So, from the File menu, select Preferences and enter the following URL into the Additional Boards Manager URL box:
Click OK on the Preferences dialog, then from the Tools menu, select Board -> Boards Manager
In the Boards Manager dialog, scroll down to the very bottom of the list and select the esp8266 by ESP8266 Community driver and click Install. The latest version is 2.3.0.
Once the installation is complete, close the Boards Manager dialog and then close the Arduino IDE program. At this point I would reboot the PC. Is it necessary? I have no idea but I did it anyway. Plus, one of the web sites says "When you've restarted, …" but it doesn't say what to restart. One can assume, but hey…
Anyway, once you're restarted whatever you restarted, plug in the HAZZAH to the breadboard then connect the HAZZAH to power via the USB cable.
Next, start up the Arduino IDE again and from the Tools menu, select Board: and you'll see the Adafruit HAZZAH ESP8266 listed.
Next, from the Tools menu, you'll need to configure the CPU Frequency, Flash Size, Upload Speed, and Port. For the HAZZAH ESP8266, select 80 MHz for the CPU Frequency, and4M (3M SPIFFS) for the Flash Size. For the Upload speed, I have selected 256000, but it works great with 115200 as well and according to the documentation, 921600 also works but may fail on occasion. I have had great success with 256000. For the Port, select the appropriate port your HUZZAH is plugged in to.
At this point your configuration is all set and it's time to run a test. Back in the Arduino IDE, replace the default code in the Sketch window with the following code, then click the Upload button. The IDE will ask you to save the file. You don't need to, simply click cancel and it will still deploy the code to the Feather HUZZAH (it just won't save the file).
After several seconds, the blue LED on the feather HUZZAH will start to blink. In Part 2 of this series I will show how to hook up the temperature sensor.