ADS-B Receiver Project Setup Scripts

The safest solution is to create a backup image of your micrSD card on your Laptop or Desktop, then attempt upgrade. If your files/db get damaged/over-written during upgrade, you can restore your install using the backup.

Please see this web page and youtube video:

VIDEO 1

VIDEO 2

3 Likes

@jprochazka : I am trying to re-install on a fresh SD card your script and I am getting a few errors that lead to the script not being finished.
1. First one is during dump978 install - the netcat won’t install from script:
```
The ADS-B Receiver Project v2.6.3 Installer

  Setting up dump978...

  ------------------------------------------------------------------------------

  Installing packages needed to build and fulfill dependencies...

  Checking if the package git is installed... [OK]
  Checking if the package make is installed... [OK]
  Checking if the package rtl-sdr is installed... [OK]
  Checking if the package librtlsdr-dev is installed... [OK]
  Checking if the package libusb-1.0-0-dev is installed... [OK]
  Checking if the package gcc is installed... [OK]
  Checking if the package netcat is installed... [NOT INSTALLED]
  Installing the package netcat...

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libbladerf-dev : Depends: libbladerf2 (= 2018.08-rc2) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

  Checking if the package netcat is installed...  [INSTALLATION ATTEMPT FAILED]
```

I have installed manually the netcat with “sudo apt-get install netcat” and then re-run the script.
Now it passed trough that point, but I am getting two more errors that cannot be manually installed either:
2. Second failure is at the FlightAware PiAware client.

The ADS-B Receiver Project v2.6.3 Installer

  Setting up FlightAware PiAware client...

  ------------------------------------------------------------------------------

  Installing packages needed to fulfill dependencies for FlightAware PiAware client...

  Checking if the package build-essential is installed... [OK]
  Checking if the package debhelper is installed... [OK]
  Checking if the package tcl8.6-dev is installed... [NOT INSTALLED]
  Installing the package tcl8.6-dev...

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libbladerf-dev : Depends: libbladerf2 (= 2018.08-rc2) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

  Checking if the package tcl8.6-dev is installed...  [INSTALLATION ATTEMPT FAILED]

3. Third failure, after I have installed PiAware manually, if I don’t choose to install the Piaware with the script, it stops at the Portal installation:

The ADS-B Receiver Project v2.6.3 Installer

  Setting up the ADS-B Receiver Project Portal...
  ------------------------------------------------------------------------------

  Installing packages needed to fulfill dependencies...

  Checking if the package lighttpd is installed... [OK]
  Checking if the package php7.0-cgi is installed... [NOT INSTALLED]
  Installing the package php7.0-cgi...

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libbladerf-dev : Depends: libbladerf2 (= 2018.08-rc2) but it is not installable
 php7.0-cgi : Depends: php7.0-cli but it is not going to be installed
              Depends: php7.0-common (= 7.0.30-0+deb9u1) but it is not going to be installed
              Depends: php7.0-json but it is not going to be installed
              Depends: php7.0-opcache but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

  Checking if the package php7.0-cgi is installed...  [INSTALLATION ATTEMPT FAILED]

Any ideas?

I usually update my system first before I go for installs. I wonder if it needs the updates first?

Hardware: Pi model 2, 8 Gb microSD card Class 10

(1) Wrote 2018-06-27-raspbian-stretch-lite.img

(2) microSD card slipped into Pi Model2

sudo raspi-config

#Expanded file system
#Set Locale
#Set Time Zone
#Rebooted

.
(3) apt update

sudo apt update
..............
..............
Reading state information... Done
24 packages can be upgraded. Run 'apt list --upgradable' to see them.

.
(4) apt upgrade

sudo apt upgrade

Reading package lists... Done
........
........
done.

.
(5) Run JP Script

sudo apt install git
git clone https://github.com/jprochazka/adsb-receiver.git
cd adsb-receiver
./install.sh

.
.

Installation halted

