Building IoT Applications with Vortex and the Intel Edison Starter Kit

Preview:

Citation preview

Building IoT Apps with Vortex and the Intel Edison Starter Kit

AngeloCorsaro,PhDChiefTechnologyOfficer

angelo.corsaro@prismtech.com

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryIoT Architectures

Cop

yrig

ht P

rism

Tech

, 201

5

Cop

yrig

ht P

rism

Tech

, 201

5

Cloud

Cloud Centric Architectures

Cop

yrig

ht P

rism

Tech

, 201

5

Cloud

FogFog

Fog

Fog

Cop

yrig

ht P

rism

Tech

, 201

5

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryVortex Intro

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiary

Vortex is a standard technology for efficient, ubiquitous, interoperable, secure and platform independent data sharing across network connected devices

in151 Characters

Applications can autonomously and asynchronously read and write data enjoying spatial and

temporal decoupling DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

Virtualised Data Space

Temporal DecouplingFour different levels of temporal decoupling allow to control the trade-off between full temporal decoupling, performances and

resource usage

tSource

t

t

Sink

Sink

Volatile Durability

tSource

t

t

Sink

Sink

Transient Durability

Built-in dynamic discovery isolates applications from

network topology and connectivity details

DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

Dynamic Discovery

Failure DetectionVortex provides mechanism for

detecting traditional crashes as well as performance failures

Source

tSink

Fault Notification

TD

Source

tSink

Performance Failure Notification

P

t

P P

Fault MaskingA built-in fault-masking

mechanism transparently controls and switches between

sources of data

Source

tSink

Source t

Fault MaskingVortex provides mechanism for

detecting traditional crashes as well as performance failures

Source

tSink

Source t

QoS policies allow to express temporal and availability

constraints for data

DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

QoS - Enabled

A collection of policies that control non-

functional properties such as reliability,

persistence, temporal constraints and priority

QoS

HISTORY

LIFESPAN

DURABILITY

DEADLINE

LATENCY BUDGET

TRANSPORT PRIO

TIME-BASED FILTER

RESOURCE LIMITS

USER DATA

TOPIC DATA

GROUP DATA

OWENERSHIP

OWN. STRENGTH

LIVELINESS

ENTITY FACTORY

DW LIFECYCLE

DR LIFECYCLE

PRESENTATION

RELIABILITY

PARTITION

DEST. ORDER

RxO QoS Local QoS

QoS Policies controlling end-to-end properties

follow a Request vs. Offered

QoS Domain

Participant

DURABILITY

OWENERSHIP

DEADLINE

LATENCY BUDGET

LIVELINESS

RELIABILITY

DEST. ORDER

Publisher

DataWriter

PARTITION

DataReader

Subscriber

DomainParticipant

offered QoS

Topicwrites reads

Domain Idjoins joins

produces-in consumes-from

RxO QoS Policies

requested QoS

No single point of failure or bottleneck

Decentralised Data Space Data

Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

TopicDQoS

TopicDQoS

TopicAQoS

Connectivity is dynamically adapted to chose the most

effective way of sharing data

Adaptive ConnectivityData

Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

TopicDQoS

TopicDQoS

TopicAQoS

ThecommunicationbetweentheDataWriterandmatchingDataReaderscanbepeer-to-peerexploitingUDP/IP(UnicastandMulticast)orTCP/IP

ThecommunicationbetweentheDataWriterandmatchingDataReaderscanbe“brokered”butstillexploitingUDP/IP(UnicastandMulticast)orTCP/IP

A domain-wide information’s class A Topic defined by means

of a <name, type, qos>

TopicDDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

TopicTypeName

QoS

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryTopic Types

— Language Independent Declaration—

Topic types can be expressed using different syntaxes,

including IDL and ProtoBuf

Topic Type struct CarDynamics { string cid; long x; long y; float dx; long dy; } #pragma keylist CarDynamics cid

IDL

Topic types can be expressed using different syntaxes,

including IDL and ProtoBuf

Topic Type message CarDynamics { option (.omg.dds.type) = {name: "CarDynamics"}; required string cid = 0 [(.omg.dds.member).key = true]; required long x = 1; required long y = 2; required float dx = 3; required long dy = 4; }

ProtoBuf

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryTopic Types

