Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-5434

FIWARE.Question.Tech.IoT.IDAS.Fiware IotAgent: can't send command to a device

    Details

      Description

      Created question in FIWARE Q/A platform on 30-11-2015 at 18:11
      Please, ANSWER this question AT http://stackoverflow.com/questions/34004222/fiware-iotagent-cant-send-command-to-a-device

      Question:
      Fiware IotAgent: can't send command to a device

      Description:
      I approvisionned my device like this:

      curl -X POST http://192.168.1.110:80/iot/devices \
      -i \
      -H "Content-Type: application/json" \
      -H "Fiware-Service: egmsmartcity" \
      -H "Fiware-ServicePath: /egmsmartcitypath" \
      -d ' { "devices": [ { "device_id": "test",
      "entity_name": "sensors:test",
      "entity_type": "sensors",
      "protocol": "PDI-IoTA-MQTT-UltraLight",
      "timezone": "Europe/Paris",
      "endpoint": "notUsed",
      "commands": [

      { "name": "ping", "type": "command", "value": ""}

      ] } ] }'

      It is successufl registered in the context Broker:

      GET on: http://192.168.1.77:1026/v1/contextEntities/sensors:test

      with headers:

      Accept: application/json
      Fiware-Service: egmsmartcity
      Fiware-ServicePath: /egmsmartcitypath

      I got the following response:

      {
      contextElement: {
      type: "sensors"
      isPattern: "false"
      id: "sensors:test"
      attributes: [1]
      0: {
      name: "TimeInstant"
      type: "ISO8601"
      value: "2015-11-30T16:53:45.556269Z"
      }-
      -
      }-
      statusCode: {
      code: "200"
      reasonPhrase: "OK"
      }-
      }

      and then when I try to update the command like this:

      curl -X POST http://192.168.1.77:1026/v1/updateContext \
      -i \
      -H "Content-Type: application/json" \
      -H "Fiware-Service: egmsmartcity" \
      -H "Fiware-ServicePath: /egmsmartcitypath" \
      -d ' {"updateAction":"UPDATE","contextElements":[{"id":"sensors:test","type":"sensors","isPattern":"false","attributes":[

      {"name":"ping","type":"command","value":"22" }

      ]} ]}'

      I got this response:

      HTTP/1.1 200 OK
      Content-Length: 157
      Content-Type: application/xml
      Date: Mon, 30 Nov 2015 17:05:11 GMT

      <updateContextResponse>
      <errorCode>
      <code>404</code>
      <reasonPhrase>No context element found</reasonPhrase>
      </errorCode>
      </updateContextResponse>

      why is it returning "No context element found" ? What have I missed ?
      Thanks in advance for your help!

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2015-11-30 21:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2015-11-30 21:05|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-12-01 15:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2015-12-01 15:05|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-12-01 18:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-12-01 18:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            ralli Carlos Ralli Ucendo
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: