This document provides instructions for 8 exercises involving deploying and using an IoT Agent to connect IoT devices to the FIWARE Context Broker. The exercises cover tasks like deploying an IoT Agent, provisioning devices, registering devices using the LWM2M protocol, retrieving and updating sensor data, detecting new data providers, customizing attribute mappings, and provisioning device groups. Contact information is provided for getting help with the exercises.
2. 0. Deploy a Lightweight M2M IoT Agent
• Prerequisite
– Node.js v0.10.x (installed interpreter)
• Steps
– Install the IoT Agent from the following URL
https://github.com/telefonicaid/lightweightm2m-iotagent
• Hints
– The agent is a standard Node.js application, following the
usual folder conventions (as /bin for the executables)
Easy
3. 1. Provision a Device using the Provisioning API
• Prerequisites
– Any kind of REST Client (programmatic, command-line, browser plugin...)
• Steps
– The goal of this exercise is to handle the device creation and management
with an IoT Agent. You will provision a device with the following properties:
• name: ws1
• entity name: weather1
• type: weatherStation
• attributes: two attributes, temperature and humidity, with float type.
– Do the following steps:
• Provision the new device in the IoT Agent using the Device Provisioning API.
• List the information about the provisioned device.
• Remove the device from the IoT Agent
• Hints
– You will find all the API operations in the following URL:
https://github.com/telefonicaid/iotagent-node-lib#-device-provisioning-api
Easy
4. • Prerequisites
– Node.js v0.10.x (installed interpreter)
– Context Broker knowledge (queries)
• Steps
– In this exercise you will install a LWM2M client to simulate the information
sending from the client. You can find the LWM2M client in the following URL
https://github.com/telefonicaid/lwm2m-node-lib
– Perform the following tasks :
• Provision a device as the one you used in exercise 1 in the IoT Agent with id “ws2’
and name “weather2” with Temperature and Humidity sensors as defined in the
OMA Registry (names should be “Temperature Sensor” and “Humidity Sensor”).
• Install the client project and execute the command line LWM2M Client.
• In the client, create the temperature and humidity objects in the client and assign
them resource with ID 0.
• Connect the device to the IoT Agent. The client should be assigned an ID by the
server.
• Change the original values and check the information changes in the Context
Broker.
• Hints
– the Object ID for the temperature sensor in the OMA Registry is 3303 and
for the humidity sensor 3304.
Medium2. Register a device in the IoT Agent using the
LWM2M Command line client
5. • Prerequisites
– Node.js v0.10.x (installed interpreter)
– Context Broker knowledge (queries)
• Steps
– The goal of this exercise is to try the lazy attribute query
functionalities of the IOT Agents.
– Perform the following tasks :
• Provision another device as the one you used in exercise 1, but declare
both attributes as lazy.
• Execute the command line LWM2M client.
• Create the temperature and humidity objects in the LWM2M client and
assign them a value.
• Query the information in the context broker, and compare it to the
value you assigned.
• Change the values in the client.
• Query the Context broker for the same information.
• Hints
– OMA Registry mappings are lazy by default, so there is no
need to declare them in the Device Provisioning.
Medium
3. Retrieve information from the LWM2M Client
using the Context Broker (default OMA
Registry Mapping).
6. • Prerequisites
– Node.js v0.10.x (installed interpreter)
– Context Broker knowledge (updates)
• Steps
– The goal of this exercise is to try the lazy attribute update
functionalities of the IOT Agents.
– Perform the following tasks :
• Provision another device as the one you used in exercise 1, but declare
both attributes as lazy.
• Execute the command line LWM2M client.
• Create the temperature and humidity objects in the LWM2M client and
assign them a value.
• Query the information of the attributes in the Context Broker and check
against the values you provided.
• Update the values in the Context Broker.
• Check the values in the client and check against the values you
provided to the Context Broker.
• Hints
– OMA Registry mappings are lazy by default, so there is no
need to declare them in the Device Provisioning.
Medium4. Send information to the LWM2M Client using
the Context Broker
7. • Prerequisites
– Node.js v0.10.x (installed interpreter)
– Context Broker knowledge (NGSI9)
• Steps
– The goal of this exercise is to learn how to check
for the presence of new Context Providers using
queries to the Context Broker.
– Perform the following tasks :
• Check the context broker availability for Weather
Stations.
• Create a new WeatherStation device named ‘weather5’
with id ‘ws5’, with two lazy attributes.
• Use the client to register the actual device.
• Check the context availability again and check your new
Weather station is available.
• Hints
Medium5. Detect new context providers through
queries
8. • Prerequisites
– Node.js v0.10.x (installed interpreter)
– Context Broker knowledge (NGSI9)
• Steps
– The goal of this exercise is to learn how to subscribe to the
creation of new Context Providers in the Context Broker.
– Perform the following tasks :
• Create an HTTP server listening to Context Availability notifications on
the WeatherStation types.
• Create a new WeatherStation device named ws6, with two lazy
attributes.
• Check the context availability notification has arrived and that the
attributes are the ones you created.
• Hints
6. Detect new context providers through
subscription
Hard
9. • Prerequisites
– Node.js v0.10.x (installed interpreter), Context Broker
knowledge (queries)
• Steps
– The goal of this exercise is to provision devices using
mappings that differ from the OMA Registry (or even do not
appear in the Registry at all), and lean how to configure
additional device provisioning properties.
– Perform the following tasks :
• Provision a new device “ws7” with two lazy attributes:
– One called “TheTemperature”, with type “TheType”, that maps to the LWM2M
URI /34000/0/5
– Another one called “TheHumidity”, with type “TheOtherType”, that maps to
the LWM2M URI /34000/0/6
• Open the client
• Create the /34000/0 object
• Set values for the resources with IDs 5 and 6
• Register to the IOTAgent
• Check the Context Broker for the values you set.
• Hints
– Use the ‘internal_attributes’ attribute in the provision.
7. Provision devices with customized attribute
mapping
Easy
10. • Prerequisites
– Node.js v0.10.x (installed interpreter)
– Context Broker knowledge (queries)
• Steps
– The goal of this exercise is to show how to configure device groups, so you don’t have
to provision every device you want to connect to the platform.
• You will be creating a new group of devices, with the following parameters:
• type: HidroponicPot
• lazy attributes:
– Humidity
– Temperature
• active attributes:
– Luminance
• resource: /hidroponic
– Perform the following tasks :
• You will be creating a new group of devices, with the following parameters:
• type: HidroponicPot
• lazy attributes:
– Humidity
– Temperature
• active attributes:
– Luminance
• resource: /hidroponic
• Hints
– You will find all the API operations in the following URL.
https://github.com/telefonicaid/iotagent-node-lib#-configuration-api
8. Provision device groups using the
Configuration API
Easy
Hinweis der Redaktion
1. En la primera slide poned una lista de puntos de lo que se puede hacer con ese GE/set de GEs. Me refiero en plan titulares, sin muchas explicaciones.
2. Mostrad un ejemplo representativo de uno o varios de los puntos anteriores.
Recordad: si lo hacéis como demo, poned slides con capturas y explicaciones también (así sirve también por si la demo os falla en ese momento ;-) ).
3. Mostrad un enlace donde pondremos esta semana las slides de la Campus que tienen los detalles de todos los puntos mencionados en 1.
(Poned la lista de ficheros pero dejad el enlace en blanco que ya lo pondremos a última hora).
1. En la primera slide poned una lista de puntos de lo que se puede hacer con ese GE/set de GEs. Me refiero en plan titulares, sin muchas explicaciones.
2. Mostrad un ejemplo representativo de uno o varios de los puntos anteriores.
Recordad: si lo hacéis como demo, poned slides con capturas y explicaciones también (así sirve también por si la demo os falla en ese momento ;-) ).
3. Mostrad un enlace donde pondremos esta semana las slides de la Campus que tienen los detalles de todos los puntos mencionados en 1.
(Poned la lista de ficheros pero dejad el enlace en blanco que ya lo pondremos a última hora).
1. En la primera slide poned una lista de puntos de lo que se puede hacer con ese GE/set de GEs. Me refiero en plan titulares, sin muchas explicaciones.
2. Mostrad un ejemplo representativo de uno o varios de los puntos anteriores.
Recordad: si lo hacéis como demo, poned slides con capturas y explicaciones también (así sirve también por si la demo os falla en ese momento ;-) ).
3. Mostrad un enlace donde pondremos esta semana las slides de la Campus que tienen los detalles de todos los puntos mencionados en 1.
(Poned la lista de ficheros pero dejad el enlace en blanco que ya lo pondremos a última hora).
1. En la primera slide poned una lista de puntos de lo que se puede hacer con ese GE/set de GEs. Me refiero en plan titulares, sin muchas explicaciones.
2. Mostrad un ejemplo representativo de uno o varios de los puntos anteriores.
Recordad: si lo hacéis como demo, poned slides con capturas y explicaciones también (así sirve también por si la demo os falla en ese momento ;-) ).
3. Mostrad un enlace donde pondremos esta semana las slides de la Campus que tienen los detalles de todos los puntos mencionados en 1.
(Poned la lista de ficheros pero dejad el enlace en blanco que ya lo pondremos a última hora).
1. En la primera slide poned una lista de puntos de lo que se puede hacer con ese GE/set de GEs. Me refiero en plan titulares, sin muchas explicaciones.
2. Mostrad un ejemplo representativo de uno o varios de los puntos anteriores.
Recordad: si lo hacéis como demo, poned slides con capturas y explicaciones también (así sirve también por si la demo os falla en ese momento ;-) ).
3. Mostrad un enlace donde pondremos esta semana las slides de la Campus que tienen los detalles de todos los puntos mencionados en 1.
(Poned la lista de ficheros pero dejad el enlace en blanco que ya lo pondremos a última hora).
1. En la primera slide poned una lista de puntos de lo que se puede hacer con ese GE/set de GEs. Me refiero en plan titulares, sin muchas explicaciones.
2. Mostrad un ejemplo representativo de uno o varios de los puntos anteriores.
Recordad: si lo hacéis como demo, poned slides con capturas y explicaciones también (así sirve también por si la demo os falla en ese momento ;-) ).
3. Mostrad un enlace donde pondremos esta semana las slides de la Campus que tienen los detalles de todos los puntos mencionados en 1.
(Poned la lista de ficheros pero dejad el enlace en blanco que ya lo pondremos a última hora).
1. En la primera slide poned una lista de puntos de lo que se puede hacer con ese GE/set de GEs. Me refiero en plan titulares, sin muchas explicaciones.
2. Mostrad un ejemplo representativo de uno o varios de los puntos anteriores.
Recordad: si lo hacéis como demo, poned slides con capturas y explicaciones también (así sirve también por si la demo os falla en ese momento ;-) ).
3. Mostrad un enlace donde pondremos esta semana las slides de la Campus que tienen los detalles de todos los puntos mencionados en 1.
(Poned la lista de ficheros pero dejad el enlace en blanco que ya lo pondremos a última hora).
1. En la primera slide poned una lista de puntos de lo que se puede hacer con ese GE/set de GEs. Me refiero en plan titulares, sin muchas explicaciones.
2. Mostrad un ejemplo representativo de uno o varios de los puntos anteriores.
Recordad: si lo hacéis como demo, poned slides con capturas y explicaciones también (así sirve también por si la demo os falla en ese momento ;-) ).
3. Mostrad un enlace donde pondremos esta semana las slides de la Campus que tienen los detalles de todos los puntos mencionados en 1.
(Poned la lista de ficheros pero dejad el enlace en blanco que ya lo pondremos a última hora).
1. En la primera slide poned una lista de puntos de lo que se puede hacer con ese GE/set de GEs. Me refiero en plan titulares, sin muchas explicaciones.
2. Mostrad un ejemplo representativo de uno o varios de los puntos anteriores.
Recordad: si lo hacéis como demo, poned slides con capturas y explicaciones también (así sirve también por si la demo os falla en ese momento ;-) ).
3. Mostrad un enlace donde pondremos esta semana las slides de la Campus que tienen los detalles de todos los puntos mencionados en 1.
(Poned la lista de ficheros pero dejad el enlace en blanco que ya lo pondremos a última hora).