23
BUILDING IOT SOLUTIONS WITH NITROGEN Doug Seven, Director Microsoft DX-TED, Partner Catalyst Team @DSeven @ThingLabsIo

Building IoT Solutions with Nitrogen

Embed Size (px)

Citation preview

BUILDING IOT SOLUTIONS WITH NITROGENDoug Seven, Director

Microsoft DX-TED, Partner Catalyst Team

@DSeven @ThingLabsIo

Field

Gate

ways Proto

col A

dapte

rsO

SS P

roje

ct

Clo

ud G

ate

way

Eve

nt

Hub ->

IoT H

ub

Hot Path AnalyticsAzure Stream Analytics, Azure Storm

Cold / Batch Analytics & Visualizations

Azure HDInsight, AzureML, Power BI, Azure Data Factory

Hot Path Business LogicPaaS V2 & Actor Framework E

nte

rprise

Pro

cess

Connect

ions

Biz

Talk

Serv

ices,

Notific

ation H

ubs

Devi

ces

Linux,

Andro

id, iO

S, RTO

S, W

indow

s

Device Connectivity

Analytics & Operationalized Insights

BusinessConnectivity

IOT DEVICE <-> CLOUD PATTERNS

Field

Gate

ways Proto

col A

dapte

rsO

SS P

roje

ct

Clo

ud G

ate

way

Eve

nt

Hub ->

IoT H

ub

Hot Path AnalyticsAzure Stream Analytics, Azure Storm

Cold / Batch Analytics & Visualizations

Azure HDInsight, AzureML, Power BI, Azure Data Factory

Hot Path Business LogicPaaS V2 & Actor Framework E

nte

rprise

Pro

cess

Connect

ions

Biz

Talk

Serv

ices,

Notific

ation H

ubs

Devi

ces

Linux,

Andro

id, iO

S, RTO

S, W

indow

s

Device Connectivity

Analytics & Operationalized Insights

BusinessConnectivity

IOT DEVICE <-> CLOUD PATTERNS

NITROGENNitrogen is an open-source, JavaScript backendfor the Internet of Things.

Nitrogen provides Device Management Security and permissions Data Ingest Command & Control

Nitrogen includes a JavaScript client library for device and web applications.

http://www.Nitrogen.io

PUB-SUB MESSAGING MODEL

Bad User

MotorizedBlinds

Rogue Light

Light Sensor

Nitrogen Service

Lighting App

Light

LightSwitch

Mobile App

NITROGEN MESSAGING

var message = new nitrogen.Message({ type: '_lightState', body: { on: false } });

var message = new nitrogen.Message({ type: '_lightLevel', body: { ambientLight: 51 } });

NITROGEN MESSAGE{

"ts":"2015-05-20T05:52:16.323Z",

"body":

{

"temperature":30

},

"type":"temperature“

}

DEMO

Sending Telemetry to Nitrogen

COMMAND & CONTROL Nitrogen enables sending messages or subscribing to message streams

Any device with permission can send a message to a specific device

Any device with permission can subscribe to the message stream of a device

NITROGEN COMMANDMANAGER The CommandManager enables interrogation and execution of commands

for a device.

CommandManager should be sub-classed for the specific implementation.

Sub-classes must override five (5) functions: isRelevant() isCommand() obsoletes() executeQueue() start()

IMPLEMENTING COMMANDMANAGER isRelevant

Should I care about the message?

isCommand Do I need to execute the message?

obsoletes Do I care any more? (e.g. have I already processed this)

executeQueue Do whatever needs to be done based on the message

start Get things going

PERMISSIONS Permissions enable control over which Principals can interact (or not) with

other Principals

Permission Types admin view send subscribe

Permissions enable explicit authorization control n2 permission add --action subscribe --authorized true --issueTo <PRINCIPAL ID> --principalFor <PRINCIPAL ID>

NITROGEN MESSAGE{ "ts":"2015-05-20T15:03:48.299Z",

"body":{

"command":{

"on":false }},

"from":"555ca24bf9b56a0100321aae", "type":"_lightState",

"index_until":"2015-05-27T15:03:48.683Z",

"expires":"2500-01-01T00:00:00.000Z",

"tags":["command:555ca24bf9b56a0100321aae"],

"response_to":["555ca2539746460100146efc"],

"ver":0.2, "updated_at":"2015-05-20T15:03:48.683Z",

"created_at":"2015-05-20T15:03:48.683Z",

"id":"555ca254edc0b30100124cee“

}

DEMO

Implementing Command Manager to Control a Device

CAR CLIENT

type: enginets: 05/03/2014 08:00:24rpms: 23.23fuel: 2.2

type: locationts: 05/03/2014 08:00:23latitude: -33.92253longitude: 18.4239

type: locationts: 05/03/2014 08:00:26latitude: 38.2longitude: 2.2

type: locationts: 05/03/2014 08:00:25latitude: 38.2longitude: 2.2

Nit

rogen

Fro

ntd

oor

MQTTuC

(1

28

KB

, 8

0M

Hz)

3G

TELEMETRY INGESTION

MQTT AMQP

Authentication and Authorization

Ingestion Service

REST

Device Registry

Data Pipeline

Cars Browsers, MobileServers

Nit

rogen

Serv

ices

Azu

reC

lients

Machine Learning

NEXT STEPSTutorials/labs at http://ThingLabs.iohttp://Nitrogen.io

[email protected]

@DSeven @ThingLabsIo