2015-10-04 5 views
5

Questa domanda è molto simile a Missing attributes on Orion CB Entity when registering device through IDAS ma non è stata trovata una risposta definitiva.Fiware: nessun attributo di osservazione in Orion CB se registrato/inviato tramite IDAS UltraLight

Ho cercato di ottenere FiWare UL2.0 tramite IDAS alla Orion CB lavoro nel ENV Fiware-Lab:

Ho un account Lab FI-WARE con token generato. Adattato il file config.ini:

[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. E.g. 79:ed:af 
# Also you may use your e-mail address. 
host_id=a0:11:00 

ho usato il modello SENSOR_TEMP, aggiungendo il campo 'protocollo' (PDI-iota-Ultralight che, come il primo problema sono incappato):

{ 
"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" 
     } 
     ] 
     } 
    ] 
    } 

Ora Posso registrare il dispositivo ok. Come

python RegisterDevice.py SENSOR_TEMP NexusPro Temp-Otterlo 

e vederlo in Elenco periferiche:

python ListDevices.py 

posso inviare osservazioni come

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

Ma nel ContextBroker vedo l'Entità, ma mai le misure, per esempio

python GetEntity.py Temp-Otterlo 

* 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" 
     } 
    } 
    ] 
} 

ottengo un TimeInstant attributo in modo strano. Ho provato a giocare con le impostazioni di .ini come fiware-service = fiwareiot, ma senza successo. Non ho più idee. La documentazione a catalogo. per IDAS4 si sta parlando di osservazioni da inviare alla porta 8002 e impostazione del servizio "OpenIoT", ma anche questo è fallito.

Qualsiasi aiuto apprezzato.

+0

Hai provato a utilizzare un altro Orion Context Broker? (ad esempio, il tuo). – LeandroGuillen

+0

No non ancora, anche perché potrebbe essere un problema comune (vedere http://stackoverflow.com/questions/31051501/missing-attributes-on-orion-cb-entity-when-registering-device-through-idas). Potrebbe ad es. la versione OCB è importante? –

+0

Potrebbe sicuramente essere. Prova a utilizzare l'ultima versione di OCB (da 0.24 a oggi). – LeandroGuillen

risposta

0

Si dovrebbe eseguire "python SendObservation.py NexusPro 'otemp | 17'" invece di "python SendObservation.py Temp-Otterlo 'otemp | 17'".

La ragione è che si sta fornendo un'osservazione a sud e quindi si deve utilizzare DEV_ID.

L'entità non include un attributo finché non viene ricevuta un'osservazione, quindi è normale che non si riesca a vederlo. Una volta provato quello sopra dovrebbe funzionare.

Cheers,

+0

Provato id dispositivo, ma lo stesso risultato: nessun valore in entità tramite CB. –

Problemi correlati