Updated: Custom ADS-B Raspberry Pi Feeding
As someone who is an Amateur Radio Operator, Student Pilot, and tech addict during the Pandemic SIP I decided to build a performant ADS-B feeder. Besides, when you feed these various site, they tend to give you complimentary access to their services. This perk alone saved me from at least one monthly subscription, plus I help fellow pilots at the same time. Win-win in my book!
Before we begin there is some added hardware this will require. I will share a sample list of what you would want to purchase, however there are many options and you don’t have to buy exactly what I suggest. There are also better versions of almost all these components. You can decide what fits your needs the best.
If I can also explain why to feed the same sites I feed:
ADSBExchange — This is the best of them all. No paid blocking, API access if you feed, and they are a very helpful bunch on their Discord server.
FlightAware — While they do make money off your feeding data they do give Enterprise access for free. Additionally Pilots that use the ForeFlight aviation app (myself included) get Internet based ADS-B traffic on our tables from FlightAware. This helps improve the safety in the skies.
FlightRadar24 — I like this site as it’s quite international. They do also make money off your data but at the same time give their Business account for free. Their mobile apps have useful features for pilots and frequent travelers as well.
RadarBox — I just like their website and UI. I figure they are one of the smaller sites with a cool app and app idea which includes trying to pipe in ATC audio which is live presently but needs more coverage.
- Raspberry Pi 4–4GB RAM (kit, $99.99)
- AirSpy Mini — 1090MHz SDR (preferred, $99)
- RTL-SDR Compat — Many — Options (Preferred for 978, cheaper 1090 option $24–$30)
- Low Noise Amplifier — LNA ($29.95)
- High Endurance MicroSD 32GB ($10.99)
- Coax w/SMA Y Cable ($7.49 — needed to for 978MHz and 1090MHz)
- SMA Barrel Adapters ($5.59 — depending on what you buy you will likely need at least one)
- External Antenna ($59.95 — so many options here. If you have a short run this coax is fine, but if it gets longer you’d want better coax and N-Connectors)
- ADS-B Band Pass Filter ($14.94)
Once you have the hardware, you will want to set it up in the below configuration:
Burning the image to a SD Card
The awesome people over at adsbexchange.com make a raspberry pi image that anyone can use with a lot of the basics already setup. Alternatively, you can use a generic raspberry pi image and setup everything from scratch. The later is how I had initially built my feeder.
You can find the image download at this link: https://www.adsbexchange.com/myip/downloads/adsbx-8.1.220228.zip. As of today (5.Mar.2022) the current version is 8.1.220228. Once downloaded unzip the file and you will have an .img file. Note that this image works well if using RTL based SDR’s but needs work if using an AirSpy. Additionally it has a graphana dashboard that has some nice data but will slightly reduce the lifespan of your SD card.
Next you will want to download balenaEtcher which can be found here: https://www.balena.io/etcher/
Once installed and running it’s this simple to burn the image:
Flash from file, select the .img
It should automatically detect your connected SD card
Then click flash!
Once the flashing is complete you will need to remount the SD card on your computer. This should show the /boot partition once mounted. NOTE: If you are using the Raspian Lite aka Raspberry Pi OS — Lite install you can skip the below two steps. However, if you wish to build a wpa_supplicant.conf it will help save time later.
You will want to edit both the adsb-config.txt file and wpa_supplicant.conf if using the ADSBExchange Image. If not, skip these for now.
In the adsb-config.txt file you will want to make a few edits. First is setting your latitude and longitude. Delete whatever values are in there and replace with the coordinates of your ANTENNA. If you need to determine what they are this is a handy resource: https://www.freemaptools.com/elevation-finder.htm. Additionally, set the altitude of your antenna, your local username, and if you plan to also capture ADS-B on the 978Mhz then change DUMP978 from no to yes.
In the wpa_supplicant.conf file you need to set your SSID and psk. The SSID needs to be in quotes and it will be the full name of your WiFi network. The PSK option will be your WiFi password. Ensure this also has quotes around it and save the file.
At this point you’re ready to boot the Raspberry Pi. Unmount the SD card from your computer and install it into your Raspberry Pi. If you plan to use AirSpy I highly suggest a Pi4 Model B with 4GB of RAM.
NOTE: If you use a vanilla Raspberry Pi Image make sure you download the correct one. Typically you will want the lite image and unless you have a 16GB RAM Raspberry Pi 4, you do NOT need the 64 bit OS.
After imaging you can put the wpa_supplicant.conf file in the /boot folder. However, the default raspberry pi image does not ship with the SSH Server enabled by default. You will need to connect the HDMI port and a keyboard and enable ssh through the sudo raspi-config command.
Once the Pi has booted you will want to run through the raspi-config utility. In here you will need to check a few things. Ensure you have enabled ssh access, set a new password, configured your WiFi if you did not before and plan to use it, as well as set the time zone and adjust your locale as necessary. There are plenty of resources on the internet you can search for if you need help with any of this. Additionally before you begin I suggest you also install an NTP client… I prefer chrony. This is a random guide I found that will set you on the right path for this step.
Also install some useful tools:
sudo apt update
sudo apt install chrony mtr git wget curl vim htop rtl-sdr
Now you are ready for the main event! Setting up your Raspberry Pi to be an ADS-B feeder!
I like to break this down in terms of the order in which the various pieces of software work together. As I use an AirSpy I also use readsb vs the standard dump1090 setup, this will also assume you have an Airspy (if not skip the airspy setup step, but you can still use readsb)…
First we will install Readsb via the automated method:
On your Pi next you will want to clone this repo from github as it will install the AirSpy software and configure readsb:
After this has been completed, be sure you check the airspy config. If you happen to use a Bias-T or need to feed power to your LNA then ensure on the options line that you add the -b flag.
sudo vi /etc/default/airspy_adsb
My Options line:
OPTIONS= -v -t 90 -f 1 -w 5 -P 8 -C 75 -E 20 -b -m 12
Last you need to set your latitude and longitude. I like to use this site, but there are many others as well: https://www.gps-coordinates.net/
After completing these steps we just need to restart readsb for all of the changes to take effect.
Now we should have readsb and airspy installed and next we will want to install the tar1090 GUI so we can see our traffic on a map. To install this GUI it’ also quote simple:
Once that installation is complete you can (optionally) edit the configuration file to customize tar1090 to your liking. Note in here you can define different range rings:
For users that have been running their receiver for some time, you can also update the airspy client:
If you wish to get an overlay on your map for your anticipated coverage area based upon your antenna installation location you can use this website: http://www.heywhatsthat.com/. Once there select ‘New Panorama’ and input either your address or LAT/LONG as well as altitude of antenna. Give it a name and submit it. Within a few minutes it will provide you a link with a string of text. Save that string and replace the XXXX’s in this command with that string:
Now, when you visit http://127.0.0.1/tar1090 you will have a coverage plot on your graph!
You should now have a working ADS-B receiver that plots on a map where nearby aircraft are located, good work! Now, lets make this data useful to a variety of sites. One benefit to feeding numerous sites is that you get their Enterprise/Business (top tier) plan at no monthly cost. Additionally, I highly suggest everyone also feeds ADSBExchange as they do not charge for access or permit people to pay to hide flights.
Let’s start by feeding ADSBExchange first!
If you wish to feed more sites you can follow these steps…
For FlightAware see this link.
The brief excerpt:
wget https://flightaware.com/adsb/piaware/files/packages/pool/piaware/p/piaware-support/piaware-repository_7.1_all.deb
sudo dpkg -i piaware-repository_7.1_all.deb
sudo apt-get update
sudo apt-get install piaware
sudo piaware-config allow-auto-updates yes
sudo piaware-config allow-manual-updates yes
sudo apt-get install dump978-fa
sudo reboot
Then edit the config…
sudo vi /etc/piaware.conf
allow-mlat yes
mlat-results yes
uat-receiver-type sdr
To setup FlightRadar24 you can start with this link.
The brief excerpt:
sudo bash -c «$(wget -O — https://repo-feed.flightradar24.com/install_fr24_rpi.sh)»
Then follow the steps as it asks questions. Once the wizard is done you need to edit the config…
sudo vi /etc/fr24feed.ini
Change these lines to this:
receiver=”beast-tcp”
host=”127.0.0.1:30005″
If you also wish to feed RadarBox visit this link. You can stick with their defaults which is already beast TCP to port 30005.
The brief excerpt:
sudo bash -c «$(wget -O — http://apt.rb24.com/inst_rbfeeder.sh)»
sudo apt-get install mlat-client -y
Then edit your configuration and ensure these are set to active:
sudo vi /etc/rbfeeder.ini
Last, restart the client:
sudo systemctl restart rbfeeder
There are other sites you can feed but I think you should have the hang of how to set that up by now. Good luck, have fun and thanks for contributing!
Be sure to share your Raspberry Pi projects with the community.
Adsb raspberry pi
Read this in other languages: 日本.
Raspberry Pi powered Ground Station for commercial flights that does the following:
- receives [Automatic Dependent Surveillance-Broadcast(ADS-B)] (http://airfactsjournal.com/2013/01/ads-b-101-what-it-is-and-why-you-should-care/) messages broadcasted by commercial flights using a Software-Defined Radio(SDR) device tuned to 1090 MHz frequency
- decodes ADS-B messages from commercial flights
- publishes corresponding MQTT messages to [Bluemix Internet of Things(IoT) Platform] (https://console.ng.bluemix.net/catalog/services/internet-of-things-platform/?taxonomyNavigation=applications) in IBM’s Bluemix Cloud.
The MQTT messages from the IBM Bluemix Cloud can then be transmitted over to devices, based on their coordinates, to be able to track flights in the vicinity of the device. Details of iOS flight tracking app using Augmented Reality are in it’s own README.md.
SDR devices such as [NooElec’s RTL-SDR receiver set with antenna] (http://www.nooelec.com/store/sdr/sdr-receivers/nesdr-mini-2-plus.html), which support USB 2.0 interface, can be used to receive ADS-B messages that are being broadcasted in clear text by commercial flights, within a decent radius, on practically any device with a USB port.
As part of this exercise, a Raspberry Pi 3 along with [NooElec’s RTL-SDR receiver set with antenna] (http://www.nooelec.com/store/sdr/sdr-receivers/nesdr-mini-2-plus.html) were used to not only receive ADS-B messages from commercial flights and decode them but also to publish corresponding MQTT messages to IBM Bluemix IoT Platform.
The following sections describe in great detail how to set up Raspberry Pi 3 so that it can publish information about commercial flights in it’s vicinity over IBM Bluemix. One can imagine a whole bunch of such Raspberry Pi powered ADS-B Ground Stations that can track aircraft in 100-150mile radius scattered all over the world publishing messages to create modern Air Traffic Controls in IBM Bluemix and perhaps replacing the out-dated radar technology that is currently used by the conventional Air Traffic Controls.
- Raspberry Pi 3 with at least 32GB SD card
- SDR device such as [NooElec’s RTL-SDR receiver set with antenna] (http://www.nooelec.com/store/sdr/sdr-receivers/nesdr-mini-2-plus.html)
In addition to the aforementioned hardware, adsb.ground.station requires the following software:
- RTL-SDR USB driver
- Dump1090 decoder that tunes the SDR device to 1090MHz frequency, collects the data, and makes it available on port 30002 .
- Java SE Development Kit (JDK) 8 or higher
- Maven 3.2.5 higher
Getting Raspberry Pi 3 Ready
There are a lot of resources that can help you with getting your brand new Raspberry Pi 3 ready. For this exercise, the New Out Of Box Software(NOOBS) on a 32GB SD card was used as described here.
Configuring the Hardware
Since a picture is worth a thousand words, here is the picture that shows how the hardware needs to be configured:
Here are the steps to accomplish the configuration:
- Attach the antenna to the [NooElec’s RTL-SDR receiver dongle] (http://www.nooelec.com/store/sdr/sdr-receivers/nesdr-mini-2-plus.html).
- Plug in NooElec’s RTL-SDR receiver into the Raspberry Pi’s USB port.
- Power up Raspberry Pi 3 using the micro-USB port.
That’s it! Before we can receive ADS-B messages from RTL-SDR receiver, we have to build, install, and run specialized software called Dump1090 Server on Raspberry Pi 3.
There are two options to build and run Dump1090 Server . You can either use the Dockerfile to create a Docker image that would in turn contain all the necessary software to build and run Dump1090 Server in a Docker container or you can install the software that let’s you build and run Dump1090 Server directly on your Raspberry Pi 3. The following sections provide steps for both of these approaches.
Using Docker on Raspberry Pi 3 to build and run Dump1090 Server
Using the Dockerfile that is part of this repository, you can create a Docker image that would contain all the necessary software to build and run Dump1090 Server from within the Docker container running on Raspberry Pi 3.
Here are the steps to accomplish this:
Upgrade to the latest Raspbian image
Install Docker on Raspberry Pi 3
Instructions to install and configure Docker on Raspberry Pi 3 are here.
Create Docker Image for Dump1090 Server
Once the Docker image is ready, you can retrieve the image-id for dump1090 , using the following command:
Start Docker Container and Dump1090 Server
Once the Docker image for Dump1090 Server has been created, you can start a Docker container. The Docker container will launch Dump1090 Server internally. Here is the step to start the container using image-id from the previous command:
This command will use the specified image to start a container process and print the container_id in the Terminal.
In order to see the log of ADS-B messages broadcasted by the commercial flights that are being received by the Dump1090 Server from the SDR, you can attach to the container using the following command:
Building and Running Dump1090 Server directly on Raspberry Pi 3
If you don’t want to use Docker, then this section describes in detail all the steps that you should perform to install the necessary drivers and other software directly on Raspberry Pi 3 to be able to build and run Dump1090 Server that would allow the SDR to receive ADS-B messages from the commercial flights.
Raspberry Pi 3 comes with a HDMI port that can be used to connect a display. You can also use it in headless mode and ssh from your other machine. Regardless of which option you choose, here are the sequence of steps that you should perform: