IoT with UWP, .NETCore and Azure

Post on 18-Feb-2017

922 views 5 download

Transcript of IoT with UWP, .NETCore and Azure

Zagreb,24.09.2015.Hotel Antunović

Zagreb,24.09.2015.

IoT with UWP & NetCore

Damir Dobric

AGENDA

IoT Apps on UWP How to “I” in IoT? IoT Apps on .NET Core

.net

UWP .net core

demo

ImplementDeployConnect

Run UWP App on PI2

How does it work?

Controlling GPIO

Assemblies for Messaging

• Open Source Messaging Library for Azure Service Bus and Event Hub• Support for different platforms (UWP, NETMF, net Core, Desktop)• Protocols: HTTP/AMQP

Send Message

Receive Message

.NET Core

https://dotnet.github.io/core/about/overview.html

demo

ImplementDeployConnect

Run .net Core on PI2

.NET Core Where is documentation?

https://dotnet.readthedocs.org/en/latest/

How to install?https://dotnet.readthedocs.org/en/latest/getting-started/installing-core-windows.html@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}“

This installs DNVM (.NET Version Manager) Run c:\> dnvm

Install DNX:c:\>dnvm install -r coreclr -arch x64 latest -u

Write some code

Console.ForegroundColor = ConsoleColor.Yellow;Console.WriteLine("Hello World");

Console.WriteLine("Machine: {0}, OS: {1}, Processors: {2}", Environment.GetEnvironmentVariable("COMPUTERNAME"), Environment.GetEnvironmentVariable("OS"), Environment.ProcessorCount);

Console.WriteLine(DateTime.Now.ToString());

Add required references

project.json  . . . "frameworks": { "dnx451": { }, "dnxcore50": { "dependencies": { "System.Collections": "4.0.10-beta-23019", "System.Console": "4.0.0-beta-23019", "System.Linq": "4.0.0-beta-23019", "System.Threading": "4.0.10-beta-23019", "Microsoft.CSharp": "4.0.0-beta-23019" } } }

Build and Package

C>dnu publish --out "C:\temp\netcoreapp\publish" --no-source --runtime dnx-coreclr-win-arm.1.0.0-beta7-12364

Connect to PI2

>net start winrm

>Set-Item WSMan:\localhost\Client\TrustedHosts –Value 192.168.178.79

>Enter-PSSession -ComputerName 192.168.178.79 -Credential Administrator

Start Application

[192.168.178.79]: PS C:\netcore\netcoreapp> .\go.cmd

References Cross-Plarform Console App

http://docs.asp.net/en/latest/dnx/console.html Running .NET Core App on PI2

http://developers.de/blogs/damir_dobric/archive/2015/09/22/how-to-run-net-core-application-on-pi2-win10-iot-core.aspx

JS SB SDKhttp://developers.de/blogs/damir_dobric/archive/2015/01/26/eventhubs-support-for-azure-servicebus-javascript-sdk.aspx

Win 10 IoT Corehttps://ms-iot.github.io/content/en-US/GetStarted.htm

Cross Platform Messaging:comming soon . Follow at http://developers.de

pitanja

Blog Twitter

damir.dobric@daenet.deb-dadobr@microsoft.com

https://twitter.com/ddobrichttp://developers.de/blogs/damir_dobric/default.aspx

ankete

Ankete su dostupne na:a) Mobilnim uređajima (Android, Apple, Windows)b) Web-u http://www.mobilityday.com PIN za pristup se nalazi na poleđini akreditacije i u vašem on-line profilu.

Popunite ankete i osvojite vrijedne nagrade!

demo