Raspberry Pi ADSB Receiver
I’ve been tossing around the idea of building an ADSB receiver using one of the spare Pis I had laying around. For the unaware, an ADSB receiver picks up the transponder signals from nearby aircraft. The signals can then be fed to ADSB Exchange, FlightRadar24, or one of the other sites that crowdsources aircraft tracking information. I picked up a little SDR starter kit off Amazon and got to work.
Some images already exist to get projects like this off the ground (no pun intended). PiAware and Pi24 are two for FlightAware and FlightRadar24 respectively. Additionally, and the kit I ordered included a preflashed SD card for the ADSB Exchange. Of course, using one of these images would be too easy. Rather I started with a base install of Raspberry Pi OS Lite and dug through some software to build my own.
Initially, I built this on a spare Pi 3B but I’m stingy with the Pis. I have since moved it over to an Inovato Quadra that was itching to be used. It has been working flawlessly.
Hardware Preparation
I first started with a freshly baked Pi using Raspberry Pi OS Lite. When I moved to the Quadra, I also started with a freshly flashed device.
Since this device will run headless, it is nessicary to get some initial configuration out of the way. I won’t go into lots of detail here as these are pretty basic steps when setting up network based and/or headless devices. Make sure the device can connect to the network. SSH should be enabled and consider using a static IP address. Change or select the username and password as desired.
I prototyped this device on my home WiFi prior to moving it to its deployment location. As such I also used Network Manager
sudo nmtui
to configure all networks this device will end up using.
As always, make sure the device is up to date prior to starting any software install.
1
sudo apt update && sudo apt full-upgrade -y
For the Inovato, I also shutoff the GUI.
1
sudo systemctl disable lightdm
Decoder Install & Configuration
I dug through the software included in the ADSB Exchange image which eventually lead me to wiedehopf/readsb and the associated automated install scripts.
The automated script installs readsb for the ADSB decoding and the tar1090 web interface. tar1090 is the same interface used by ADSB Exchange. Also included with the script are some adjustment tools.
Running random scripts is never a great idea. I scrolled through the scripts prior to running them and also noticed they were used by several other trusted sources. The developer has also included the option of manually compiling this software.
The script can be run with:
1
sudo bash -c "$(wget -O - https://github.com/wiedehopf/adsb-scripts/raw/master/readsb-install.sh)"
A reboot is recommended following the script. Additionally, the same script can be run to update the software.
Assuming the SDR is attached, the readsb software should start automatically and the tar1090 interface will be accessible from the network by using the host’s IP address followed by /tar1090. Example 192.168.1.200/tar1090
.
The developer also included an automatic gain adjustment script for some optimization.
For now I’m using the autogain script. I may fine tune this later as I would like to pick up more helicopter traffic.
1
2
sudo bash -c "$(curl -L -o - https://github.com/wiedehopf/adsb-scripts/raw/master/autogain-install.sh)"
hash -r
Before accurate detection is possible, the antenna’s location needs to be specified. I used the Free Map Tools Elevation Finder as recommended by ADSB Exchange. Record the lat, long, and elevation of the antenna’s position. Then set the location with the following command (replace the coordinates with what is correct for you location):
1
sudo readsb-set-location 40.23655 -116.23589
Restart the readsb service after any configuration change.
1
sudo systemctl restart readsb
Additionally, the entire readsb configuration file can be found at /etc/default/readsb
.
Return to the tar1090 GUI and shortly it should begin to populate with aircraft in the detector’s range and the view centered on the coordinates. Aircraft detection can also be confirmed by comparing to the live ADSB Exchange feed.
Receiver Statistics
If performance statistics and pretty graphs are your thing, this developer also created the optional graphs1090 package. After installing, it can be accessed at hostip#/graphs1090
.
1
sudo bash -c "$(curl -L -o - https://github.com/wiedehopf/graphs1090/raw/master/install.sh)"
Feeding Data
Now a fully functional ADSB Receiver has been configured and should be receiving signals. The GUI will only show aircraft being picked up by this box and by default does not share any information. The following explains how I set up my receiver to share information with ADSB Exchange and FlightRadar24. These are the two services I used prior to building the box. Additionally, sharing information with the various services provides benefits like an ad free experience and account upgrades.
Feeding ADSB Exchange
The ADSB Exchange GitHub provides information for installing their feed client. Once again, it is a script that will pull and install the files.
The script requires
whiptail
. It was not installed on my Inovato Quadra by default nor included in the dependency check run by the script. Runsudo apt install whiptail
to install this dependency prior to running the script. I have submitted a pull request to addwhiptail
to the dependency check.
1
2
curl -L -o /tmp/axfeed.sh https://adsbexchange.com/feed.sh
sudo bash /tmp/axfeed.sh
This script will open the installer then ask for the coordinates and elevation of the receiver. It can be ran again at anytime to update and make changes.
Upon completion, the receiver should now be feeding the ADSB Exchange. When visiting https://globe.adsbexchange.com and viewing the tracking map, there should no longer be ads and the right panel should display Premium Active. You can also visit https://adsbexchange.com/myip/ to view the connection status of the feeder and https://map.adsbexchange.com/mlat-map/ to see how well the feeder syncs with others in the area.
ADSB Exchange Stats
Once again, there is an optional statistics package. This is specific to the ADSB Exchange feed. Enabling it allows the feeder to become part of their leaderboard and provides another way to view statistics. It also gives a web URL allowing the feed specific from this receiver to be viewed anywhere.
The following commands install the statistics package and output the statistics URL.
1
2
3
4
curl -L -o /tmp/axstats.sh https://adsbexchange.com/stats.sh
sudo bash /tmp/axstats.sh
adsbexchange-showurl
Post install, the statistics page URL can be found again at https://adsbexchange.com/myip/ or by running adsbexchange-showurl
FlightRadar24
FlightRadar24 is the first app I used to track aircraft. I still use it regularly so I decided to feed them as well. By feeding them they also upgrade your account to Business, about a $500/year value.
FlightRadar24 provides information for installing their feeder client on the share your data page. The developer of readsb also provides a (leaned out FR24 Feeder install script)[https://github.com/wiedehopf/adsb-wiki/wiki/Raspbian-Lite:-ADS-B-receiver#10-feed-fr24-optional].
I elected to run the readsb version of the script as it removes some possible conflicting features of FR24 Feeder when ran along side readsb and other feeders.
I would still like to test running the offical FR24 Feeder software.
To install the leaned out FR24 Feeder, run:
1
sudo bash -c "$(wget -O - https://github.com/wiedehopf/adsb-scripts/raw/master/fr24-nopackage.sh)"
This can also be ran in the future to update the feeder.
Following the install of the feeder software, run the configuration wizard.
1
sudo fr24feed --signup
The wizard will ask several configuration questions. Some are specific to the user/device. These include an email address, feeder ID, and location. The feeder ID will be automatically generated and should be unique to each receiver. Only reuse an existing feeder ID if replacing hardware.
A full breakdown of all the options can be found in the FR24 Feeder Manual. A truncated version can be found in the guide specific to using FR24 Feeder with readsb. I have also highlighted some of these options and appropriate answers below.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Step 1.3 - Would you like to participate in MLAT calculations? (yes/no)$:
no
Step 4.1 - Receiver selection:
Enter your receiver type (1-7)$:
4
Step 4.2 - Please select connection type:
Enter your connection type (1-2)$:
1
Step 4.3A - Please enter your receiver's IP address/hostname:
127.0.0.1
Step 4.3B - Please enter your receiver's data port number
30005
Step 5.1 - Would you like to enable RAW data feed on port 30334 (yes/no)$:
no
Step 5.2 - Would you like to enable Basestation data feed on port 30003 (yes/no)$:
no
Remember, the reasdb software is acting as a decoder, it feeds the information to FR24 Feeder, which then feeds to FlightRadar24. This is why ModeS Beast is used as the receiver type and the local loopback network (127.0.0.1) is used as the receiver’s host.
Once the install and configuration is complete, restart FR24 Feeder and check the status.
1
2
sudo systemctl restart fr24feed
sudo systemctl status fr24feed
With the service running correctly, nothing should have changed on the readsb/tar1090 side. Shortly, an email will come from FlightRadar24 thanking you for feeding and upgrading the associated account to business.
Play around in the upgraded FR24 interface and enjoy some new features like advanced filters, additional users, longer timelines, and no ads!
Updating
Offsite/Remote Access
I previously mentioned this device was prototyped at my home before I deployed it in the field. To be exact, my deployment location is at my work on the visitor/guest network. Since I don’t have physical 24/7 access to the device I wanted to make sure it was secure but I could still access it remotely.
Naturally, I changed the default password on the device. This way I can directly access the device with a physical keyboard and monitor on site. I also found I am able to SSH into the device when on the same guest/visitor network so I set up secure keys for SSH access.
I still needed to solve the problem of remotely accessing the device. I could have tried setting up a WireGaurd service on the unit but I wasn’t sure about the port forwarding status of this network. I used a separate Tailscale network. It is installed by default on the Inovato Quadra and quickly installs on a Pi. Tailscale worked great for remote access, it is separate from my personal VPN and I am able to disable any outbound connections from the receiver box for added security.