introduction to windows iot via raspberry pi 3

46
Lee Richardson @lprichar http://www.leerichardson.com Introduction to Windows IoT via Raspberry Pi 3 Microsoft Maniacs Metup – January 19, 2017

Upload: lee-richardson

Post on 13-Apr-2017

4.587 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Introduction to Windows IoT via Raspberry Pi 3

Lee Richardson

@lprichar

http://www.leerichardson.com

Introduction to

Windows IoTvia Raspberry Pi 3

Microsoft Maniacs Metup – January 19, 2017

Page 2: Introduction to Windows IoT via Raspberry Pi 3

Lee Richardson@lprichar

www.leerichardson.com

Page 3: Introduction to Windows IoT via Raspberry Pi 3

Microsoft

.NET

I

Page 4: Introduction to Windows IoT via Raspberry Pi 3

WE BUILD AWESOME SOFTWARE.

Page 5: Introduction to Windows IoT via Raspberry Pi 3

sirenofshame.com

Page 6: Introduction to Windows IoT via Raspberry Pi 3

Microsoft

.NETMaker2

IoT

=+

Page 7: Introduction to Windows IoT via Raspberry Pi 3

Overview

• Part 1: What, Why

• Part 2: How

• Part 3: Connectivity

• Part 4: GPIO

• Part 5: Remote Controlled Car

Page 8: Introduction to Windows IoT via Raspberry Pi 3

Cost: $$

Updates: Deferrable

Cost: $

Updates Deferrable

Cost: Free

Updates Automatic

X86 or X64 or ARM

X86 or X64 or ARM

X86 or ARM

Page 9: Introduction to Windows IoT via Raspberry Pi 3

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

Page 10: Introduction to Windows IoT via Raspberry Pi 3

• System On Chip

• Operating System (Multitasking)

• USB (Mouse, Keyboard)

• HDMI / GPU

• Internet Connected

Arduino

• Microcontroller

• Single Program

• ~$2

Raspberry Pi

Page 11: Introduction to Windows IoT via Raspberry Pi 3

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

Page 12: Introduction to Windows IoT via Raspberry Pi 3

$1.3 trillionMarket for IoT by 2020

IDC

25 billionConnected “things” by 2020

Gartner

Page 13: Introduction to Windows IoT via Raspberry Pi 3

Part 2: How

• Stuff You Need

• Device Setup

• Dev Environment Setup

• Hello World

Page 14: Introduction to Windows IoT via Raspberry Pi 3

Ensure

>= 2 Amp

Output

Page 15: Introduction to Windows IoT via Raspberry Pi 3
Page 16: Introduction to Windows IoT via Raspberry Pi 3
Page 17: Introduction to Windows IoT via Raspberry Pi 3

https://developer.microsoft.com/en-us/windows/iot/win10/SupportedInterfaces.htm

Page 18: Introduction to Windows IoT via Raspberry Pi 3
Page 19: Introduction to Windows IoT via Raspberry Pi 3

Part 2: How

• Stuff You Need

• Device Setup

• Dev Environment Setup

• Hello World

Page 20: Introduction to Windows IoT via Raspberry Pi 3

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 >

Page 21: Introduction to Windows IoT via Raspberry Pi 3

Plug In• Ethernet (optional)

• Keyboard/Mouse

• HDMI

• Power

Turn On

Page 22: Introduction to Windows IoT via Raspberry Pi 3

(optional)

Set Up Wifi

Page 23: Introduction to Windows IoT via Raspberry Pi 3

Default Credentials

Username: Administrator

Password: [user provided]

Page 24: Introduction to Windows IoT via Raspberry Pi 3
Page 25: Introduction to Windows IoT via Raspberry Pi 3

Part 2: How

• Stuff You Need

• Device Setup

• Dev Environment Setup

• Hello World

Page 26: Introduction to Windows IoT via Raspberry Pi 3

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

Page 27: Introduction to Windows IoT via Raspberry Pi 3

Demo Time – Hello World

Page 28: Introduction to Windows IoT via Raspberry Pi 3

Part 3: Connectivity

• SignalR

• Azure IoT

• Alljoyn

• Web Server

Page 29: Introduction to Windows IoT via Raspberry Pi 3

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();

}

Page 30: Introduction to Windows IoT via Raspberry Pi 3

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

Page 31: Introduction to Windows IoT via Raspberry Pi 3
Page 32: Introduction to Windows IoT via Raspberry Pi 3

AllJoyn

• P2P, Discoverable

• Open Source Standard

• Core component in Windows 10

• https://allseenalliance.org/

AllJoyn

Consumer

Discoverability

2-way Communication

AllJoyn

Producer

Page 33: Introduction to Windows IoT via Raspberry Pi 3

Web Browser

or Any App

HTTP

Web Server on Pi

• P2P Communication

• Headless

• Also available via Node

Background

App

Page 34: Introduction to Windows IoT via Raspberry Pi 3

Part 4: GPIO

Page 35: Introduction to Windows IoT via Raspberry Pi 3

GPIO

Dem

o

Page 36: Introduction to Windows IoT via Raspberry Pi 3

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]

Page 37: Introduction to Windows IoT via Raspberry Pi 3

PWM

See Also: How to Fade an LED with PWM at http://blog.infernored.com or http://www.leerichardson.com

Page 38: Introduction to Windows IoT via Raspberry Pi 3

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();

}

Page 39: Introduction to Windows IoT via Raspberry Pi 3

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

Page 40: Introduction to Windows IoT via Raspberry Pi 3
Page 41: Introduction to Windows IoT via Raspberry Pi 3
Page 42: Introduction to Windows IoT via Raspberry Pi 3

Resources

• These slides:• http://www.slideshare.net/LeeRichardson13/introduction-to-windows-

iot-via-raspberry-pi-3

• IotRcCar Source Code• https://github.com/lprichar/IotRcCar

Page 43: Introduction to Windows IoT via Raspberry Pi 3

http://www.nova-labs.org/ 1916 Isaac Newton Square West

Reston, VA 20190

• 3D Printers

• Laser Cutter

• Arduino Classes

• CNC Mill

Page 44: Introduction to Windows IoT via Raspberry Pi 3

TechShophttp://techshop.ws

2110 Crystal Dr # B,

Arlington, VA 22202

Page 45: Introduction to Windows IoT via Raspberry Pi 3

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

Page 46: Introduction to Windows IoT via Raspberry Pi 3

Lee Richardson

@lprichar

http://www.leerichardson.com

Introduction to

Windows IoTvia Raspberry Pi 3