In this first part of three tutorials, we're going to show you how you can access the flight data local to your area through an SDR receiver and a RaspberryPi. In the rest of this series, we'll be looking at how we can point this data to a data-broker such as OpenSensors.io and share this data with the world.
You will need:
First things first. You will need an SDR receiver of some fashion - we chose a NooElec R820T/RTL2832U DVD Receiver dongle. You will also need a platform to connect this to. We will be using a Debian powered RaspberryPi for a remote deployment but you can use a desktop Linux variant. Additionally you will need a screen, keyboard and mouse.
Hardware setup:
This is rather brief. Plug the SDR dongle into your Pi's USB socket, connect the power and turn on the Pi. Connect your screen, mouse and keyboard. Connect your Pi to your local/home network via WiFi dongle or hardwired via Ethernet port. Lastly, plug the SDR aerial into your dongle and run the lead out.
Let's get this thing started
Let's make sure we're using all the latest software first. In Terminal, run:
uname -a
This will check your Operating System version. If later than 3.6.11+, I suggest leaving it without upgrading. If not, run:
sudo apt-get update
sudo apt-get upgrade
Next, at the command line, type:
sudo apt-get install git-core
This install the gito repo fetch code. Chances are this is already installed, and it will simply notify that you have the latest version installed. However, sometimes even minimal 'git' is not even present.
Setting up SDR-RTL
Open up this web guide and follow the commands until it reads "To run the rtl server type rtl_tcp". For ease, you can run all these commands from the following:
sudo apt-get install git git-core cmake libusb-1.0-0-dev build-essential
Now install the dongle driver source and compile:
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 successful there should be no return on the final command.
Let's tell the system what the new device is allowed to do, and then reboot the Pi:
cd ~
sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
sudo reboot
rtl_test -t
At this point, on newer versions of Linux you may get the following error message:
Found 1 device(s): 0: Generic RTL2832U
Using device 0: Generic RTL2832U
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 Failed to open rtlsdr device #0.
This is because a DVB driver was added to the system so that a signal could be received, this is a trifle annoying and interferes with the operation of the SDR stick for data reception. To rectify this, take the steps noted here.
Now rerun:
rtl_test -t
If running off a USB hub, you may have issues with power consumption, signified by the "cb transfer status: 1, canceling" error. You will need to run the receiver off a powered hub or the Pi itself.
Installing Dump1090
Let's download the latest release of Dump1090 source code. We'll use the instructions here - starting half way down the page where it says "git clone git://github.com/antirez/dump1090.git"or (goes to your home directory)or (goes to your home directory)
-
cd /home/pi/
or
cd ~
(goes to your home directory)
git clone git://github.com/MalcolmRobb/dump1090.git
cd dump1090
make
sudo apt-get install pkg-config
make
Now you'll be able to type:
./dump1090 --interactive
If you've got everything installed and connected correctly, then you should see a screen displaying aircraft being received by the Pi. It's likely you'll need to run this with privelege however to allow the program to open the port:
./dump1090 --interactive
We hope you made it! You should now have some pretty awesome looking data coming in on your RaspberryPi!
In the next part of this tutorial we'll be showing you how you can connect this data feed with OpenSensors and get round to sharing that data with the rest of the world...
For a glossary of terms relating to flight data, see here!
Known issues:
1. The Dump1090 program misses quite a lot of available Mode-S frames present in the data, due to a poor detection algorithm, however this is ok for a starter project.
2. For best results you may need to calibrate your dongle, see this post , using Kalibrate.
Acknowledgements
Malcolm Robb and Steve Tickle from the PlanePlotter group for their excellent resources and writeups.
Comments