What to do with an old Raspberry Pi and a DVB‑T stick that are just lying around unused? That’s right— you build an ADS‑B receiver with them.

This is a fairly lengthy post explaining how to set up a Raspberry Pi from scratch with everything necessary to receive ADS‑B data and feed it to FlightAware. We will cover the following topics:

  • What is ADS‑B?
  • Let’s go shopping
  • Setting up the Raspberry Pi
  • Installing the Flight Tracking Software
  • Starting it all up
  • A little tweaking

What is ADS-B

Most planes broadcast radio signals to report their position, altitude, velocity, and other data. We can receive these signals, decode them, and display the aircraft on a map along with their information.

Check out this Wikipedia entry for a detailed explanation.

Let’s go shopping

We need a few inexpensive items to make this work. If you already have a running Raspberry Pi, you basically only need a DVB-T stick to get started.

  • Raspberry Pi
  • DVB-T stick with antenna
  • SD card
  • Power supply
  • Optional: band filter
  • Optional: ADS-B antenna

Setting up a Raspberry Pi

First, download the operating system image. For this guide I chose the lite version of Raspbian Jessie.

Follow these instructions to install the image. For me it looked like this:

diskutil list
diskutil umountDisk /dev/disk2
sudo dd bs=1m if=~/Downloads/2016-03-18-raspbian-jessie-lite.img of=/dev/rdisk2
sudo diskutil eject /dev/rdisk2

I started the Raspberry Pi with a keyboard and screen attached, and I also plugged in the DVB-T stick.

Also, change the default password of user pi with passwd.

After that, the software that comes with Raspbian Jessie was updated to the latest versions:

sudo apt-get update
sudo apt-get upgrade

Since I have a German keyboard, I changed the layout with sudo raspi-config.

Check if the DVB-T stick is recognized with lsusb. Look for “wireless” or “802.11”.

Then I set up my wireless adapter. The command ifconfig showed the adapter as wlan0, so it was recognized and only needed to be configured.

Edit the config file: sudo vi /etc/network/interfaces and add the following lines under iface wlan0:

wpa-ssid "thessid"
wpa-psk "thepasswd"

Restart networking afterwards with sudo service networking restart.

Installing the Flight Tracking Software

We have our Raspberry Pi up and running; now it’s time to set up the flight tracking software called PiAware. This software will send the received radio signals to FlightAware for everyone to see. Before installing the software, register first and note your user name and password.

wget http://flightaware.com/adsb/piaware/files/dump1090_1.2-3_armhf.deb
sudo dpkg -i dump1090_1.2-3_armhf.deb
wget http://flightaware.com/adsb/piaware/files/piaware_2.1-5_armhf.deb
sudo dpkg -i piaware_2.1-5_armhf.deb
sudo apt-get install -fy
sudo piaware-config -autoUpdate 1 -manualUpdate 1
sudo piaware-config -user <yourusername> -password
sudo /etc/init.d/piaware restart

After I did all this I checked if everything was okay:

piaware-status

Apparently, nothing was okay:

dump1090 is not running.
faup1090 is not running.
piaware is running.
no program appears to be listening for connections on port 30005.
faup1090 is NOT connected to port 30005.
piaware is connected to FlightAware.
got 'couldn't open socket: connection refused'
maybe dump1090 is NOT producing data on port 30005.

This post here shows the reason why this happens and how to solve it.

The device is already in use by the DVB-T driver. A quick fix is to unload the driver:

sudo rmmod dvb_usb_rtl28xxu rtl2832

This is not permanent— after restarting the Raspberry Pi the driver will be reloaded. To make it permanent, add the following to a blacklist file (for example /etc/modprobe.d/blacklist-rtl.conf):

blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830

Starting it all up

Let’s get the ball rolling and start all software components:

dump1090 --quiet --net &
sudo /etc/init.d/piaware restart

Finally, everything shows up okay:

dump1090 is running.
faup1090 is running.
piaware is running.
dump1090 is listening for connections on port 30005.
faup1090 is connected to port 30005.
piaware is connected to FlightAware.
dump1090 is producing data on port 30005.

You can check the log file to see current activity:

tailf /tmp/piaware.out

Also check your network ports:

sudo netstat -tulpen

There is a web server running on port 8080. Point your browser to http://<yourip>:8080 and enjoy!

You can also check my FlightAware statistics.

A little bit of tweaking

The setup can certainly be improved by:

  • Automatically starting dump1090 and PiAware after a Raspberry Pi restart
  • Using a band-pass filter
  • Using a better ADS‑B antenna and placing it on the roof

After a while, the Raspberry Pi and the DVB-T stick got quite warm. I now monitor the Raspberry Pi temperature and post it to ThingSpeak. For that I set up a cron job as follows:

*/10 * * * * echo "field1=`vcgencmd measure_temp | grep -o '[0-9]*\.[0-9]*'`" | curl -d "api_key=<your-api-key>" -d @- https://api.thingspeak.com/update.json

I will also receive an SMS when the temperature reaches a certain threshold.

Done for today!