Dump1090 – Installation on the RPi

INSTALLING dump1090:

After getting the raspberry pi configured, this post will explain how to install all the drivers and the repositories to get the dump1090 software running on the raspberry pi and to make that the raspberry pi recognizes the RTL2832 USB dongle. If you haven’t read the previous posts I recommend to have a look at the draft named “Raspberry pi – beginners setup“, this draft explains how to configure the raspberry pi to feed data to some web pages like for example FlightRadar24.com.

sudo apt-get install git-core

This installs the git repository fetch code.  You may already have this installed, in which case you will get a message advising that you already have the most up-to-date version. You also need “git” in order to be able to clone some applications from the git repository. What is “git”? It really overcomes my knowledge but you will need it to get all running. The following step is to introduce these instructions to setup RTL-SDR. To explain what we are doing I will summarize but mainly we are installing the packages that let the raspberry pi use the RTL2832 USB dongle hardware. First of all we must install the packages that we have to use to compile and the dependencies needed for this process:

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
There are like the drivers that we must install to recognize any device that we may use.
Now we are goint to install the RTL2832U USB dongle driver source and compile it:
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 the installation was correct you should see no return on the previous command. Now you can pluggin the RTL2832 USB dongle on the USB port, preferably on the USB hub. Now we can continue with the installation:

sudo  ldconfig

You should now do these steps to tell the system about what the new device is allowed to do, and then to reboot the system:

cd ~
sudo  cp  ./rtl-sdr/rtl-sdr.rules  /etc/udev/rules.d/
sudo  reboot

After this the only thing we have to do is to check if the system recognizes the device:

rtl_test  -t

When you try this test it will return some commands and say this:

prompt

Some further information suggests that the test (-t) command is only intended to find the gap in the E4000 frequency coverage.  The RTL2832 don’t have a frequency gap so because of this reason “Failed to open rtlsdr device”. But there is no a problem, so the raspberry pi has found the device so we can go on with the intallation. You will not need the sudo word in the commands if you are logged in as a super user. Now download the latest release dump1090 application source code. So follow these steps:

cd  /home/pi/

or

cd  ~  (goes to your home directory)

And then:

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

If all the packages are correctly installed, compiled and connected correctly then you can try to use the dump1090 software by typing one of these commands:

./dump1090 --interactive

then you should see a screen displaying aircrafts being received by your raspberry pi. However you will need to run this with privilege to allow the program to open the port. Note the double “–” if you are typing the command by hand. Other command options are:

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

This command will show the same prompt on the screen as before but in this case the extra part of the command should enable a network server. To reduce the ammount of network traffic you can replace “–interactive” by the word “–quiet” in all the possibilities.

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

This other possibility enables to get the application running after logging out, because the ampersand denotes running in background.

./dump1090 --interactive --net --net-beast --net-ro-port 31001 --net-ro-size 500 --net-ro-rate 5 &

And this final option brings us the program running with a reduced CPU and I/O(Input/Output) load of the raspberry pi.

PLANEPLOTTER talking with the raspberry pi:

These 2 last options bring us the possibilty to share/send the data with our laptop software like planeplotter, because the commands open a port to share the data collected by the dump1090. To get the planeplotter using the data of the rapsberry pi(RPi) dump1090 software you must follow the following steps:

1) Start the Planeplotter software on your laptop or home PC.

2) Select Options – Mode-S Receiver – RTL dongle RPi dump1090 – Setup TCP/IP client.

3) In the window that appears, type in the IP address of your RPi on your local network followed by “:31001” which is the port where the data is shared by dump1090 – then click OK.

4) Select Options – I/O settings.

5) In the dialog that appears check the Input data – Mode-S/ADS-B box – then select “RTL > RPi+Dump1090” from the list window to the right.

6) Press the green circle on the toolbar to start Planeplotter monitoring the aicrafts. Now if you pay attention to the map, the planes on the dump1090 and of the Planeplotter must be the same.

Running the dump1090 software automatically:

Basically, we will run the program as a daemon, which is broadly equivalent to a service, in Windows parlance. What that means is that a program can run without a user having to be logged in to start and stop it. So what we’ll do is create a little script which is run when the RPi boots and which in turn will start our dump1090 program. First of all create the script with the following command:

 sudo nano /etc/init.d/dump1090.sh

This command will open the nano text editor and create an empty file named dump1090.sh in the specified path. Now you only have to paste into the file all the content:

#!/bin/bash
### BEGIN INIT INFO
#
# Provides:		dump1090
# Required-Start:	$remote_fs
# Required-Stop:	$remote_fs
# Default-Start:	2 3 4 5
# Default-Stop:		0 1 6
# Short-Description:	dump1090 initscript

#
### END INIT INFO
## Fill in name of program here.
PROG="dump1090"
PROG_PATH="/home/pi/dump1090"
PROG_ARGS="--interactive --net --net-beast --net-ro-port 31001"
#PROG_ARGS="--interactive --net --net-ro-port 31001"
PIDFILE="/var/run/dump1090.pid"

start() {
      if [ -e $PIDFILE ]; then
          ## Program is running, exit with error.
          echo "Error! $PROG is currently running!" 1>&2
          exit 1
      else
          ## Change from /dev/null to something like /var/log/$PROG if you want to save output.
          cd $PROG_PATH
          ./$PROG $PROG_ARGS 2>&1 >/dev/null &
          echo "$PROG started"
          touch $PIDFILE
      fi
}

stop() {
      if [ -e $PIDFILE ]; then
          ## Program is running, so stop it
         echo "$PROG is running"
         killall $PROG
         rm -f $PIDFILE
         echo "$PROG stopped"
      else
          ## Program is not running, exit with error.
          echo "Error! $PROG not started!" 1>&2
          exit 1
      fi
}

## Check to see if we are running as root first.
## Found at http://www.cyberciti.biz/tips/shell-root-user-check-script.html
if [ "$(id -u)" != "0" ]; then
      echo "This script must be run as root" 1>&2
      exit 1
fi

case "$1" in
      start)
          start
          exit 0
      ;;
      stop)
          stop
          exit 0
      ;;
      reload|restart|force-reload)
          stop
          start
          exit 0
      ;;
      **)
          echo "Usage: $0 {start|stop|reload}" 1>&2
          exit 1
      ;;
esac
#

After copy in the content you can save the file by “CTRL+O” and closing the nano text editor by “CTRL+X“. Then we only have to make the file executable (executable files have a green colour when prompted with the “ls” command) by the command:

 sudo chmod +x /etc/init.d/dump1090.sh

Now we only have to create the runlevel shortcuts with the command:

sudo update-rc.d dump1090.sh defaults

And that’s all we have to do, if we reboot the raspberry pi, it will run the dump1090 software automatically. If we want to stop or start the program after rebooting the raspberry pi, we can do this by the next commands:

 sudo etc/init.d/dump1090.sh stop

To stop the program when running in the background.

 sudo etc/init.d/dump1090.sh start

To start the program when is stopped.

The program can be stopped by killing it with the command:

kill -9 "process number"

The number of the process can be known by typing the command:

 ps -e

This command will show all the active processes on the background.

Finally if you want to remove the dump1090 as a service, you have to introduce this last command:

sudo update-rc.d -f dump1090.sh remove

All the information is extracted from the next web page and is a really nice tutorial to get started with dump1090, if you have some problem you could look for some solution here: http://www.satsignal.eu/raspberry-pi/dump1090.html

Dump1090 options:

The dump1090 software when running on the Raspberry Pi produces a nice plot on a Web browser running on your local network (PC, Linux or Mac).  You might also like to use this as a check that the dump1090 program is still running as expected, and that the TCP/IP link is still up on your Raspberry Pi.

To see the plot on the browser you just have to enter the local IP adress of the raspberry pi followed by “:8080” and this will bring you to a web page that uses the google maps to plot the aicrafts and shows a table with all the data of every flight.

dump1090 - web server plotting option

dump1090 – web server plotting option

For example, I have entered in my browser: http://192.168.1.17:8080/ because the IP adress of my raspberry pi is 192.168.1.17. You have to do the same but with your own IP adress.

To get all the command options to run the dump1090 software you can type:

 cd dump1090

enters to the folder where the executable file is.

 ./dump1090 --help

shows all the options for the dump1090 program.

Or you can just enter:

 dump1090/dump1090 --help

which is the same.

Finally I want to recommend another interesting web page where some more things are explained: http://sonicgoose.com/mode-s-and-ads-b-on-a-raspberry-pi/

Anuncis

25 pensaments sobre “Dump1090 – Installation on the RPi

  1. Retroenllaç: ADSB mit dem Raspberry Pi

  2. Retroenllaç: SDR Network? - Page 2 - The RadioReference.com Forums

  3. Retroenllaç: Building an ADS-B receiver with a Raspberry Pi, a DVB-T stick and some bits. | Matthew Ernisse

  4. Hi do you maybe know why sometimes dump1090 stops working? Like the website will just infinitely load if I try and open it. If I restart dump then it’ll work fine for a while.

    I power the dongle directly from Pi, is it pulling too much power when many signals and crashing/causing issues with dump?

    I use flightradar24, dump1090 and planeplotter all in conjunction.

      • Yes all 3 basically. Maybe not enough processing power? 🙂

        Well Planeplotter runs on desktop PC but I send Dump1090 data to it and FR24 also runs on the pi which it sends to FR24.

        It was happening a lot earlier today but not any more. It has been stable for like 6 hours.

        I don’t know what causes the problem. it’s like dump1090 will crash, stop processing signals/wouldn’t send it to planeplotter and the website of dump1090 with the map won’t load. FR24 will still be running fine. Usually

        sudo etc/init.d/dump1090.sh stop
        sudo etc/init.d/dump1090.sh start would fix it or simply restarting the Pi.

        I am thinking maybe when there are many planes/signals there’s not enough power to the dongle, I am buying a usb hub now to power the dongle itself instead of the Pi powering it.

        Will post back if any changes.

        (btw thanks for your guide, helped me with a thing or two with setting up!)

      • Thank to you for readin! That’s what keeps it alive haha

        Anyway from my experience, I think there’s not a problem of being dump1090 and FR24 softwares running on the Pi…

        Idk what can be causing it but, in my case, I left the Rpi running for more than a month I figured out when checking it that it stopped running after 3 weeks iwth both softwares sharing data! So I think it should run without stopping…

        Sorry I cannot give you more advance details…

      • Thank you for the reply.

        I got a hub with independent power (so the dongle doesn’t get power from the Pi) and it hasn’t happened since!

        I think when the dongle loses power and gains it again, dump1090 doesn’t restart the connection to the dongle and stops responding which is why it would work if I restart dump1090.

        Now everything is okay and that’s not happening any more since I got the dongle into an independent hub and then the hub goes into the Pi.

  5. Retroenllaç: ADS-B Empfang - "Plane Spotting" - marsipulami0815 (DC5DM)

  6. Retroenllaç: PiAware: Live Flight Tracking Using Raspberry Pi | TRIFORCE STUDIO

  7. Retroenllaç: Tracking Aircraft on Raspberry PI – securitycurmudgeon.com

Deixa un comentari

Fill in your details below or click an icon to log in:

WordPress.com Logo

Esteu comentant fent servir el compte WordPress.com. Log Out / Canvia )

Twitter picture

Esteu comentant fent servir el compte Twitter. Log Out / Canvia )

Facebook photo

Esteu comentant fent servir el compte Facebook. Log Out / Canvia )

Google+ photo

Esteu comentant fent servir el compte Google+. Log Out / Canvia )

S'està connectant a %s