Raspberry Pi + Wi-Fi USB + RTL SDR (DVBT) Receiver
Track Aircraft with a Raspberry Pi
If you’re looking for an interesting project for your old Raspberry Pi, receiving data from aircraft’s flying above you might be something. As an added bonus feeding this data to FlightRadar24 or other services will gain you a free subscription.
You need to position your Pi somewhere high, the DVB-T antenna close to or outside a window, so you probably need a USB Wi-Fi dongle. Most of them should work out of the box, take care to pick one that draws a minimum of power otherwise it won’t work without a USB hub.
You can buy an RTL-SDR dongle with Antenna for 10$ and a Wi-Fi dongle for 7$. Take care to pick a RTL-SDR dongle that supports ADS-B / 1090Mhz!
Step 1: Install the latest Raspbian OS. Once you have the SD card ready, add a file named “ssh”:
touch ssh
This will enable SSH access to the Pi, so you don’t have to hook it up to a TV or monitor.
Step 2: Not all Wi-Fi dongles work out-of-the-box. SSH to the Pi and insert the dongle in the Pi and type:
ifconfig
If you don’t see the “wlan0” interface, you need to install a driver. To check if it is recognised at all type:
lsusb
This should show you all connected USB devices and it’s manufacturer. The cheaper Wi-Fi dongles mostly use RealTek, you can download an automatic RealTek install script from raspberry.org. Follow the instructions to install the driver and test if your Wi-Fi is up and running with a network scan:
iwlist wlan0 scan
Step 3: Configure your Wi-Fi network by providing the SSID (network name) and Password:
sudo wpa_passphrase "YOURSSID" "YOURPASSWORD" >> /etc/wpa_supplicant/wpa_supplicant.conf sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Remove the plain text password from the configuration and save the file (Command+X). Then reboot the Pi:
sudo reboot
Step 4: Prepare the Pi for the RTL SDR dongle. This section was taken from the excellent tutorial on fontenay-ronan:
sudo apt-get install git cmake libusb-1.0-0-dev build-essential git clone git://git.osmocom.org/rtl-sdr.git cd rtl-sdr mkdir build cd build cmake ../ -DINSTALL_UDEV_RULES=ON make sudo make install sudo ldconfig cd ~ sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/ sudo reboot cd ~ git clone git://github.com/flightradar24/dump1090 cd dump1090 make sudo modprobe -r dvb_usb_rtl28xxu sudo nano /etc/modprobe.d/rtl-sdr-blacklist.conf
Then add the following line and save the file:
blacklist dvb_usb_rtl28xxu
To test the output:
./dump1090 --interactive
If you don’t see any airplanes, check the dongle’s tuner:
rtl_test -t
In case you have a Fitipower FC0012 or FCI FC2580 tuner, you’re in bad luck, these versions do not support 1090 MHz and cannot be used to track airplanes.
First thing to do is check the offset of the tuner. Let it run for a few minutes, then use the cumulative PPM value in the configuration (few steps below).
rtl_test -p
Step 5: The next step would be to start feeding the data to a tracker service, this would install and prepare your system for flightradar24:
sudo bash -c "$(wget -O - https://repo-feed.flightradar24.com/install_fr24_rpi.sh)"
You will be asked to enter your email address, antenna position and other details, and your account will automatically be created. Your account will remain in free trial mode until you spot the first airplanes and the Pi uploads data. After the first data upload, your account will change to a full business account.
If you open the configuration page in your web browser, let’s say:
http://192.168.1.100:8754
You will be able to check the status and you could set/change the settings. Add the ppm setting and enable the web interface as per below:
--ppm 18 --phase-enhance --net
To view the web interface with tracked aircraft:
http://192.168.1.100:8080
To stop/start:
sudo service fr24feed stop
If you’re looking for a nice macOS app to monitor your new ADS-B receiver, it’s right here!
References:
https://www.raspberrypi.org/downloads/raspbian/
https://osmocom.org/projects/rtl-sdr/wiki/Rtl-sdr
https://www.raspberrypi.org/forums/viewtopic.php?p=462982#p462982
https://www.fontenay-ronan.fr/flightradar24-behind-the-scene-receiver-setup/