Fiware: there are no observational attributes in Orion CB when registering / sending via IDAS UltraLight

This question is very similar to Missing Attributes on Orion CB Entity when registering a device through IDAS , but did not find a definitive answer there.

I am trying to get FiWare to get UL2.0 through IDAS to Orion CB running in Fiware-Lab env:

I have a FI-WARE Lab account with a generated token. Adapted config.ini file:

[user] # Please, configure here your username at FIWARE Cloud and a valid Oauth2.0 TOKEN for your user (you can use get_token.py to obtain a valid TOKEN). username=MY_USERNAME token=MY_TOKEN [contextbroker] host=130.206.80.40 port=1026 OAuth=no # Here you need to specify the ContextBroker database you are querying. # Leave it blank if you want the general database or the IDAS service if you are looking for IoT devices connected by you. # fiware_service= fiware_service=bus_auto fiware-service-path=/ [idas] host=130.206.80.40 adminport=5371 ul20port=5371 OAuth=no # Here you need to configure the IDAS service your devices will be sending data to. # By default the OpenIoT service is provided. # fiware-service=fiwareiot fiware-service=bus_auto fiware-service-path=/ #apikey=4jggokgpepnvsb2uv4s40d59ov apikey=4jggokgpepnvsb2uv4s40d59ov [local] #Choose here your System type. Examples: RaspberryPI, MACOSX, Linux, ... host_type=MACOSX # Here please add a unique identifier for you. Suggestion: the 3 lower hexa bytes of your Ethernet MAC. Eg 79:ed:af # Also you may use your e-mail address. host_id=a0:11:00 

I used the SENSOR_TEMP template by adding the "protocol" field (PDI-IoTA-UltraLight, which I came across as the first problem):

 { "devices": [ { "device_id": "DEV_ID", "entity_name": "ENTITY_ID", "entity_type": "thing", "protocol": "PDI-IoTA-UltraLight", "timezone": "Europe/Amsterdam", "attributes": [ { "object_id": "otemp", "name": "temperature", "type": "int" } ], "static_attributes": [ { "name": "att_name", "type": "string", "value": "value" } ] } ] } 

Now I can register the device in order. how

 python RegisterDevice.py SENSOR_TEMP NexusPro Temp-Otterlo 

and see it in the device list:

 python ListDevices.py 

I can send observations as

 python SendObservation.py Temp-Otterlo 'otemp|17' 

But in ContextBroker, I see an Entity object, but not dimensions, like

 python GetEntity.py Temp-Otterlo 

gives

 * Asking to http://130.206.80.40:1026/ngsi10/queryContext * Headers: {'Fiware-Service': 'bus_auto', 'content-type': 'application/json', 'accept': 'application/json', 'X-Auth-Token': 'NULL'} * Sending PAYLOAD: { "entities": [ { "type": "", "id": "Temp-Otterlo", "isPattern": "false" } ], "attributes": [] } ... * Status Code: 200 * Response: { "contextResponses" : [ { "contextElement" : { "type" : "thing", "isPattern" : "false", "id" : "Temp-Otterlo", "attributes" : [ { "name" : "TimeInstant", "type" : "ISO8601", "value" : "2015-10-03T14:04:44.663133Z" }, { "name" : "att_name", "type" : "string", "value" : "value", "metadatas" : [ { "name" : "TimeInstant", "type" : "ISO8601", "value" : "2015-10-03T14:04:44.663500Z" } ] } ] }, "statusCode" : { "code" : "200", "reasonPhrase" : "OK" } } ] } 

I get the TimeInstant attribute is weird. I tried playing with .ini settings like fiware-service = fiwareiot, but to no avail. I have no ideas. Catalog Documentation. for IDAS4, it says that the observations are sent to port 8002 and install the "OpenIoT" service, but this also failed.

Any help appreciated.

+5
source share
1 answer

You should run "python SendObservation.py NexusPro 'otemp | 17'" instead of "python SendObservation.py Temp-Otterlo 'otemp | 17'".

The reason is that you are providing southbound surveillance and then you should use DEV_ID.

The entity does not include the attribute until an observation is received, so this is normal; you cannot see it. As soon as you try the one above, everything should work.

Greetings

0
source

Source: https://habr.com/ru/post/1232901/


All Articles