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.
@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]
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.
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.
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.
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
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
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
(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
: