connecting to the internet of things (iot)

49
Connecting IoT Devices to FIWARE Fernando López FIWARE Cloud and Platform Senior Expert [email protected] @flopezaguilar

Upload: fernando-lopez-aguilar

Post on 23-Jan-2018

451 views

Category:

Internet


2 download

TRANSCRIPT

Page 1: Connecting to the internet of things (IoT)

Connecting IoT Devices to FIWARE

Fernando LópezFIWARE Cloud and Platform Senior [email protected]@flopezaguilar

Page 2: Connecting to the internet of things (IoT)

1

Page 3: Connecting to the internet of things (IoT)

#SmartCities#SmartAgrifood

#SmartIndustry

FIWARE: Technology for Smart*

#SmartRegions

NGSICONTEXTINFORMATION

Page 4: Connecting to the internet of things (IoT)

IoT Interoperability ? Still a $1,000,000 question

3

Page 5: Connecting to the internet of things (IoT)

4

Page 6: Connecting to the internet of things (IoT)

5

Weneedtofind

We need to find the exit of this labyrinth

Page 7: Connecting to the internet of things (IoT)

6

Page 8: Connecting to the internet of things (IoT)

FIWARE IoT: Interoperability at Context Data Level

Satisfying Developers view:

§ Common language for all Data Sources (IoT and non-IoT).

§ Single REST API. Query, Subscribe, Trigger Actions.

§ Open Source solutions published in GitHub, Read-the-docs, etc.

7

Street Devices• Location• Observations• Commands

Context Broker

NGSI APIBoiler• Manufacturer• Last revision• Product id• Temperature• Actions

Users• Name-Surname• Birthday• Location• ToDo list

City• OpenData• Users Input

Public Bus T.System• Location• Arrival time

APPs / Services / Data Scientist

Page 9: Connecting to the internet of things (IoT)

Previously: Sylos or Verticals SmartCity/Smart*

8

HighEfficiency• Automatization

HigherITBusiness

• Commonsuppliers

Maintenance• Differentplatforms

Page 10: Connecting to the internet of things (IoT)

Previously: Horizontals SmartCity/Smart*

9

HigherEfficiency• Automatization• Maintenance

HigherITBusiness

• Commonsuppliers

Intelligence

Connectivity

Monolithic• Verycomplex• Scaling• Onlyoneconnectivity

Page 11: Connecting to the internet of things (IoT)

FIWARE Smart*: Local Ecosystemgrowth engine

10

HigherEfficiency

BoostOverallBusiness

• Cross-verticalideasandservices

• NewPlayers• DataScientists• Developers

• SharedNetworks,Cloud

Page 12: Connecting to the internet of things (IoT)

Smart* FIWARE most-used IoT Stack

11

Page 13: Connecting to the internet of things (IoT)

Talking to IoT – Choosing an IoT-Agent

12

Use IoT Agents node.jslibrary to develop your

own IoT Agent.

Can I program mydevices/gatewaysto support a given

IoT protocol?

Is your IoT networklossy & unstable or

your devices tooconstrained to support

HTTP/TCP?

Use LWM2M IoT Agent. UDP isrecommended for constrainednetworks and CoAP is REST for

constrained devices

Are your codingPreferences/ libraries/

language handling betterJSON objects rather thanshorter text messages?

Use Ultralight2.0 IoTAgent. Messages are

simple and light as “t|25”

No

Yes

Use JSON IoT Agent.Choose MQTT if RT bidirectionality is a

must.

Yes

No

No

Yes

Page 14: Connecting to the internet of things (IoT)

Ongoing Work

§ Evolution of IoT Agents• Include new functionalities such as data Transformations.• New protocols (Modbus)• Consider IoT management.

§ From Cloud-Centralized to Distributed models• IoT Agents, NGSI Brokers and CEP at the IoT Gateway Level.

§ Context Data Models • Smartcities: OASC Alliance • SmartAgrifood: IoF Project• SmartIndustry

§ Federation and other implementations of NGSI Brokers • IoT Broker

§ Market dynamization (marketplace)• FIWARE-ready IoT Device Program.

13

Page 15: Connecting to the internet of things (IoT)

IoT Agents

14

Page 16: Connecting to the internet of things (IoT)

FIWARE IoT architecture

15

Page 17: Connecting to the internet of things (IoT)

16

Page 18: Connecting to the internet of things (IoT)

IoT Platform

1717

IOTA IOTA IOTA

DEVDEVDEV

DEVDEV

DEVDEVDEVDEV

UL 2.0 LWM2M MQTT

NGSI

IoT Manager

Provision API

AppAppApp

App

AppAppApp

AppAppApp

AppApp

Page 19: Connecting to the internet of things (IoT)

IoT Agents Overview

18

• Design principles:• Modular approach• Deployment flexibility• Ease the creation of Custom IoT Agents

• Device Protocol to NGSI Bridge• One entity per device• Constrained set of interactions

• Provisioning of devices and groups of devices

• IoT Manager

• Additional services (e.g. security, model transformation, stats)

Page 20: Connecting to the internet of things (IoT)

Example: Group provision

19

API Key provision

Type definition

Common attributes and commands

POST /iot/services HTTP/1.1

Host: localhost:4041

Fiware-Service: smartsville

Fiware-ServicePath: /managementContent-Type: application/json

{

"services": [

{

"apikey": "1234567890",

"resource": "/iot/d",

"type": "smartcity",

"protocol": "PDI-IoTA-UltraLight"

}

]

}

Page 21: Connecting to the internet of things (IoT)

Example: Device provision

20

Device ID definition

Defines per-deviceattributes and commands

POST /iot/devices HTTP/1.1

Host: localhost:4041

Fiware-Service: smartsville

Fiware-ServicePath: /managementContent-Type: application/json

{

"devices": [{

"device_id": "smartsville",

"entity_type": "smartcity",

"protocol": "PDI-IoTA-UltraLight",

"attributes": [

{

"object_id": "lum",

"name": "Luminance",

"type": "lumens"

}

]}]}

Page 22: Connecting to the internet of things (IoT)

Example: Ultralight 2.0 HTTP

21

Simple HTTP Protocol

Key Pair values

Push and Pull commands

POST /iot/d?k=1234567890&i=smartsville HTTP/1.1

Host: localhost:7896

Content-Type: text/plain

Cache-Control: no-cache

park1|true|park2|false|lum|300

HTTP/1.1 200 OK

Content-Length: 88

Content-Type: text/html

Connection: Closed

smartsville@semaphoreFreq|2|smartsville@luminosityLimit|200

Page 23: Connecting to the internet of things (IoT)

Links and documentation

§ IoT Agent Library• https://github.com/telefonicaid/iotagent-node-lib

§ Ultralight 2.0 IoT Agent• https://github.com/telefonicaid/iotagent-ul

§ The FIWARE Catalogue• https://catalogue.fiware.org/

22

Page 24: Connecting to the internet of things (IoT)

IoT Broker

23

Page 25: Connecting to the internet of things (IoT)

Table of Contents

• Introduction• What does IoT Broker do?

• Advanced Features:• IoT Knowledge Server• IoT Broker Federation• IoT Broker Scalability

Page 26: Connecting to the internet of things (IoT)

25

The FIWARE Enablers for IoT

Page 27: Connecting to the internet of things (IoT)

What does the IoT Broker do?

FIWARE GE:IoT Broker

Thing Abstraction: enable applications to interact with things instead of sensors

Thing-Level Interaction: Organizing information flows:

- executing information queries on behalf of applications

- discover the resources providing the requested information

- collecting & aggregating the received information – query and subscribe/notifyabstractions

apps

Devices Gateways other sources

Page 28: Connecting to the internet of things (IoT)

IoT Broker§ decouples applications from underlying IoT device installations

§ paradigm adopted: Subscribe/Notify§ Context data fetched directly from reporitory§ No need of a centralized repository, but can be added “Plug&Play”§ Optimized communications with underlying device installations

§ Initialized only when requested from the application§ Bandwidth communication reduced§ Scalability ensured in a scenario of billion of devices

§ Assemble lower-level device information (device-centric access) intohigher-level Thing information (information-centric access)§ Naming: From Devices (e.g. sensorId) to Things (e.g. Trafalgar Square).§ Type & Context: Close the gap between information-centric applications and

