Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Chapter:IoT
-
HD-Enabler:IDAS
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" : [
], "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
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":[
]}
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?
2015-05-24 10:05|CREATED monitor # answers= 1, accepted answer= True