— Language Dependent Declaration—

Topic types can be expressed using different syntaxes,

including IDL and ProtoBuf

Topic Type class CarDynamics: constructor: (@cid, @x, @y, @dx, @dy) ->

CoffeeScript

Topic types can be expressed using different syntaxes,

including IDL and ProtoBuf

Topic Type public struct CaDynamics { public string cid { get; set; } public int x { get; set; } public int y { get; set; } public int dx { get; set; } public int dy { get; set; } public CaDynamics (string cid, int x, int y, int dx, int dy) { this.cid = cid; this.x = x; this.y = y; this.dx = dx; this.dy = dy; } }

C#

Topic types can be expressed using different syntaxes,

including IDL and ProtoBuf

Topic Type @KeyList ( topicType = "CarDynamics", keys = {"cid"})public class CarDynamics { public String cid; public int x; public int dx; public int y; public int dy; public CarDynamics(String s, int a, int b, int c,int d) { this.cid = s; this.x = a; this.dx = b; this.y = c; this.dy = d; } @Override public String toString() { … }}

Java

Vortex “knows” about application

data types and uses this

information provide type-

safety and content-based

routing

Content Awareness structCarDynamics{

@keystringcid;longx;longy;floatdx;longdy;}

cid x y dx dyGR 33N GO 167 240 45 0LO 00V IN 65 26 65 0AN 637 OS 32 853 0 50AB 123 CD 325 235 80 0

“dx>50ORdy>50”

Type

CarDynamics

cid x y dx dyLO 00V IN 65 26 65 0AB 123 CD 325 235 80 0

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryProgramming Model

Cop

yrig

ht P

rism

Tech

, 201

4

Reading Data in C++#include <dds.hpp>