device-centric IoT installations§ Discovery & Resolution: IoT applications are agnostic of the device

installations§ Advanced Features:

§ Association§ Entity Composition

Page 29: Connecting to the internet of things (IoT)

EmergingIoTProtocolStack

IoT Development System• SDK• OS Integration• IoT Hardware

IoT Integration Layer• IoT Resources: Black Box

Container• REST-based Access

OMANGSI(IoTBroker)

IoT Entities• Contextualized Information• Content-based Queries• Pub / Sub

Knowledge-baseSemantic Processing Agents

Data Integration• across many systems• Semantic Representation• Semantic Mediation

New Standardization: ETSI ISG on Contextualized Information Models

Page 30: Connecting to the internet of things (IoT)

Advanced Feature:

§ IoT Knowledge Server§ Add semantic information into NGSI messages§ Enhance NGSI messages with semantic reasoning

§ IoT Broker Federation§ Separate IoT domains§ Improve IoT system integration

§ IoT Broker Scalability§ Enhance performances in envisioned scenario of millions of devices in

each domain

Page 31: Connecting to the internet of things (IoT)

IoT Knowledge Server

Page 32: Connecting to the internet of things (IoT)

IoT Knowledge Server: Overview§ IoT Knowledge Server: A standalone component created for serving

semantic information

§ Purpose: serving IoT Broker with triple-store datasets of semantic ontologies (e.g., NGSI/SmartSantander ontology)

§ Record and Explore Information Structure contained in the real-world data§ “get sub types of an entity type”

§ Interfaces: REST API and Subscribe/Notify in JSON format

§ IoT Knowledge Server is composed of two components (web servers) and two databases along with the servers

Page 33: Connecting to the internet of things (IoT)

Functionalities§ Pre-Defined Queries

§ HTTP requests for getSubTypes, getSuperTypes, getAttributes, getAllSubTypes, getAllSuperTypes

§ Add new queries§ New queries with one or zero variables (e.g. Entity Type) can be added to a

file and we can start using as a new functionality (other than the 5 above)

§ Register new queries§ Adding new queries by HTTP request on the fly (without restarting the

server)

§ Forward SPARQL queries§ To provide single point of contact even for direct SPARQL queries along with

the high level ones (getSubTypes)

§ Subscribe functionality§ Subscribing to queries and regular (fixed time) updates on change to the

subscribers by the IoTKnowledgeServer.

§ Caching mechanism§ Caching mechanisms for fast respond (without asking SPARQL server) § Both for Queries and for Subscriptions

Page 34: Connecting to the internet of things (IoT)

An example query

ApacheJenaFuseki

RDF Triple Store

REST

JSON

JDBC

IoT Broker

JSON

Ontology manager

REST

getSubTypes of Sensor

“getSubTypes_Sensor”

2

Get SPARQLQuery for getSubTypes

SELECT ?type WHERE {?type rdfs:subClassOf ngsi:<???>}

SELECT ?type WHERE {?type rdfs:subClassOf ngsi:Sensor}

NULL

3

1

4

5

6

7 {TempSensor,NoiseSensor,LightSensor}

8

{TempSensor,NoiseSensor,LightSensor}

<K,V>

REST

9

<“getSubTypes_Sensor”, {TempSensor,

NoiseSensor,LightSensor} >

IoT Knowledge Server

Page 35: Connecting to the internet of things (IoT)

IoT Knowledge Server: ExampleApplicationApplicationApplications

IoT AgentsContextProviders

IoT Broker IoT DiscoveryAvailability request:Entity of type “sensor”

Legend:- NGSI-10 - NGSI-9- IoT

Knowledge Server APIData request:

Entity of type “sensor”

Data Responses:Entity of type “sensor”, “TempSensor”, “NoiseSensor”,“LightSensor”

IoT Knowledge Server

getSubTypes of Sensor {TempSensor,NoiseSensor,LightSensor}

Data request:Entity of type “sensor”, “TempSensor”, “NoiseSensor”,“LightSensor”

Page 36: Connecting to the internet of things (IoT)

IoT Broker Federation

Page 37: Connecting to the internet of things (IoT)

IoT Broker Federation

§ Smart Cities are dominated by federated information from different agencies

§ An IoT platform is responsible for a single IoT domain§ Separate IoT data in different domains§ Full power on the produced data to the IoT domain administrator, e.g. for

privacy purpose

§ Selective communication to a specific domain§ Selected by IoT domain name§ Selected by entity name§ Selected by attribute type provided§ Selected by scope, e.g. geographic scope § Mixture of the above.

Page 38: Connecting to the internet of things (IoT)

Federation: hierarchicalApplications

NGSIagents

NG

SI

NG

SI NG

SI

NG

SI

IoT Platform (a)

IoTBroker

IoTDiscovery

IoT Platform (b)

IoTBroker

IoTDiscovery

NGSIagents

▌IoT Platform HierarchylTwo type of platform

• Subordinated IoT Platform: responsible for its IoT domain; subordinated to Platform

• Top IoT Platform: responsible of its own domain of NGSI devices; contact point for all subordinated domains

lTwo IoT domains manage their data inseparate repositories

lCommon communication language based on standard NGSI protocol

lMechanism of Subscribe Notify for accessing the data

▌Feature: broadcastinglTop IoT Platform dispatches

query/subscription to subordinated IoTPlatform

▌Feature: selective communicationlPossibility to query/subscribe only to a

specific subordinated IoT Platform

Page 39: Connecting to the internet of things (IoT)

Federation: mash-upApplications

NGSIagents

NG

SI

NG

SI

NGSI NGSIagentsNGSI

Applications

NG

SI

NGSIagents

NGSIApplications NGSI

IoT Platform (a)

IoTBroker

IoTDiscovery

IoT

Plat

form

(c)IoT

Broker

IoT Platform (b)

IoTBroker

IoTDiscovery

NGSI

▌ IoT Platform Meshl Each platform is a peerl Each peer is responsible of its own domainl Applications requesting a peer will get data

coming from other peer transparently

▌ Feature: broadcastingl Peer broadcast request to all known peer

▌ Feature: selective communicationl Possibility to query/subscribe only to a specific

known peer▌ Feature: loop detection

l A loop detection feature avoid loop in the topology

Page 40: Connecting to the internet of things (IoT)

IoT Broker Scalability

Page 41: Connecting to the internet of things (IoT)

ScalabilityApplicationApplicationApplications

IoT AgentsContextProviders

IoT Broker

IoT Discovery

registration

availabilityrequests

Load

Bal

ance

r(e.

g. D

NS)

Legend:- NGSI-10 - NGSI-9

IoT Broker

IoT Broker- Update

- Query- Subscription

Responses

- Query- Subscription

Page 42: Connecting to the internet of things (IoT)

IoT on the edge

41

Page 43: Connecting to the internet of things (IoT)

FIWARE IoT architecture

42

Page 44: Connecting to the internet of things (IoT)

edge

43

FIWARE in the cloud & in the edge

sensor data providers

LPWAN sensors

developers

end users

other data providers

latency-criticalsensor & actuatornetworks

FIWARE backend

Apps

Operatorplatform

LPWANetwork

servers

Equipment vendor

platform

sensor data providers

Page 45: Connecting to the internet of things (IoT)

Smart City platform

44

CKAN

Big Data

Context Broker

Accou

ntin

g & Paym

ent &

Billin

g

IDM

& A

uth

Short-termhistoric

data

BigData Processing

Data Quering/Action, Publish/Subscr

Open Data publishing

Real-time processing

BIETL

RULESDEFINITION

TOOL

OPERATIONAL DASHBOARD

KPI GOVERNANCE OPEN DATA PORTALS

Serviceorchestrator

ContextAdapters

CEP

IoT Backend

measures / commands

Sensors Open DataActuatorsMedia streams

Real Time Media Stream

Processing

City Services

GIS

Inventory

Specific Enablers

Generic Enablers

IoT Edge

Devicemanagement

& abstraction

Page 46: Connecting to the internet of things (IoT)

45

Page 47: Connecting to the internet of things (IoT)

46

http://fiware.orgFollow @FIWARE on Twitter

Page 48: Connecting to the internet of things (IoT)

Thank you!

http://fiware.orgFollow @FIWARE on Twitter

Page 49: Connecting to the internet of things (IoT)

Backup slides