windows azure and embedded devices

Post on 20-May-2015

1.877 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

This talk will demonstrate the Internet of Things with Windows Azure. Using embedded devices that interact with Windows Azure cloud technologies, the Internet of Things ideology is enabled with scalable and resilient cloud systems that imbue the resource constrained devices with elastic, on-demand additional computing power that allows any network connected device to achieve amazing computational feats. The talk features three main device/cloud interactions: persisting unbounded data from sensors, communicating through resilient channels and interacting directly with the Windows Azure cloud to provision and control cloud based infrastructure.

TRANSCRIPT

Andy Cross

@andybareweb

Devices and Windows AzureThe openness of Windows Azure

Introduction

AgendaScenario OutlineDevices

TraditionalMobileEmbedded

Windows Azure ScalabilityCommandControl

WhoAndy Cross, Windows Azure MVP, co-founder UK Windows Azure User Group and HPC and Hadoop with Windows Azure expert.

Elastacloud Limited, HPC, Big Data and tiny little microchip consultancy

Time until next coffee

Devices are everywhere

2020 est

2012

Population, Earth

24bn33

%

9bnUnprecedented growth

The number of internet connected devices is sky rocketing.

The trend shows no sign of slowing.

Node.js server handles 2.4k/sec requests

0.000016% if the device connects hourlyOr 100000 servers to deal with 1%

Scenario outline IoT

Potential Workloads

PredictabilityDevices may report periodically (hourly temperature reading)Devices may interact frequently (retrieve news)

UnpredictabilityDevices may respond to user input (milk taken from fridge)Devices may be free to communicate (peer discovery)

Predictable Burst

Unpredictable Burst

Growing Fast“On and Off”

Com

pute

Time

4Devices and Azure ©Copyright 2012 09 / 14 /12

Only a scalable elastic computing infrastructure can solve this scalability challenge; such as Windows Azure

Time until next coffee

Device Classifications

Background processesPush notifications requiring Server contextsLocation sensitive data

Nike+Intelligent HousingRFID

Desktop PC and LaptopsBackground processesUser interactions

Desktop

Mobile

Embedded

Devices illustrated

Desktop Mobile Embedded

Capacity Cost Potential Capacity Cost Potential Capacity Cost Potential

Familiar form factorsDesktopVery resource rich

Fully featured clientsHTMLWPF

Azure Client LibrariesC#/VB .netRuby/Python/Node.js etc etc

Many communication methodsHTTP(S)WinsockUSB/Serial etc to devices

Mobile DevicesResource wealthy (increasing)

Very functional clientsHTMLSilverlightProprietary UI technologies

Azure Client LibrariesPlatform specific

Mainly web communication methodsHTTP(S)

Embedded … A real challenge with rewards!Limited Processor

Limited MemoryNo Operating SystemPartial or No Cryptography Libraries

Low level codeClose access to hardwareSmallest possible form factor

Many communication channels available from USB to Serial to network

How does Windows Azure Help Embedded?

Mobile ServicesMedia ServicesHPC and Big Data

Windows Azure StorageWindows Azure Service BusService Management API

Compute provisioned on demandStorage into 100s TBs easilyGeo-locatable

Scalable Resource

Infrastructure Services

Architectures

This is no Windows Azure Client for embedded devices. We will have to write our own.

Where could we find such a device?

This integration is only possible if the platform is truly open and device agnostic. There is no more evident test of this than consuming and interacting with Windows Azure from a device which does not have an operating system.

An introduction to NETMF.net Microframework

Time until next coffee

Background

What.net for Devices

• 64k of RAM• No need for MMU

WhyC# or VB.Net on a chip!Debugging tools such as Visual Studio allow for revolutionary development experience and real time debugging of devices

When->2007 Microsoft SPOT

2007 NETMF

2009 Open Sourced

2010 www.netmf.com

Comparative .net FrameworksR

eq

uir

ed

Devic

e R

eso

urc

e

Framework Complexity

.net Microframework

.net Compact Framework

.net Framework

Today’s devices• Netduino +

Inspired by ArduinoOpen source hardwarePin Compatible shieldsStandard enclosures and accessories

processor and memory

• Amtel 32-bit microcontroller

• Speed: 48MHz, ARM7• Code Storage: 64KB

without networking: 128 KB• RAM: 42KB

without networking: 60 KB

processor and memory

• STMicro 32-bit microcontroller• Speed: 168MHz, Cortex-M4• Code Storage: 384 KB• RAM: 100+ KB

2

Primer: netmf fundamentals120 seconds tour of netmf

Write in C# or Visual Basic (recent)Use Visual Studio (Express inc)Deploy and debug via USBDebugging WORKS! Breakpoints, immediates, watches etc

Development, Devices, Delivery

Open Source HardwareArduino layoutsCustom NETMF boardsDesign your ownDotnet Gadgeteer /Netduino GO

When complete, publish your software to a firmwareand distribute to your hardware vendor for delivery

.net Framework classes

NETMF architecture

Device specific implementations

User CodeYou

Who

Microsoft and community

Device vendors

What

Primer: GPIOGeneral Purpose IO (input/output)

Notice the class is standard C# with typical namespaces. There are additional using statements for device specific libraries.The class looks almost identical to a C# console app – but without args[] on the Main()

The AnalogInput class will do most of our work, it takes a hardware address.We Read() to get a voltage – and let whatever is on the pin do the work of generating this.

This class uses an OuputPort set to communicate with the on board LED of the Netduino.

We use the Write method to send a binary (Digital) signal to the output device, in this case the on board LED.

We use familiar System.Threading namespace to control the execution flow, in this case, pausing for 200ms so that the LED flashes changing state 5 times a second

Cryptography in the .net MicroFrameworkPrimer: Crypto

If you try to use System.Security.Cryptography you’ll most likely get …..

The Crypto assemblies in NETMF don’t ship for Netduino because of their size

Don’t despair! This is C#!http://www.microframework.nl/2009/09/05/shahmac-digest-class/

Using only standard System namespace types we can implement our own SHA-256 hash, sufficient for many Azure operations

Primer: net ioSockets and Networks in .net Microframework

This simple class makes a web request to retrieve the last tweet by @andybareweb using api.twitter.com

The connectivity is done using familiar .net classes, HttpWebRequest.

The response is retrieved and read from the response stream by a System.IO.StreamReader.

Using blocks manage object disposal.

If we modify the request to request a large number of tweets (100), we run into the limits of the devices’ capabilities (in terms of Main Memory).

In order to remedy this, we read smaller amount of the response stream, using a batch buffering approach.

Demo 1Storing sensor data in Windows Azure Storage

Time until next coffee

Temperature Device

Windows Azure Blob Storage

Trigger Button

Key technologies: Net.IO, Crypto, InterruptPort, File.IO

Key driver: turbocharge any device with limitless storage

On device storage from MB -> 2GB on SD card is increased infinitely.

Data stored in Windows Azure Table Storage, adding querying

Demo 2Commanding Devices using Windows Azure Distributed Queues

Time until next coffee

Key technologies: Net.IO, Crypto, OutputPorts

Key drivers: scalable command of remote and disconnected devices

OutputDevice

Windows Azure Queue Storage

Scalable queues used from Windows Azure Storage; more scenarios supported by Service Bus Topics where SSL is available.

Queue Mechanism

ZapChom

p Austin

Mojo

Demo 3Controlling Windows Azure from Devices

Time until next coffee

Key Technologies: Crypto, Net.IO and Analog Input

Key Driver: Materialize remote control over cloud with tangible artifact

Analog Input Device

Windows Azure Service Management

Gateway

To supplement the limitation of the device (no SSL) a custom Gateway is provided to handle this transport level.

This gateway then communicates with Service Mgt API

Big DataSolving data retrieval problems with HADOOP

Time until next coffee

A final thought

Gather 1KB of data 9bn global devices. This equates to 9 petabytes.

Imagine that per day or per hour.

HDInsight gives you the ability to gain sense from this scale of data.

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Q&A

Thanks for Listening!

top related