stream data into the cloud with raspberry pi and windows 10 iot core

43
+ Cincinnati + Louisville + Nashville + Columbus + Detroit + Indianapolis Mike Branstein – Director, Application Development @mikebranstein [email protected] Internet of Things (IoT) Workshop

Upload: mike-branstein

Post on 12-Apr-2017

115 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

+ Cincinnati + Louisville + Nashville + Columbus+ Detroit + Indianapolis

Mike Branstein – Director, Application Development@[email protected]

Internet of Things (IoT)

Workshop

Page 2: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

2

Welcome@mikebranstein@kizantech#[email protected]

Page 3: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

3

• You rarely get the chance to practice for practice’s sake• IoT and cloud architecture/development patterns can be

confusing and are frankly “new” to many of us• It’s not what’s going to change, it’s when – and the answer is likely

yesterday

• Today• The Internet of Things (IoT)• Cloud architecture• See an end-to-end solution• Hands-on practice• Get excited or inspired

Practice Makes Perfect

Page 4: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

4

IoT: The Internet of Toasters Things

Page 5: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

5Source: Oxford Ditionary

Internet of thingsnoun A proposed development of the Internet in which everyday objects have network connectivity, allowing them to send and receive data.

What is the Internet of Things?

Page 6: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

Source: Cisco & Internet World Stats, sourced and created by Nick Landry 10

How Big is Big?

Page 7: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

13

The cool stuff.

Page 8: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

14

Common IoT Devices & Platforms

Page 9: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

19Source: Nick Landry

• Full single-board computer with SoC• Average cost: $30 to $45• Model A, A+, B, B+ and Raspberry Pi 2 B,

3, Zero• Runs Linux – flavor of Debian called

Raspbian• http://www.raspbian.org

• Huge accessory selection• Programmable

• Python• (Mono), etc.

• 5+ million units sold in 3 years of manufacture, technically the largest computer manufacturer in UK!

Raspberry Pi

Page 10: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

21Source: Nick Landry

• Windows 10 is on Raspberry Pi 2 and 3!• http://windowsondevices.com

New Windows == More Fun!

Page 11: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

22

Demo: Windows 10 IoT Core

Page 12: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

23

The RPi can be powered either by the USB cable from the host PC or by an external DC power source (5V).

The RPi also has 5V, 3.3V and GND pins to supply voltages to your project components.

Raspberry Pi 2 Introduction

Source: Nick Landry

Page 13: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

24

• General Purpose Input/Output• Pin that can be controlled by

the user• Can be set to input or output • Input can be things like

temperature sensors, buttons, IR etc

• Output can be LEDs, Motors, LCDs etc

GPIO

Source: Nick Landry

Page 14: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

25

• 40 pins total• Pi Wedge organizes pins• 17 GPIO• 6x power• 5x SPI (Serial Peripheral

Interface) serial comm.• 2x UART, Tx (out) / Rx (in)

serial comm.• 4x I2C (comm. Protocol,

master/slave)

Pi Wedge Pin Out

Page 15: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

29

Breadboards offer a great way to prototype circuits. The provide a number of “buses” for connecting both power and components

Power buses run the entire horizontal length

Component buses (vertical) give you easy ways to connect pins together

Breadboards

Source: Nick Landry

Page 16: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

IoT Hub

{“device”:”kizan-pi-01”, “tempC”:”25.5”, “tempF”:”77.9”}

The Lab Cloud IoT Architecture

Stream Analytics

Service BusTopic

Subscribe to Average TempTopic

Power BI

{“avgTempC”:”24.3”,“avgTempF”:”75.7”}

SQL Azure

Raw dataETL temp avgs

Service Bus

ETL temp avgs

Page 17: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

35

Lab 3 Temperature Sensor

Page 18: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

36

• Analog Temp. Sensor• Analog to Digital

Convertor (RPi 2 only reads digital signals, so we need a convertor from Analog to Digital)

• Capacitor (to reduce line noise)

Temperature Sensor Components

Page 19: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

37

• Red are Power and GRD• Analog/Digital

Convertor (1 set for the analog component, another for the digital component)

• Temperature Sensor

Powering the Circuit

Page 20: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

38Customer & KiZAN confidential

• Serial Communications happen over 4 lines• Yellow• White• Blue• Green

• Yellow connects Temp sensor to the Convertor

Communicating with the RPi

Page 21: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

40

IoT Hub Placeholder and Azure IoT Hub Walkthrough

Page 23: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

43

Cloud Overview: IaaS, PaaS, SaaS

Source: Nick Landry, Microsoft

Page 24: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

44

• PaaS is where you “should” want to be• Use the service, don’t do the plumbing• We’ve been doing the plumbing for a long time• Challenges

