IoT Agents (Introduction)
Transcript of IoT Agents (Introduction)
Introduction to the IoT Agents
Contact [email protected]
(Reference Orion Context Broker version: 0.24.0)
• IOT Agents• Provisioning APIs• Interaction models• Where to start
Outline
IOT Agents
• IoT Architecturehttp://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
DEVDEVDEV
DEVDEV
DEVDEVDEVDEV
UL 2.0 LWM2M MQTT
NGSI
Device Provisioning: Models
4
Context Broker
IoT AgentLightweight M2M
NGSI
Dev. Protocol
IoT AgentThinking 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
DeviceProtocol NGSI
Entity information
Interaction begins
Interaction models: Lazy Attributes
IOT Agent
DeviceProtocol NGSI
Entity information
Interaction beginsRequires the IOT Agent to be
registered as a Context Provider
Completely synchronous model
Interaction models: Commands
IOT Agent
DeviceProtocol NGSI
CommandExecution
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 frameworkhttps://github.com/telefonicaid/iotagent-node-lib
– C++ IOT Agent frameworkhttps://github.com/telefonicaid/fiware-IoTAgent-Cplusplus
– LWM2M IOT Agenthttps://github.com/telefonicaid/lightweightm2m-iotagent
• IoT Architecture
http://bit.ly/iotArchitecture
• MQTThttp://mqtt.org
• COAPhttps://tools.ietf.org/html/rfc7252
• Lightweight M2Mhttp://openmobilealliance.org/about-oma/work-program/m2m-enablers/
BACKUP SLIDESBackup slides
12