18 Mar

Building a Beaglebone ADS-B Receiver/Feeder

These are my notes on setting up an ads-b receiver using a BeagleBone.  Many people also do this on the Raspberry Pi and while there are some miner differences, there are a lot of similarities.  I’ve stumbled my way through to a pretty good setup on the BeagleBone and I want to share it with you so that you can learn from my efforts and quickly get a working setup feeding data!

My motivation for this project is to gain additional experience with Linux, embedded systems, programming, and my general love of aviation.  I also wanted to contribute to the live-tracking data set and get access to the premium features of two great flight tracking websites, flightaware and flightradar24, who both have programs where you can access these premium services for free by becoming a “feeder” and sending them your ads-b data.

I’m assuming if you’ve found this page, you already know what ads-b is and some of the basics.

Project Goals

The goals of this project are to create a reliable ads-b feeder that can be placed in a good location for receiving ads-b signals and can feed that data to FlightAware.

What you need to build the BeagleBone ads-b feeder

If you’re like me, most of this stuff will already be laying around your house, and even then, not all of it is required.  The most basic system will require two items which can both be bought cheaply from Amazon:

  1. BeagleBone
  2. DVB-T dongle
  3. 5V power supply

The BeagleBone is the computer which will do all the processing and sending of data.  The DVT-B dongle will act as the radio receiver that will listen for the ADS-B signals.  I also strongly recommend a power supply as I has all kinds of instability troubles that turned out to be due to low voltage from the USB supply I was using.  I have all kinds of USB chargers that are more than capable of supplying enough current, so I took an old USB cable, cut off one end and wired it into a barrel connector to plug into the BeagleBone and that’s worked great for me!

The options beyond that are endless.  The stock antenna that comes with DVT-B dongle works, I’ve tracked many aircraft with it, but it’s one of the most commonly upgraded items.  It appears most people build their own antenna which is really easy (I chose to build a collinear antenna and seal it inside a PVC pipe) just Google it to find out how.  If you don’t want to mess around with trying to build one, this one is an excellent antenna that’s made in the USA (although it will set you back about $150).

If you want to locate your feeder outside for better reception, you will want to find or buy a good water-tight box to protect the electronics.  I have seen people that use everything from Tupperware containers and hot glue to professional grade utility boxes and bulkhead fittings.  BeagleBone computers are not able to be powered directly using POE (Power Over Ethernet), but it’s still a great way to power a remote feeder if you purchase an injector/splitter.  This will allow you to “inject” the power into the network cable inside and “split” it back out before the BeagleBone and then plug the power in

In order to get the best signal, I’ll be placing my receiver up on top of a hill behind my house.  It will connect to my network with a wifi link (I have a high-gain directional antenna pointed up the hill at the feeder).  Without the ability to run wires, it will be solar powered with a battery.  The solar power portion of my project will require a solar panel, charge controller, and battery.  You can read more about the solar power part of my project here <<<To do: Insert link here>>>

Setting up the Beaglebone Feeder

This section describes the steps I take to get the Beaglebone feeder running.  You only need the BeagleBone, DVT-B dongle and a network cable for this portion.  I’m using a BeagleBone Black Revision C (4GB eMMC).  If you have an earlier version, or even the plain white BeagleBone, all of this is still applicable, but you will have to run from the SD card instead of the on board eMMC due to space limitations.  I’m using the official BeagleBone Debian image dated 2015-03-08.

Fresh operating system install

For the best stability and longevity, I always recommend starting out with a fresh operating system.  The BeagleBone Getting Started Guide has the instructions on how to update the board with the latest software here.

There are two ways to run an OS on a BeagleBone, from the internal eMMC, or directly from the microSD card.  Be sure to download the correct image you want to use!  The images for flashing the internal eMMC have “eMMC-flasher” in their name.  BeagleBone has changed some of the file locations on their website, but as of this writing they are located here.

  1. Download the appropriate version and get it installed from the link above
  2. Use “sudo apt-get update” and then “sudo apt-get upgrade” to make sure all the default programs are up to date

 Don’t be stupid, be secure

This is a topic that is often overlooked, and if you want can be totally skipped.  This is a real computer that you will be attaching to a real network with real bad people lurking on it.  The default settings for the BeagleBone use “root” as the root user and don’t have a password.  This is like living in a bad neighborhood and leaving your front door wide open.  Even if you keep your feeder behind a firewall, I strongly recommend that you change the default username, disable root login, and add a strong password.  A good article on adding a new user and setting them up so they can use the sudo command can be found here.  If you’re going to expose your BeagleBone to the outside internet I strongly recommend disabling password authentication and only allowing only key-based authentication!  This is a great article on configuring key-based login for Linux in general (but also applies to your BeagleBone or Raspberry Pi).

 Setting up Dump1090

We are going to install three pieces of software.  The first, Dump1090, is the software that talks to the DVT-B dongle and can decode the signals.  It has a simple web-based map showing traffic around you as well as serving and receiving data in several formats.

For the more details and explanation, check out this excellent resource.  While it’s targeted at the Raspberry Pi, it’s pretty much the same on the BeagleBone.  I’ll highlight the commands that you should type below:

  1. Setup the programs needed to build and install the necessary drivers for Dump1090
    sudo apt-get install git git-core cmake libusb-1.0-0-dev build-essential
  2. Download the drivers for the dongle
    git clone git://git.osmocom.org/rtl-sdr.git
  3. Move to the newly created folder
    cd rtl-sdr
  4. make a new directory called “build”
    mkdir build
  5. Move to the build directory
    cd build
  6. Compile the drivers
    cmake ../ -DINSTALL_UDEV_RULES=ON
  7. Then run
    make
  8. Install the drivers
    sudo make install
  9. Test that everything works correctly (you should not see anything returned, if you do check out the link above for more details on solving it)
    sudo ldconfig
  10. Move to your home directory
    cd ~
  11. Copy the rules for the device to the correct folder
    sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
  12. Reboot the system
    sudo reboot
  13. Make sure you’re in your home directory
    cd ~
  14. Download Dump1090
    git clone git://github.com/MalcolmRobb/dump1090.git
  15. move to the new dump1090 directory
    cd dump1090
  16. Compile Dump1090
    make
  17. Now test Dump1090 by starting the software in interactive mode
    ./dump1090 –interactive

At this point you should have a basic screen up and be seeing data about the aircraft around you.  If you are inside, you might receive very few or even nothing.  Hook it up to your laptop nad go outside and you should see something.  If you want to connect to the built in web page, you will need to start it with the –net flag, but be aware that BeagleBone has services running on some of the ports by default.  To stop these services run sudo service apache2 stop and then start dump1090 again ./dump1090 –interactive –net and login to the webpage with your BeagleBone’s IP address and port 8080.

 Setting up FlightAware feeder

Now that you have Dump1090 installed and running, you can start to feed that data to FlightAware.  To do this, you will need to download and install their application that monitors the data being output by Dump1090 and sends it to their servers.  In exchange for doing this, they will give you an enterprise account membership for free!  Normally, an enterprise account costs $89.95/month!

If you don’t already have an account, head on over to FlightAware and sign up.  Once you have your account, sign in and go to their PiAware for Dump1090 page and follow the instructions there.

Starting up the feeder

If you installed the FlightAware feeder correctly, it should start as a dameon when the BeagleBone boots up.  However, the default install of Dump1090 will not do this.  I’ve not yet gone through the process of figuring out how to do this, but I will post an update here when I do.

Let’s assume you have to restart or your BeagleBone has otherwise just powered on.  Connect via SSH and make sure it’s connected to the internet by pinging Google or 4.2.2.2.  Then run the following commands to get Dump1090 started:

  1. sudo service apache2 stop
  2. cd ~/dump1090/
  3. ./dump1090 –net –aggressive –fix -quiet &

Close the SSH window and conenct to the web page display at your BeagleBone’s IP address and port 8080 (ex. 192.168.1.2:8080) and check out the traffic around you!  You can also check the FlightAware stats for your feeder from the “My ADS-B” link at the top of the page when you’re signed in!

Happy tracking!