Remote retrieve sensor data

Hello

I would like to get the actual sensor data by connecting over TCP/IP to the Flukso server.
The manual describes a way to do this but it won't work.
I've tried this http request: "https://api.flukso.net/sensor/*SensorID*?version=1.0&token=*TokenID*&param=all"
All I get is an internal server error.
Can somebody help me with this?
I would also like to request the data from the Fluko Kubes.
Requesting the data locally at the FLM (http or from the mqtt broker) is no option in my case.

Regards,
Gwen

gebhardm's picture

Do not publish your tokens as these are your keys - edit it away...
I also get an internal error on the sample request - for the records and for icarus75 to follow up on:

  1. Internal Server Error
  2. The server encountered an error while processing this request:
  3.  
  4. {error,{case_clause,{[">"],[],[[567]]}},
  5.        [{api_sensor,is_auth_GET,2,[{file,"src/api_sensor.erl"},{line,162}]},
  6.         {webmachine_resource,resource_call,3,
  7.                              [{file,"src/webmachine_resource.erl"},
  8.                               {line,186}]},
  9.         {webmachine_resource,do,3,
  10.                              [{file,"src/webmachine_resource.erl"},
  11.                               {line,142}]},
  12.         {webmachine_decision_core,resource_call,1,
  13.                                   [{file,"src/webmachine_decision_core.erl"},
  14.                                    {line,48}]},
  15.         {webmachine_decision_core,decision,1,
  16.                                   [{file,"src/webmachine_decision_core.erl"},
  17.                                    {line,209}]},
  18.         {webmachine_decision_core,handle_request,2,
  19.                                   [{file,"src/webmachine_decision_core.erl"},
  20.                                    {line,33}]},
  21.         {webmachine_mochiweb,loop,2,
  22.                              [{file,"src/webmachine_mochiweb.erl"},{line,74}]},
  23.         {mochiweb_http,parse_headers,5,
  24.                        [{file,"src/mochiweb_http.erl"},{line,180}]}]}

Following request posted in a browser works (no token required; sensor id to be set in):
https://api.flukso.net/sensor/<sensorid>?version=1.0&interval=15min&unit=watt
and delivers
[[1451999280,14],[1451999340,18],[1451999400,18],[1451999460,18],[1451999520,43],[1451999580,80],[1451999640,69],[1451999700,69],[1451999760,68],[1451999820,67],[1451999880,"nan"],[1451999940,"nan"],[1452000000,"nan"],[1452000060,"nan"],[1452000120,"nan"]]
Be aware that due to high traffic, the API-server does not provide minute resolution; so, interval=minute gives a "bad request"...

Proeftuinen's picture

Thank you for the quick reply.
Is there also an option to get data from the Flukso Kubes with this method?

gebhardm's picture

Who has seen a kube in real life?

petur's picture

I have (a few years ago at Fosdem) :)