Installing ADS-B In on Raspberry Pi

Updated: August 09, 2020

Assumption is that you have already installed Raspbian and configured the network

Hardware:

You need to purchase a R820T SDR USB dongle. There are reasonably good quality RTL2832U R820T2 USB dongles for $40-$50.

You also need an antenna. Search Google for “DIY ADS-B antenna”. There are a lot of various simple designs.

 

Here what I made. Took me 30 minutes with a coffee break:

 

Software

Prepare your Raspberry Pi environment

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

 

Download the software directly to your Raspberry Pi. The assumption is that you have the internet connection.

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
cd ~
sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
sudo reboot

After the system reboots run the follwing commands to install the dump1090:

cd ~
git clone git://github.com/MalcolmRobb/dump1090.git
cd dump1090
make
sudo cp dump1090 /usr/local/bin
sudo mkdir /usr/local/share/dump1090
sudo cp -a public_html /usr/local/share/dump1090

To test the receiver run the following command from inside /home/pi/dump1090 folder

./dump1090 --interactive

If you have antenna connected, you should be able to see the ADS-B data from near by aircrafts.

If you get an error message that looks like this:

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.

usb_claim_interface error -6
Error opening the RTLSDR device: Device or resource busy

Create a blacklist file bu running the following command

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

Put the following text there:

blacklist dvb_usb_rtl28xxu
blacklist rtl12832
blacklist rtl12830

 

Load OzRunways or other EFB components

cd ~
git  clone https://github.com/OzRunways/ads-pi.git

Test your setup by running the following command:

nc localhost 30003

 

Configuring automatic start-up for the ABS-B service

Create a config file:

sudo nano /etc/systemd/system/ADSB.service

Copy-past the following text into the file

[Unit]
Description=Get ADSB-In (dump1090) service running at boot

[Service]
WorkingDirectory=/home/pi/dump1090
ExecStart=/home/pi/dump1090/dump1090 --net --quiet
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=dump1090
User=pi
Group=pi

[Install]
WantedBy=multi-user.target

Enable the service:

sudo systemctl enable ADSB.service

Start the service

sudo systemctl start ADSB.service

Check the status:

sudo systemctl status ADSB.service

 

Now, you can test ads-b system end-to-end by connecting to the RPi from the internet browser of your PC

For LAN connected PC the address is: http://192.168.0.111:8080/

For WiFi connected PC, tablet or phone the address is: http://192.168.4.1:8080/