Extracting data from piaware

Is there any way to leave the raspberry pi with piaware and antenna running for a day, so that it collects data during that day, stores it in some file, such as a .json, and then I can extract it to my computer?

Not Piaware, but dump1090/readsb

It provides a network output stream which can be covered by tools like Virtual Radar Server or a Python script like this one
http://cactusprojects.com/logging-dump1090-fa-to-local-database/

I’ve used that one for some time, works great after some modifications.

2 Likes

As @foxhunter said the cactusprojects Python script approach does work after some modifications. A couple things to be aware of: if you want to display results on a web page, you might want to use something different than /var/www/html/index.html because that’s where the PiAware web page is. Also: d3.v3.min.js isn’t the latest version of d3. The latest version of d3 won’t work with that script. I’m not knowledgeable enough in d3 to modify the script to work with the latest version of d3. If anyone knows how to do that, it would be helpful to post.

2 Likes

If you terminal into your Pi and go to /run/dump1090-fa, you’ll see a set of JSON files. These get generated in 30 second intervals. I believe they represent a snapshot of what you’re receiving at a given moment, but maybe someone more knowledgeable can correct me if I’m wrong.

I pull these into a Python script every hour via a cron job, parse them, and send to a Postgres database. The result is that I grab about 50% to 60% of what SkyAware shows on my “Positions Reported” tile.

I’ve been wanting to work with the actual output stream though, so I appreciate what @foxhunter posted and will look at that more closely.

The JSON file is correct, but if you query it via script, you need to remove the duplicates.

This is done already by the suggestions i made (with some individual adjustments)