33
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 [email protected] for any clarifications or information.

Building IoT Solutions using Windows IoT Core

Embed Size (px)

Citation preview

Page 1: Building IoT Solutions using Windows IoT Core

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 [email protected] for any clarifications

or information.

Page 2: Building IoT Solutions using Windows IoT Core

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

Page 3: Building IoT Solutions using Windows IoT Core

Agenda

Sample IoT Solution

Developing and Deploying UWP apps

Windows 10 IoT Solution Development

Introducing Windows 10 IoT Core

Demo

12345

Page 4: Building IoT Solutions using Windows IoT Core
Page 5: Building IoT Solutions using Windows IoT Core

“ ”

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

Page 6: Building IoT Solutions using Windows IoT Core

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

Page 7: Building IoT Solutions using Windows IoT Core

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

Page 8: Building IoT Solutions using Windows IoT Core

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

Dir., Windows Dev Platform

Page 9: Building IoT Solutions using Windows IoT Core

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

Page 10: Building IoT Solutions using Windows IoT Core

A converged core means we can leverage our

Windows dev skills for IoT solutionsand extend/scale

them by leveraging Azure as backend

Page 11: Building IoT Solutions using Windows IoT Core

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.

Page 12: Building IoT Solutions using Windows IoT Core
Page 13: Building IoT Solutions using Windows IoT Core

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

Page 14: Building IoT Solutions using Windows IoT Core

Getting started on Win 10 IoT Solution Development

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

Page 15: Building IoT Solutions using Windows IoT Core

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:

Page 16: Building IoT Solutions using Windows IoT Core

Step 2 - Installing Windows 10 IoT Core

Page 17: Building IoT Solutions using Windows IoT Core

Download Windows 10 IoT core for Raspberry Pi 2

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

Page 18: Building IoT Solutions using Windows IoT Core
Page 19: Building IoT Solutions using Windows IoT Core

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

Page 20: Building IoT Solutions using Windows IoT Core

Deploying UWP solution to remote machine

Page 21: Building IoT Solutions using Windows IoT Core

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

Page 22: Building IoT Solutions using Windows IoT Core

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

Page 23: Building IoT Solutions using Windows IoT Core

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; }

Page 24: Building IoT Solutions using Windows IoT Core

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;} } }

Page 25: Building IoT Solutions using Windows IoT Core

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"; } } }

Page 26: Building IoT Solutions using Windows IoT Core

Power BI based Dashboard

Page 27: Building IoT Solutions using Windows IoT Core

Xamarin based WinIoT Mobile Application

Controls Custom Reporting

Page 28: Building IoT Solutions using Windows IoT Core

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

Page 29: Building IoT Solutions using Windows IoT Core

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

Page 30: Building IoT Solutions using Windows IoT Core

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

Page 31: Building IoT Solutions using Windows IoT Core

Microsoft Partner for

Page 32: Building IoT Solutions using Windows IoT Core

WinWire IoT Quick Start Offering

Page 33: Building IoT Solutions using Windows IoT Core

[email protected]

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/