ADS-B

From Colin Hardy
Jump to: navigation, search

TL;DR


Lately I've been playing with receiving and decoding ADS-B signals from aircraft using the rather ubiquitous RTL2832U TV dongle. The versatility of these dongles has not ceased to amaze me over the last few months of tinkering and the availability of open source scripts to harness the ADS-B signals makes this a really interesting and simple to get into part of the hobby.

Hardware Required


  • RTL2832U (or similar) USB TV Dongle ~£6
  • Raspberry Pi (or other such machine running Linux)
  • 1090 MHz Antenna - I found a great one on eBay for £15 delivered from Ukraine, and it's excellent.

Setup


I configured my Pi to be accessed remotely via SSH so I could work on it from my macbook. Setting your Pi up headless is certainly recommended but all of this can obviously be done locally on your machine. It goes without saying you should have your Pi up and running, on your WiFi with the dongle plugged in and antenna connected.

Dependencies


The instructions I followed were largely based on this site and repeated here for ease of reference:

First we start, as you always should, by upgrading any available packages:

sudo apt-get upgrade

Then, install the required dependencies:

sudo apt-get install git git-core cmake libusb-1.0-0-dev build-essential

Next, install the RTL2832 driver:

git clone git://git.osmocom.org/rtl-sdr.git

cd rtl-sdr

mkdir build

cd build

cmake ../ -DINSTALL_UDEV_RULES=ON

make

sudo make install

sudo ldconfig

If all is good, running the last command sudo ldconfig won't actually show anything to your output.

Now, tell the system what it can and can't do with this new driver:

cd ~

sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/

sudo reboot

rtl_test

You may find, like I did, that running the rtl_test gave an error similar to the following:

Kernel driver is active, or device is claimed by second instance of librtlsdr.
In the first case, please either detach or blacklist the kernel module
(dvb_usb_rtl28xxu), or enable automatic detaching at compile time.

In which case carry out the following additional steps:

cd /etc/modprobe.d
sudo nano no-rtl.conf

Now, in the file you're creating, enter the following:

blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830

Probably best to reboot for this to take effect:

sudo reboot

Dump1090


Now, we need to install dump1090 - an awesome piece of script which really does the leg work in decoding the signals and producing respective outputs.

First, let's clone the repository:

git clone https://github.com/antirez/dump1090.git

This should give you a directory called dump1090.

cd dump1090 && make

Once this is complete, you can run

./dump1090 --interactive

and with that you'll see the output of the decoded signals right in your terminal window :)

Dump1090.png

You can also run dump1090 in net mode which enables networking and gives a nice google maps overlay within your browser. It also enables you to pipe the stream of data into feeds such as that for flightradar24.net.

./dump1090 --interactive --net

Then in your browser, visit 127.0.0.1:8080 to view the output with Google Maps. Note, if your Pi or other device running dump1090 is on your network and you are remotely accessing the device, instead of 127.0.0.1:8080 you would use the local IP address of the Pi, so for example: 10.0.1.42:8080