fiware iot_idas_intro_ul20_v2

24
FIWARE IoT: IDAS intro + UL2.0 Carlos Ralli Ucendo, @carlosralli FIWARE, Telefonica I+D http://www.slideshare.net/ FI-WARE/fiware-iotidasintroul20v2

Upload: fiware

Post on 16-Jul-2015

985 views

Category:

Internet


5 download

TRANSCRIPT

FIWARE IoT IDAS intro + UL20

Carlos Ralli Ucendo carlosralli

FIWARE Telefonica I+D

httpwwwslidesharenetFI-WAREfiware-iotidasintroul20v2

FIWARE (IoT) Target Developers

ContextBroker

App Logic FIWARE-Cloud

DesktopMobileTabletUser Interface

Web 3D GE Advanced UIWirecloud GE Dashboards

OAuth20

SANTANDER

SMARTSPACES

SEVILLA 2) IoT Providers Pretty Heterogeneous solutionsskillsbull An incremental approach PublicPrivate instancesbull KISS philosophy for most (web)developersbull Advanced IoT architecture eg for IoT Advanced

Devel

1) IoT Consumers Normally not just IoTbull A single point API amp Protocol for IoT OpenData etcbull Context Data Entities + Data Entities eventsbull A Public amp Secured Ecosystem at FIWARE Lab

MultiMediaEvents

ComplexEvent Processing

IoT GEis

SmartcitiesOpenData

BigDataAnalytics

IoT ndash Typical Scenario I (fully tested most used so far)

bull Simplest scenario at FIWARE Wiki IoT Architecturebull Extensively tested with developers Most Feedback Implemented bull New features are required (Edge management more Agents)

IDAS40 - Modular architecture IoT-Agents

bull Monolithic vs Modular -gt Easier Installation Cloud Blueprintsbull Coded in C++ vs Coded in any language -gt Higher flexibility bull Extensibility via C++ plugins vs a new IoT Agent -gt Easier to get

contribsextensionsbull Scalability by design

FIWARE Context Broker

IoT Agent-UL20

IoT Agent-TT

IoT Agent-lwm2m

IoT Agent

Manager

createmonitor

FIWARE IoT BackendDevice Management

OMA NGSI API (Developersrsquo Interface)

(southbound interfaces)

MQTT Ultralight20

HTTPOMA

LWM2MIETF CoAP

OMA NGSI APIBE DeviceManagement(IDAS)

SIGFOX

IDAS40 ndash Available IoT-Agents (May 2015)

- Ultralight20 httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus

- MQTT httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus

- LWM2MCoAP httpsgithubcomtelefonicaidlightweightm2m-iotagent

- SigFox httpsgithubcomtelefonicaidsigfox-iotagent

- Generic IoT-Agent Skeletonshttpsgithubcomtelefonicaidiotagent-node-lib (nodejs)httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus (C++)

Connect your IoT IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create a Service (not in Public Instance)Step 1 ndash Create DeviceStep 2 ndash Send MeasurementsStep 3 ndash Send Commands

Testing Hackathons

IDAS4x Testing details bull IPv4 1302068040bull IPv6 200172015148040bull IDAS API (DevAdmin ) Port 5371 (IPv4)bull ContextBroker Port 1026 (IPv4IPv6)bull Testing Service fiwareiotbull APIKEY 2015fiwareiotbull Service URL

ltIDAS_HOSTgtiot

fiwareiot

IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create Service(REST ADMIN API)

Normally only if you deployyour own IDAS instance

For the FIWARE Lab instancejust use fiwareiot service

If ContextBroker in the sameVM use 0000 as IP address

HTTP POST http13020680405371iotservicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service [myservice]rdquo Fiware-ServicePath Payloadservices [

apikey rdquo[myservice-API-KEY]token token2cbroker http00001026entity_type thingresource iotd

]

IoT-Agent-UltraLight20 (IDAS)

Step 1 ndash Create Device(REST ADMIN API)

Payload JSON Format - Device ID- Entity Name = Entity ID- Protocol (mandatory)- Attributes

- Object ID (Alias)- Static Atributes- Commands for Actuators

- See step 3

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]rdquoentity_type thingprotocol PDI-IoTA-UltraLightrdquo Added in June 2015timezone rdquoEuropeMadrid

attributes [ object_id tname temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]]

