telefonicaid / fiware-IoTAgent-Cplusplus

IoTAgent development framework for C++
GNU Affero General Public License v3.0
11 stars 57 forks source link

IoTAgent Commands #412

Open usuarioIOT opened 8 years ago

usuarioIOT commented 8 years ago

Hi,

We are trying to send Push commands to a device following the next schema: synccommands

We have created a device through IoTAgentUL2.0 with a PING command attribute. Then we try to send a PING command with value 22 with the next updateContext over ContextBroker:

curl -X POST http://CB_IP/v1/updateContext \ -i \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "Fiware-Service: welcome" \ -H "Fiware-ServicePath: /subservice" \ -d ' {"updateAction":"UPDATE","contextElements":[{"id":"1e2636f3-8289-1111-8327-a76b8623e877","type":"dispositivo","isPattern":"false","attributes":[{"name":"PING","type":"command","value":"22" } ]} ]}'

But the device that not receive any command. We can see on logs that ContextBroker Orion receives status pending and after time out expires ContextBroker entity shows that:

{ "contextElement" : { "type" : "dispositivo", "isPattern" : "false", "id" : "1e2636f3-8289-1111-8327-a76b8623e877", "attributes" : [ { "name" : "PING_status", "type" : "string", "value" : "expired read", "metadatas" : [ { "name" : "TimeInstant", "type" : "ISO8601", "value" : "2016-03-09T08:36:45.538669" } ] }, { "name" : "TimeInstant", "type" : "ISO8601", "value" : "2016-03-09T08:36:45.538775" }, { "name" : "domain", "type" : "string", "value" : "a05fb80ddd9f4d2db4801a53ab2ceb9f", "metadatas" : [ { "name" : "TimeInstant", "type" : "ISO8601", "value" : "2016-03-09T08:36:35.533839" } ] }, { "name" : "status", "type" : "integer", "value" : "0", "metadatas" : [ { "name" : "TimeInstant", "type" : "ISO8601", "value" : "2016-03-09T08:36:35.533839" } ] }, { "name" : "PING", "type" : "command", "value" : " " } ] },

What are we making wrong? Is necessary to add special data to device or to IoTAgent in order to perform commands? On CB entity no "providingApplication" appears, and we are not sure if we have to add and endpoint to the device or some info related to that.

We will appreciate if you can clarify the configuration and steps to follow in order to use commands, we have follow commands.md documentation with no successful.

Thanks,