getting started with iot using azure, windows iot core, and raspberry pi

53
http:// BuildAzure.com Getting Started with IoT Using Azure, Windows IoT and Raspberry Pi

Upload: chris-pietschmann-microsoft-mvp

Post on 16-Apr-2017

1.397 views

Category:

Technology


2 download

TRANSCRIPT

PowerPoint Presentation

Getting Started with IoTUsing Azure, Windows IoT and Raspberry Pi

http://BuildAzure.com

Chris PietschmannSenior Cloud Solution Architecthttp://Opsgility.com~15 years architecting enterprise systems

Microsoft MVP (2008 2012)

http://BuildAzure.com

@BuildAzure

The Internet of Things

IoT Devices

NOTES:Heres a bunch of Consumer IoT devices available today

ATTRIBUTION:http://nest.comhttp://tesla.comhttp://sonos.comhttp://amazon.comhttp://vizio.comhttp://sony.comhttp://apple.comhttp://smartthings.com

5

AgendaIoT Architecture

Raspberry Pi

Windows IoT Core

Azure IoT

IoT Architecture

Device-to-Cloud MessagingData Event / Messages are sent from the hardware device to the cloudSensor readingsTelemetry stream

Generally feeds into some kind of Message Queue for processing

Lambda ArchitectureData Aggregation

Real-Time Processing / Analyticsfast

Batch Processingslow

NOTES:Devices generate events / messages sent to a Queue. In Azure this would be Azure IoT Hub or Event HubsThem event data is sent 2 directionsFor Real-Time processing, like using Azure Stream Analytics and possibly Machine LearningFor Batch Processing, like Azure SQL Database or DocumentDB for archivingThe end result is basically the same for both paths; some kind of database to persist the data for longer term storage and retrievalFinally an application on the other end that will do something with the data.Perhaps reporting like Power BI or just some kind of business app9

Cloud-to-Device MessagingCommand / Messages sent to the hardware deviceInstruction to perform an actionTurn something on: Light, Fan, Open Door, etcStart / Stop gathering telemetry

2-way messaging

MQTT ProtocolMessage Queuing Telemetry Transport

Publish / Subscribe, simple and lightweight protocol

Encryption performed using SSL

Designed for low-bandwidth, high-latency or unreliable networks

Created in 1999 http://mqtt.org

NOTES:MQTT has become a standard protocol for Internet of ThingsOperates over TCP/IP port 1883 reserved for MQTT, and 8883 with SSL / encryption11

Other ProtocolsAMQPAdvanced Message Queuing Protocolhttp://amqp.org

HTTPStandard web protocol

Custom or Device SpecificLegacy or Proprietary

IoT GatewaysSimilar to a Proxy

Provide aggregation point for device communications

Field GatewayLow powered or simple devices may not have capacity to provide security necessary for IoT; maybe no SSL

Protocol GatewayProvides protocol adaptationTranslates from custom / proprietary protocol to one cloud supports; like MQTT or AMQP

Offers a single security attack vector connected to Internet

LINKS:https://azure.microsoft.com/en-us/documentation/articles/iot-hub-protocol-gateway/

13

IoT Architecture

LINKS:https://azure.microsoft.com/en-us/documentation/articles/iot-hub-what-is-azure-iot/14

Raspberry Pi

Attribution:http://www.prioryfinepastries.com/our-pies/http://www.prioryfinepastries.com/wp-content/gallery/pies/cherry-pie.png

15

Raspberry PiDesigned with the purpose to help teach Basic Computer Science in schools

Very active community building all kinds of stuff

First boards released in 2012Many editions have been released since

http://www.raspberrypi.org

Raspberry Pi 2 & 3ARM CPUHeader with 40 GPIO PinsNetwork: Ethernet, WifiVideo: HDMI, Composite VideoStorage: Micro SD Card4 USB PortsOperating System support:Raspbian / LinuxWindows 10 IoT Core

Raspberry Pi 2 & 3Raspberry Pi 2900 Mhz 32-bit quad-core ARM Cortex-A7 CPU1GB RAM

Released Feb 2015Raspberry Pi 31.2 Ghz 64-bit quad-core ARMv8 CPU1 GB RAM

Integrated:Wifi 802.11nBluetooth 4.1 w/ BLE

Released Feb 2016

Certified for IoT Starter KitAdafruit Raspberry Pi KitRaspberry Pi 3BreadboardJumper wiresTemp, Pressure, Humidity SensorRGB Color SensorPhoto cellLEDsResistorsand more

http://bit.ly/AzureIoTStarterKits

Link:http://bit.ly/AzureIoTStarterKits19

Windows IoT Core

Windows IoT CoreWindows 10 optimized for smaller devices

With Display or Headless

Supports Auto-update over Windows Update

Hardware SupportRaspberry Pi 2 & 3, Qualcomm DragonBoard 410c, MinnowBoard MAXFREE

Device UI - Dashboard

Device Name

Network & IP Address

Windows 10 Version

Device UI Setup Wifi & Bluetooth

Setup Wifi

Setup Bluetooth

IoT DevelopmentUniversal Windows Apps (UWP) APISame development tools for Windows 10 Desktop, Phone, Xbox, HoloLens, and Windows IoT CoreVisual Studio 2015, .NET, XAML

IoT DashboardEasily Flash SD Card

Configure Device SettingsDevice nameAdministrator PasswordWifi network

https://developer.microsoft.com/en-us/windows/iot/downloads

