Building IoT Solutions using Windows IoT Core

Preview:

Citation preview

Building IoT Solutions using Windows IoT Core - (Part 2 of 3

Series)Notes: If you experience audio issues during the webinar, you can dial in

through telephone details provided to you in your registration confirmation email.

Please feel free to post questions in the questions dialog and we will try to answer as many as we can at the end.

Recording of this session will be shared in next 24-48 hours. You can also write to us at marketing@winwire.com for any clarifications

or information.

Session Speaker

Vineet AroraCTO

WinWire TechnologiesMCA – Microsoft Certified

Azure ArchitectMicrosoft V-TSP

Amit DubayDirector – Cloud &

MobilityWinWire Technologies

Microsoft Azure Certified Developer

Vineet AroraCTO

WinWire TechnologiesMCA – Microsoft Certified

Azure ArchitectMicrosoft V-TSP

Agenda

Sample IoT Solution

Developing and Deploying UWP apps

Windows 10 IoT Solution Development

Introducing Windows 10 IoT Core

Demo

12345

“ ”

What is the Internet of Things?

The network of physical objects that contain embedded technology to communicate and interact with their internal states or the external environment.Source: Gartner

Cell phone

VoIP phone

HVAC

Computer

Vending

Printer

Security

Media player

Oven

Automobile

Smart scale

Refrigerator

Television

Microwave

Coffee maker

Alarm clock

HOME HOMEWORKPLACE

IoT 2010

Sleep tracking

COMMUTE COMMUTE

Home security Home automation Leak detection

Smart appliances

Indoor navigation

Health monitoring

Smart lighting

Pet tracking

Information capture

Trip tracking and car health

Control

Child and eldermonitoring

Sports and fitness

Air conditioning and temperature control Environmental sensors

Behavior modification

Garden, lawn and plant care

Food and nutrition tracking

Beacons and proximity

New devices and sensors

Object tracking

Identity Smart vending machines

Medication adherence

Bike ride stats and protection

Entertainment systems

Office equipment

IoT 2015

HOME HOMEWORKPLACE

”Windows 10 represents the culmination of our platform convergence journey with Windows now running on a single, unified Windows core.”

Dir., Windows Dev Platform

Microsoft’s Embedded Platform Convergence

v6.5

Windows Embedded Handheld

Windows Embedded

Windows on Devices

Windows Embedded Standard

v8.1

Con

verg

edO

S k

erne

l

Con

verg

edap

p m

odel

v7

Windows Embedded Compact

Windows 10

v2013

Porti

ng T

ools

v8

v7

One coreMultiple SKUs

A converged core means we can leverage our

Windows dev skills for IoT solutionsand extend/scale

them by leveraging Azure as backend

Windows 10 IoT overview

You can write a Universal Windows Platform (UWP) Application using a variety of programming languages in Visual Studio to rapidly create maker projects

Windows 10 IoT Core is a new edition of Windows targeted towards small embedded devices and maker boards such as Raspberry Pi2

IoT core is designed to work with low-level bus interfaces such as I2C, SPI, USB

You can use Windows 10 IoT Core to read sensor data, control actuators, connect to the cloud, create IoT applications and much more.

Getting started on Win 10 IoT Solution Development

Step 1 – Select device (maker boards) supported by

Windows 10 to run UWP apps and configure it

Step 3 – Using Visual Studio

develop UWP apps for IoT devices

Step 5 – Use Azure hosted services

to communicate with devices

Getting started on Win 10 IoT Solution Development

Best place to start !http://ms-iot.github.io/content/en-US/GetStarted.htm

Set-Up Windows 10 DEV PC for IoT Project

1. Make sure you are running the public release of Windows 10 (version 10.0.10240) or better.

2. Install Visual Studio 2015 (community edition is fine!)Make sure to do a Custom install and select the checkbox Universal Windows App Development Tools -> Tools and Windows SDK.

3. Install Windows IoT Core Project Templates Visual Studio in the Extension and Updates dialog (Tools > Extensions and Updates > Online)

4. Enable developer mode on your Windows 10 device

Setup your Windows 10 IoT Core development PC, by following this:

Step 2 - Installing Windows 10 IoT Core

Download Windows 10 IoT core for Raspberry Pi 2

● http://ms-iot.github.io/content/en-US/Downloads.htm

Deploy code to ‘Remote Machine’ (for example a Raspberry Pi 2 device)2Develop code for business logic in Visual Studio1