int main(int, char**) {

DomainParticipant dp(0); Topic<Meter> topic(”SmartMeter”); Subscriber sub(dp); DataReader<Meter> dr(dp, topic);

LambdaDataReaderListener<DataReader<Meter>> lst; lst.data_available = [](DataReader<Meter>& dr) { auto samples = data.read(); std::for_each(samples.begin(), samples.end(), [](Sample<Meter>& sample) { std::cout << sample.data() << std::endl; } } dr.listener(lst); // Print incoming data up to when the user does a Ctrl-C std::this_thread::join(); return 0; }

enumUtilityKind{ ELECTRICITY, GAS, WATER};structMeter{ stringsn; UtilityKindutility; floatreading; floaterror;};#pragmakeylistMetersn

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryModeling Idioms

A state that is periodically updated

Examples are the reading of a sensor (e.g. Temperature Sensor), the

position of a vehicle, etc.

Soft StateReliability=>BestEffortDurability=>VolatileHistory=>KeepLast(n)Deadline=>updatePeriodLatencyBudget=>updatePeriod/3DestinationOrder=>SourceTimestamp

// Vortex’s Scala API provides first class implementation of the // soft-state pattern val temperature = SoftState[AnalogSensor](topicName)

A state that is sporadically updated and that often has temporal

persistence requirements

Examples are system configuration, a price estimate, etc.

Hard StateReliability=>ReliableDurability=>Transient|PersistentHistory=>KeepLast(n)(oftenn=1)DestinationOrder=>SourceTimestamp

// Vortex’s Scala API provides first class implementation of the // hard-state pattern. The state is transient by default and can be controlled // by an additional argument val runningMicrosvc = HardState[RunningMicrosvc](topicName)

The occurrence of something noteworthy for our system

Examples are a collision alert, the temperature beyond a given

threshold, etc.

EventsReliability=>ReliableDurability=>anyHistory=>KeepAllDestinationOrder=>SourceTimestamp

// Vortex’s Scala API provides first class implementation of the // hard-state pattern. The state is transient by default and can be controlled // by an additional argument val nodeError = Event[NodeError](topicName)

Data-centric design leverage the same principle of Feedback-control

loops to assert a state

In other terms, the desired state is asserted by writing a topic and the

actual state is monitored.

A control action is taken when the desired and the actual state differ

Feedback Control Loop

Data-centric design leverage the same principle of Feedback-control

loops to assert a state

In other terms, the desired state is asserted by writing a topic and the

actual state is monitored.

A control action is taken when the desired and the actual state differ

Feedback Control Loop Hard State

Soft State

microservice

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryVortex Technology Stack

Device implementations optimised for OT, IT and

consumer platforms

Native support for Cloud and Fog Computing Architectures

Device-2-DeviceDevice-2-Cloud

Fog-2-Cloud

Device-2-Fog

Cloud-2-Cloud

Fog-2-Fog

infra

structure

sdk

Polyglot and Interoperable across Programming

Languages Device-2-DeviceDevice-2-Cloud

Fog-2-Cloud

Device-2-Fog

Cloud-2-Cloud

Fog-2-Fog

infra

structure

sdk

Fully Independent of the Cloud Infrastructure

Private Clouds

Device-2-DeviceDevice-2-Cloud

Fog-2-Cloud

Device-2-Fog

Cloud-2-Cloud

Fog-2-Fog

infra

structure

sdk

Native Integration with the hottest real-time analytics

platforms and CEP Device-2-DeviceDevice-2-Cloud

Fog-2-Cloud

Device-2-Fog

Cloud-2-Cloud

Fog-2-Fog

infra

structure

sdk

Integration with the popular Node-RED framework

Device-2-DeviceDevice-2-Cloud

Fog-2-Cloud

Device-2-Fog

Cloud-2-Cloud

Fog-2-Fog

infra

structure

sdk

Integration with mainstream Dashboard Technologies

Device-2-DeviceDevice-2-Cloud

Fog-2-Cloud

Device-2-Fog

Cloud-2-Cloud

Fog-2-Fog

infra

structure

sdk

High Performance 30 μs peer-to-peer latency

4+ Mmsgs/sec p2p throughput

Device-2-DeviceDevice-2-Cloud

Fog-2-Cloud

Device-2-Fog

Cloud-2-Cloud

Fog-2-Fog

infra

structure

sdk

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryIntel Edison Starter Kit

Edison is an Octo-Linux based x86 board for prototyping IoT

applications

Edison shirts an Intel optimised OpenJDK implementation — perfect

for Café

The Grove Starter Kit Plus provides a set of nice sensor, displays and

actuators to get started with IoT

IoT Starter Kit

Before getting started with playing with the demo, make sure your

board is properly configured

You can check the configuration using the configure_edison

command

Ensure that the WiFi is working!

Configuring your Board

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiarySensors

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryDisplays

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiary

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryLED

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiary

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryProgramming

Intel has contributed several Open Source project that provide high

level abstractions to access Sensors, LCD, Led, etc. , for a very large

number of different kinds of sensors and manufacturers

Programming

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiary

LED

Light Sensor

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiary

IoT Applications with Vortex and Edison

Cop

yrig

ht P

rism

Tech

, 201

5

Cloud

FogFog

Fog

Fog

Cop

yrig

ht P

rism

Tech

, 201

5

Vortex can be used to virtualise sensors/displays/motors/.. and make them universally available

Instead of locally programming sensors/displays/motors we

abstracts them with Topics and access /control through DDS in a

location transparent manner

Virtualisation

DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

The agentv micro service framework is used to flexibly

provision and manage applications

Deployment

DDS Global Data Space

...

Data Writer

Data Writer

Data Writer

Data Reader

Data Reader

Data Reader

Data Reader

Data Writer

TopicAQoS

TopicBQoS

TopicCQoS

TopicDQoS

struct AnalogSensor { short id; float rvalue; float value; }; #pragma keylist AnalogSensor id

Temperature Sensor

TopicAnalogSensor

Temperature

Soft S

tate

sensor specific microsvc

write

read

read

read

struct LCDText { short id; unsigned short row; unsigned short col; string text; }; #pragma keylist LCDText id

LCD TopicLCDText

LCDText

Hard

State

sensor specific microsvc

read

read

struct LCDColor { short id; short r; short g; short b; }; #pragma keylist LCDColor id

TopicLCDColor

LCDColor

Hard

State

write

write

write

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiaryCoding-Lab

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiary

This slides have been crafted by Angelo Corsaro

Any use of these slides that does include me as Author/Co-Author is plagiary

Vortex makes it extremely easy to build IoT applications

Get started Building IoT apps with Vortex and Edison!

In Summary

Cop

yrig

ht P

rism

Tech

, 201

5

Recommended