I am using Fiware-Orion ContextBroker 0.28, a docked version in my localhost on ubuntu 15.10 64 bit.
$ curl localhost:1026/version { "orion" : { "version" : "0.28.0-next", "uptime" : "0 d, 0 h, 0 m, 6 s", "git_hash" : "067e13618c247daa4af61f82d7831f3015d9eb5d", "compile_time" : "Mon Mar 14 13:04:02 UTC 2016", "compiled_by" : "root", "compiled_in" : "838a42ae8431" } }
The docker configuration I'm using is:
$ cat docker-compose.yml mongo: image: mongo:2.6 command: --smallfiles --nojournal orion: image: fiware/orion links: - mongo ports: - "1026:1026" command: -dbhost mongo
The warning I get from orion / docker when I sign up:
orion_1 | WARNING@12 :19:14 AlarmManager.cpp[303]: Raising alarm NotificationError localhost:1028/accumulate: (curl_easy_perform failed: Couldn't connect to server)
I follow the walkthorugh V1 API to test change subscriptions. I start with the mint, the new docked (sudo docker-compose up and all the fuzz) fiware-orion 0.28 with mongodb. Then i start the battery
$ ./accumulator-server.py 1028 /accumulate localhost on verbose mode is on * Running on http:
Then I register Room1
$ (curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' \ > --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF > { > "contextElements": [ > { > "type": "Room", > "isPattern": "false", > "id": "Room1", > "attributes": [ > { > "name": "temperature", > "type": "float", > "value": "23" > }, > { > "name": "pressure", > "type": "integer", > "value": "720" > } > ] > } > ], > "updateAction": "APPEND" > } > EOF { "contextResponses": [ { "contextElement": { "attributes": [ { "name": "temperature", "type": "float", "value": "" }, { "name": "pressure", "type": "integer", "value": "" } ], "id": "Room1", "isPattern": "false", "type": "Room" }, "statusCode": { "code": "200", "reasonPhrase": "OK" } } ] }
Then I check the request context for validation only:
$ (curl localhost:1026/v1/queryContext -s -S --header 'Content-Type: application/json' \ > --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF > { > "entities": [ > { > "type": "Room", > "isPattern": "false", > "id": "Room1" > } > ] > } > EOF { "contextResponses": [ { "contextElement": { "attributes": [ { "name": "pressure", "type": "integer", "value": "720" }, { "name": "temperature", "type": "float", "value": "23" } ], "id": "Room1", "isPattern": "false", "type": "Room" }, "statusCode": { "code": "200", "reasonPhrase": "OK" } } ] }
Then i subscribe
$ (curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' \ > --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF > { > "entities": [ > { > "type": "Room", > "isPattern": "false", > "id": "Room1" > } > ], > "attributes": [ > "pressure" > ], > "reference": "http://localhost:1028/accumulate", > "duration": "P1M", > "notifyConditions": [ > { > "type": "ONCHANGE", > "condValues": [ > "pressure" > ] > } > ], > "throttling": "PT5S" > } > EOF { "subscribeResponse": { "duration": "P1M", "subscriptionId": "570f8ac247fcf8a62722353c", "throttling": "PT5S" } }
At this point, the manual says that the battery may receive the first update, but this is not required, so I am not getting anything, but maybe it’s OK. Or maybe not, because after sending a subscription request, the docker supporter says:
orion_1 | WARNING@12 :19:14 AlarmManager.cpp[303]: Raising alarm NotificationError localhost:1028/accumulate: (curl_easy_perform failed: Couldn't connect to server)
Finally, I am updating the object, and I should get the update on the battery, but I am not doing this:
$ (curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' \ > --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF > { > "contextElements": [ > { > "type": "Room", > "isPattern": "false", > "id": "Room1", > "attributes": [ > { > "name": "temperature", > "type": "float", > "value": "56.5" > }, > { > "name": "pressure", > "type": "integer", > "value": "553" > } > ] > } > ], > "updateAction": "UPDATE" > } > EOF { "contextResponses": [ { "contextElement": { "attributes": [ { "name": "temperature", "type": "float", "value": "" }, { "name": "pressure", "type": "integer", "value": "" } ], "id": "Room1", "isPattern": "false", "type": "Room" }, "statusCode": { "code": "200", "reasonPhrase": "OK" } } ] }
I also have to say that it is quite difficult to get a fiware-orion compilation on Ubuntu and that the reason I use docker is.