25

Device Web Portal

Headless Management of Device

http://{IP Address}:8080

Login: AdministratorPassword defined when SD Card was flashed

26

Windows IoT Remote ClientNeeds Windows IoT Remote Server turned on.Can be done from the Device Web Portal

Available in Windows Store

Windows IoT Core ProCommercial Version is available

https://www.windowsforiotdevices.com/

https://www.microsoft.com/en-us/windowsforbusiness/windows-iot28

Azure IoT

Azure IoT SuiteIoT Hub

Notification Hubs

Stream Analytics

Machine Learning

Power BI

Attribution:Cloud graphic is from https://azure.microsoft.com/en-us/suites/iot-suite/

30

IoT HubDevice-to-Cloud messagingSupport AMQP, MQTT, HTTP/1

Cloud-to-Device messaging2-way communication between Cloud and IoT Device

ScalableSupports millions of simultaneous devices

Device Management / Security

Azure IoT Gateway SDK BetaOpen Source SDK for building IoT Gateways

LINKS:https://azure.microsoft.com/en-us/documentation/articles/iot-hub-what-is-iot-hub/https://azure.microsoft.com/en-us/documentation/articles/iot-hub-compare-event-hubs/

https://azure.microsoft.com/en-us/blog/introducing-the-azure-iot-gateway-sdk-beta/31

IoT Hub SDKsMulti-platformCNode.jsJava.NETPython

https://github.com/Azure/azure-iot-sdks

https://github.com/Azure/azure-iot-sdks/blob/master/readme.md32

IoT Hub Architecture

NOTES:Protocols supported: MQTT, AMQP, HTTP

LINKS:https://azure.microsoft.com/en-us/documentation/articles/iot-hub-what-is-iot-hub/33

Notification HubSend Push Notifications to any platformMobile Push Notification, not to be confused with SMS messages

Supports All Major PlatformsiOS, Android, Windows, Kindle, Baidu

Highly ScalableMillions of Mobile Devices and Billions of Notifications

NOTES:Baidu is a Chinese cloud service

LINKS:- https://azure.microsoft.com/en-us/services/notification-hubs/- https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-baidu-china-android-notifications-get-started/34

Notification Hub Architecture

Platform Notification Service(Apple, Microsoft, Google) App Back-EndMobile Device

3. Send Notification2. Register PNS Handle4. Send to Device1. Retrieve PNS HandleNotification Hub

LINKS:- https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-push-notification-overview/35

Stream AnalyticsReal-time stream processing

Stream millions of events per second

Can handle multiple Inputs and OutputsInput: IoT Hub, Event Hubs, Blob StorageOutput: SQL Database, DocumentDB, Azure Storage, Event Hubs, Power BI, Service Bus Queues/Topics

Uses SQL-like query syntax for Input to Output mapping

LINKS:https://azure.microsoft.com/en-us/services/stream-analytics/https://azure.microsoft.com/en-us/documentation/articles/stream-analytics-introduction/

36

Stream Analytics Architecture

Stream Analytics

SQL Database

DocumentDB

IoT Hub

Machine LearningPaaS Predictive Analytics

Create Learning Models using ML Studio

Outputs Web Service that can be run on Schedule and connected to database

Add intelligence to apps or provide insights to BI tools

LINKS:https://azure.microsoft.com/en-us/services/machine-learning/

38

Power BI

PaaS Service

Create Interactive Reports

Easily embed BI and analytics within apps

LINKS:https://powerbi.microsoft.com/en-us/https://powerbi.microsoft.com/en-us/features/39

Other PaaS Services

App Service Web Apps

Platform as a Service (PaaS)

Host Web ApplicationsASP.NET, Node.js, PHP, Java

Foundation for other servicesAPI AppsMobile AppsFunctions

Azure FunctionsServer-lessWell not really, actually built on top of App Service Web Apps

Language Support:C# and Node.js

Isolated Function of Code

Run on Schedule or Trigger

Service Bus QueueMessage Queue

First In, First Out

Enable loosely coupled applications

More robust than Storage Queues

DocumentDBNoSQL document databaseJSON documentsSchema-free

Highly scalable

SQL query syntax

Demo

45

Raspberry Pi GPIO

http://bit.ly/RPiHeaderPins

Link:http://bit.ly/RPiHeaderPins46

Connect Temperature Sensor

Adafruit BME280Temperature, Humidity, Barometric Pressure

Connect to I2C bus on header pins 3 and 5

http://bit.ly/RPWeather3

NOTE:Link is for the Weather Station V 3.0 project I put up on Hackster.io. Project includes code, wiring diagram and other info necessary for connecting this up.

Links:https://www.adafruit.com/products/2652

https://www.hackster.io/23021/weather-station-v-3-0-b8b8bchttp://bit.ly/RPWeather347

Connect LED

Blue LED220 Ohm Resistor

Connected to GPIO 4Located on Header Pin 7

All wired up

NOTES:- I am using a cobbler with a Breakout ribbon to connect the Raspberry Pi to the Breadboard.49

Demo Hardware

NOTES- LED turns on at 29c for 1.5 seconds50

Demo Architecture

UWP App / Raspberry PiIoT HubStream AnalyticsDocumentDBFunctionService Bus Queue

Demo: Into the Code and Portal

More Informationhttp://hackster.io/microsoft

http://adafruit.com

http://BuildAzure.com @BuildAzure

Thank you to our sponsor