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

FIWARE.Question.Tech.IoT.IDAS.Fiware iotagent: How to send measure from a device?

    Details

    • Type: Monitor
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2021
    • Component/s: FIWARE-TECH-HELP
    • Labels:

      Description

      Created question in FIWARE Q/A platform on 24-08-2015 at 09:08
      Please, ANSWER this question AT http://stackoverflow.com/questions/32176619/fiware-iotagent-how-to-send-measure-from-a-device

      Question:
      Fiware iotagent: How to send measure from a device?

      Description:
      I'm developing a Fiware system and I don't know how to send measures from a device through IDAS iot-agent.

      I have Orion and Cygnus running, but I'm sending the measures with a servlet directly to Orion and I want to switch the proccess to IDAS iot-agent.

      I've created the service and the device properly but I'm stucked with the POST from the device to the iot-agent.

      My device is created as follows:

      { "device_id" : "0010", "entity_name" : "0010", "entity_type" :
      "xxxxx", "timezone" : "Europe/Madrid", "attributes" : [

      { "object_id" : "0010", "name" : "fecha", "type" : "timestamp", "name" : "coord_x", "type" : "double", "name" : "coord_y", "type" : "double", "name" : "coderr", "type" : "string", "name" : "s_temp", "type" : "double", "name" : "s_hum", "type" : "double", "name" : "num_sat", "type" : "int", "name" : "voltaje", "type" : "double", "name" : "inicio", "type" : "int" }

      ], "service" : "xxxxx", "service_path" : "/xxxxx" }

      How it would be the POST from the device to send the measures?

      Thanks.

      EDIT:

      I tried to POST from a command line to test like this:

      curl -X POST xxxxxxxxxxxx:8080/iot/d?i=0010 \
      -i \
      -H "Content-Type: application/text" \
      -H "Fiware-Service: xxxxxx" \
      -H "Fiware-ServicePath: /xxxxxx" \
      -d "s_temp|25"

      And here is the response:

      HTTP/1.1 415 Connection: close
      Content-Length: 88

      {"reason": "Unsupported Media Type (only support application/xml and application/json)"}

      Now the question is... if I had installed iot-agent-base and iot-agent-ul, Why I'm not able to POST text? Did I miss some configuration?

      EDIT:

      I'm able to send values to this url:

      http://xxxxxxxx:8080/iot/xx?k=xxxxxxx&i=xxxxxxxx#fecha|1#coord_x|1#coord_y|1#coderr|1#s_temp|1#s_hum|1#s_temp|1#num_sat|1#voltaje|1#inicio|1

      And this is the respone

      DEBUG - Accept: /
      DEBUG - End filters status 200
      DEBUG - Proccessing in handle /iot
      DEBUG - iota::AdminService::error_response 0
      DEBUG - finish connection 2
      DEBUG - Get statistics /iot/ngsi Counters 0
      INFO - Agent Activity {"statistics":[

      {"resource":"/iot/ngsi","data":[]}

      ]}

      But Orion doesn't get anything

      EDIT:

      It was a version issue, now I have the latest version of iot-agent installed with UltraLight module and device with "protocol":"PDI-IoTA-UltraLight" and the protocol itself is working.

      But I don't know what is the correct url to post measures from the device. Any help?

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2015-05-24 10:05|CREATED monitor # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-05-24 10:05|CREATED monitor # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-05-24 10:05|UPDATED status| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-05-24 10:05|UPDATED status| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-09-28 10:30|UPDATED status: transition Answered| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-09-28 10:30|UPDATED status: transition Answered| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-09-28 10:35|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-09-28 10:35|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: