An ADS-B Receiver That's as Independent as Possible
Just note that I am not a pilot. I'm a radio guy who listens in on random things, including airplanes that fly overhead.
ADS-B Background
Traditionally, radar was used to track flights, but that has some problems. First, radar could only see so much and so far. If you were behind a mountain or out of range, no one could see you. Even if you could be seen by radar, only ATC would know where you were; the rest of the pilots in the sky had to rely on information from ATC and their own eyeballs to make sure there weren't any other aircraft in the area. Enter ADS-B.
Automatic Dependent Surveillance-Broadcast (ADS-B) is a system used by aircraft to transmit pertinent information like location in real-time as well as providing weather and other information for pilots. With an appropriate transponder onboard, aircraft continually send out their registration, serial number, and ICAO address along with their position, altitude, and speed. With the addition of ground-based transceivers (GBTs), ATC and pilots can see all the aircraft around them in real-time by processing all the ADS-B packets and plotting them on a map. With the right hardware and software, you can, too.
First Time?
If this is your first time setting up an ADS-B receiver, you might want to start simple to get your feet wet. You can buy kits and bundles from the aggregators to get some ears to the sky with little cost and effort. As of today (Feb 2023), the biggest obstacle is finding a Raspberry Pi, so hording all those Pis for the past few years is finally paying off.
FlightRadar24 (FR24) and FlightAware (FA) have kits you can buy that include the ADS-B stuff. Pi sold separately.
I've also got an Amazon shopping list of stuff I've tested if you want to piece something together.
For software, FR24, FA, and ADSB Exchange all have custom Raspberry Pi images that should work for you. They also have great instructions for getting going.
Something More Advanced
When ADSB Exchange was sold to Jetnet in January of 2023, I wanted to step away from them until they figured out what they were going to do with the data I sent them. I quickly realized that my main receiver was using one of their images to run the Pi, so I started looking for a way to still send data to the aggregators without relying on one of them. That's what I'm describing here.
The Hardware
You will need
- an antenna,
- some feedline,
- an SDR dongle,
- and a Raspberry Pi.
The Antenna
First, you need an antenna. Since we're only interested in a single frequency (1090 Mhz) and won't be transmitting, we can get a very specialized antenna that will outperform anything for general use. The one in my Amazon list above is a great performer and has worked very well for me
You'll need a place to mount the antenna. Since I've already got a 30' tower in my yard, I just installed mine there. You don't have to get that fancy, though. A pipe or post screwed to your deck would be fine. Strap it to a flagpole. Heck, even just strapping it to the deck itself will get you some signals (though you'll get shadows from the deck and house, I imagine). Somewhere in the open with a view of the sky is optimal, but don't dwell on that too much. I'm getting aircraft from a Pi on my desk in the basement with no outside antenna at all. Wherever you choose will be fine.
The Feedline
Believe it or not, the feed line is the hardest selection to make. This runs from the antenna to the Pi inside, so your choice will depend on how you run it between the two. The antenna I got came with 33 feet of coax for the feed line. For me, this was plenty since I have multiple runs of coax running from the tower into the house already (it's actually way too long!). You may need to improvise. You'll have to find an entry point and measure how long of a run you'll need to get from the antenna to the Pi.
You have lots of options here, actually. You could run it through an existing conduit like where your home Internet comes in. You could drill a hole, run the line through it, then put some silicone in the hole to keep the bugs out. I actually have bulkhead connectors through my wall to get inside. Well, I have 4 of them, but it's not enough! LOL
Be very careful here, though. The easiest place to come into a house is probably where you utilities come in as well. No one wants to drill through a 120V residential line or right through their ISP's fiber. Or even through a water line. Know what's on both sides of the wall before you drill or shove a wire through.
Another thing to keep in mind is what connectors come with the coax. Most ADS-B antennas come with an N-connector on it, and the dongle will probably have an SMA connector on it. The coax that comes with the antenna has the proper connectors already installed, so you should be good in most cases. In those cases where you decide to terminate in the bulkhead or have to extend the cable for a longer reach, you'll need to make sure you have the right connectors to do so. A series of adapters and jumpers is quite acceptable.
The Dongle
The dongle digitizes the radio signals. It's basically a radio that listens one or more frequencies at the same time (for definitions of the phrase) that can be read by the Pi. There are lots of options out there, and you may already have something that will work. I had an RTL SDR dongle collecting dust, so I hooked that initially. It works very well, but it's a general-purpose receiver for listening to lots of stuff. If you want to really get those weak signals, you need a dongle with a filter and amplifier for 1090 MHz. I've used a couple, and there's not much difference between them in the same price range. See my Amazon list for those.
The Pi
Of course, you need a Raspberry Pi of some kind to do the thinking. A Pi 3B+ or higher will be fine. It just needs to have USB ports and some way to get on the network. A case is also a must. And some way to power the thing. Not too difficult.
For an OS, I just chose Raspberry Pi OS (formerly Raspbian). I won't go into the details of putting an OS on the Pi, but download the image, burn the image, boot the image, run an update. Basic Pi stuff.
Note: I wound up disabling IPv6 from the OS since I have no native IPv6 at home. I accept your boos and realize I've failed as a network engineer.
Also note: I tried this with a 64-bit OS, but some packages aren't there yet. I wound up reflashing the Pi with a 32-bit Lite version, and it works fine.
The Software Model
Let's talk about the software model for a bit here. The way most of stuff works is that you have a demodulator/decoder software package that reads the info off the dongle, and each feed package reads off of that process through a TCP port. The Pi images from the aggregators use a custom version of dump1090 as their demodulator/decoder with another piece of software that sends it to their site. For this project, though, I wanted to use my own demodulator/decoder so that I can just turn feeds on and off without affecting everything.
ReadSB
My latest build uses ReadSB as the modulator/decoder. It can detect your dongle and start reading the data with no effort on your part. Of course, it provides the appropriate TCP ports so that feed packages can just read off the port and get the data. It comes with a small web server so you can see your data off your dongle and make sure everything is working.
To install, I went through the installation directions here.
Just run this command and reboot.
sudo bash -c "$(wget -O - https://github.com/wiedehopf/adsb-scripts/raw/master/readsb-install.sh)"
sudo reboot
This takes care of everything for you except the location of the receiver. You'll need to run "sudo readsb-set-location <LAT> <LONG>" after the reboot to set where you actually are.
Browse over to http://<YOURIP>/tar1090. You should see a pretty map with the aircraft flying around on it (you may have to find yourself on the map first). It's a pretty nifty interface for checking out stuff in the air around you.
Even on my desk in the basement with no antenna, my Pi sees aircraft as they fly overhead, so you should see something. Keep an eye on it, and, when you see any aircraft pop up, you'll know you've done it right. If you've got everything connected to an external antenna, you should see a whole mess of aircraft pretty quickly. I usually see ~50 aircraft at any time during busy times of the day, and I'm 70 miles from the closest major airport.
The Aggregators
Next up is to add the different aggregators. Of course, you need an account with each service, so make sure you do that first. Some of them give you some pretty cool benefits for providing information, like access to business or enterprise tools that you normally have to pay *a lot* to get.
They all ask for some location information, so have your latitude, longitude, and altitude (in feet and in meters) recorded somewhere to paste. If you right-click on your location on Google Maps, it will show you the latitude and longitude in the context menu. If you click on it, it copies to your clipboard, so just paste it into a text document somewhere.
Note: I've done a build with these instructions a few times, and it seems like I didn't get the same result twice. For example, if I install the FR24 package first, it wants to load its own dump1090, but, when I do FA first, FR24 sees it already. I'm not sure what's going on since FA didn't install dump1090 anywhere. I'm sure somebody knows what's happening, but I haven't found the answer yet. Take these instructions as guidelines instead of a step-by-step guide.
FlightRadar24
Go here to get started.
The installer is a BASH file that adds FR24 as an APT repo then installs itself from there. When it's done, it runs through a helper app to guide you through to the end.
sudo bash -c "$(wget -O - https://repo-feed.flightradar24.com/install_fr24_rpi.sh)"
The helper app will ask for
- your email address,
- your sharing key (if you're replacing an existing receiver),
- whether or not you want to participate in MLAT (beyond the scope of this document),
- your lat/long,
- and your altitude.
If all goes well, it will tell you that you already have a dump1090 instance running and will just use the TCP ports. It may ask you to make a receiver selection, which can be quite confusing. Just select DVBT (it should be option 1). If you see this choice, don't freak out; we'll fix the INI file in a bit.
There's some other stuff that is asks for, but, frankly, I don't pay them too much attention. I answer the RAW and Basestation questions with yes and no, respectively. Log retention I set for 72 hours.
If you're registering this receiver for the first time, you'll need to claim it. This is done by browsing to this URL and doing some clicky-clicks. The idea here is that they'll match your browser's IP to an unclaimed feeder with the same address.
If you had to choose the receiver type, we need to modify the /etc/fr24feed.ini file. Here's what mine looked like.
receiver="avr-tcp"
fr24key="<YOUR SHARE KEY>"
host="127.0.0.1:30002"
bs="no"
raw="no"
logmode="2"
logpath="/var/log/fr24feed"
mlat="yes"
mlat-without-gps="yes"
Check out what the FR24 feeder sees by going to this site.
http://<YOURIP>:8754
You can see how many aircraft the FR24 feed sees,
I've seen that the interface here shows no aircraft seen even though the other feeds and ReadSB show aircraft in the air. Looking through the logs, I think it's trying to bind to port 30005, which is already in use by ReadSB. The fix was to change the receiver to "beast-tcp" and the host to "127.0.0.1:30005".
If you check this FR24 site, you can see if your feed is online and whether or not any data is showing up.
FlightAware
FlightAware works very similarly to FR24. Check out the install instructions here.
To get everything set up, you really only care about step 2 on their list. The rest of the instructions are to get dump1090 running, but we don't need that since we're running ReadSB already.
Install the APT repo by running these commands.
wget https://flightaware.com/adsb/piaware/files/packages/pool/piaware/f/flightaware-apt-repository/flightaware-apt-repository_1.1_all.deb
sudo dpkg -i flightaware-apt-repository_1.1_all.deb
Do an update refresh the repos and install piaware (their package) with this.
sudo apt-get update
sudo apt-get install piaware
If you want to be able to upgrade the software automatically, you can put in these commands.
sudo piaware-config allow-auto-updates yes
sudo piaware-config allow-manual-updates yes
You claim your receiver the same way you did for FR24. You go to this site, do some clicky-click, and you're done.
You set the receiver and location from the website, so you'll need to find your feed. Go to your site page to do that.
If you have more than one site with FA, you'll need to make sure you're on the right one by selecting it from the dropdown menu (that's not obvious if you don't know what to look for).
With the right one selected, click the settings button (the grey gear) and click "Configure location". You can select your location on the map or just enter your lat/lon manually. Select your antenna height as well (either AGL (above ground level) or AMSL (above mean sea level)). Once it knows where you are, you can choose to enable MLAT. Be sure to click "Save".
The main page should have green boxes -- PiAware, FlightAware, and MLAT. Obviously, it won't be green if you don't participate in MLAT. The graphs should start moving around, and you're good to go!
Note: On the FA site page, you'll see references to a web server running on port 8080 that shows the local data (like FR24's 8754). I have yet to find any configuration that matches this on my device. I've seen people on discussion boards mentioning that it only shows up if you use their image, but I haven't verified myself.
OpenSky Network
The OpenSky Network feeder instructions want you to download a .DEB file and install it. This is a much simpler install than FR24 and FA. The installer asks you for the stuff it needs, which makes it even easier.
wget https://opensky-network.org/files/firmware/opensky-feeder_latest_armhf.deb
sudo dpkg -i opensky-feeder_latest_armhf.deb
When it asks for the high-precision stuff, just tell it to use the default settings.
Part of the install includes giving your OpenSky username, so there's no need to claim your feed when you're done.
Apart from the lat/long/alt and username fields, just accept the defaults. That's it. Easy.
You can check your OpenSky dashboard to see your feeder status. Don't freak out when you large chunks of "offline" in the availability graph. I've added several feeds to OpenSky, and they all show lots of offline times even though other feeds show data is being sent. I want to say it shows offline when you haven't sent any new data, but I'm not sure.
Plane Finder
Plane Finder provides a .DEB file just like OpenSky. You'll copy the link and do a wget on your Pi to download it. Here are the commands to download and install version 5.0.161, but you'll need to check their site for the latest and greatest version.
wget http://client.planefinder.net/pfclient_5.0.161_armhf.deb
sudo dpkg -i pfclient_5.0.161_armhf.deb
After the install, you'll need to create a sharecode to register it. Point your browser at your Pi on port 30053
http://<YOURIP>:30053
You'll see a nice page to enter your email address, lat, and long, and click "Create a new sharecode" to get the code. You'll get an email with that code, so there's no need to write it down.
The next page is where you set up the data source stuff. Choose "AVR (TCP)" for the receiver data format question. Enter "127.0.0.1" for the IP address and "30002" for the port number. When you click "Complete registration", it'll take you to a local map interface where you can see what the client sees. You can do some other stuff from there, too, but that's for another time.
Recap
So, now we've made your HOA angry to putting an antenna way up in the air, made your neighbors angry by drilling holes in the house, and let bugs in because you didn't caulk the holes properly. At least all the feeds are working. :)
Send any interesting flyovers questions to me.
Comments
Post a Comment