ADS-B Receiver Project Setup Scripts

@obj
Good news. J Prochazka fixed the bug an hour ago by adding declaration of variable
DISTRO_PHP_VERSION=5
before start of case, as per your advise, which I coveyed to him in the issue I have opened in github.
(This issue is now closed)

Also noted that bug #2 (trying to install non-existant package php5-xml in Jessie, and then failing), has been fixed by J Prochazka by adding if statement. The script will now not try to install php5-xml in Jessie. It will install php7.0-xml only if it is Ubuntu 16.04 or Debian 9 or Raspbian Stretch, but not in Raspbian Jessie and Piaware 3.5.1

Before bug fixing:

else
        CheckPackage php${DISTRO_PHP_VERSION}-xml
fi

.
.

After bug fixing

else
    if [ $DISTRO_PHP_VERSION == "7.0" ]; then
        CheckPackage php${DISTRO_PHP_VERSION}-xml
    fi
fi 

Today tried to install Web Portal on Ubuntu Mate (Xenial) on RPi, failed due to DISTRO_PHP_VERSION is assuming the default value of 5 instead of 7.0, and instead of php7.0-cgi, attempted to install php5-cgi which is not available in Ubuntu repositories.

  Checking if the package php5-cgi is installed... [NOT INSTALLED]
  Installing the package php5-cgi...

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php5-cgi is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php5-cgi' has no installation candidate

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

I have finally found the reason: The comparison operator -ge (greater than or equal to) used in bash scripts applies only to integer comparison, and fails when used for comparison of a decimal number 16.04

I first tried to replace -ge by >=, but it also failed. I then separately compared integer and decimal parts, and it worked ok.

I replace the original line
if [[ $DISTRO_RELEASE -ge "16.04" ]]; then DISTRO_PHP_VERSION="7.0"; fi

by line
if [[ (${DISTRO_RELEASE%%.*} == "16" || ${DISTRO_RELEASE%%.*} > "16") && (${DISTRO_RELEASE##*.} == "04" || ${DISTRO_RELEASE##*.} > "04") ]]; then DISTRO_PHP_VERSION="7.0"; fi

and the scripts works OK after this change, and successfully installed Web Portal.

Here is the version detection part of JP’s script with my modification.

# Detect the OS distribution and version.
DISTRO_ID=`. /etc/os-release; echo ${ID/*, /}`
DISTRO_RELEASE=`. /etc/os-release; echo ${VERSION_ID/*, /}`
DISTRO_PHP_VERSION="5"

case $DISTRO_ID in
    debian|raspbian)
        if [[ $DISTRO_RELEASE -ge "9" ]]; then DISTRO_PHP_VERSION="7.0"; fi
        ;;
    ubuntu)
#        if [[ $DISTRO_RELEASE -ge "16.04" ]]; then DISTRO_PHP_VERSION="7.0"; fi
        if [[ (${DISTRO_RELEASE%%.*} == "16" || ${DISTRO_RELEASE%%.*} > "16") && (${DISTRO_RELEASE##*.} == "04" || ${DISTRO_RELEASE##*.} > "04") ]]; then DISTRO_PHP_VERSION="7.0"; fi
        ;;
esac

Further on failure of Web Portal installation on Ubuntu Mate (Xenial):
Now I changed -ge in following line by separate == and >, and that also made the script to work. This is much easier solution than what I gave in my previous post. Seems == and > operands can compare decimal/floating point numbers, while -ge and >= cannot.

sudo nano adsb-receiver/bash/portal/install.sh
#in line 249, changed -ge by separate == and > statements.

#        if [[ $DISTRO_RELEASE -ge "16.04" ]]; then DISTRO_PHP_VERSION="7.0"; fi
        if [[ $DISTRO_RELEASE == "16.04" || $DISTRO_RELEASE > "16.04" ]]; then DISTRO_PHP_VERSION="7.0"; fi

I have raised this issue at Github, awaiting J Prochazka’s responce/action.

Note:
To post an issue at Github, one has to signup. When I tried to signup as abcd567, found that some one has already taken user name abcd567, forcing me to open an account by adding an “a” at the end of abcd567, i.e. as abcd567a

Error message which I missed posting in my previous post. This message pin points to the line where the error is (line 249), as well as nature of error (invalid arithematic operator).

~: $ cd adsb-receiver
~/adsb-receiver: $ sudo chmod +x bash/portal/install.sh
~/adsb-receiver: $ sudo ./bash/portal/install.sh

Error: line 249: [[: 16.04: syntax error: invalid arithmetic operator (error token is ".04")

FWIW - I ran this script on an Asus Tinkerboard running 20170928-tinker-board-linaro-stretch-alip-v2.0.3 and it is running perfectly.

1 Like

Yes, Joe Prochazka fixed the last bug on Oct 19. On Oct 20 I ran his script on Ubuntu Xenial 16.04 for Pi2-Pi3, and it worked flawlessly. The script installed:
dump1090-mutability
Piaware data feeder 3.5.1
Planefinder data feeder
Flightradar24 data feeder
Adsbexchange data feeder
Performance Graph

Yesterday (Nov 04), I ran the script on Piaware SD card image 3.5.1bis (with integral dump1090-fa and Piaware datafeeder 3.5.1), and it worked flawlessly. The script installed:
Planefinder data feeder
Flightradar24 data feeder
Adsbexchange data feeder
Performance Graphs.

Yesterday (Nov 05), I ran his script on Raspbian STRETCH Lite, and it worked flawlessly.
The script installed:
dump1090-fa
Piaware data feeder 3.5.1
Planefinder data feeder
Flightradar24 data feeder
Adsbexchange data feeder
Performance Graph

ALL software i.e. dump1090-fa, all datafeeders, and performance graphs are working normally and without any problems.

So I’m comparing this with the FA SD image side by side. The only thing I would change to this is the way the font and format that the “Live Dump Map” displays. The font in used by the FA image is much easier to read and the color coding for the type of signal on the FA page is easier to distinguish.

With all that said - is there a way to change that on this version? If so I’ll migrate my main receiver to this.

@brainstomp

Please see two types of “Live Dump Map” below.
Do you mean you have “Live Dump Map” Type (A) and want to change to Type (B)?

Live Dump Map Type (A) - dump1090-mutability

.

Live Dump Map Type (B) - dump1090-fa

Indeed. I should have included the screenshots in my question. But yes, that is exactly what I want to do. I love the information under system|performance graphs that the 1st screen shot interface has. Plus the ability to change to Bing/Sectionals/etc.

.

Please see this post:

Damn the RTFM, how did I miss it? Apologies for asking the already answered.

1 Like

I put in an issue on the GitHub page for the first issue below, but I figure to also reach out here to see if anyone has suggestions on where to look to fix code.

I recently re-did my setup, and did fresh reinstalls on my RPi3. I tried the manual install on both stretch and jessie, and the adsb-receiver premade image. All three exhibit the same issues. This was using Dump1090-MU only, not FA.

Issue #1
Flightradar24 feeder program forces downgrade of Dump1090-Mutability 1.15-dev to 1.14 during installation.

Issue #2
Related, but trying to find culprit… After installation, the Web Portal still asks for the Google API key and loads the Google Map, no choice for bing or mapzen. The live map shows three black rings, and the planes are monochrome. The live map shows version 1.15-dev.

During the installation, the Mutability installer does ask for Mapzen and Bing keys, plus the heywhatsthat URL. Subsequent attempts using the install script do not ask for the heywhatsthat URL, but still acknowledge the bing and mapzen keys. Looking at config.js and script.js the heywhatsthat portion looks correct, the plane settings look correct, etc…

Any help greatly appreciated! Thinking of trying a fork in the meantime…

Issue #1 is caused by recent change in fr24feed installation method by FR24. It now installs dump1090-mutability v1.14 alongwith fr24feed.

Do following:

apt-cache policy dump1090-mutability

If you see “Installed: v 1.14”, go ahead as follows:

sudo dpkg --purge dump1090-mutability

sudo rm -rf /usr/share/dump1090-mutability

Now run script again and choose dump1090-mutability ONLY, and say no to everything else.

cd adsb-receiver
./install.sh
1 Like

@abcd567 much better. I had tried purge in the past, but I had tried other installs along with installing mutability. I did that install solo, then went back and installed the FlightAware and ADSB Exchange feeders, then went back again and did the web interface last on its own. I also took the extra step and did a sudo rm -rf /usr/share/dump1090-mutability just to be sure I got everything (the purge threw the error about not removing everything from the share folder). Reason being, I ran the mutability installer but I did not get prompted for the heywhatsthat URL. So, I purged again, and removed that share folder. That time, I was prompted for the heywhatsthat URL.

So, now I’m at a bing map, with the heywhatsthat barriers, and the three distance rings… and the planes are colored again. Yay! :slight_smile: Time to make a backup, then start to customize and color the rings and such.

1 Like

@anarchydude:
Great that your problem is solved.

Thanks for mentioning the step after purge, which I have forgotten to post:
sudo rm -rf /usr/share/dump1090-mutability

I will now add this to my previous post to help any one else using it.

2 Likes

Ajax Call Failed

Hmm, I’m getting this error all of a sudden. It was running fine for months…
rtl-sdr.rules are set.

Edit 1: FR24Feed caused the error. The solution is to change line 12 of this file: /etc/systemd/system/fr24feed.service

to

ExecStartPre=-/bin/chown -R dump1090:nogroup /run/dump1090-mutability /var/log/fr24feed /run/fr24feed /dev/shm/decoder.txt

Edit 2:
My ADS-B Receiver Project Portal is broken after running the commands below (I tried these to fix the original problem). I get a 403 - Forbidden error. Reinstall of the portal did not work. :frowning:

sudo apt-get remove --purge lighttpd
sudo apt-get install lighttpd
sudo lighty-enable-mod dump1090
sudo service lighttpd force-reload

Edit 3: Fixed the portal with:
sudo lighttpd-enable-mod fastcgi fastcgi-php

.
Thanks @Randstad for posting the solution.

I would like to mention that “Ajax call failure” happens if the existing install has dump1090-mutability.

For Piaware SD Card image/Raspbian image, with dump1090-fa, the “Ajax call failure” does not happen after auto upgrade to fr24feed ver 1.0.19-2 and ver 1.0.19-5.

This is what I encountered on Piaware SD card img AND Raspbian img installs with dump1090-fa:

  1. There was no problem of "Ajax call failed. The Skyview map displayed OK.

  2. status of fr24feed is failed:

    pi@piaware:~$ fr24feed-status
    [FAIL] FR24 Feeder/Decoder Process ... failed!
    pi@piaware:~$ sudo systemctl status fr24feed
    ● fr24feed.service - Flightradar24 Decoder & Feeder
       Loaded: loaded (/etc/systemd/system/fr24feed.service; disabled)
       Active: inactive (dead)
  1. The page ip-of-pi:8754 and ip-of-pi:8754/settings.html will not load sayaing “Problem loading page. Unable to connect”.

Fix 1 of 2 (for dump1090-fa)

  1. Open file /etc/rc.local for editing

    pi@piaware:~$ sudo nano /etc/rc.local

  2. Add line sudo systemctl restart fr24feed above last single-worded line (i.e. above exit0)
    The file will become like this:

  #!/bin/sh -e
  .......
  .......
  # By default this script does nothing.
  sudo systemctl restart fr24feed
  exit 0
  1. Save file (Ctrl+o) and close file (Ctrl+x)

  2. Reboot

  sudo reboot
  1. After reboot, check status
  pi@piaware:~$ fr24feed-status
  [ ok ] FR24 Feeder/Decoder Process: running.
  [ ok ] FR24 Stats Timestamp: 2018-01-20 20:04:36.
  [ ok ] FR24 Link: connected [TCP].
  [ ok ] FR24 Radar: T-CYYZ9.
  [ ok ] FR24 Tracked AC: 43.
  [ ok ] Receiver: connected (52092 MSGS/0 SYNC).
  [ ok ] FR24 MLAT: ok [UDP].
  [ ok ] FR24 MLAT AC seen: 41.

Fix 2 of 2 (for dump1090-fa and dump1090-mutability installs)

The page ip-of-pi:8754 and ip-of-pi:8754/settings.html will start displaying after Fix 1, but from settings page, the “Save” and “Restart” buttons are missing, and instead there is a remark “Config file is open in read-only mode and cannot be modified from within the application.”

Give following command, then reboot.

sudo chmod a+rw /etc/fr24feed.ini
sudo reboot

After reboot load page ip-of-pi:8754/settings.html and you will see the “Save” and “Restart” buttons.
If these buttons still dont appear, clear browser cache (Ctrl+Shift+Delete) and Reload Browser (Ctrl+F5).
[/quote]

2 Likes