IoT-Agent-UltraLight20 (IDAS)

Step 2 ndash Send Measurements(UL20 DEVICE API)

Payload JSON Format - TOKEN = FIWARE Oauth Token- Device ID (Step 1)

HTTP POST http13020680405371iotdk=[APIKEY]ampi=[DEV_ID]

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payload lsquo t|25lsquo

- Sending multiple measurements with one request

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Servicerdquofiwareiotrdquo Fiware-ServicePath Payload lsquot|23h|80l|95m|Quietlsquo

IoT-Agent-UltraLight20 (IDAS)

Step 3 ndash Sending Commands to Devices

IDAS

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

FIWARE (IoT) Target Developers

ContextBroker

App Logic FIWARE-Cloud

DesktopMobileTabletUser Interface

Web 3D GE Advanced UIWirecloud GE Dashboards

OAuth20

SANTANDER

SMARTSPACES

SEVILLA 2) IoT Providers Pretty Heterogeneous solutionsskillsbull An incremental approach PublicPrivate instancesbull KISS philosophy for most (web)developersbull Advanced IoT architecture eg for IoT Advanced

Devel

1) IoT Consumers Normally not just IoTbull A single point API amp Protocol for IoT OpenData etcbull Context Data Entities + Data Entities eventsbull A Public amp Secured Ecosystem at FIWARE Lab

MultiMediaEvents

ComplexEvent Processing

IoT GEis

SmartcitiesOpenData

BigDataAnalytics

IoT ndash Typical Scenario I (fully tested most used so far)

bull Simplest scenario at FIWARE Wiki IoT Architecturebull Extensively tested with developers Most Feedback Implemented bull New features are required (Edge management more Agents)

IDAS40 - Modular architecture IoT-Agents

bull Monolithic vs Modular -gt Easier Installation Cloud Blueprintsbull Coded in C++ vs Coded in any language -gt Higher flexibility bull Extensibility via C++ plugins vs a new IoT Agent -gt Easier to get

contribsextensionsbull Scalability by design

FIWARE Context Broker

IoT Agent-UL20

IoT Agent-TT

IoT Agent-lwm2m

IoT Agent

Manager

createmonitor

FIWARE IoT BackendDevice Management

OMA NGSI API (Developersrsquo Interface)

(southbound interfaces)

MQTT Ultralight20

HTTPOMA

LWM2MIETF CoAP

OMA NGSI APIBE DeviceManagement(IDAS)

SIGFOX

IDAS40 ndash Available IoT-Agents (May 2015)

- Ultralight20 httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus

- MQTT httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus

- LWM2MCoAP httpsgithubcomtelefonicaidlightweightm2m-iotagent

- SigFox httpsgithubcomtelefonicaidsigfox-iotagent

- Generic IoT-Agent Skeletonshttpsgithubcomtelefonicaidiotagent-node-lib (nodejs)httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus (C++)

Connect your IoT IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create a Service (not in Public Instance)Step 1 ndash Create DeviceStep 2 ndash Send MeasurementsStep 3 ndash Send Commands

Testing Hackathons

IDAS4x Testing details bull IPv4 1302068040bull IPv6 200172015148040bull IDAS API (DevAdmin ) Port 5371 (IPv4)bull ContextBroker Port 1026 (IPv4IPv6)bull Testing Service fiwareiotbull APIKEY 2015fiwareiotbull Service URL

ltIDAS_HOSTgtiot

fiwareiot

IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create Service(REST ADMIN API)

Normally only if you deployyour own IDAS instance

For the FIWARE Lab instancejust use fiwareiot service

If ContextBroker in the sameVM use 0000 as IP address

HTTP POST http13020680405371iotservicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service [myservice]rdquo Fiware-ServicePath Payloadservices [

apikey rdquo[myservice-API-KEY]token token2cbroker http00001026entity_type thingresource iotd

]

IoT-Agent-UltraLight20 (IDAS)

Step 1 ndash Create Device(REST ADMIN API)

Payload JSON Format - Device ID- Entity Name = Entity ID- Protocol (mandatory)- Attributes

- Object ID (Alias)- Static Atributes- Commands for Actuators

- See step 3

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]rdquoentity_type thingprotocol PDI-IoTA-UltraLightrdquo Added in June 2015timezone rdquoEuropeMadrid

