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

FIWARE.Question.Tech.Error get empty value when retriving data from sth-comet.

    Details

      Description

      Created question in FIWARE Q/A platform on 08-09-2017 at 11:09
      Please, ANSWER this question AT https://stackoverflow.com/questions/46112683/error-get-empty-value-when-retriving-data-from-sth-comet

      Question:
      Error get empty value when retriving data from sth-comet

      Description:
      First i register service using this script

      curl -H "Content-type: application/json" -H "Fiware-Service:
      cairoUniversity" -H "Fiware-ServicePath: /FCI/ICDL" \
      http://X.X.X.X:4041/iot/services -d '{ "services": [

      { "apikey": "api1", "cbroker": "http://0.0.0.0:1026", "entity_type": "Camps", "resource": "/iot/d" }

      ] }'

      then i register device using this

      curl http://X.X.X.X:4041/iot/devices \ -H "Content-type:
      application/json" -H "Fiware-Service:cairoUniversity" -H
      "Fiware-ServicePath: /FCI/ICDL" \ -d '{ "devices": [
      {
      "device_id": "smartmeter2",
      "entity_name": "ICDL2",
      "entity_type": "Camps",
      "protocol": "PDI-IoTA-UltraLight",
      "timezone": "Europe/Madrid",
      "attributes": [

      { "object_id": "c", "name": "Conscemption", "type": "int" }

      ]
      } ] }'

      then i make subscription to orion

      curl -X POST -H "Content-Type: application/json" -H "Accept:
      application/json" -H "Fiware-Service: cairoUniversity" \
      -H "Fiware-ServicePath: /FCI/ICDL" -H "Cache-Control: no-cache" -d '{
      "entities": [

      { "type": "Camps", "isPattern": "false", "id": "ICDL2" }

      ],
      > "attributes": [
      "Conscemption"
      ],
      "reference": "http://X.X.X.X:8666/notify",
      "duration": "P1M",
      "notifyConditions": [

      { "type": "ONCHANGE", "condValues": [ "Conscemption" ] }

      ] }' "http://X.X.X.X:1026/v1/subscribeContext" }

      after that i send observation

      curl "http://X.X.X.X:7896/iot/d?k=api1&i=smartmeter2" -d 'c|47' -H
      "Content-type: text/plain"

      and finally retrieve data from sth

      curl -X GET \
      'http://X.X.X.X:8666/STH/v1/contextEntities/type/Camps/id/ICDL/attributes/Conscemption?aggrMethod=min&aggrPeriod=day&dateFrom=2015-01-28T00%3A00%3A00&dateTo=2018-01-01T23%3A59%3A59'
      \ -H 'accept: application/json' \ -H 'cache-control: no-cache' \
      -H 'content-type: application/json' \ -H 'fiware-service: cairoUniversity' \ -H 'fiware-servicepath: /FCI/ICDL' | python
      -mjson.tool }

      i got this respones

      "contextResponses": [
      {
      "contextElement": {
      "attributes": [

      { "name": "Conscemption", "values": [] }

      ],
      "id": "ICDL",
      "isPattern": false,
      "type": "Camps"
      },
      "statusCode":

      { "code": "200", "reasonPhrase": "OK" }

      }
      ]

      and this the logs

      sth-comet | time=2017-09-04T14:26:44.782Z | lvl=INFO | corr=n/a |
      trans=n/a | op=OPER_STH_SERVER_LOG | from=n/a | srv=n/a | subsrv=n/a |
      comp=STH | msg=Everything OK, 0 requests attended in the last 60s
      interval sth-comet | time=2017-09-04T14:27:44.787Z | lvl=INFO |
      corr=n/a | trans=n/a | op=OPER_STH_SERVER_LOG | from=n/a | srv=n/a |
      subsrv=n/a | comp=STH | msg=Everything OK, 0 requests attended in the
      last 60s interval

      sth-comet | time=2017-09-04T14:27:52.834Z | lvl=WARN |
      corr=99577e81-bbd4-4130-95f6-a9d029f84db0 |
      trans=99577e81-bbd4-4130-95f6-a9d029f84db0 | op=OPER_STH_GET |
      from=n/a | srv=cairoUniversity | subsrv=/FCI/ICDL | comp=STH |

      > msg=Error when getting the aggregated data collection for retrieval
      (the collection may not exist)

      sth-comet | time=2017-09-04T14:28:44.792Z | lvl=INFO | corr=n/a |
      trans=n/a | op=OPER_STH_SERVER_LOG | from=n/a | srv=n/a | subsrv=n/a |
      comp=STH | msg=Everything OK, 0 requests attended in the last 60s
      interval sth-comet | time=2017-09-04T14:29:44.797Z | lvl=INFO |
      corr=n/a | trans=n/a | op=OPER_STH_SERVER_LOG | from=n/a | srv=n/a |
      subsrv=n/a | comp=STH | msg=Everything OK, 0 requests attended in the
      last 60s interval sth-comet | time=2017-09-04T14:30:44.805Z |
      lvl=INFO | corr=n/a | trans=n/a | op=OPER_STH_SERVER_LOG | from=n/a |
      srv=n/a | subsrv=n/a | comp=STH | msg=Everything OK, 0 requests
      attended in the last 60s interval sth-comet |
      time=2017-09-04T14:31:44.811Z | lvl=INFO | corr=n/a | trans=n/a |
      op=OPER_STH_SERVER_LOG | from=n/a | srv=n/a | subsrv=n/a | comp=STH |
      msg=Everything OK, 0 requests attended in the last 60s interval

      What may case this problem and how solve it

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-12 19:49|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-12 19:49|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-01-22 12:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-01-22 12:05|UPDATED status: transition Answered| # answers= 1, accepted answer= False

          People

          • Assignee:
            andres.munoza Andres Muñoz
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: