introduction to windows iot via raspberry pi 3
TRANSCRIPT
Lee Richardson
@lprichar
http://www.leerichardson.com
Introduction to
Windows IoTvia Raspberry Pi 3
Microsoft Maniacs Metup – January 19, 2017
Lee Richardson@lprichar
www.leerichardson.com
Microsoft
.NET
I
WE BUILD AWESOME SOFTWARE.
sirenofshame.com
Microsoft
.NETMaker2
IoT
=+
Overview
• Part 1: What, Why
• Part 2: How
• Part 3: Connectivity
• Part 4: GPIO
• Part 5: Remote Controlled Car
Cost: $$
Updates: Deferrable
Cost: $
Updates Deferrable
Cost: Free
Updates Automatic
X86 or X64 or ARM
X86 or X64 or ARM
X86 or ARM
Raspberry Pi 3* Raspberry Pi 2 MinnowBoard
MAX
DragonBoard 410c Intel Joule
$35 $35 $99 $75 $315
Broadcom BCM2837 Broadcom
BCM2836
Intel Atom (x86) Qualcomm Snap
Dragon 410
Intel Atom (x86)
900MHz Quad-Core
ARM Cortex A53
900MHz Quad-Core
ARM Cortex A7
1.91GHz Atom
E3845
900MHz Quad-Core
ARM Cortex A7
1.7 GHz Quad-Core
Atom
On-board WiFi** &
Bluetooth**
Firmware TPM On-board WiFi* &
Bluetooth & GPS
WiFi
IoT Core Boards
• System On Chip
• Operating System (Multitasking)
• USB (Mouse, Keyboard)
• HDMI / GPU
• Internet Connected
Arduino
• Microcontroller
• Single Program
• ~$2
Raspberry Pi
Linux vs Windows IoT
• Automatic Updates
• Identity Protection
• Trusted Platform Module (TPM)*
• Native UEFI*
• BitLocker*
• Enterprise Data Protection
• Azure IoT Hub
• Azure Iot Suite
• SignalR
• AllJoyn
• Http
• Visual Studio
• UWP
• Remote Desktop
• Language Support• C#
• Python
• JavaScript
• Arduino C + Arduino Libraries
• Learning Curve
Security Connectivity Ecosystem
*Only on MinnowBoard Max and Qualcomm DragonBoard
$1.3 trillionMarket for IoT by 2020
IDC
25 billionConnected “things” by 2020
Gartner
Part 2: How
• Stuff You Need
• Device Setup
• Dev Environment Setup
• Hello World
Ensure
>= 2 Amp
Output
https://developer.microsoft.com/en-us/windows/iot/win10/SupportedInterfaces.htm
Part 2: How
• Stuff You Need
• Device Setup
• Dev Environment Setup
• Hello World
IoT Dashboardhttp://ms-iot.github.io/content/en-US/win10/GetStartedManually.htm
Or Getting Started With Windows IoT And Raspberry PI 3 at http://blog.infernored.com or http://www.leerichardson.com
Basically:
1. Install IoTDashboard
2. Set up a new device
3. Burn Image to SD Card >
Plug In• Ethernet (optional)
• Keyboard/Mouse
• HDMI
• Power
Turn On
(optional)
Set Up Wifi
Default Credentials
Username: Administrator
Password: [user provided]
Part 2: How
• Stuff You Need
• Device Setup
• Dev Environment Setup
• Hello World
Things To Install
• Visual Studio (Any Edition)• Universal Windows App Development Tools
• Windows IoT Core Project Templates• https://visualstudiogallery.msdn.microsoft.com/55b35
7e1-a533-43ad-82a5-a88ac4b01dec
• Enable Developer Mode
Demo Time – Hello World
Part 3: Connectivity
• SignalR
• Azure IoT
• Alljoyn
• Web Server
SignalR Demo• Simple, Fast, Nuget download
• But on ARM
private async Task InitializeSignalR()
{
var cn = new HubConnection("http://mysite.com");
var proxy = cn.CreateHubProxy("MyHub");
proxy.On<string>("itHappened", OnItHappened);
await cn.Start();
}
Azure IoT Hub
Azure IoT HubDevice Explorer
Device
Azure IoTHub
Prerequisites• Visual Studio Extension
https://visualstudiogallery.msdn.microsoft.com/e254a3a5-d72e-488e-9bd3-8fee8e0cd1d6
• Hub Device Explorerhttps://github.com/Azure/azure-iot-sdks
Benefits• Per-device authentication• Secure connection• Massively scales
AllJoyn
• P2P, Discoverable
• Open Source Standard
• Core component in Windows 10
• https://allseenalliance.org/
AllJoyn
Consumer
Discoverability
2-way Communication
AllJoyn
Producer
Web Browser
or Any App
HTTP
Web Server on Pi
• P2P Communication
• Headless
• Also available via Node
Background
App
Part 4: GPIO
GPIO
Dem
o
Web Server Demo
• Headless Background Task
• Open Firewall• Log in with Powershell
http://ms-iot.github.io/content/en-US/win10/samples/PowerShell.htm
• netsh advfirewall firewall add rule name=[Any name
to identify rule] dir=in action=allow protocol=TCP
localport=[Port number]
PWM
See Also: How to Fade an LED with PWM at http://blog.infernored.com or http://www.leerichardson.com
1. Lightning Driver2. Lightning SDK3. Permissions
4. Code
<iot:Capability Name="lowLevelDevices" />
<DeviceCapability Name="109b86ad-f53d-4b76-aa5f-821e2ddf2141"/>
if (LightningProvider.IsLightningEnabled) {
LowLevelDevicesController.DefaultProvider =
LightningProvider.GetAggregateProvider();
var pwmControllers =
await PwmController.GetControllersAsync(LightningPwmProvider.GetPwmProvider());
var pwmController = pwmControllers[1]; // use the on-device controller
pwmController.SetDesiredFrequency(50); // try to match 50Hz
_pin = pwmController.OpenPin(22);
_pin.SetActiveDutyCyclePercentage(.25);
_pin.Start();
}
Part 5: RC Car
• Prototyped• 3D Printed Components
• Custom PCB Board• Designed with Eagle -
http://www.cadsoftusa.com/
• Printed at OSH Park -https://oshpark.com/
• Plans on Github• http://www.github.com/lprichar/IotRcCar
Resources
• These slides:• http://www.slideshare.net/LeeRichardson13/introduction-to-windows-
iot-via-raspberry-pi-3
• IotRcCar Source Code• https://github.com/lprichar/IotRcCar
http://www.nova-labs.org/ 1916 Isaac Newton Square West
Reston, VA 20190
• 3D Printers
• Laser Cutter
• Arduino Classes
• CNC Mill
TechShophttp://techshop.ws
2110 Crystal Dr # B,
Arlington, VA 22202
Next Up: Build Something
• Grilling - Temperature Controlled BBQ Fan
• Foosball – Workplace table monitor
• Safety - Smart smoke detector
• Drinking - Alcohol breathalyzer
• Gardening - Per-plant water monitor and drip
• Homeowner - Window/door temperature tracker
• Cigars - Humidity controlled humidor
• https://developer.microsoft.com/en-us/windows/iot
Lee Richardson
@lprichar
http://www.leerichardson.com
Introduction to
Windows IoTvia Raspberry Pi 3