attributes [ object_id tname temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]]

IoT-Agent-UltraLight20 (IDAS)

Step 2 ndash Send Measurements(UL20 DEVICE API)

Payload JSON Format - TOKEN = FIWARE Oauth Token- Device ID (Step 1)

HTTP POST http13020680405371iotdk=[APIKEY]ampi=[DEV_ID]

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payload lsquo t|25lsquo

- Sending multiple measurements with one request

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Servicerdquofiwareiotrdquo Fiware-ServicePath Payload lsquot|23h|80l|95m|Quietlsquo

IoT-Agent-UltraLight20 (IDAS)

Step 3 ndash Sending Commands to Devices

IDAS

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

IoT ndash Typical Scenario I (fully tested most used so far)

bull Simplest scenario at FIWARE Wiki IoT Architecturebull Extensively tested with developers Most Feedback Implemented bull New features are required (Edge management more Agents)

IDAS40 - Modular architecture IoT-Agents

bull Monolithic vs Modular -gt Easier Installation Cloud Blueprintsbull Coded in C++ vs Coded in any language -gt Higher flexibility bull Extensibility via C++ plugins vs a new IoT Agent -gt Easier to get

contribsextensionsbull Scalability by design

FIWARE Context Broker

IoT Agent-UL20

IoT Agent-TT

IoT Agent-lwm2m

IoT Agent

Manager

createmonitor

FIWARE IoT BackendDevice Management

OMA NGSI API (Developersrsquo Interface)

(southbound interfaces)

MQTT Ultralight20

HTTPOMA

LWM2MIETF CoAP

OMA NGSI APIBE DeviceManagement(IDAS)

SIGFOX

IDAS40 ndash Available IoT-Agents (May 2015)

- Ultralight20 httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus

- MQTT httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus

- LWM2MCoAP httpsgithubcomtelefonicaidlightweightm2m-iotagent

- SigFox httpsgithubcomtelefonicaidsigfox-iotagent

- Generic IoT-Agent Skeletonshttpsgithubcomtelefonicaidiotagent-node-lib (nodejs)httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus (C++)

Connect your IoT IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create a Service (not in Public Instance)Step 1 ndash Create DeviceStep 2 ndash Send MeasurementsStep 3 ndash Send Commands

Testing Hackathons

IDAS4x Testing details bull IPv4 1302068040bull IPv6 200172015148040bull IDAS API (DevAdmin ) Port 5371 (IPv4)bull ContextBroker Port 1026 (IPv4IPv6)bull Testing Service fiwareiotbull APIKEY 2015fiwareiotbull Service URL

ltIDAS_HOSTgtiot

fiwareiot

IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create Service(REST ADMIN API)

Normally only if you deployyour own IDAS instance

For the FIWARE Lab instancejust use fiwareiot service

If ContextBroker in the sameVM use 0000 as IP address

HTTP POST http13020680405371iotservicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service [myservice]rdquo Fiware-ServicePath Payloadservices [

apikey rdquo[myservice-API-KEY]token token2cbroker http00001026entity_type thingresource iotd

]

IoT-Agent-UltraLight20 (IDAS)

Step 1 ndash Create Device(REST ADMIN API)

Payload JSON Format - Device ID- Entity Name = Entity ID- Protocol (mandatory)- Attributes

- Object ID (Alias)- Static Atributes- Commands for Actuators

- See step 3

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]rdquoentity_type thingprotocol PDI-IoTA-UltraLightrdquo Added in June 2015timezone rdquoEuropeMadrid

attributes [ object_id tname temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]]

IoT-Agent-UltraLight20 (IDAS)

Step 2 ndash Send Measurements(UL20 DEVICE API)

Payload JSON Format - TOKEN = FIWARE Oauth Token- Device ID (Step 1)

HTTP POST http13020680405371iotdk=[APIKEY]ampi=[DEV_ID]

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payload lsquo t|25lsquo

- Sending multiple measurements with one request

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Servicerdquofiwareiotrdquo Fiware-ServicePath Payload lsquot|23h|80l|95m|Quietlsquo

IoT-Agent-UltraLight20 (IDAS)

Step 3 ndash Sending Commands to Devices

IDAS

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

IDAS40 - Modular architecture IoT-Agents

bull Monolithic vs Modular -gt Easier Installation Cloud Blueprintsbull Coded in C++ vs Coded in any language -gt Higher flexibility bull Extensibility via C++ plugins vs a new IoT Agent -gt Easier to get

contribsextensionsbull Scalability by design

FIWARE Context Broker

IoT Agent-UL20

IoT Agent-TT

IoT Agent-lwm2m

IoT Agent

Manager

createmonitor

FIWARE IoT BackendDevice Management

OMA NGSI API (Developersrsquo Interface)

(southbound interfaces)

MQTT Ultralight20

HTTPOMA

LWM2MIETF CoAP

OMA NGSI APIBE DeviceManagement(IDAS)

SIGFOX

IDAS40 ndash Available IoT-Agents (May 2015)

- Ultralight20 httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus

- MQTT httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus

- LWM2MCoAP httpsgithubcomtelefonicaidlightweightm2m-iotagent

- SigFox httpsgithubcomtelefonicaidsigfox-iotagent

- Generic IoT-Agent Skeletonshttpsgithubcomtelefonicaidiotagent-node-lib (nodejs)httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus (C++)

Connect your IoT IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create a Service (not in Public Instance)Step 1 ndash Create DeviceStep 2 ndash Send MeasurementsStep 3 ndash Send Commands

Testing Hackathons

IDAS4x Testing details bull IPv4 1302068040bull IPv6 200172015148040bull IDAS API (DevAdmin ) Port 5371 (IPv4)bull ContextBroker Port 1026 (IPv4IPv6)bull Testing Service fiwareiotbull APIKEY 2015fiwareiotbull Service URL

ltIDAS_HOSTgtiot

fiwareiot

IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create Service(REST ADMIN API)

Normally only if you deployyour own IDAS instance

For the FIWARE Lab instancejust use fiwareiot service

If ContextBroker in the sameVM use 0000 as IP address

HTTP POST http13020680405371iotservicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service [myservice]rdquo Fiware-ServicePath Payloadservices [

apikey rdquo[myservice-API-KEY]token token2cbroker http00001026entity_type thingresource iotd

]

IoT-Agent-UltraLight20 (IDAS)

Step 1 ndash Create Device(REST ADMIN API)

Payload JSON Format - Device ID- Entity Name = Entity ID- Protocol (mandatory)- Attributes

- Object ID (Alias)- Static Atributes- Commands for Actuators

- See step 3

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]rdquoentity_type thingprotocol PDI-IoTA-UltraLightrdquo Added in June 2015timezone rdquoEuropeMadrid

attributes [ object_id tname temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]]

IoT-Agent-UltraLight20 (IDAS)

Step 2 ndash Send Measurements(UL20 DEVICE API)

Payload JSON Format - TOKEN = FIWARE Oauth Token- Device ID (Step 1)

HTTP POST http13020680405371iotdk=[APIKEY]ampi=[DEV_ID]

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payload lsquo t|25lsquo

- Sending multiple measurements with one request

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Servicerdquofiwareiotrdquo Fiware-ServicePath Payload lsquot|23h|80l|95m|Quietlsquo

IoT-Agent-UltraLight20 (IDAS)

Step 3 ndash Sending Commands to Devices

IDAS

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

IDAS40 ndash Available IoT-Agents (May 2015)

- Ultralight20 httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus

- MQTT httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus

- LWM2MCoAP httpsgithubcomtelefonicaidlightweightm2m-iotagent

- SigFox httpsgithubcomtelefonicaidsigfox-iotagent

- Generic IoT-Agent Skeletonshttpsgithubcomtelefonicaidiotagent-node-lib (nodejs)httpsgithubcomtelefonicaidfiware-IoTAgent-Cplusplus (C++)

Connect your IoT IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create a Service (not in Public Instance)Step 1 ndash Create DeviceStep 2 ndash Send MeasurementsStep 3 ndash Send Commands

Testing Hackathons

IDAS4x Testing details bull IPv4 1302068040bull IPv6 200172015148040bull IDAS API (DevAdmin ) Port 5371 (IPv4)bull ContextBroker Port 1026 (IPv4IPv6)bull Testing Service fiwareiotbull APIKEY 2015fiwareiotbull Service URL

ltIDAS_HOSTgtiot

fiwareiot

IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create Service(REST ADMIN API)

Normally only if you deployyour own IDAS instance

For the FIWARE Lab instancejust use fiwareiot service

If ContextBroker in the sameVM use 0000 as IP address

HTTP POST http13020680405371iotservicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service [myservice]rdquo Fiware-ServicePath Payloadservices [

apikey rdquo[myservice-API-KEY]token token2cbroker http00001026entity_type thingresource iotd

]

IoT-Agent-UltraLight20 (IDAS)

Step 1 ndash Create Device(REST ADMIN API)

Payload JSON Format - Device ID- Entity Name = Entity ID- Protocol (mandatory)- Attributes

- Object ID (Alias)- Static Atributes- Commands for Actuators

- See step 3

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]rdquoentity_type thingprotocol PDI-IoTA-UltraLightrdquo Added in June 2015timezone rdquoEuropeMadrid

attributes [ object_id tname temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]]

IoT-Agent-UltraLight20 (IDAS)

Step 2 ndash Send Measurements(UL20 DEVICE API)

Payload JSON Format - TOKEN = FIWARE Oauth Token- Device ID (Step 1)

HTTP POST http13020680405371iotdk=[APIKEY]ampi=[DEV_ID]

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payload lsquo t|25lsquo

- Sending multiple measurements with one request

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Servicerdquofiwareiotrdquo Fiware-ServicePath Payload lsquot|23h|80l|95m|Quietlsquo

IoT-Agent-UltraLight20 (IDAS)

Step 3 ndash Sending Commands to Devices

IDAS

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Connect your IoT IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create a Service (not in Public Instance)Step 1 ndash Create DeviceStep 2 ndash Send MeasurementsStep 3 ndash Send Commands

Testing Hackathons

IDAS4x Testing details bull IPv4 1302068040bull IPv6 200172015148040bull IDAS API (DevAdmin ) Port 5371 (IPv4)bull ContextBroker Port 1026 (IPv4IPv6)bull Testing Service fiwareiotbull APIKEY 2015fiwareiotbull Service URL

ltIDAS_HOSTgtiot

fiwareiot

IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create Service(REST ADMIN API)

Normally only if you deployyour own IDAS instance

For the FIWARE Lab instancejust use fiwareiot service

If ContextBroker in the sameVM use 0000 as IP address

HTTP POST http13020680405371iotservicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service [myservice]rdquo Fiware-ServicePath Payloadservices [

apikey rdquo[myservice-API-KEY]token token2cbroker http00001026entity_type thingresource iotd

]

IoT-Agent-UltraLight20 (IDAS)

Step 1 ndash Create Device(REST ADMIN API)

Payload JSON Format - Device ID- Entity Name = Entity ID- Protocol (mandatory)- Attributes

- Object ID (Alias)- Static Atributes- Commands for Actuators

- See step 3

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]rdquoentity_type thingprotocol PDI-IoTA-UltraLightrdquo Added in June 2015timezone rdquoEuropeMadrid

attributes [ object_id tname temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]]

IoT-Agent-UltraLight20 (IDAS)

Step 2 ndash Send Measurements(UL20 DEVICE API)

Payload JSON Format - TOKEN = FIWARE Oauth Token- Device ID (Step 1)

HTTP POST http13020680405371iotdk=[APIKEY]ampi=[DEV_ID]

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payload lsquo t|25lsquo

- Sending multiple measurements with one request

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Servicerdquofiwareiotrdquo Fiware-ServicePath Payload lsquot|23h|80l|95m|Quietlsquo

IoT-Agent-UltraLight20 (IDAS)

Step 3 ndash Sending Commands to Devices

IDAS

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

IoT-Agent-UltraLight20 (IDAS)

Step 0 ndash Create Service(REST ADMIN API)

Normally only if you deployyour own IDAS instance

For the FIWARE Lab instancejust use fiwareiot service

If ContextBroker in the sameVM use 0000 as IP address

HTTP POST http13020680405371iotservicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service [myservice]rdquo Fiware-ServicePath Payloadservices [

apikey rdquo[myservice-API-KEY]token token2cbroker http00001026entity_type thingresource iotd

]

IoT-Agent-UltraLight20 (IDAS)

Step 1 ndash Create Device(REST ADMIN API)

Payload JSON Format - Device ID- Entity Name = Entity ID- Protocol (mandatory)- Attributes

