Introduction to the IoT Agents
Contact email
daniel.moranjimenez@telefonica.com
(Reference Orion Context Broker version: 0.24.0)
• IOT Agents
• Provisioning APIs
• Interaction models
• Where to start
Outline
IOT Agents
• IoT Architecture
http://bit.ly/iotArchitecture
• Device Protocolo to NGSI Bridge
– One entity per device
– Constrained set of interactions
• Design principles:
– Modular approach
– Deployment flexibility
– Ease the creation of Custom IOT Agents
• Provisioning of devices and group of
devices
• Additional services (e.g.: security,
device registration, stats)
IOTA IOTA IOTA
DEV
DEV
DEV
DEV
DEV
DEV
DEV
DEV
DEV
UL 2.0 LWM2M MQTT
NGSI
Device Provisioning: Models
4
Context Broker
IoT Agent
Lightweight M2M
NGSI
Dev. Protocol
IoT Agent
Thinking Things
Context BrokerApp Backend
Configuration APIDevice Provisioning API
Device Provisioning: Device Provisioning API
{
"devices": [
{
”device_id": "Light1",
"entity_name": "TheFirstLight",
"entity_type": "TheLightType",
"attributes": [
{
"name": "attr_name",
"type": "string"
}
],
"lazy": [
{
"name": "luminance",
"type": "lumens"
}
],
"commands": [
{
"name": "commandAttr",
"type": "commandType"
}
]
}
]
}
• /iot/devices/:deviceId
• Not exactly REST
(check doc):
– POST
– GET
– DELETE
– PUT
• Service headers:
– Fiware-service
– Fiware-servicepath
• Mandatory
– Device_id
– Entity_type
• Internal_attributes
Device Provisioning: Configuration API
{
services: [
{
resource: '/deviceTest',
apikey: '801230BJKL23Y24HV8732',
type: 'Light',
trust: '8970A9078A803HAMS’,
commands: [],
lazy: [
{
name: 'luminescence',
type: 'Lumens'
}
],
active: [
{
name: 'status',
type: 'Boolean'
}
]
}
]
}
• /iot/services
• Not exactly REST (check
doc)
– POST
– GET
– DELETE
– PUT
• Service headers:
– Fiware-service
– Fiware-servicepath
• Mandatory
– Resource
– Api_key
– Type
Interaction models: Active Attributes
IOT Agent
DB
Device
Protocol
NGSI
Entity information
Interaction
begins
Interaction models: Lazy Attributes
IOT Agent
Device
Protocol
NGSI
Entity
information
Interaction
begins
Requires the IOT Agent to be
registered as a Context Provider
Completely synchronous model
Interaction models: Commands
IOT Agent
Device
Protocol
NGSI
Command
Execution
Interaction
begins
Result Information
Requires the IOT Agent to be
registered as a Context Provider
And now… where do I start?
• Install an IoT Agent:
– UL 2.0 is a common option
– Use Docker
https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus/tree/develop/docker
• Use testing tools to send the data:
– Some agents have built-in test consoles
– Use figway for UL 2.0
https://github.com/telefonicaid/fiware-figway/tree/develop
• ReadTheDocs
http://fiware-iot-stack.readthedocs.org/en/latest/device_api/index.html
Resources
• Github Projects:
– Node.js IOT Agent framework
https://github.com/telefonicaid/iotagent-node-lib
– C++ IOT Agent framework
https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus
– LWM2M IOT Agent
https://github.com/telefonicaid/lightweightm2m-iotagent
• IoT Architecture
http://bit.ly/iotArchitecture
• MQTT
http://mqtt.org
• COAP
https://tools.ietf.org/html/rfc7252
• Lightweight M2M
http://openmobilealliance.org/about-oma/work-program/m2m-enablers/
BACKUP SLIDES
Backup slides
12

IoT Agents (Introduction)

  • 1.
    Introduction to theIoT Agents Contact email daniel.moranjimenez@telefonica.com (Reference Orion Context Broker version: 0.24.0)
  • 2.
    • IOT Agents •Provisioning APIs • Interaction models • Where to start Outline
  • 3.
    IOT Agents • IoTArchitecture http://bit.ly/iotArchitecture • Device Protocolo to NGSI Bridge – One entity per device – Constrained set of interactions • Design principles: – Modular approach – Deployment flexibility – Ease the creation of Custom IOT Agents • Provisioning of devices and group of devices • Additional services (e.g.: security, device registration, stats) IOTA IOTA IOTA DEV DEV DEV DEV DEV DEV DEV DEV DEV UL 2.0 LWM2M MQTT NGSI
  • 4.
    Device Provisioning: Models 4 ContextBroker IoT Agent Lightweight M2M NGSI Dev. Protocol IoT Agent Thinking Things Context BrokerApp Backend Configuration APIDevice Provisioning API
  • 5.
    Device Provisioning: DeviceProvisioning API { "devices": [ { ”device_id": "Light1", "entity_name": "TheFirstLight", "entity_type": "TheLightType", "attributes": [ { "name": "attr_name", "type": "string" } ], "lazy": [ { "name": "luminance", "type": "lumens" } ], "commands": [ { "name": "commandAttr", "type": "commandType" } ] } ] } • /iot/devices/:deviceId • Not exactly REST (check doc): – POST – GET – DELETE – PUT • Service headers: – Fiware-service – Fiware-servicepath • Mandatory – Device_id – Entity_type • Internal_attributes
  • 6.
    Device Provisioning: ConfigurationAPI { services: [ { resource: '/deviceTest', apikey: '801230BJKL23Y24HV8732', type: 'Light', trust: '8970A9078A803HAMS’, commands: [], lazy: [ { name: 'luminescence', type: 'Lumens' } ], active: [ { name: 'status', type: 'Boolean' } ] } ] } • /iot/services • Not exactly REST (check doc) – POST – GET – DELETE – PUT • Service headers: – Fiware-service – Fiware-servicepath • Mandatory – Resource – Api_key – Type
  • 7.
    Interaction models: ActiveAttributes IOT Agent DB Device Protocol NGSI Entity information Interaction begins
  • 8.
    Interaction models: LazyAttributes IOT Agent Device Protocol NGSI Entity information Interaction begins Requires the IOT Agent to be registered as a Context Provider Completely synchronous model
  • 9.
    Interaction models: Commands IOTAgent Device Protocol NGSI Command Execution Interaction begins Result Information Requires the IOT Agent to be registered as a Context Provider
  • 10.
    And now… wheredo I start? • Install an IoT Agent: – UL 2.0 is a common option – Use Docker https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus/tree/develop/docker • Use testing tools to send the data: – Some agents have built-in test consoles – Use figway for UL 2.0 https://github.com/telefonicaid/fiware-figway/tree/develop • ReadTheDocs http://fiware-iot-stack.readthedocs.org/en/latest/device_api/index.html
  • 11.
    Resources • Github Projects: –Node.js IOT Agent framework https://github.com/telefonicaid/iotagent-node-lib – C++ IOT Agent framework https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus – LWM2M IOT Agent https://github.com/telefonicaid/lightweightm2m-iotagent • IoT Architecture http://bit.ly/iotArchitecture • MQTT http://mqtt.org • COAP https://tools.ietf.org/html/rfc7252 • Lightweight M2M http://openmobilealliance.org/about-oma/work-program/m2m-enablers/
  • 12.