Balena-ready dump1090-fa + piaware + fr24feed + planefinder
Contribute to the flight tracking community! Feed your local ADS-B data from an RTL-SDR USB dongle and a Raspberry Pi running BalenaOS to the tracking services FlightAware, Flightradar24, and Plane Finder. In return, you will receive free premium accounts (worth several hundred dollars/year)!
This project is inspired by and has borrowed code from the following repos:
Thanks to compujuckel and Glenn Stewart for sharing!
We'll build the receiver using the parts that are outlined on the Flightradar24 and FlightAware websites:
If you wish to keep the setup as cheap as possible, you can use a Raspberry Pi Zero rather than the described Raspberry Pi 3 B+. The Raspberry Pi Zero comes without ethernet, however. If you need this, you will have to buy a breakout cable, too. Keep in mind that the Zero is less powerful than the 3 B+. If you plan to run a lot of services simultaneously, you should probably go all-in on the 3 B+.
In addition to the Pi, you will need an RTL-SDR compatible USB dongle. The dongles are based on a digital television tuner, and numerous types will work – both generic TV sticks and specialized ADS-B sticks (produced by FlightAware). Although both options work, the ADS-B sticks seem to perform a little better.
- Create a free Balena account. During the process, you will be asked to upload your public SSH key. If you don't have a public SSH key yet, you can create one.
- Sign in to Balena and head over to the Applications panel.
- Create an application with the name of your choice, for the device type of your choice. In the dialog that appears, make sure to pick a Default Device Type that matches your receiver. I have tested this code with Raspberry Pi Zero and Raspberry Pi 3 B+, and both work well. If you want to use WiFi, specify the SSID and password here, too.
- Balena will create an SD card image for you, and this will start downloading automatically after a few seconds. Flash the image to an SD-card using Balena's dedicated tool balenaEtcher.
- Insert the SD card in your receiver, and connect it to your cabled network (unless you plan to use WiFi only, and configured that in step 3).
- Power up the receiver.
- From the Balena dashboard, navigate to the application you just created. Within a few minutes, a new device with an automatically generated name should appear. Click on it to open it.
- Rename your device to your taste by clicking on the pencil icon next to the current device name.
- Next, we'll configure the receive with its geographic location. Unless you happen to know this by heart, you can use Google Maps to find it. When you click on your desired location on the map, the corresponding coordinates should appear. We are looking for the decimal coordinates, which should look similar to this: 60.395429, 5.325127.
- Back in the Balena console, verify that you have opened up the view for your desired device. Click on the Device Variables-button – D(x). Add the following two variables:
LAT
(Receiver Latitude), e.g. with a value such as60.12345
andLON
(Receiver Longitude), e.g. with a value such as4.12345
. - Now, you're going to enter the receiver's altitude in meters above sea level in a new variable named
ALT
. If you don't know the altitude, you can find it using one of several online services. If your antenna is mounted above ground level, remember to add the approximate number of corresponding meters. - Almost there! Next, we are going to push this code to your device through the Balena cloud. Head into your terminal and clone this repository to your local computer:
git clone [email protected]:ketilmo/balena-ads-b.git
- Add a Balena remote to your newly created local Git repo. You'll find the exact command you need for this at the Application page in your Balena dashboard. It should look something like this:
git remote add balena [email protected]:your_username/your_application_name.git
- Push the code to Balena's servers by typing
git push balena master
. - Now, wait while the Docker containers build on Balena's servers. If the process is successful, you will see a beautiful piece of ASCII art depicting a unicorn:
\ \ \\ \\ >\/7 _.-(6' \ (=___._/` \ ) \ | / / | / > / j < _\ _.-' : ``. \ r=._\ `. <`\\_ \ .`-. \ r-7 `-. ._ ' . `\ \`, `-.`7 7) ) \/ \| \' / `-._ || .' \\ ( >\ > ,.-' >.' <.'_.'' <'
- Wait a few moments while the Docker containers are deployed and installed on your Raspberry Pi. The groundwork is now done – good job!
If you have previously set up a standalone FlightAware receiver, and want to port it to Balena, you only have to do the following steps:
- Head back to your device's page in the Balena dashboard and click on the Device Variables-button – D(x). Add the following variable:
FLIGHTAWARE_FEEDER_ID
, then paste your Unique Identifier key, eg.134cdg7d-7533-5gd4-d31d-r31r52g63v12
. The ID can be found on the My ADS-B section at the FlightAware website. - From the Balena dashboard, restart the piaware application under Services by clicking the "cycle" icon next to the service name.
If you have not previously set up a FlightAware receiver that you want to reuse, do the following steps:
- Register a new account at FlightAware:
- Login using your newly created credentials.
- While being connected to the same network (either cabled or wireless) as your receiver is linked to, head to FlightAware's Claim Receiver page.
- Check if any receivers show up under the Linked PiAware Receivers heading. (If not, wait about five minutes and click the Check Again for my PiAware-button.) Hopefully, your receiver is now visible under the Linked PiAware Receivers header.
- In the left-hand-side menu on the top of the page, click the My ADBS-B menu item. Your device should be listed in an orange rectangle. Next, click the cogwheel icon on the right-hand side of the screen.
- Click the Configure Location-button, and verify that the location matches the coordinates you entered earlier. If not, correct them.
- Click the Configure Height-button, and specify the altitude of your receiver. The value should match the number you entered in the
ALT
variable in part 1. - If you don't face any bandwidth constraints, enable multilateration (MLAT). Enabling MLAT lets your receiver connect to other nearby receivers to multilaterate the positions of aircraft that does not report their position through ADS-B. This option increases the bandwidth usage a bit but gives more visible aircraft positions in return.
- Specify the other settings in the FlightAware lightbox according to your personal preferences.
- Close the lightbox. Find and copy your receiver's Unique Identifier. It should look something like this:
134cdg7d-7533-5gd4-d31d-r31r52g63v12
. - Head back to the Balena dashboard and your device's page. Click on the Device Variables-button – D(x). Add the following variable:
FLIGHTAWARE_FEEDER_ID
, then paste your Unique Identifier, eg.134cdg7d-7533-5gd4-d31d-r31r52g63v12
.
If you have previously set up a FlightRadar24 receiver and want to port it to Balena, you only have to do the following steps:
- Head back to the Balena dashboard and your device's page. Click on the Device Variables-button – D(x). Add a variable named
FR24_KEY
and paste the value of your existing FlightRadar24 key, e.g.dv4rrt2g122g7233
. The key is located in the FlightRadar24 config file, which is usually found here:/etc/fr24feed.ini
. (If you are unable to locate your old key, retrieve or create a new one it by following the steps in alternative B.) - Restart the fr24feed application under Services by clicking the "cycle" icon next to the service name.
If you have not previously set up a FlightRadar24 receiver that you want to reuse, do the following steps:
- Head back to your device's page on the Balena dashboard.
- Inside the Terminal section, click Select a target, then fr24feed, and finally Start terminal session.
- This will open a terminal which lets you interact directly with your FlightRadar24 container.
- At the prompt, enter
fr24feed --signup
. - When asked, enter your email address.
- You will be asked if you have a FlightRadar sharing key. Unless you have one from the past that you would like to reuse, press return here.
- If you want to activate multilateration, type
yes
at the next prompt. If you have restricted bandwidth available, consider leaving it off by typingno
. - Enter the receiver's latitude. This should be the exact same value that you entered in the
LAT
variable in part 1. - Enter the receiver's longitude. This should be the exact same value that you entered in the
LON
variable in part 1. - Finally, enter the receiver's altitude in feet. You can calculate this by multiplying the value that you entered in the
ALT
variable in part 1 by 3.28. - Now, a summary of your settings will be displayed. If you are happy with the result, type
yes
to continue. - Under receiver type, choose
4
for ModeS Beast. - Under connection type, choose
1
for network connection. - When asked for your receiver's IP address/hostname, enter
dump1090-fa
. - Next, enter the data port number:
30005
. - Type
yes
to enable the RAW data feed on port 30334. - Type
yes
to enable the Basestation data feed on port 30003. - Enter
0
to disable log file writing. - When asked for a log file path, just hit return.
- The configuration will now be submitted, and you are redirected back to the terminal.
- At the prompt, type
cat /etc/fr24feed.ini
. Your FlightRadar settings will be displayed. - Find the line starting with
fr24key=
, and copy the string between the quotes. It will look something like this:dv4rrt2g122g7233
. - Click on the Device Variables-button – D(x) in the left-hand menu. Add a variable named
FR24_KEY
and paste the value from the previous step, e.g.dv4rrt2g122g7233
. - Restart the fr24feed application under Services by clicking the "cycle" icon next to the service name.
- As soon as your receiver starts receiving data, you will receive an e-mail from FlightRadar24 containing your login credentials.
If you have previously set up a Plane Finder receiver and want to port it to Balena, you only have to do the following steps:
- Head back to the Balena dashboard and your device's page. Click on the Device Variables-button – D(x). Add a variable named
PLANEFINDER_SHARECODE
and paste the value of your existing Plane Finder key, e.g.7e3q8n45wq369
. You can find your key at Plane Finder's Your Receivers page. - On your device's page in the Balena dashboard, restart the planefinder application under Services by clicking the "cycle" icon next to the service name.
If you have not previously set up a Plane Finder receiver that you want to reuse, do the following steps:
- Register a new Plane Finder account.
- Locate your local clone of this git repo,
balena-ads-b
, then navigate to the folderplanefinder
. - Open the file
SharecodeGenerator.html
in your web browser. - Fill in the form to generate a Plane Finder share code. Use the same email address as you used when registering for the Plane Finder account. For Receiver Lat, use the value from the
LAT
variable in part 2. For Receiver Lon, use the value from theLON
variable. Lastly, click the Create new sharecode button. A sharecode should appear in a few seconds, it should look similar to6g34asr1gvvx7
. Copy it to your clipboard. Disregard the rest of the form – you don't have to fill this out. - Open Plane Finder's Your Receivers page. Under the Add a Receiver heading, locate the Share Code input field. Paste the sharecode from the previous step, then click the Add Receiver-button.
- Head back to the Balena dashboard and your device's page. Click on the Device Variables-button – D(x). Add a variable named
PLANEFINDER_SHARECODE
and paste the value of the Plane Finder key you just created, e.g.7e3q8n45wq369
. - On your device's page in the Balena dashboard, restart the planefinder application under Services by clicking the "cycle" icon next to the service name.
If the setup went well, you should now be feeding flight traffic data to several online services. In return for your efforts, you will receive access to the providers' premium services. But in addition to this, you can explore the data straight from your device, raw and unedited. And that's part of the magic, right?
When you have local network access to your receiver, you can explore the data straight from the source. Start by opening your device page in Balena console and locate the IP ADDRESS
field, e.g. 10.0.0.10
. Then, add the desired port numbers specified further below.
Away from your local network but still eager to know what planes are cruising over your home? Here, Balena's builtin Public Device URL comes in handy. Open your device page in Balena console and locate the PUBLIC DEVICE URL
header, and flip the switch below to enable it. Finally, click on the arrow icon next to the button, add the desired URL postfix specified below and voila – you should see what's going on in your area.
Dump1090's Radar View
This view visualizes everything that your receiver sees, including multilaterated plane positions. When you are in your local network, head to YOURIP:8080
to check it out. When remote, open Balena's Public Device URL and add /dump1090-fa/
to the tail end of the URL, e.g. https://6g31f15653bwt4y251b18c1daf4qw164.balena-devices.com/dump1090-fa/
Plane Finder's Radar View
It's similar to Dump1090, but Plane Finder adds 3D visualization and other nice viewing options. Head to YOURIP:30053
to check it out. When remote, open Balena's Public Device URL and add /planefinder/
to the tail end of the URL, e.g. https://6g31f15653bwt4y251b18c1daf4qw164.balena-devices.com/planefinder/
Flightradar24 Status Page
Less visual than the two other options, Flightradar24's status page gives you high level statistics and a metrics about how your feeder is doing. Head to YOURIP:8754
to check it out. When remote, open Balena's Public Device URL and add /fr24feed/
to the tail end of the URL, e.g. https://6g31f15653bwt4y251b18c1daf4qw164.balena-devices.com/fr24feed/
Enjoy!