- Object ID (Alias)- Static Atributes- Commands for Actuators

- See step 3

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]rdquoentity_type thingprotocol PDI-IoTA-UltraLightrdquo Added in June 2015timezone rdquoEuropeMadrid

attributes [ object_id tname temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]]

IoT-Agent-UltraLight20 (IDAS)

Step 2 ndash Send Measurements(UL20 DEVICE API)

Payload JSON Format - TOKEN = FIWARE Oauth Token- Device ID (Step 1)

HTTP POST http13020680405371iotdk=[APIKEY]ampi=[DEV_ID]

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payload lsquo t|25lsquo

- Sending multiple measurements with one request

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Servicerdquofiwareiotrdquo Fiware-ServicePath Payload lsquot|23h|80l|95m|Quietlsquo

IoT-Agent-UltraLight20 (IDAS)

Step 3 ndash Sending Commands to Devices

IDAS

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

IoT-Agent-UltraLight20 (IDAS)

Step 1 ndash Create Device(REST ADMIN API)

Payload JSON Format - Device ID- Entity Name = Entity ID- Protocol (mandatory)- Attributes

- Object ID (Alias)- Static Atributes- Commands for Actuators

- See step 3

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]rdquoentity_type thingprotocol PDI-IoTA-UltraLightrdquo Added in June 2015timezone rdquoEuropeMadrid

attributes [ object_id tname temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]]

IoT-Agent-UltraLight20 (IDAS)

Step 2 ndash Send Measurements(UL20 DEVICE API)

Payload JSON Format - TOKEN = FIWARE Oauth Token- Device ID (Step 1)

HTTP POST http13020680405371iotdk=[APIKEY]ampi=[DEV_ID]

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payload lsquo t|25lsquo

- Sending multiple measurements with one request

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Servicerdquofiwareiotrdquo Fiware-ServicePath Payload lsquot|23h|80l|95m|Quietlsquo

IoT-Agent-UltraLight20 (IDAS)

Step 3 ndash Sending Commands to Devices

IDAS

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

IoT-Agent-UltraLight20 (IDAS)

Step 2 ndash Send Measurements(UL20 DEVICE API)

Payload JSON Format - TOKEN = FIWARE Oauth Token- Device ID (Step 1)

HTTP POST http13020680405371iotdk=[APIKEY]ampi=[DEV_ID]

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payload lsquo t|25lsquo

- Sending multiple measurements with one request

Headers content-type applicationtextrsquo X-Auth-Token [TOKEN] Fiware-Servicerdquofiwareiotrdquo Fiware-ServicePath Payload lsquot|23h|80l|95m|Quietlsquo

IoT-Agent-UltraLight20 (IDAS)

Step 3 ndash Sending Commands to Devices

IDAS

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

IoT-Agent-UltraLight20 (IDAS)

Step 3 ndash Sending Commands to Devices

IDAS

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

IoT-Agent-UltraLight20 (IDAS)