dpkg-checkbuilddeps: error: Unmet build dependencies: libbladerf-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)

  Entering the dump1090-fa build directory...
  Installing the dump1090-fa package...

dpkg: error: cannot access archive 'dump1090-fa_3.5.3_*.deb': No such file or directory

  Checking that the dump1090-fa package was installed properly...

  INSTALLATION HALTED!
  UNABLE TO INSTALL A REQUIRED PACKAGE.
  SETUP HAS BEEN TERMINATED!

The package "dump1090-fa" could not be installed.

  ------------------------------------------------------------------------------
  Dump1090-fa setup halted.

I did all the automatic updates and upgrades (as suggested).
Like I have showed above, the script fails in three different places.

First, because I wanted to install also dump978, it required netcat too. The installer failed to install netcat, but I was able to install it manually (“apt-get install netcat”) and then the installer didn’t try to install it anymore.

Second, it also failed the installation of FlightAware PiAware client. I have installed that manually too (instructions from FA webpage), and then choose not to install it with the script (so the script skipped over that phase).

After that, it fails, in the third place, at installing the ADS-B Receiver Project Portal. Here is nothing that I can do, the Portal is not installed.

All the error captures are in the first post.

1 Like

shoudn’t that be 3.6.2 ?

I think you must edit /adsb-receiver/bash/variables.sh and change 3.5.3 to 3.6.2
as 3.5.3 not available anymore in FA site.

sw%20ver%20adsb%20receiv

did you try to install ONLY the web portal ?

That’s when it fails. Otherwise you won’t even get there because of the other errors.

@obj ; Two questions:

Q-1: Why dump1090-fa needs BladeRF packages when most of users dont have BladeRF?

Q-2: Is there a swith/option in dump1090-fa source code to install dump1090-fa WITHOUT installing BladeRF? I vaguely remember seeing a switch in MAKE file (or sensible install).

.

As all the problems faced by me were caused by broken BladeRF package, this is how I proceeded with JP Script after dump1090-fa package failed to build:

As a pre-requisite to install dump1090-fa, the JP script attempted to install package libbladerf-dev, which depends on an uninstallable package libbladerf2, resulting in a broken bladeRF package. Presence of this broken package caused errors during installation of netcat and other packages.

After failure of installation of dump1090-fa due to broken package, I ran following command to remove the broken packages

sudo apt --fix-broken install

Above command removed the broken package libbladerf-dev.

After this clean-up operation, I ran the script again, but this time chose dump1090-mutability.

As (1) I have already removed broken package libbladerf-dev, and (2) the dump1090-mutability installation does not try to install libbladerf-dev, the installation went smoothly and finished successfully, WITHOUT NEED FOR ANY MANUAL INTERVENTION.

Because the same dump1090-fa build is used on FlightFeeders which have a bladeRF.

If you are building/installing by hand without the debian packaging, yes.
If you are building the debian package (as I believe adsbreceiver does) then no - it is a build-dep - you need to satisfy the build-dep.

It sounds like adsbreceiver is getting the libbladerf install wrong.
The FA piaware repository has bladerf packages that work with dump1090-fa.

1 Like

Is that true for the Orange FF too? I wonder if that’s why my Piaware build, with FA Pro Plus stick, never gets the same amount of planes like the FF, even when feed from the same antenna? They are close, but after numerous careful gain adjusts, the FF still gets a few planes extra.

Yes, all FF models use the same build. It’s probably just minor hardware variation?

It’s just annoying me :slight_smile:
Delta

UNTESTED

If you want 3.6.2, then before running ./install.sh, do this:

cd ~/adsb-receiver/bash/decoders
sudo nano dump1090-fa.sh

Press keys Ctrl+w, then type /dump1090-fa/dump1090 2>&1, then press Enter key.
The cursor will jump to following line:
cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090 2>&1

Below this line, and above fi, add following line

git reset --hard 20a16d5

The code will become like this

if [[ ! "${PWD}" = "${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090" ]] ; then
    echo -e "\e[94m  Entering the dump1090-fa git repository directory...\e[97m"
    cd ${RECEIVER_BUILD_DIRECTORY}/dump1090-fa/dump1090 2>&1
    git reset --hard 20a16d5
fi

Save file (Ctrl+o) and Close file (Ctrl+x)

Now run ./install.sh

.

NOTE:
if manually given:

cd ~/adsb-receiver/build/dump1090-fa/dump1090
git reset --hard 20a16d5

HEAD is now at 20a16d5 Prepare for 3.6.2 release
1 Like

Thanks Oliver for the very useful tip.
Can you please elaborate a little more.
I am not sure what do you mean by “built by hand without the debian packaging”.
Do you mean using make or CMake?
Thanks

make BLADERF=no

Installing the results is left as an exercise for the reader

1 Like

.

sudo mkdir ~/build-dump-fa
cd ~/build-dump-fa
sudo git clone https://github.com/flightaware/dump1090.git

cd ~/build-dump-fa/dump1090
sudo make BLADERF=no

sudo systemctl stop dump1090-mutability

./dump1090 --interactive --net 
Sun Aug 19 12:09:57 2018 EDT  dump1090-fa  starting up.
rtlsdr: using device #0: Generic RTL2832U (Realtek, RTL2832U, SN 00000000)
Found Rafael Micro R820T tuner
rtlsdr: tuner gain set to 49.6 dB

NEXT CHALLENGE … start daemon at boot + config + display SkyView map … good activity for Sunday :slight_smile:

1 Like

I think this thread will provide a guide, but guide only, not copy-paste. Will need lot of adaptation.

One Pi, Two Dongles, Two Maps, Two Receivers

(1) Pre-reqisuites

sudo apt update
sudo apt upgrade

sudo apt install git
sudo apt install debhelper
sudo apt install lighttpd
sudo apt install rtl-sdr
sudo apt install librtlsdr-dev
sudo apt install libusb-1.0-0-dev
sudo apt install libncurses5-dev

sudo mkdir ~/build-dump-fa
cd ~/build-dump-fa
sudo git clone https://github.com/flightaware/dump1090.git

cd ~/build-dump-fa/dump1090
sudo make BLADERF=no

sudo ./dump1090 --interactive

(2) Cloned Config file

sudo cp ~/build-dump-fa/dump1090/debian/dump1090-fa.default /etc/default/dump1090-fa

.

(3) Copied lighttpd config file

sudo cp ~/build-dump-fa/dump1090/debian/lighttpd/89-dump1090-fa.conf  /etc/lighttpd/conf-available/89-dump1090-fa.conf 

.

(4) Copied the dump1090 file created by make command above to folder /user/bin, renaming copy to dump1090-fa.

sudo cp -r ~/build-dump-fa/dump1090/dump1090  /usr/bin/dump1090-fa 

.

(5) Create new file /etc/init.d/dump1090-fa

sudo touch /etc/init.d/dump1090-fa  
sudo chmod +x /etc/init.d/dump1090-fa  
sudo nano /etc/init.d/dump1090-fa  

.

(6) Copy-paste following code in above newly created file.

#!/bin/sh
### BEGIN INIT INFO
# Provides:          dump1090-fa
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: dump1090 daemon (flightaware)
# Description:       Receives ADS-B messages from a RTLSDR dongle
#                    and makes them available to other applications via
#                    a variety of network protocols.
### END INIT INFO

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="dump1090-fa daemon"
NAME=dump1090-fa
DAEMON=/usr/bin/$NAME
ARGS="--measure-noise "
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
DUMP1090_USER="dump1090"
JSON_DIR="/run/dump1090-fa"

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# work out daemon args

# sanitize missing settings
[ -z "$START_DUMP1090" ] && START_DUMP1090=no
[ -z "$DUMP1090_USER" ] && DUMP1090_USER="missing-DUMP1090_USER-setting-in-config"
[ -z "$RAW_INPUT_PORT" ] && RAW_INPUT_PORT=0
[ -z "$RAW_OUTPUT_PORT" ] && RAW_OUTPUT_PORT=0
[ -z "$SBS_OUTPUT_PORT" ] && SBS_OUTPUT_PORT=0
[ -z "$BEAST_INPUT_PORT" ] && BEAST_INPUT_PORT=0
[ -z "$BEAST_OUTPUT_PORT" ] && BEAST_OUTPUT_PORT=0
[ -z "$NET_BUFFER" ] && NET_BUFFER=0
[ -z "$JSON_INTERVAL" ] && JSON_INTERVAL=0
[ -z "$MAX_RANGE" ] && MAX_RANGE=300

# receiver:
NICELEVEL="--nicelevel -5"
case "x$DEVICE" in
 x|x0) ARGS="$ARGS --net" ;;
 xnone) ARGS="$ARGS --net-only"; NICELEVEL="" ;;
 *) ARGS="$ARGS --net --device-index $DEVICE" ;;
esac
case "x$GAIN" in
 x|xmax) ;;
 xagc) ARGS="$ARGS --gain -10" ;;
 *) ARGS="$ARGS --gain $GAIN" ;;
esac
if [ -n "$PPM" ]; then ARGS="$ARGS --ppm $PPM"; fi

# decoder:
if [ "x$FIX_CRC" = "xyes" ]; then ARGS="$ARGS --fix"; fi
if [ -n "$LAT" ]; then ARGS="$ARGS --lat $LAT"; fi
if [ -n "$LON" ]; then ARGS="$ARGS --lon $LON"; fi
ARGS="$ARGS --max-range $MAX_RANGE"

# net:

ARGS="$ARGS \
--net-ri-port $RAW_INPUT_PORT --net-ro-port $RAW_OUTPUT_PORT \
--net-bi-port $BEAST_INPUT_PORT --net-bo-port $BEAST_OUTPUT_PORT \
--net-sbs-port $SBS_OUTPUT_PORT"
if [ -n "$NET_HEARTBEAT" ]; then ARGS="$ARGS --net-heartbeat $NET_HEARTBEAT"; fi
if [ -n "$NET_OUTPUT_SIZE" ]; then ARGS="$ARGS --net-ro-size $NET_OUTPUT_SIZE"; fi
if [ -n "$NET_OUTPUT_INTERVAL" ]; then ARGS="$ARGS --net-ro-interval $NET_OUTPUT_INTERVAL"; fi
if [ "$NET_BUFFER" -le "65536" ]; then ARGS="$ARGS --net-buffer 0"
elif [ "$NET_BUFFER" -le "131072" ]; then ARGS="$ARGS --net-buffer 1"
elif [ "$NET_BUFFER" -le "262144" ]; then ARGS="$ARGS --net-buffer 2"
else ARGS="$ARGS --net-buffer 3"; fi
if [ -n "$NET_BIND_ADDRESS" ]; then ARGS="$ARGS --net-bind-address $NET_BIND_ADDRESS"; fi

# misc:
if [ -n "$STATS_INTERVAL" ]; then ARGS="$ARGS --stats-every $STATS_INTERVAL"; fi
if [ -n "$JSON_DIR" ]; then ARGS="$ARGS --write-json $JSON_DIR"; fi
if [ -n "$JSON_INTERVAL" ]; then ARGS="$ARGS --write-json-every $JSON_INTERVAL"; fi
case "x$JSON_LOCATION_ACCURACY" in
  xexact) ARGS="$ARGS --json-location-accuracy 2" ;;
  xapproximate) ARGS="$ARGS --json-location-accuracy 1" ;;
  *) ARGS="$ARGS --json-location-accuracy 0" ;;
esac

if [ "x$LOG_DECODED_MESSAGES" != "xyes" ]; then ARGS="$ARGS --quiet"; fi