• Mapping exercise• Architect the

PaaS way or thehighway

Moving to PaaS

Page 25: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

45

Reference Cloud IoT Architecture

Source: Nick Landry, Microsoft

Page 26: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

IoT Hub

{“device”:”kizan-pi-01”, “tempC”:”25.5”, “tempF”:”77.9”}

The Lab Cloud IoT Architecture

Stream Analytics

Service BusTopic

Subscribe to Average TempTopic

Power BI

{“avgTempC”:”24.3”,“avgTempF”:”75.7”}

SQL Azure

Raw dataETL temp avgs

Service Bus

ETL temp avgs

Page 27: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

IoT Hub

{“device”:”kizan-pi-01”, “tempC”:”25.5”, “tempF”:”77.9”}

The Lab Cloud IoT Architecture

Stream Analytics

Service BusTopic

Subscribe to Average TempTopic

Power BI

{“avgTempC”:”24.3”,“avgTempF”:”75.7”}

SQL Azure

Raw dataETL temp avgs

Service Bus

ETL temp avgs

Page 28: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

58

Stream Analytics

Page 29: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

59

Standard Data Analysis• Your data already exists –

it’s all from the past or projections of the future

• You can aggregate everything

• Not real-time• Batch processing• Reactionary in nature

Data Analysis

Page 30: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

60

Streaming Data Analysis• Data arrives temporally • You can’t aggregate data all at once• Real-time• Data is grouped into different

windows

Data Analysis

• What is a data window?• What’s your data window?• Concept: arriving data as an “event”

Page 31: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

61

Tumbling Window Hopping Window

Source: MSDN and MSDN

• Tumbling Windows that overlap• Timeunit (minutes, seconds, etc.)• Windowsize (duration)• Hopsize (skip duration)

• Series of fixed-size, non-overlapping and contiguous time windows

Temporal Windowing

Page 32: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

62Source: Microsoft

• Real-time stream processing in the cloud

• Real-time cloud-based ETL• Millions of events per second• Scale dynamically

What is Azure Stream Analytics?

Page 33: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

63

• Create Stream Analytics Job• Configure 1 or more Inputs and Outputs• Create Queries to ETL from Inputs to Outputs• Use SQL-like language

Making Cloud ETL Easy

Page 34: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

64

Demo Looking at a Stream Analytics Job

Page 35: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

Microsoft Power BI

Page 36: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

Stream Analytics

Machine Learning

Statistical Analysis

Intelligent Apps

INTE

LLIG

ENCE

Power BI: experience your dataAny data, any way, anywhere

45,000organizations500,000unique users185 countries

MICROSOFT CLOUD

NON-MICROSOFT CLOUD

ON-PREMISE DATA

Page 37: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

See all your data in a single pane of glassLive dashboards and interactive reports

• Monitor live dashboards for the data that matters most

• Track your data in real-time with support for streaming data

• Drill through to underlying reports to explore and discover new insight

• Pin new visualizations and KPIs to monitor performance

146.03K145.84K145.96K146.06K

40.08K38.84K39.99K40.33K

Page 38: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

Stay connected from any device

• Native apps for iPad, iPhone, and Windows devices

• Receive alerts to important changes in your data

• Share and collaborate with colleagues and take action

Page 39: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

Power BI Content Packs

Prebuilt Power BI experience for your service

TODAY

COMING SOON

Dynamics Marketing

Azure Mobile Engagement

Page 40: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

Create Power BI contentVisual data exploration & interactive reporting

Desktop tool for data exploration and interactive reporting Freeform drag and drop canvasEffortless publishing to the Power BI service

Power BI Desktop

Page 41: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

Connect live to your on-premises dataLive Query & Scheduled Data Refresh

SQL Server Analysis Services

Live Power BI reports

& dashboards

LiveQuery

Scheduled Refresh

Cloud

On-premises

Data Source

• Deploy quickly with a hybrid BI solution

• Manage and secure data on-premises with SQL Server Analysis Services

• Optimized query performance for interactive data exploration

• Scheduled refresh from on-premises data sources

Page 42: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

Power BI overviewWeb browser

HTML

Microsoft cloud

Power BI

Partner apps

Office 365

Dynamics

Azure data services

Microsoft cloud

Non Microsoft cloud software systems(e.g., SaaS applications, IOT scenarios, and data streams)

Non-Microsoft cloud

On-premises data

SQL Server analysis services

Databases andother data sources

Mobile apps

iOS

Power BI Desktop

Business analyst tools

Page 43: Stream Data into the Cloud with Raspberry Pi and Windows 10 IoT Core

73Customer & KiZAN confidential

Build a Dashboard