I feel obliged to point out that this blog post is roughly 5 years and 1 month old. People change, opinions evolve. In just a few years, vast technological landscapes can shift. And don't get me started on config files. Please consider this text in the context of its time.

You may know that I’m very interested in aviation, despite the fact that I had a quite severe case of “being totally afraid of flying” in the past. Or perhaps exactly because I’m afraid of flying.

I’m so interested in it that I have an ADS-B receiver (Automatic Dependent Surveillance–Broadcast) at home and I’m feeding data to Flightaware. You may have already surmised from a number of articles that I’m using Grafana and InfluxDB to collect and present data around my home. So it was a rather obvious task to do this for my ADS-B receiver as well.

In order to receive ADS-B data I’m using piaware from Flightaware. In the end it uses a DVB-T stick as a software defined radio to listen on 1090 MHz and it’s decoding the transmissions of aircraft that send out a number of pieces of information like coordinates, courses, altitude and so on. This is for collision avoidance and in the future for traffic control. The core of the piaware suite is dump1090. As it’s dumping data from 1090 MHz the source of the name of the tool is quite obvious. Despite being called piaware it doesn’t run on a Raspberry Pi here but on a server.

Aside from transmitting the data to Flightaware, it provides some local interfaces to access the information it collects. The web interface on 8080 doesn’t only provide you with a nice map, but with a number of JSON feeds as well. For a while I used one of them to alert me when LH454 was passing by in line of sight to get some “Fernweh”. LH454 is the flight from FRA to SFO.

I tapped into those feeds to collect data from the receiver for my monitoring as well, however I didn’t use Telegraf for this as I needed to do some preprocessing like calculating the distance and the bearing.

For this I wrote a small Python script. You can download it from Github. In order to get it to work you have to change some variables at the start of the script.

ip = "" # IP or name of the receiver
influxdbserver= "" # IP or name of the InfluxDB server
influxdbusername= "" # Username for the InfluxDB Server
influxdbpassword = "" # Password for the InfluxDB Server
influxdbdbname = "" # Database name for the InfluxDB server

In addition you have to install two Python libraries.

# pip3 install python-influxdb
# pip3 install great-circle-calculator

Obviously you should do this in a virtual environment. I omitted this for purposes of brevity in this article.

You now just have to put it into cron to run it every minute. From there you can just use the measurements in InfluxDB for Grafana dashboards.

Written by

Joerg Moellenkamp

Grey-haired, sometimes grey-bearded Windows dismissing Unix guy.