Step 3 PUSH versus POOLING (at Device registration)

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id rdquo[DEV_ID]entity_name rdquo[ENTITY_ID]entity_type thingendpoint http[DEVICE_IP][PORT]timezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue ldquo[Dev_ID]RawCommand|s

]attributes [

hellip

HTTP POST http13020680405371iotdevicesHeaders content-type applicationjsonrsquo X-Auth-Token [TOKEN] Fiware-Service fiwareiotrdquo Fiware-ServicePath Payloaddevices [

device_id ldquo[DEV_ID]entity_name rdquo [ENTITY_ID]entity_type thingtimezone rdquoEuropeMadridcommands [

name rdquoRawCommandtype commandvalue rdquo [Dev_ID]RawCommand|s

]attributes [

hellip

How to send commands Just update the command attribute in the ContextBrokerHow to get commands (from device)

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I IoT-Agent-UltraLight20 (IDAS) ndash FIGWAY Python27 Tools

Testing Hackathons

httpsgithubcomtelefonicaidfiware-figwaypython-IDAS4

bull Coded in Python Tested with RaspberryPI MACOS amp Linuxbull Tools for (virtual) Sensors via IDAS IoT-Agent (Ultralight20)bull Tools to access a ContextBrokerbull For IDAS 4x onwards use IDAS4 folder

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I FIGWAY - Configuration

figwaypythonconfigini

[user] Please configure here your username at FIWARE Cloud and a valid Oauth20 TOKEN for your user (you can use get_tokenpy to obtain a valid TOKEN) username=token=

Configure for the ContextBroker and the IDAS instancesbull IP Addresses Normally 1302068040bull Ports Normally 1026 for ContextBroker and 5371 for IDASbull FIWARE_SERVICE Change it to fiwareiot Update API-KEY alsobull FIWARE_SERVICE_PATH Normally bull Oauth2 normally no

If you are using the FIWARE Lab instance protected by IdM

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I FIGWAY ndash Registering a (UL20) Sensor

SensorsUL20gt python RegisterDevicepy [DEV_FILE] [DEV_ID] [ENTITY_ID]

gt python RegisterDevicepy SENSOR_TEMP Sensor1 Temp-Madrid28001

opening devicesSENSOR_TEMP Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

[hellip] (See Next Slide)

Status Code 201 Response

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I FIGWAY ndash Registering a (UL20) Sensor Sensor_TEMP FILE

devices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadrid

attributes [ object_id t

name temperaturetype int

]static_attributes [

name att_nametype stringvalue value

]

]

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I FIGWAY ndash Check List of Devices

SensorsUL20gt python ListDevicespy

gt Python ListDevicespy

Asking to http13020680405371iotdevices Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL

Status Code 200 Response count 6devices [ device_id 3F2A1Alamp3 device_id Sensor1 device_id dev_1 device_id ej1 device_id ej2 device_id ej3 ]

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I FIGWAY - Sending Sensor ObservationsMeasurements

SensorsUL20gt python SendObservationpy [DEV_ID] lsquo[alias1|value1]rsquo

gt python SendObservationpy Sensor1 t|34

Asking to http13020680405371iotdk=2015fiwareiotampi=Sensor1 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD t|34

Status Code 200 Response

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I FIGWAY ndash Read your Sensor data at the ContextBroker

ContextBrokergt python GetEntitypy [ENTITY_ID]

gt python GetEntitypy Temp-Madrid28001

contextResponses [

contextElement type thingisPattern falseid Temp-Madrid28001attributes [

name att_nametype stringvalue valuemetadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488457Z

]name temperaturetype intvalue 34metadatas [

name TimeInstanttype ISO8601value 2015-04-15T095735488052Z

hellip

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I FIGWAY ndash What if I want to connect Actuators

SensorsUL20gt python RegisterDevicepy SWITCH dev_11 actuator

SWITCH FILEdevices [

device_id DEV_IDentity_name ENTITY_IDentity_type thingtimezone EuropeMadridcommands [ name RawCommandtype commandvalue rdquoRawCommand|s

]

attributes [ object_id sname statustype string

]static_attributes [

name att_nametype stringvalue value

]]

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I FIGWAY ndash What if I want to connect Actuators (II)

python SimulateCommandpy [ENTITY_ID] lsquo[COMMAND]lsquo

gt python SimulateCommandpy dev_11 actuator

Asking to http13020680405371iotngsidupdateContext Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD contextElements [

attributes [

type command name RawCommand value Set 95-10-45

]

hellip

Status Code 200 Response statusCode code200 reasonPhraseOK

Normal Operation just update command attribute at ContextBrokerTodayrsquos Bug please issue commands manually with this python script

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I FIGWAY ndash What if I want to connect Actuators (III)

python GetPoolingCommandspy [DEV_ID]

gt python GetPoolingCommandspy dev_11

Asking to http13020680405371iotdk=2015fiwareiotampi=dev_11 Headers Fiware-Service rsquofiwareiot content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

Status Code 200 Response [Dev_ID]RawCommand|Set 95-10-45

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

Annex I FIGWAY ndash Creating an IoT Service

Python CreateServicepy [FIWARE_SERVICE] [API_KEY] [IP_CB] [PortCB]

gt Python CreateServicepy MyOwnService secret 0000 1026

Asking to http13020680405371iotservices Headers Fiware-Service MyOwnService content-type applicationjson Fiware-ServicePath X-Auth-Token NULL Sending PAYLOAD

services [

token token2 apikey rdquosecret resource iotd entity_type thing cbroker http00001026

]

hellip Status Code 201 Response

This operation is only for your private instancesIf you need your own private service in the public instance of IDAS let the Admins Know

ThanksThanks

ThanksThanks