metrics to CSV

Started by Kilo95, October 10, 2017, 09:55:01 PM

Kilo95

I have 2 Weathershields (soon to be another), connected to a Moteino USB to RPi using Felix's GW. Correct me if i'm wrong but isn't all the data from the WSs stored in gateway.db? It is stored in CSV format? Is it immediately stored when the gateway receives it?

Felix

the gateway.db only stores the latest metrics data, along with other node information, events etc.
The "logged" metrics are saved in individual .bin files in the data\db directory, in a special format - each data point is 9 bytes in length, 1 reserved byte, 4 timestamp bytes, 4 value bytes.
Hence you need some special functions to extract that data and format it in CSV human readable files.

Kilo95

so, if you only wanted to export the latest metrics you could use the gateway.db? at this time, i don't need historical data for this project

Felix

Yes for the latest metrics (all metrics on the node) values you can see those in the gateway.db file. There is no export feature for gateway.db though.
That said, the gateway.db format is JSON, so I think you can just look at that data in a JSON viewer.

Kilo95

ok. i think freeboard.io is cool with the JSON format. got a couple of 7.5F supercaps in the mail. waiting on my solar panels to arrive. :D