Build an Airplane Tracker with the Pine A64 and an RTL-SDR dongle (also Rock64 or Orange Pi)

map with planes and their speed

It’s school vacation time and I hear a lot of planes passing by, when I am in the garden. This reminded me of a project for the Rtl-Sdr, that I saw a while ago. I could track the ADS-B signals of aircrafts to mark their position on a map. And this all can be done in minutes!

Required hardware:

– 1x Pine A64 with power adaptor and wifi module or ethernet
– 1x MicroSD 16 GB
– 1x MicroSD to usb adaptor (to plug microSD into PC)
– 1x RTL-SDR (DVB-T Dongle with the RTL2832U Chip)

Preparation of Armbian:

1. Download the Armbian operating system with desktop (right one).

2. Unpack it until you see a .img file (e.g. with 7-Zip).

3. Plug-in the microSD with an adaptor and write the .img on it with Win32DiskImager. Select the .img file as image and the usb adaptor as medium.

4. Put the microSD back into the Pine and connect an usb-mouse and -keyboard as well as an hdmi display. Now connect the power and let it boot.

5. Log in with the user “root” and password “1234”. You are forced to change the password and create a new standard user. Then, you will see the desktop. SSH starts automatically, so you can access the terminal from another pc (e.g. with Putty).

Install the RTL-SDR dongle:

1. Open the terminal and run

sudo apt-get update && sudo apt-get upgrade

.

2. Plug in the RTL-SDR dongle and run:

lsusb

. You should now see the dongle in the list. For me it looks like this:
Bus 001 Device 003: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T.
In my case “0bda” is the vendor identification and “2838” is the product number.

3. Run

sudo nano /etc/udev/rules.d/20.rtlsdr.rules

to write a new file with the content:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", GROUP="adm", MODE="0666", SYMLINK+="rtl_sdr"

You need to insert the vendor id and product number of your device if it is different than my example. This should ensure that the rtl-sdr is accessible by the pine. Now shutdown with

sudo halt

and then start it again (the reboot command can cause problems).

4. Run ‘sudo apt-get install librtlsdr-dev’ to install the development package for rtl-sdr.

5. Install two more packages:

sudo apt-get install pkg-config build-essential

6. Download the plane tracking program Dump1090 from Github:

git clone git://github.com/MalcolmRobb/dump1090.git

7. Go to the folder:

cd dump1090

and install it with:

make

8. To start the plane logs type:

./dump1090 --interactive --net --net-beast --net-ro-port 31001

9. Now, you will see the raw data. If you want to get a neat map with all the planes around you, open the browser on any pc in the network and go to “IP of Pine64”:8080. You can see your IP with

ifconfig

. The map might be watermarked, but you can get a free API code in the Google Console. Then, open the gmap file: ‘sudo nano ~/dump1090/public_html/gmap.html’. Insert the following line before the

<title>

tag:

<script type=”text/javascript” src=”//maps.googleapis.com/maps/api/js?key=YOUR_GENERATED_KEY&libraries=geometry”></script>

Reboot the device and it should work. You can click on individual planes to see their path, speed and altitude.