Skip to content

Instantly share code, notes, and snippets.

@tanmayee30
Last active July 23, 2016 22:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanmayee30/e1b23a12c5ed13f601d3 to your computer and use it in GitHub Desktop.
Save tanmayee30/e1b23a12c5ed13f601d3 to your computer and use it in GitHub Desktop.

ADS-B Basics

Automatic Dependent Surveillance-Broadcast. It is a cooperative surveillance technology.
By using this technology aircraft can determine its position via satellite navigation also can broadcast it periodically.Thus we can say it works same as radar as it enables the option of aircraft to be tracked.--wiki
This is the one way by which we can get aircraft's data i.e.basic parameters like flight no., longitude, latitude etc. we could get the up to date information about this because air carft continuosly broadcasts this data with the help of radio broadcasting.They generally use 1090MHz frequency for broadcsting it. If you will read the full wikipedia article then you will get to know more information about this. Do read it ,it's interesting enough.

###Components Required 1.SDR Receiver- Software Defined Radio is the key tool in this system. Using this we can receive the signals transmitted by air craft. There are many different main lines of such receivers depending upon their operating frequency range, chipset etc. see here to get comparision between them depending on several parametres. Following two are very common:
🔺R820T : covers from 24MHz to 1766MHz (We will use this) Datasheet
🔺E4000 : covers from 52MHz to 2200Mhz with gap 1100-1250MHz.
2.Raspberry Pi - We can build this system on our PC / Laptop but the advantage of using Raspberry Pi is that it requires small amount of power.Along with pi we require SD card.

system configuration for Linux

Once you are equipped with the above hardware next thing comes is to get done with the remaining software part. There are many software's available to make this system run.You can find wide range of software list here
Why i have choosen dump1090?

1.It is Open source.
2.It's code is available on github.
3.Easy to use.

Before moving forward you must check if you have following prerequisites available on your machine.

1.g++
2.git
3.make
4.cmake
5.libusb

You must be wondering how we can check if these are available on our machines or not right?
so to check if these prerequisites are available or not we just need to type them in a terminal.
For example, if i want to do check for g++
Simply i will type git in my command line if it is available i will get list of most common commands. Otherwise i will get something like command not found.It means i need to install it.
For that refer to the instruction given below
1.For installing g++ type command in terminal

sudo apt-get install g++

2.For installing git type command in terminal

sudo apt-get install git

3.For installing cmake click here
4.For installing libusb type command in terminal

sudo apt-get install libusb-1.0-0-dev

Once you are done with the above installation try installing rtl-sdr. To know how to install rtl-sdr click here
Now,
You can clone dump1090 from github repository to your desktop.
To clone it type command

gitclone https://github.com/antirez/dump1090

After that you just need to just type command

make

Then go to the directory of dump1090.You ready to begin with dump1090. Type following command in the terminal.

./dump1090 --interactive

Also,to check its representation on localhost 8080 type commnad

./dump1090 --interactive--net

###Errors that may takes place while installation:
#####Error 1
Found 1 device(s):
0: pxQ#, , SN: ��# (currently selected) usb_open error -3 Please fix the device permissions, e.g. by installing the udev rules file rtl-sdr.rules Error opening the RTLSDR device: Permission denied

Cause : Non Root user Solution1 : sudo Solution2 : Change udev rules : http://www.instructables.com/id/rtl-sdr-on-Ubuntu/step3/Setup-udev-rules/

#####Error 2
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

Cause : Driver loaded Solution : unload driver : sudo rmmod dvb_usb_rtl28xxu rtl2832

Note: After installing the libraries you will likely need to unload the DVB-T drivers, which Linux uses by default. To unload them temporarily type “sudo rmmod dvb_usb_rtl28xxu” into terminal. This solution is only temporary as when you replug the dongle or restart the PC, the DVB-T drivers will be reloaded. For a permanent solution, create a text file “rtlsdr.conf” in /etc/modprobe.d and add the line “blacklist dvb_usb_rtl28xxu”.

After succesful installation of the software you can observe the signals via terminal. ######Note: Antenna should be in line of sight range.

Working with pi

All the above steps are used to build the ADS-B Rx system on your laptop or desktop.Now to work on raspberry pi we need to follow same steps as i have written above. There are two ways to work on raspberry pi.
🔺Method 1 :Attach raspberry pi to your monitor.
🔺Method 2 :Work on pi headless(if monitor is not available) by ssh.

