Page 16 - MSDN Magazine, June 2017
P. 16

INTERNET OF THINGS
Use Azure IoT Suite to
Boost IoT Development
Dawid Borycki
An Internet of Things (IoT) solution comprises remote telemetry devices, a Web portal, cloud storage and real-time pro- cessing. Such a complex structure can make you reluctant to start IoT development. To make things easier, the Microsoft Azure IoT Suite provides two preconfigured solutions: remote monitoring and predictive maintenance. Here, I’ll tell you how to create a remote monitoring solution, which will collect and analyze data from a remote IoT device controlled by Windows 10 IoT Core. This device, the Raspberry Pi, will acquire images from a USB camera. Subse- quently, the image brightness will be calculated on the IoT device and then streamed to the cloud, where it will be stored, processed and displayed (see Figure 1). Furthermore, the end user will not only
be able to see the information acquired with the remote device, but alsoremotelycontrolthatdevice.Youcanfindthecompletesource code supporting this discussion at msdn.com/magazine/0617magcode.
Remote Device
The basics of programming the Raspberry Pi with Windows 10 IoT Core was already discussed in this magazine by Frank LaVigne (msdn.com/magazine/mt694090) and Bruno Sonnino (msdn.com/ magazine/mt808503). LaVigne and Sonnino showed how to set up the development environment and the IoT board, how to con- figure the IoT unit in your browser using the Device Portal, and how to control GPIO ports with Windows 10 IoT Core. Moreover, LaVigne mentioned in his article that IoT can be used to program and control remote cameras. Here, I develop this thought and explicitly show how to turn the Raspberry Pi into such a device.
To that end, I create the RemoteCamera Universal Windows Platform (UWP) app using the Blank App (Universal Windows) Visual C# project template, and then set the target and minimum API versions to Windows 10 Anniversary Edition (10.0; Build 14393). I use this API version to enable binding to methods, which allows me to directly wire methods of the view model with events fired by visual controls:
<Button x:Name="ButtonPreviewStart" Content="Start preview"
Click="{x:Bind remoteCameraViewModel.PreviewStart}" />
Next, I declare the UI as shown in Figure 1. There are two tabs: Camera capture and Cloud. The first contains controls for starting
This article discusses:
• Creating the RemoteCamera UWP app
• Provisioning the remote monitoring solution and registering
a device
• Device metadata and communicating with the cloud
• Handling remote commands and sending commands from the cloud
Technologies discussed:
Azure IoT Suite, Universal Windows Platform, Raspberry Pi
Code download available at:
msdn.com/magazine/0617magcode
12 msdn magazine












































































   14   15   16   17   18