telemetry with windows 10 iot core : from raspberry pi2 to event hubs

25
Telemetry with Windows 10 IoT : from Raspberry Pi2 to Event Hubs Paolo Patierno Microsoft MVP Windows Embedded / IoT [email protected] @ppatierno

Upload: paolo-patierno

Post on 02-Aug-2015

595 views

Category:

Technology


2 download

TRANSCRIPT

Telemetry with Windows 10 IoT :from Raspberry Pi2 to Event

Hubs

Paolo PatiernoMicrosoft MVP Windows Embedded / IoT

[email protected]@ppatierno

Who am I ? Contacts• Senior Software Engineer (Leonardo Ricerche S.r.l.)

• Microsoft MVP Windows Embedded / IoT”... constantly moving between the devices and the cloud ...”

• Microsoft Azure Advisor• «DotNetCampania» member

– https://paolopatierno.wordpress.com

• «Embedded101» board of director member– http://www.embedded101.com/Blogs/PaoloPatierno.aspx

• «TinyCLR.it» member– http://www.tinyclr.it

• Linkedinhttp://it.linkedin.com/in/paolopatierno

• AllSeen Alliance «sponsored» member for AllJoin project• Eclipse «committer» for Paho project / M2Mqtt library owner

Agenda• Windows 10 IoT• Raspberry Pi 2 : what is it ?• Developing, tools ... and app model• Interfacing peripheral : GPIO, I2C &

SPI• Pi2 & Windows 10 IoT Core

management• Event Hubs : telemetry in the cloud• Demo time !!

Embedded platforms to IoT

* Windows Embedded Compact will not evolve into Windows 10; porting tools available

The Windows Embedded metro line

Windows 10 IoT EditionsWindows 10 IoT for industry devicesDesktop Shell, Win32 apps, Universal apps and drivers

Minimum: 1 GB RAM, 16 GB storage

X86/x64

Windows 10 IoT for mobile devicesModern Shell, Mobile apps, Universal apps and drivers

Minimum: 512 MB RAM, 4 GB storage

ARM

Windows 10 IoT CoreUniversal Apps and Drivers

No shell or MS apps

Minimum: 256MB RAM, 2GB storage

X86/x64 or ARM

One Secure Connected

Pay attention !! No real time !!

Windows 10 IoT Core boards• Windows 10 IoT Core preview

available for Minnowboard Max and Raspberry Pi 2

Raspberry Pi 2 : what is it ?• Quad-core ARM Cortex A7 900 Mhz• 1 GB RAM• 4 USB ports• Full HDMI port• Ethernet port• MicroSD card slot• Camera interface (CSI)• Display interface (DSI)

Raspberry Pi 2 : what is it ?• 40 pins• Available– GPIO– I2C– SPI– UART **

• Not available– ADC– PWM

** not supported by Windows 10 IoT Core

Developing & Tools• Latest Windows 10

build• Visual Studio 2015

RC– Universal Windows

App Development Tools

Developing & Tools• Windows IoT Extension SDK–Windows.Devices.Gpio–Windows.Devices.I2c–Windows.Device.Spi

• Deploy– ARM architecture

Windows 10 IoT Core app model• Only one app with UI (headed) in

foreground (as Windows Phone)– Developed as UWP app with its own

process

• More apps without UI (headless) as BackgroundTask– Developed as UWP app and hosted in

BACKGROUNDTASKHOST.EXE process (one for each task)

– No triggers, specific “startup” task type

GPIO : General Purpose Input/Output

• Digital pin (high/low value)• Input or Output direction• Read or Write operation• ValueChanged event (as an

“interrupt”)• Useful for LEDs, switches, relays,

very simple sensors

I2C : Inter-Integrated Circuit• Synchronous (clock) communication

bus for connecting an MCU/CPU to devices (as sensors)

• Low speed (100 Khz to 400 Khz)• Only two wires (clock and data)• Slave addressed• Half-duplex

SPI : Serial Peripheral Interface• Synchronous (clock) communication

bus for connecting an MCU/CPU to devices (as sensors)

• High speed (up to 10 Mhz and more)• Four wires (clock, data in, data out,

chip select)• Slave enabled• Full-duplex

Management• PowerShell & Web interface

Features missing from current preview

• No IIS• No WCF hosting• No RDP, use PowerShell• No graphic hardware acceleration

support• Few USB devices supported (no WiFi

or BLE dongle)

Telemetry• Information flowing

from a device to other systems for conveying status of device and environment

• Unidirectional• Data frequency can

be different based on applications/conditions

Event Hubs & Stream Analytics• Event Hubs– Ingestion system (million events/sec)– Telemetry from devices, apps,

websites– Partition consumer pattern– SAS based security, per publisher

token

• Stream Analytics– Real time analytics for IoT– Stream with million events/sec– SQL-Like language for developing– Low latency

Event Hub

Stream Analytics

Azure Event Hubs

Windows 10 IoT Core to Event Hubs

• Official Microsoft Azure Service Bus Nuget package (https://www.nuget.org/packages/WindowsAzure.ServiceBus/) – It’s only for the .Net Framework full– It doesn’t work with UWP apps (and 8.1

apps)– Full features

Windows 10 IoT Core to Event Hubs

• Azure SB Lite (http://azuresblite.codeplex.com/) – wrapper around AMQP .Net Lite– exposes (part of) official package APIs– porting your code is very easily– support for all .Net platforms (full,

compact and micro) and WinRT. Of course UWP apps.

Pi2 to Event Hubs

Resources• Windows Dev Center (IoT) : https://

dev.windows.com/en-US/iot • IoT Core Get Started : http://

ms-iot.github.io/content/en-US/GetStarted.htm

• Universal Windows Samples : https://github.com/Microsoft/Windows-universal-samples