Connecting to the internet of things (IoT)
-
Upload
fernando-lopez-aguilar -
Category
Internet
-
view
452 -
download
2
Transcript of Connecting to the internet of things (IoT)
Connecting IoT Devices to FIWARE
Fernando LópezFIWARE Cloud and Platform Senior [email protected]@flopezaguilar
1
#SmartCities#SmartAgrifood
#SmartIndustry
FIWARE: Technology for Smart*
#SmartRegions
NGSICONTEXTINFORMATION
IoT Interoperability ? Still a $1,000,000 question
3
4
5
Weneedtofind
We need to find the exit of this labyrinth
6
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
Previously: Sylos or Verticals SmartCity/Smart*
8
HighEfficiency• Automatization
HigherITBusiness
• Commonsuppliers
Maintenance• Differentplatforms
Previously: Horizontals SmartCity/Smart*
9
HigherEfficiency• Automatization• Maintenance
HigherITBusiness
• Commonsuppliers
Intelligence
Connectivity
Monolithic• Verycomplex• Scaling• Onlyoneconnectivity
FIWARE Smart*: Local Ecosystemgrowth engine
10
HigherEfficiency
BoostOverallBusiness
• Cross-verticalideasandservices
• NewPlayers• DataScientists• Developers
• SharedNetworks,Cloud
Smart* FIWARE most-used IoT Stack
11
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
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
IoT Agents
14
FIWARE IoT architecture
15
16
IoT Platform
1717
IOTA IOTA IOTA
DEVDEVDEV
DEVDEV
DEVDEVDEVDEV
UL 2.0 LWM2M MQTT
NGSI
IoT Manager
Provision API
AppAppApp
App
AppAppApp
AppAppApp
AppApp
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)
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"
}
]
}
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"
}
]}]}
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
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
IoT Broker
23
Table of Contents
• Introduction• What does IoT Broker do?
• Advanced Features:• IoT Knowledge Server• IoT Broker Federation• IoT Broker Scalability
25
The FIWARE Enablers for 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
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
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
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
IoT Knowledge Server
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
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
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
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”
IoT Broker Federation
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.
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
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
IoT Broker Scalability
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
IoT on the edge
41
FIWARE IoT architecture
42
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
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
45
46
http://fiware.orgFollow @FIWARE on Twitter
Thank you!
http://fiware.orgFollow @FIWARE on Twitter
Backup slides