FIWARE IoT Agents
1
IoT Communication Protocols
2
Range
Speed
< 3m < 5km < 100km
bps
Kbps
Mbps
IoT Network of Networks
3
https://atos.net/content/mini-sites/journey-2020/index.html
IoT Devices: constrained nodes
4
IoT Devices: constrained nodes
5
ARM	Cortex-M3 32	MHz
~MB	Flash,	~KB	RAM
ZigBee, GRPS,	IEEE	802.15.4
Low	power	consumption	
mode
Contiki	OS,	FreeRTOS,	RIOT
IoT Devices: constrained nodes
§ https://tools.ietf.org/html/rfc7228
§ Target of price lower as possible. Less than 1$??
6
Class RAM Flash
Class 0 <	1KB <100KB
Class 1 ~10KB ~100KB
Class 2 ~50KB ~250KB
IoT Agents: Connecting IoT Protocols to FIWARE
7
APPLICATION
TRANSPORT
SIMPLIFIED OSI
NETWORK
LINK
PHYSICAL
CoAP
802.15.4
UDP
IoT Device
IPv6, RPL
6LoWPAN
App protocol
IoT Agent
TCP
CONTEXT BROKER
IPv4
HTTP
NGSI /REST
1000s of bytes
10/100s of bytes
IoT Agents: Connecting IoT Protocols to FIWARE
8
APPLICATION
TRANSPORT
SIMPLIFIED OSI
NETWORK
LINK
PHYSICAL
CoAP
802.15.4
UDP
IoT Device
IPv6, RPL
6LoWPAN
App protocol
IoT Agent
802.15.4
UDP
IPv6, RPL
6LoWPAN
IPv4
TCP
CoAP
App protocol
HTTP
NGSI/REST
TCP
CONTEXT BROKER
IPv4
HTTP
NGSI /REST
1000s of bytes
10/100s of bytes
IoT Agents’ features
9
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
IoT Agents’ features
10
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
1. IoT Agent Registers the device
1.
IoT Agents’ features
11
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
1. IoT Agent Registers the device
2. Device sends information updates
1.
2.
IoT Agents’ features
12
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
1. IoT Agent Registers the device
2. Device sends information updates
3. Agent sends NGSI request
1.
2.
3.
IoT Agents’ features
13
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
1. IoT Agent Registers the device
2. Device sends information updates
3. Agent sends NGSI request
4. External system modifies CB data
1.
2.
3.
4.
IoT Agents’ features
14
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
1. IoT Agent Registers the device
2. Device sends information updates
3. Agent sends NGSI request
4. External system modifies CB data
5. Context broker updates device value
1.
2.
3.
4.
5.
IoT Agents’ features
15
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
1. IoT Agent Registers the device
2. Device sends information updates
3. Agent sends NGSI request
4. External system modifies CB data
5. Context broker updates device value
6. Device receives command
1.
2.
3.
4.
5.
6.
IoT Agents’ features
16
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
1. IoT Agent Registers the device
2. Device sends information updates
3. Agent sends NGSI request
4. External system modifies CB data
5. Context broker updates device value
6. Device receives command
1.
2.
3.
4.
5.
6.
NGSI
IoT
Comm
IoT Agents: device to NGSI mapping
§ Each IoT Device is mapped to a CB Entity
§ Each IoT resource is mapped to CB attribute
17
• devID0001
• remoteType
Entity
• temperature
• float
• 25.4
Attribute
• heartRate
• integer
• 80
Attribute
IoT Agents: active attributes
18
http://www.smartdubai.ae
IoT Agents: active attributes
19
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
1.
2.
3.
NGSI
IoT
Comm
1. Device sends information updates
2. Agent sends NGSI request
3. External system is notified or queries CB
data
§ Device may be sleep to reduce energy
consumption
IoT Agents: lazy attributes
20
IoT Agents: lazy attributes
21
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
1. External system queries CB
2. CB queries IoT Agent as Context
provider
3. IoT Agent queries device
§ Device may be listening to queries
3.
1.
4.
NGSI
IoT
Comm
2. 5.
IoT Agents: commands
22
https://atmelcorporation.files.wordpress.com
IoT Agents: commands
23
IoT Agent
IoT Agent Lib
Agent Ad-hoc
Context broker
IoT Device
External system
1. External system sets attribute in CB
2. CB updates context in IoT Agent as
Context provider
3. IoT Agent answers with PENDING
4. IoT Agent sends command to device
5. Device answers with command result
6. IoT Agent updates context in CB
4.
1.
5.
NGSI
IoT
Comm
2. 3. 6.
Device Provisioning API
§ POST /iot/devices
§ Service headers
• FIWARE-service
• FIWARE-servicepath
24
{ "devices": [
{
device_id: “coffee001”,
entity_name: “coffeeMachineHome",
entity_type: “coffeMachineDevice",
attributes: [
{
name: “waterLevel",
type: “integer"
}
],
lazy: [
{
name: “status",
type: “string"
}
],
commands: [
{
name: “start",
type: “string"
}]}]}
Configuration API
§ POST /iot/services
§ Service headers
• FIWARE-service
• FIWARE-servicepath
25
{ services: [
{
resource: “/deviceTest”,
apikey: “801230BJKL23Y24HV8732”,
type: “Light”,
trust: “8970A9078A803HAMS”,
commands: [],
lazy: [{
name: “luminescence”,
type: “Lumens”
}],
active:[]
}
]
}
Main IoT Agents available: Ultralight 2.0
26
APPLICATION
TRANSPORT
SIMPLIFIED OSI
NETWORK
LINK
PHYSICAL
MQTT / HTTP
TCP
IoT Device
ULTRALIGHT
IoT Agent
TCP
IPv4
TCP
MQTT / HTTP
ULTRALIGHT
HTTP
NGSI/REST
TCP
CONTEXT BROKER
IPv4
HTTP
NGSI /REST
Main IoT Agents available: Ultralight 2.0
§ Measure payload syntax
• temperature | 15 | position up
§ Does not support lazy attributes
§ https://github.com/Fiware/iot.IoTagent-UL
§ Un-appropriate for:
• Really constrained devices
• Low-Power and Lossy Networks (LLNs),
§ Data model based on shorter text messages
27
Main IoT Agents available: JSON
28
APPLICATION
TRANSPORT
SIMPLIFIED OSI
NETWORK
LINK
PHYSICAL
MQTT
TCP
IoT Device
JSON
IoT Agent
TCP
IPv4
TCP
MQTT
JSON
HTTP
NGSI/REST
TCP
CONTEXT BROKER
IPv4
HTTP
NGSI /REST
Main IoT Agents available: JSON
§ Measure payload syntax
• {“temperature”: 40.2, “position”: “left”}
§ Does not support lazy attributes
§ https://github.com/Fiware/iot.IoTagent-JSON
§ Un-appropriate for:
• Really constrained devices
• Low-Power and Lossy Networks (LLNs),
§ Data model based on JSON standard objects
29
Main IoT Agents available: OMA Lightweight M2M
30
http://openmobilealliance.org
Main IoT Agents available: OMA Lightweight M2M
31
APPLICATION
TRANSPORT
SIMPLIFIED OSI
NETWORK
LINK
PHYSICAL
DTLS / CoAP
UDP
IoT Device
LWM2M
IoT Agent
UDP
IPv4
TCP
DTLS / CoAP
LWM2M
HTTP
NGSI/REST
TCP
CONTEXT BROKER
IPv4
HTTP
NGSI /REST
Main IoT Agents available: OMA Lightweight M2M
§ Object model
• Based on Object and Resource hierarchy (e.g.: /1/12/3)
• OMA Registry
§ https://github.com/Fiware/iot.IoTagent-LWM2M
§ Appropriate for:
• Really constrained devices
• Low-Power and Lossy Networks (LLNs),
32
How to start… First, choose your flavour!!
33
§ https://fiware-iot-stack.readthedocs.io/en/latest/device_gateway/index.html
§ https://github.com/Fiware/iot.IoTagent-node-lib
§ https://github.com/Fiware/iot.IoTagent-UL
§ https://github.com/Fiware/iot.IoTagent-JSON
§ https://github.com/Fiware/iot.IoTagent-LWM2M
How to start… Then, docs and requirements
34
How to start… Finally, node/npm or docker?
35
Thank you!
http://fiware.org
Follow @FIWARE on Twitter
Jose	Gato	/	Daniel	Calvo
IoE	Lab.	ATOS	Research	&	
Innovation
jose.gato@atos.net	/	
daniel.calvo@atos.net