Method 1
Steps to be followed:
1.Download the operating sysetm for raspberry pi.As Raspbian is simple and easy to use we will use it.You can download it from here.Download zip file..Extract it later.
2.After downloading, you need to install it on your pi using your SD card.Insert your SD card into computer's or laptop's Sd card slot. For installing it follow the instruction given here.
3.Begin by slotting your sd card into the SD card slot on the raspberry pi.
4.Then plug in your USB keyboards and mouse into the USB slots on Pi.
5.Then,connect your HDMI cable from your monitor to pi.Make sure that you have internet.
6.Plug in an ethernet cable into the ethernet port next to the USB ports of Pi.
7.Make sure that you have plugged in all the required cables and SD card then connect power supply to Raspberry pi.
8.once the boot process of pi gets completed,a login prompt will appear. Default login for Raspbian is username pi with the password raspberry
9.After succesful login into pi you can see command prompt as pi@raspberrypi~$.
10.check for the prerequisites stated above in the same manner.
11.If they are not available, install them by following the instructions given above. However, for cmake, there is a slightly different method to be followed. Do the following for cmake installation :

wget http://www.cmake.org/files/v3.3/cmake-3.3.1.tar.gz
tar -xvzf cmake-3.3.1.tar.gz
cd cmake-3.3.1
./bootstrap
make
sudo make install

12.Now, this is the time to install all the software's which are required to set ADS-B system. i.e.rtl-sdr,dump1090.
13. In order to install rtl-sdr, do the following : ``` git clone git://git.osmocom.org/rtl-sdr.git cd rtl-sdr/ mkdir build cd build cmake ../ make sudo make install sudo ldconfig ```
14. Now, install dump1090 by the method explained above.
15. After installation type same commands explained above to make it interactive.
16.Now,You can see signals with different parameters.

Method 2
In order to operate pi without monitor ,there ae some changes in initial steps and those are as follows :
Steps To Be Followed
1.Connect LAN cable from your router to the pi. Alos make sure that you supplied power to it.
2.Make sure that you have installed operating system on your pi using SD card.(For this instructions are provided in Method 1) Insert that SD card into the SD card slot on the pi.
3.Once it is done find IP address of Raspberry Pi. Easy way to find IP address is to login into routers and search for client list.You will come to know pi's IP address in no time.
4.Now to set up a remote system using SSH click here
5.Next all steps are same as stated in Method 1.
6.Thus, follow steps from step no.9

📝NOTE

1.Your antenna should be in line of sight range.
2.To Execute Method 2 You must be on same network as of your pi.

System configuration on windows

It is much more easier to design this system on windows. There are very few steps to be follwed. As for linux we have used dump1090 for decoding signals we will stick with the same software for windows as well.
It is weird to tell you that to run dump1090 on windows machine we first require to install one more software RTL1090.
Steps to be followed
1.Install RTL1090. For that follow the procedure given [here].(http://sonicgoose.com/using-dump1090-in-windows/)
click on Installer and Maintenance Utility
2.Now, install dump1090 from the same link given above in point 1 and save it in the same folders of RTL1090.click on download dump1090 for windows
3.You just need to double click on dump1090.(windows batch file)
This is it!!!!!!!!!
4.You can see aircraft's data.:airplane:

System Set up for pi using SSH

This will take few minutes to set up your system. For configuring this system follow the steps given below.
1.start configuring the system by inserting your SD card into the SD card slot.(I am assuming that you have installed Raspbian in your pi). If not then refer to installation of raspbian given above in the Method1 of linux system design.
2.Connect power supply to the pi.
3.Insert the LAN cable from your router into the LAN port of pi.
4.Once it is done find IP address of Raspberry Pi. Easy way to find IP address is to login into routers and search for client list.You will come to know pi's IP address in no time.
5.Now, Download puTTY from here
6.Run puTTY by double clicking it. Enter the IP address of pi in the field of host Name or IP address. Make sure that you have entered port no.22 This is the default port for SSH.
7.Click on open button.
8.login as a pi.
9.Enter the password as raspberry when it is prompted.
10.Follow the same steps given in the method 1 to install required software's on pi if not installed previously.
11.Now type ls in the command prompt.
12.change the home directory to dump1090 (or whatever name you have given it for that dirctory.)
12.type command

./[directory name] --interactive

13.You are now able to seevflight parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment