Le blog de numerunique

What is better than open source?
17/10/2015

No one will contest that open source has become the de facto standard in successful new IT stuffs. But who cares to read the code that is given in git depositories? So what is better than open source? A concise documentation, definitely! Actually, a small example of code is even better. It is worth 1000 pages of documentation - and 106 man pages.

TL;DR

A few weeks ago, OVH gave a very interesting goody to the attendees of its Summit: a small beacon connected to SigFox, an emerging network for the Internet of Things. It looks intensely promising. It gives access to temperature and movement detection every 10 minutes anywhere under the coverage of the network, without any external energy supply and for an unlimited lapse of time compared to similar beacons depending on GSM network.

Along with the goody, a new special account is offered on RunAbove labs.

Great! Another gift!

Wait. There ends all excitement: just two pair of key/password, one obviously for reading and another for writing. How one is supposed to read or write anything on the goody is mysteriously hinted by a link to the IoT tutorials.

Four articles wait deciphering. Let's start the quest of reading whatever data is recorded by the goody through the one titled How to get data from the RunAbove IoT metrics storage.

Apart from incomplete excerpts of code, another link is proposed to the complete documentation of the underlying standard: the official OpenTSDB documentation.

Alas, this last link gives access to a complete reference, an ideal source of inspiration for knowledgeable users but still frustrating for early beginners.

Hopefully, RunAbove Labs has an access to its community. On its online interface, a search of the keyword goody allows to spot a single contribution.

Hurray, there is the list of the metrics, the keyword to access the goody's data. This is the kind of precious arbitrary knowledge that defies intelligence.

There is also an example of 84 lines of PHP code that suggests you are first supposed to catch the data sent by the goody by setting a callback, write it to the OVH's Internet of Things account before reading it… In this example, different metrics are used: confusing. But those lines of code eventually give another clue for retrieving the goody's data.

Eventually, its summaries in:

curl -u hereisyourkey:anditscorrespondingpassword \
   -XPOST https://opentsdb.iot.runabove.io/api/query \
   -d '{ 
     "start":1443052800,
     "queries":[
       {
       "metric": "ovh.goody.temperature",
       "aggregator":"avg"
       }
     ]
   }'

If only I had that at the beginning, I would have saved hours of useless guesses and your time for reading this post.


Précédent | Suivant