Build circuit to connect with device and ensure correct PIN usage3Design and develop hosted web services and database (on Azure!)4Develop logic for communication between cloud hosted service and device 5Develop Mobile app as required to control the device6Don’t forget – it is all ‘Insights’ – so design and implement dashboard on data

7

Step 3 (and beyond) – Design, Develop and host UWP App

Deploying UWP solution to remote machine

WinIoT Water management Project Overview

● Our project involved leveraging Windows 10 IoT Core on Raspberry Pi2 to control and measure water flow through a Solenoid water control valve

● Showcases how Azure based Services and Database Storage is used to ensure scalability of solution

● The solution also leverages Xamarin platform to develop an app to monitor the usage

● The app can demonstrate how to use water optimally and will allow users to keep a close watch on their water consumption by each outlet

● Collected data is also visualized on PowerBI based dashboard● Featured as contest entry on https://www.hackster.io/ Windows 10 IoT

contest

Overall Architecture and Data Flow

1

2

3 Xamarin Mobile App

Tap with Solenoid Valve

PowerBI based

Monitoring Dashboard

Windows Azure Serviceswith SQL Database Storage

Raspberry Pi2 Model BWith

Windows 10 IoT Core

Push Button for Tap(or sensor in real-life)

5

4

Lets look at the code – Button click eventprivate const string WinIoTGet = "http://winwireiot.azurewebsites.net/api/valve/get";private const string WinIoTPost = "http://winwireiot.azurewebsites.net/api/valve/post";private bool ButtonClicked = false;

private async void ButtonPin_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs args) { if (args.Edge == GpioPinEdge.FallingEdge) { ButtonClicked = true; HttpClient http = new HttpClient(); if (pinValue == GpioPinValue.High) { pinValue = GpioPinValue.Low; pin.Write(pinValue); StringContent queryString = new StringContent("1"); HttpResponseMessage response = http.PostAsync(new Uri(WinIoTPost),queryString).Result; response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); http.Dispose(); ButtonClicked = false; }

Button click event code Contd… ELSEelse

{ pinValue = GpioPinValue.High; pin.Write(pinValue); StringContent queryString = new StringContent("0"); HttpResponseMessage response = http.PostAsync(new Uri(WinIoTPost), queryString).Result;

response.EnsureSuccessStatusCode();string responseBody = await response.Content.ReadAsStringAsync();http.Dispose();ButtonClicked = false;} } }

Polling the Azure hosted Service for control message private async void Timer_Tick(object sender, object e) { if (!ButtonClicked) { HttpClient http = new HttpClient();

var result = await http.GetAsync(new Uri(WinIoTGet)); var response = result.Content.ReadAsStringAsync().Result; if (response.Equals("1")) { pinValue = GpioPinValue.Low; pin.Write(pinValue); LED.Fill = greenBrush;

DelayText.Text = "Valve has been switched On"; } else { pinValue = GpioPinValue.High; pin.Write(pinValue); LED.Fill = redBrush;

DelayText.Text = "Valve has been switched Off"; } } }

Power BI based Dashboard

Xamarin based WinIoT Mobile Application

Controls Custom Reporting

The Azure IoT Suite is a collection of Azure services that come together in a composite suite that you can quickly spin up preconfigured IoT solutions in minutes.  The suite contains the following core Azure services:

• IoT Hub• Event hub

• Stream Analytics ()• Storage blob

• Web/Mobile app• DocumentDb

• Web Jobs• Logic Apps

• Azure Active Directory

• The idea is to accelerate time to value, but also allows you to customize it, so that you can add devices and modify rules and alerts to tailor to your needs. 

• Microsoft Partners can work with customers to fine tune specific assets and processes and integrate with backend systems.

Azure IoT Suite - Overview

Azure IoT Suite - Benefits

● Accelerate time-to-value by easily deploying IoT applications for the most common use cases, such as remote monitoring, asset management, and predictive maintenance

● Plan and budget appropriately through a simple predictable business model

● Grow and extend solutions to support millions of assets

Who We Are

IT solutions company making

information actionable for the enterprises in the

mobile-cloud world

Mobility,Cloud,

Collaboration & Analytics

Technologies

Collaboration and Analytics solutions

leveraging pre-built solution accelerators

Microsoft Partner for

WinWire IoT Quick Start Offering

marketing@winwire.com

www.winwire.com

http://www.winwire.com/blog-winsights/

www.twitter.com/winwire

Q & ANext Webinar

Topic : Cortana AnalyticsWhen: Dec 17th at 9am PTVisit to Register - http://www.winwire.com/webinars/

Recommended