Windows 10 Core and Azure IoT Hub

I recently had the opportunity to follow an IoT Lab following the instructions provided in the Nightlight workshop, as found here: http://thinglabs.io/workshop/cs/nightlight/. No need to say, I jumped on the opportunity to learn about Windows 10 Core and have some fun with direct Azure integration with live Power BI reporting in the backend.

You will need the Azure IoT kit in order to go through this lab: https://www.adafruit.com/products/2733 – it costs a bit over $100; money well spent! In the box, you will find a Raspberry Pi2, a breadboard, and electronic components to build a nightlight.

WP_20160412_005

The first thing I needed to do was to upgrade my Windows development laptop from Windows 8 to Windows 10. The process was smooth and everything was compatible, including my Visual Studio 2015 installation (which is required for this lab). Actually, one thing to note here is that you must install the Universal Windows App Development Tools –> Tools and Windows SDK to build an app for devices; that’s an option in the Features of the Visual Studio 2015 installer. Another important configuration step is to enable Windows 10 development on your DEV machine. All these pre-requisites can be found here: http://thinglabs.io/workshop/cs/nightlight/getting-started/

Building out the nightlight was actually fun; I hadn’t touched electronic components in years, so this was refreshing and a bit challenging at times; specially with the ADC (Analog Digital Converter) component. But with patience, it all started to make sense and soon enough the wiring was working.

WP_20160412_014

Then came the code part of things… this is where the real fun begins. Controlling the pins on the GPIO was the coolest thing ever… Basically the GPIO exposes pins that you can access programmatically to send commands and receive data.

WP_20160413_001

One of the steps in the lab was to create an Azure IoT Hub, connect to it from the device, and explore live data being sent over to the cloud; in this case, the Raspberry Pi2 was designed to capture light level information, send the light measure to the cloud every second, and turn on or off the nightlight depending on the darkness level of the room. The lab goes into details on how this is done here: http://thinglabs.io/workshop/cs/nightlight/setup-azure-iot-hub/ and here: http://thinglabs.io/workshop/cs/nightlight/sending-telemetry/.

The real surprise of this entire solution was to see data flow in near-time through Power BI and visualize the darkness level. This is roughly what it looks like at the conclusion of the lab (picture taken from the lab):

Create the Power BI report

Not everything was smooth; in fact it took me nearly two days to get everything working. My biggest frustrations with the lab were two-fold:

  1. 1. Visual Studio 2015 was, at times, unable to communicate/find the Raspberry Pi2 to start the program
  2. 2. Windows 10 Core wants to push an update to the Raspberry Pi2 regardless of whether or not you want it to

The second issue was more concerning because the Windows upgrade failed on me repeatedly, and the only option was to reimage the Raspberry Pi2 with the Windows 10 Core default image. I learned later that it is possible to disable Windows Updates if you use Windows 10 Core Pro.

In all, this was an amazing lab; if you want to learn about Windows 10 Core, Azure IoT Hub, and connect the dots with Power BI, I highly recommend going through this lab.

About Herve Roggero

Herve Roggero, Microsoft Azure MVP, @hroggero, is the founder of Enzo Unified (http://www.enzounified.com/). Herve's experience includes software development, architecture, database administration and senior management with both global corporations and startup companies. Herve holds multiple certifications, including an MCDBA, MCSE, MCSD. He also holds a Master's degree in Business Administration from Indiana University. Herve is the co-author of "PRO SQL Azure" and “PRO SQL Server 2012 Practices” from Apress, a PluralSight author, and runs the Azure Florida Association.

Print | posted @ Friday, April 22, 2016 5:01 PM

Comments on this entry:

Comments are closed.

Comments have been closed on this topic.