Aeronbroker / Aeron

Aeron is an Internet-of-Things middleware based on the OMA NGSI 9/10 standard.
Other
23 stars 9 forks source link

problem with queryContext from ContextBroker #11

Closed koff-fkd closed 8 years ago

koff-fkd commented 8 years ago

I want to send contextdata from IoTBroker to ContextBroker using "queryContext."
IoTBroker can get the contextdata from device, but ContextBroker can't get the contextdata from IoTBroker. the ContextBroker give me this error.

Following, the portion of interest of the ContextBroker log: time=2016-08-25T01:16:21.320Z | lvl=WARN | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=postQueryContext.cpp[198]:queryForward | msg=Internal Error (error parsing reply from prov app: )

Following, the portion of interest of the IoTBroker response log: 2016-08-25 10:27:25 INFO NgsiStructure:291 - Ojbect not sane.<?xml version="1.0" encoding="UTF-8"?>

humidity float temperature float 200 OK

2016-08-25 10:27:25 INFO NgsiStructure:328 - Trying to deserialize json { "contextResponses" : [ { "contextElement" : { "type" : "thermometer", "isPattern" : "false", "id" : "thermo1", "attributes" : [ { "name" : "humidity", "type" : "float", "value" : "30.00", "contextMetadata" : [ { "name" : "unit", "type" : "string", "value" : "%" } ] }, { "name" : "temperature", "type" : "float", "value" : "20.00", "contextMetadata" : [ { "name" : "unit", "type" : "string", "value" : "celsius" } ] } ] }, "statusCode" : { "code" : "200", "reasonPhrase" : "OK" } } ] }

・regisiterContext to ContextBroker (curl localhost:1026/v1/registry/registerContext -s -S --header 'Content-Type: application/json' \ --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF { "contextRegistrations": [ { "entities": [ { "type": "thermometer", "isPattern": "false", "id": "thermo1" } ], "attributes": [ { "name": "temperature", "type": "float", "isDomain": "false", "metadatas": [ { "name": "unit", "type": "string", "value": "test" } ] }, { "name": "humidity", "type": "float", "isDomain": "false", "metadatas": [ { "name": "unit", "type": "string", "value": "test" } ] }, { "name": "measurement_time", "type": "timestamp", "isDomain": "false" } ], "providingApplication": "http://localhost:8060/ngsi10" } ], "duration": "P1Y" } EOF

・registerContext to IoTBroker (curl localhost:8060/ngsi9/registerContext -s -S \ --header 'Content-Type: application/xml' --header 'Accept: application/xml' \ -d @-) <<EOF <?xml version="1.0" encoding="UTF-8"?>

thermo1 temperature float false unit string humidity float false unit string measurement_time timestamp false http://localhost:/ngsi10 P1Y

EOF

・queryContext to ContextBroker (curl localhost:1026/ngsi10/queryContext -s -S --header 'Content-Type: application/json' \ --header 'Accept: application/json' -d @-| python -mjson.tool) <<EOF { "entities": [ { "isPattern": "false", "id": "thermo1" } ] } EOF

How can I get the contextdata? Best Regards Shunya