if [ -n "$EXTRA_ARGS" ]; then ARGS="$ARGS $EXTRA_ARGS"; fi

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started

        if [ "x$START_DUMP1090" != "xyes" ]; then
            log_warning_msg "Not starting $NAME daemon, disabled via /etc/default/$NAME"
            return 2
        fi

        start-stop-daemon --start --quiet --pidfile $PIDFILE --user "$DUMP1090_USER" --exec $DAEMON --test > /dev/null \
                || return 1

        # create JSON_DIR with the appropriate permissions
        # (it is on /run by default, so will be lost on reboot)
        if [ "x$JSON_DIR" != "x" ]; then
           if [ ! -e $JSON_DIR ]; then
             (mkdir $JSON_DIR && chmod 0755 $JSON_DIR && chown $DUMP1090_USER $JSON_DIR) || log_warning_msg "Failed to create $JSON_DIR"
           fi
        fi

        # create logfile with the appropriate permissions if not already there
        touch $LOGFILE
        chown "$DUMP1090_USER":root $LOGFILE

        start-stop-daemon --start $NICELEVEL --quiet --pidfile $PIDFILE --user "$DUMP1090_USER" --chuid "$DUMP1090_USER" --make-pidfile --background --no-close --exec $DAEMON -- \
                $ARGS >>$LOGFILE 2>&1 \
                || return 2
        sleep 1
}

#
# Function that stops the daemon/service
#
do_stop()
{
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred
        start-stop-daemon --stop --retry=TERM/30/KILL/5 --pidfile $PIDFILE --user "$DUMP1090_USER" --exec $DAEMON
        RETVAL="$?"
        [ "$RETVAL" = 2 ] && return 2
        sleep 1
        # Many daemons don't delete their pidfiles when they exit.
        rm -f $PIDFILE
        return "$RETVAL"
}

case "$1" in
  start)
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  stop)
        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  status)
        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
        ;;
  restart|force-reload)
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        case "$?" in
          0|1)
                do_start
                case "$?" in
                        0) log_end_msg 0 ;;
                        1) log_end_msg 1 ;; # Old process is still running
                        *) log_end_msg 1 ;; # Failed to start
                esac
                ;;
          *)
                # Failed to stop
                log_end_msg 1
                ;;
        esac
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
        exit 3
        ;;
esac

:

(7) Save file (Ctrl+o) and close file (Ctrl+x)

.

(7) Update rc.d defaults

sudo update-rc.d dump1090-fa defaults   
sudo systemctl daemon-reload    

(8) Enable dump1090-fa module in lighttpd

sudo lighty-enable-mod dump1090-fa
sudo /etc/init.d/lighttpd force-reload   

.

(9) Create html folder for SkyView

sudo mkdir /usr/share/dump1090-fa
sudo cp -r ~/build-dump-fa/dump1090/public_html /usr/share/dump1090-fa/html

.

(10) @obj OUTCOME :frowning:

sudo reboot

.

sudo systemctl status dump1090-fa.service
● dump1090-fa.service - LSB: dump1090 daemon (Flightaware variant)
   Loaded: loaded (/etc/init.d/dump1090-fa; generated; vendor preset: enabled)
   Active: active (exited) since Sun 2018-08-19 18:37:07 EDT; 17min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1033 ExecStop=/etc/init.d/dump1090-fa stop (code=exited, status=0/SUCCESS)
  Process: 1041 ExecStart=/etc/init.d/dump1090-fa start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/dump1090-fa.service

Aug 19 18:37:07 raspberrypi systemd[1]: Starting LSB: dump1090 daemon (Flightaware variant)...
Aug 19 18:37:07 raspberrypi dump1090-fa[1041]: Not starting dump1090-fa daemon, disabled via /etc/de
Aug 19 18:37:07 raspberrypi systemd[1]: Started LSB: dump1090 daemon (Flightaware variant).

.