Missing attributes in Orion CB Entity when registering a device through IDAS

I had some problems with the expected results doing exercises from http://www.slideshare.net/FI-WARE/io-t-basicexercisesdevelopersweek

There is no problem registering a new device, its essence, it was also successfully created on CB Orion, but there are no device attributes when requesting the created Entity. The created object has the TimeInstant attribute.

I get a 200 response code when sending observations, but it apparently has noeffect, since there are no Entity attributes on CB.

Device registration

  • URL: / iot / devices
  • Method: POST
  • Payload:

Json

{ "devices": [ { "device_id": "14:da:e9", "entity_name": "Thing12", "entity_type": "Thing12Type", "protocol": "PDI-IoTA-UltraLight", "timezone": "Europe/Madrid", "attributes": [ { "name": "weight", "type": "double", "object_id": "weight" }, { "name": "valid", "type": "boolean", "object_id": "valid" } ] } ] } 

Device listing

  • URL: / iot / devices / 14: da: e9
  • Method: GET

Json

 { "device_id": "14:da:e9", "entity_name": "Thing12", "entity_type": "Thing12Type", "protocol": "PDI-IoTA-UltraLight", "timezone": "Europe/Madrid", "attributes": [ { "name": "weight", "type": "double", "object_id": "weight" }, { "name": "valid", "type": "boolean", "object_id": "valid" } ], "service": "openiot", "service_path": "/" } 

CB inquiry

  • URL: / ngsi10 / contextEntities / Thing12
  • Method: GET

Json

 { "contextElement": { "type": "Thing12Type", "isPattern": "false", "id": "Thing12", "attributes": [ { "name": "TimeInstant", "type": "ISO8601", "value": "2015-06-25T13:07:18.354970Z" } ] }, "statusCode": { "code": "200", "reasonPhrase": "OK" } } 
+3
source share
2 answers

The problem seems to be related to the image orion-psb-image-R4.2. After starting a new instance (CentOS-6.3init) and installing each component manually, the problem will be solved. There may be a conflict between the versions in the previous instance.

+1
source

Attributes are created in ContextBroker as soon as you submit observations associated with these properties. Just try sending weight and valid observations, and you should be able to see these attributes in a ContextBroker-related object.

Let us know if this worked for you.

The behavior that you observed for a device that was not created was intentionally designed so that device registration was optional (although we do not recommend it).

Thanks for using IDAS!

0
source

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


All Articles