Retrieving sensor parameters through api.flukso.net

Bart,

I have been trying to tackle this for a while now and it seems that when asking api.flukso.net for sensor parameters you'd get a 502 Bad Gateway response.
Is there a problem on your behalf?
I did make sure that it's a real SSL encrypted request so that can't be the problem.

Would you be so kind and have a check on the nginx-settings please?

icarus75's picture

Could you post the equivalent curl command that triggers this 502? I've just tested the example from the Fluksometer Manual against the api and I'm getting a 200.

  1. icarus75@cirrus:~ $ curl -k -X GET -H "Accept: application/json" "https://api.flukso.net/sensor/c1411c6b4f9910bbbab09f145f8533b9?version=1.0&token=d8a8ab8893ea73f768b66b45234b5c3a&param=all"
  2. {"access":1336883314,
  3. "type":"electricity",
  4. "function":"main",
  5. "class":"pulse",
  6. "voltage":null,
  7. "current":null,
  8. "phase":null,
  9. "constant":1.0,
  10. "enabled":1,
  11. "lastupdate":[1353677733,1213153]}

gallon_kbms's picture

The request commes from a .php environment and after RTFM a lot I now also got a 200 'OK' result.
I must have messed up big time in the original .php script.
Sorry to have bothered you.
Consider this a typical IDo10 error.

icarus75's picture

geertvanbommel has written a PHP class for extracting readings out of the platform, see [1]. It's a bit dated, but it should still work against the current api. I guess if you extend this slightly, you can use it to get the sensor metadata as well.

[1] https://www.flukso.net/content/flukso-api-php-class