FIWARE Tech Summit - FIWARE IoT Agents

  • 1.
  • 2.
    IoT Communication Protocols 2 Range Speed <3m < 5km < 100km bps Kbps Mbps
  • 3.
    IoT Network ofNetworks 3 https://atos.net/content/mini-sites/journey-2020/index.html
  • 4.
  • 5.
    IoT Devices: constrainednodes 5 ARM Cortex-M3 32 MHz ~MB Flash, ~KB RAM ZigBee, GRPS, IEEE 802.15.4 Low power consumption mode Contiki OS, FreeRTOS, RIOT
  • 6.
    IoT Devices: constrainednodes § https://tools.ietf.org/html/rfc7228 § Target of price lower as possible. Less than 1$?? 6 Class RAM Flash Class 0 < 1KB <100KB Class 1 ~10KB ~100KB Class 2 ~50KB ~250KB
  • 7.
    IoT Agents: ConnectingIoT Protocols to FIWARE 7 APPLICATION TRANSPORT SIMPLIFIED OSI NETWORK LINK PHYSICAL CoAP 802.15.4 UDP IoT Device IPv6, RPL 6LoWPAN App protocol IoT Agent TCP CONTEXT BROKER IPv4 HTTP NGSI /REST 1000s of bytes 10/100s of bytes
  • 8.
    IoT Agents: ConnectingIoT Protocols to FIWARE 8 APPLICATION TRANSPORT SIMPLIFIED OSI NETWORK LINK PHYSICAL CoAP 802.15.4 UDP IoT Device IPv6, RPL 6LoWPAN App protocol IoT Agent 802.15.4 UDP IPv6, RPL 6LoWPAN IPv4 TCP CoAP App protocol HTTP NGSI/REST TCP CONTEXT BROKER IPv4 HTTP NGSI /REST 1000s of bytes 10/100s of bytes
  • 9.
    IoT Agents’ features 9 IoTAgent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system
  • 10.
    IoT Agents’ features 10 IoTAgent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system 1. IoT Agent Registers the device 1.
  • 11.
    IoT Agents’ features 11 IoTAgent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system 1. IoT Agent Registers the device 2. Device sends information updates 1. 2.
  • 12.
    IoT Agents’ features 12 IoTAgent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system 1. IoT Agent Registers the device 2. Device sends information updates 3. Agent sends NGSI request 1. 2. 3.
  • 13.
    IoT Agents’ features 13 IoTAgent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system 1. IoT Agent Registers the device 2. Device sends information updates 3. Agent sends NGSI request 4. External system modifies CB data 1. 2. 3. 4.
  • 14.
    IoT Agents’ features 14 IoTAgent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system 1. IoT Agent Registers the device 2. Device sends information updates 3. Agent sends NGSI request 4. External system modifies CB data 5. Context broker updates device value 1. 2. 3. 4. 5.
  • 15.
    IoT Agents’ features 15 IoTAgent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system 1. IoT Agent Registers the device 2. Device sends information updates 3. Agent sends NGSI request 4. External system modifies CB data 5. Context broker updates device value 6. Device receives command 1. 2. 3. 4. 5. 6.
  • 16.
    IoT Agents’ features 16 IoTAgent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system 1. IoT Agent Registers the device 2. Device sends information updates 3. Agent sends NGSI request 4. External system modifies CB data 5. Context broker updates device value 6. Device receives command 1. 2. 3. 4. 5. 6. NGSI IoT Comm
  • 17.
    IoT Agents: deviceto NGSI mapping § Each IoT Device is mapped to a CB Entity § Each IoT resource is mapped to CB attribute 17 • devID0001 • remoteType Entity • temperature • float • 25.4 Attribute • heartRate • integer • 80 Attribute
  • 18.
    IoT Agents: activeattributes 18 http://www.smartdubai.ae
  • 19.
    IoT Agents: activeattributes 19 IoT Agent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system 1. 2. 3. NGSI IoT Comm 1. Device sends information updates 2. Agent sends NGSI request 3. External system is notified or queries CB data § Device may be sleep to reduce energy consumption
  • 20.
    IoT Agents: lazyattributes 20
  • 21.
    IoT Agents: lazyattributes 21 IoT Agent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system 1. External system queries CB 2. CB queries IoT Agent as Context provider 3. IoT Agent queries device § Device may be listening to queries 3. 1. 4. NGSI IoT Comm 2. 5.
  • 22.
  • 23.
    IoT Agents: commands 23 IoTAgent IoT Agent Lib Agent Ad-hoc Context broker IoT Device External system 1. External system sets attribute in CB 2. CB updates context in IoT Agent as Context provider 3. IoT Agent answers with PENDING 4. IoT Agent sends command to device 5. Device answers with command result 6. IoT Agent updates context in CB 4. 1. 5. NGSI IoT Comm 2. 3. 6.
  • 24.
    Device Provisioning API §POST /iot/devices § Service headers • FIWARE-service • FIWARE-servicepath 24 { "devices": [ { device_id: “coffee001”, entity_name: “coffeeMachineHome", entity_type: “coffeMachineDevice", attributes: [ { name: “waterLevel", type: “integer" } ], lazy: [ { name: “status", type: “string" } ], commands: [ { name: “start", type: “string" }]}]}
  • 25.
    Configuration API § POST/iot/services § Service headers • FIWARE-service • FIWARE-servicepath 25 { services: [ { resource: “/deviceTest”, apikey: “801230BJKL23Y24HV8732”, type: “Light”, trust: “8970A9078A803HAMS”, commands: [], lazy: [{ name: “luminescence”, type: “Lumens” }], active:[] } ] }
  • 26.
    Main IoT Agentsavailable: Ultralight 2.0 26 APPLICATION TRANSPORT SIMPLIFIED OSI NETWORK LINK PHYSICAL MQTT / HTTP TCP IoT Device ULTRALIGHT IoT Agent TCP IPv4 TCP MQTT / HTTP ULTRALIGHT HTTP NGSI/REST TCP CONTEXT BROKER IPv4 HTTP NGSI /REST
  • 27.
    Main IoT Agentsavailable: Ultralight 2.0 § Measure payload syntax • temperature | 15 | position up § Does not support lazy attributes § https://github.com/Fiware/iot.IoTagent-UL § Un-appropriate for: • Really constrained devices • Low-Power and Lossy Networks (LLNs), § Data model based on shorter text messages 27
  • 28.
    Main IoT Agentsavailable: JSON 28 APPLICATION TRANSPORT SIMPLIFIED OSI NETWORK LINK PHYSICAL MQTT TCP IoT Device JSON IoT Agent TCP IPv4 TCP MQTT JSON HTTP NGSI/REST TCP CONTEXT BROKER IPv4 HTTP NGSI /REST
  • 29.
    Main IoT Agentsavailable: JSON § Measure payload syntax • {“temperature”: 40.2, “position”: “left”} § Does not support lazy attributes § https://github.com/Fiware/iot.IoTagent-JSON § Un-appropriate for: • Really constrained devices • Low-Power and Lossy Networks (LLNs), § Data model based on JSON standard objects 29
  • 30.
    Main IoT Agentsavailable: OMA Lightweight M2M 30 http://openmobilealliance.org
  • 31.
    Main IoT Agentsavailable: OMA Lightweight M2M 31 APPLICATION TRANSPORT SIMPLIFIED OSI NETWORK LINK PHYSICAL DTLS / CoAP UDP IoT Device LWM2M IoT Agent UDP IPv4 TCP DTLS / CoAP LWM2M HTTP NGSI/REST TCP CONTEXT BROKER IPv4 HTTP NGSI /REST
  • 32.
    Main IoT Agentsavailable: OMA Lightweight M2M § Object model • Based on Object and Resource hierarchy (e.g.: /1/12/3) • OMA Registry § https://github.com/Fiware/iot.IoTagent-LWM2M § Appropriate for: • Really constrained devices • Low-Power and Lossy Networks (LLNs), 32
  • 33.
    How to start…First, choose your flavour!! 33
  • 34.
    § https://fiware-iot-stack.readthedocs.io/en/latest/device_gateway/index.html § https://github.com/Fiware/iot.IoTagent-node-lib §https://github.com/Fiware/iot.IoTagent-UL § https://github.com/Fiware/iot.IoTagent-JSON § https://github.com/Fiware/iot.IoTagent-LWM2M How to start… Then, docs and requirements 34
  • 35.
    How to start…Finally, node/npm or docker? 35
  • 36.
    Thank you! http://fiware.org Follow @FIWAREon Twitter Jose Gato / Daniel Calvo IoE Lab. ATOS Research & Innovation jose.gato@atos.net / daniel.calvo@atos.net