pull/31/head
jprochazka 2015-11-03 23:48:08 -05:00
commit 291f7afc46
15 zmienionych plików z 2510 dodań i 0 usunięć

24
CREDITS.md 100644
Wyświetl plik

@ -0,0 +1,24 @@
# Credits :airplane:
I would like to thank the developers and contributors to the following projects. Without their
hard work and dedication this project would not have been possible.
* Dump1090 (mutability): https://github.com/mutability/dump1090
* Dump1090 (MalcolmRobb): https://github.com/MalcolmRobb/dump1090
* FlightAware's PiAware: http://flightaware.com
* Plane Finder ADS-B Client: https://planefinder.net
* Dump1090-Tools: https://github.com/mutability/dump1090-tools
I would also like to thank the members and contributors to the following forums for all the time and
effort they have put in in order to create a useful and informative place to discuss aircraft tracking.
* The FlightAware Forums: http://discussions.flightaware.com
* The PlaneFinder Forums: http://forum.planefinder.net
* The ADS-B Exchange Forums: http://www.adsbexchange.com/forums/
The performance graphs were created thanks in part to the great contributions made by members of both
the FlightAware and PlaneFinder communities. Through their examples and help posted to the following
threads I was able to add these very informative graphs.
* http://discussions.flightaware.com/ads-b-flight-tracking-f21/system-monitoring-t26999.html
* http://forum.planefinder.net/threads/web-portal-and-collectd-rrd-graphs-automated-installation.256/

21
LICENSE.md 100644
Wyświetl plik

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Joseph A. Prochazka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

51
README.md 100644
Wyświetl plik

@ -0,0 +1,51 @@
# The ADS-B Feeder Project :airplane:
This repository contains a set of bash scripts and files which can be used to setup an ADS-B
feeder on a clean installation of a Debian derived operating system. The scripts are executed
in order by the main install script depending on the installation options choosen by the user.
### Obtaining And Using This Software
sudo apt-get install git
git clone https://github.com/jprochazka/adsb-feeder.git
cd adsb-feeder
chmod 755 install.sh
./install.sh
### What Can Be Installed
At this time the following software can be installed using these scripts.
**Mode S Decoders**
* Dump1090 (mutability): https://github.com/mutability/dump1090
* Dump1090 (MalcolmRobb): https://github.com/MalcolmRobb/dump1090
**Site Feeders**
* FlightAware's PiAware: http://flightaware.com
* Plane Finder ADS-B CLient: https://planefinder.net
* ADS-B Exchange: http://adsbexchange.com *
**Additional Features**
* Web accessable Dump1090 and system performance graphs. **
### Supported Operating Systems
This project is in it's early stages and still needs to be thuroughly tested in live environments.
The following is a list of operating systems which are currently going through testing as well as
the status of the testing done so far on each. Those checked off have been tested successfully.
- [X] **Raspbian Jessie**
- [ ] **Raspbian Wheezy**
- [ ] **Debian 8.0 Jessie**
- [ ] **Debian 7.0 Wheezy**
- [ ] **Ubuntu 15.04 Vivid Vervet**
- [ ] **Ubuntu 14.04 LTS Trusty Tahr**
- [ ] **Ubuntu 12.04 LTS Precise Pangolin**
---
\* *The ADS-B Exchange feed is sent via FlightAware's PiAware software.*
** *In order to utilize the performance graphs dump1090-mutability must be chosen as your mode s decoder.*

Wyświetl plik

@ -0,0 +1,229 @@
#!/bin/bash
#####################################################################################
# ADS-B FEEDER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
BUILDDIR=${PWD}
## FUNCTIONS
# Function used to check if a package is install and if not install it.
function CheckPackage(){
printf "\e[33mChecking if the package $1 is installed..."
if [ $(dpkg-query -W -f='${Status}' $1 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo -e "\033[31m [NOT INSTALLED]\033[37m"
echo -e "\033[33mInstalling the package $1 and it's dependancies..."
echo -e "\033[37m"
sudo apt-get install -y $1;
echo ""
echo -e "\033[33mThe package $1 has been installed."
else
echo -e "\033[32m [OK]\033[37m"
fi
}
clear
echo -e "\033[31m"
echo "--------------------------------------------"
echo " Now ready to install dump1090-MalcolmRobb."
echo "--------------------------------------------"
echo -e "\033[33mDump 1090 is a Mode S decoder specifically designed for RTLSDR devices."
echo ""
echo "https://github.com/MalcolmRobb/dump1090"
echo ""
echo "RTL-SDR will be built and set up as well in order to turn your RTL2832U device into a SDR."
echo ""
echo "http://sdr.osmocom.org/trac/wiki/rtl-sdr"
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
## CHECK FOR PREREQUISITE PACKAGES
echo -e "\033[33m"
echo "Installing packages needed to build and fulfill dependencies..."
echo -e "\033[37m"
CheckPackage git
CheckPackage cmake
CheckPackage libusb-1.0-0-dev
CheckPackage build-essential
CheckPackage pkg-config
## DOWNLOAD THE RTL-SDR SOURCE
echo -e "\033[33m"
echo "Downloading the source code for RTL-SDR..."
echo -e "\033[37m"
git clone git://git.osmocom.org/rtl-sdr.git
## BUILD AND INSTALL RTL-SDR
echo -e "\033[33m"
echo "Building RTL-SDR..."
echo -e "\033[37m"
cd $BUILDDIR/rtl-sdr
mkdir $BUILDDIR/rtl-sdr/build
cd $BUILDDIR/rtl-sdr/build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
## CONFIGURE RTL-SDR
echo -e "\033[33m"
echo "Configuring RTL-SDR..."
echo -e "\033[37m"
sudo ldconfig
sudo cp $BUILDDIR/rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
sudo tee -a /etc/modprobe.d/no-rtl.conf > /dev/null <<EOF
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
EOF
echo -e "\033[33mInstallation of RTL-SDR is now complete."
echo "Please look over the output generated to be sure no errors were encountered."
echo "If everything looks good then continue on to install dump1090-MalcolmRobb."
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
## DOWNLOAD THE DUMP1090-MALCOLMROBB SOURCE
cd $BUILDDIR
echo -e "\033[33m"
echo "Downloading the source code for dump1090-MalcolmRobb..."
echo -e "\033[37m"
git clone https://github.com/MalcolmRobb/dump1090.git
## BUILD DUMP1090-MALCOLMROBB
echo -e "\033[33m"
echo "Building dump1090-MalcolmRobb..."
echo -e "\033[37m"
cd $BUILDDIR/dump1090
make
## CREATE A DUMP1090 STARTUP SCRIPT
echo -e "\033[33m"
echo "Creating the dump1090-MalcolmRobb startup script..."
echo -e "\033[37m"
sudo tee -a /etc/init.d/dump1090.sh > /dev/null <<EOF
#!/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="$BUILDDIR/dump1090"
PROG_ARGS="--interactive --net --no-fix --net-ro-size 500 --net-ro-rate 5"
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.
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
exit 0
EOF
sudo chmod 755 /etc/init.d/dump1090.sh
## START DUMP1090-MALCOLMROBB
echo -e "\033[33m"
echo "Starting dump1090-MalcolmRobb..."
echo -e "\033[37m"
sudo /etc/init.d/dump1090.sh start
## DISPLAY MESSAGE STATING DUMP1090-MALCOLMROBB SETUP IS COMPLETE
echo -e "\033[33mInstallation and configuration of dump1090-MalcolmRobb is now complete."
echo "Again please look over the output to be sure no errors were encountered."
echo "If no errors were encountered feel free to continue."
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE

Wyświetl plik

@ -0,0 +1,131 @@
#!/bin/bash
#####################################################################################
# ADS-B FEEDER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
BUILDDIR=${PWD}
## FUNCTIONS
# Function used to check if a package is install and if not install it.
function CheckPackage(){
printf "\e[33mChecking if the package $1 is installed..."
if [ $(dpkg-query -W -f='${Status}' $1 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo -e "\033[31m [NOT INSTALLED]\033[37m"
echo -e "\033[33mInstalling the package $1 and it's dependancies..."
echo -e "\033[37m"
sudo apt-get install -y $1;
echo ""
echo -e "\033[33mThe package $1 has been installed."
else
echo -e "\033[32m [OK]\033[37m"
fi
}
clear
echo -e "\033[31m"
echo "-------------------------------------------"
echo " Now ready to install dump1090-mutability."
echo "-------------------------------------------"
echo -e "\033[33mDump 1090 is a Mode S decoder specifically designed for RTLSDR devices."
echo "Dump1090-mutability is a fork of MalcolmRobb's version of dump1090 that adds new"
echo "functionality and is designed to be built as a Debian/Raspbian package."
echo ""
echo "https://github.com/mutability/dump1090"
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
## CHECK FOR PREREQUISITE PACKAGES
echo -e "\033[33m"
echo "Installing packages needed to build and fulfill dependencies..."
echo -e "\033[37m"
CheckPackage git
CheckPackage build-essential
CheckPackage debhelper
CheckPackage librtlsdr-dev
CheckPackage libusb-1.0-0-dev
CheckPackage pkg-config
CheckPackage lighttpd
## DOWNLOAD THE DUMP1090-MUTABILITY SOURCE
echo -e "\033[33m"
echo "Downloading the source code for dump1090-mutability..."
echo -e "\033[37m"
git clone https://github.com/mutability/dump1090.git
## BUILD THE DUMP1090-MUTABILITY PACKAGE
echo -e "\033[33m"
echo "Building the dump1090-mutability package..."
echo -e "\033[37m"
cd $BUILDDIR/dump1090
dpkg-buildpackage -b
## INSTALL THE DUMP1090-MUTABILITY PACKAGE
echo -e "\033[33m"
echo "Installing the dump1090-mutability package..."
echo -e "\033[37m"
cd $BUILDDIR
sudo dpkg -i dump1090-mutability_1.15~dev_*.deb
## START DUMP1090-MUTABILITY
echo -e "\033[33m"
echo "Starting dump1090-mutability..."
echo -e "\033[37m"
sudo /etc/init.d/dump1090-mutability start
## CONFIGURE LIGHTTPD
echo -e "\033[33m"
echo "Configuring lighttpd..."
echo -e "\033[37m"
sudo lighty-enable-mod dump1090
sudo /etc/init.d/lighttpd force-reload
## START DUMP1090-MUTABILITY
echo -e "\033[33m"
echo "Startng dump1090-mutability..."
echo -e "\033[37m"
sudo /etc/init.d/dump1090-mutability start
## DISPLAY MESSAGE STATING DUMP1090-MUTABILITY SETUP IS COMPLETE
echo -e "\033[33m"
echo "Installation of dump-1090-mutability is now complete."
echo "Please look over the output generated to be sure no errors were encountered."
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE

Wyświetl plik

@ -0,0 +1,248 @@
#!/bin/bash
#####################################################################################
# ADS-B FEEDER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
BUILDDIR=${PWD}
## FUNCTIONS
# Function used to check if a package is install and if not install it.
function CheckPackage(){
printf "\e[33mChecking if the package $1 is installed..."
if [ $(dpkg-query -W -f='${Status}' $1 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo -e "\033[31m [NOT INSTALLED]\033[37m"
echo -e "\033[33mInstalling the package $1 and it's dependancies..."
echo -e "\033[37m"
sudo apt-get install -y $1;
echo ""
echo -e "\033[33mThe package $1 has been installed."
else
echo -e "\033[32m [OK]\033[37m"
fi
}
clear
echo -e "\033[31m"
echo "-------------------------------------------"
echo " Now ready to install dump1090-portal."
echo "-------------------------------------------"
echo -e "\033[33mThe goal of the dump1090-portal portal project is to create a very"
echo "light weight easy to manage web interface for dump-1090 installations"
echo "This project is at the moment very young with only a few of the planned"
echo "featured currently available at this time."
echo ""
echo "https://github.com/jprochazka/dump1090-portal"
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
clear
## CHECK FOR PREREQUISITE PACKAGES
echo -e "\033[33m"
echo "Installing packages needed to build and fulfill dependencies..."
echo -e "\033[37m"
CheckPackage collectd
CheckPackage rrdtool
## BACKUP AND REPLACE COLLECTD.CONF
echo -e "\033[33m"
echo "Backing up and replacing the current collectd.conf file..."
echo -e "\033[37m"
sudo mv /etc/collectd/collectd.conf /etc/collectd/collectd.conf.back
sudo tee -a /etc/collectd/collectd.conf > /dev/null <<EOF
# Config file for collectd(1).
##############################################################################
# Global #
##############################################################################
Hostname "localhost"
#----------------------------------------------------------------------------#
# Added types for dump1090. #
# Make sure the path to dump1090.db is correct. #
#----------------------------------------------------------------------------#
TypesDB "${BUILDDIR}/collectd/dump1090.db" "/usr/share/collectd/types.db"
#----------------------------------------------------------------------------#
# Interval at which to query values. This may be overwritten on a per-plugin #
# base by using the 'Interval' option of the LoadPlugin block: #
# <LoadPlugin foo> #
# Interval 60 #
# </LoadPlugin> #
#----------------------------------------------------------------------------#
Interval 60
Timeout 2
ReadThreads 5
WriteThreads 1
##############################################################################
# Logging #
##############################################################################
LoadPlugin syslog
<Plugin syslog>
LogLevel info
</Plugin>
##############################################################################
# LoadPlugin section #
#----------------------------------------------------------------------------#
# Specify what features to activate. #
##############################################################################
LoadPlugin rrdtool
LoadPlugin table
LoadPlugin interface
LoadPlugin memory
LoadPlugin cpu
LoadPlugin aggregation
LoadPlugin match_regex
LoadPlugin df
LoadPlugin disk
<LoadPlugin python>
Globals true
</LoadPlugin>
##############################################################################
# Plugin configuration #
##############################################################################
<Plugin rrdtool>
DataDir "/var/lib/collectd/rrd"
</Plugin>
#----------------------------------------------------------------------------#
# Configure the dump1090 python module. #
# #
# Each Instance block collects statistics from a separate named dump1090. #
# The URL should be the base URL of the webmap, i.e. in the examples below, #
# statistics will be loaded from http://localhost/dump1090/data/stats.json #
#----------------------------------------------------------------------------#
<Plugin python>
ModulePath "${BUILDDIR}/collectd"
LogTraces true
Import "dump1090"
<Module dump1090>
<Instance localhost>
URL "http://localhost/dump1090"
</Instance>
</Module>
</Plugin>
<Plugin table>
<Table "/sys/class/thermal/thermal_zone0/temp">
Instance rpi
Separator " "
<Result>
Type gauge
InstancePrefix "cpu_temp"
ValuesFrom 0
</Result>
</Table>
</Plugin>
<Plugin "interface">
Interface "wlan0"
</Plugin>
<Plugin "aggregation">
<Aggregation>
Plugin "cpu"
Type "cpu"
GroupBy "Host"
GroupBy "TypeInstance"
CalculateAverage true
</Aggregation>
</Plugin>
<Plugin "df">
MountPoint "/"
IgnoreSelected false
ReportReserved true
ReportInodes true
</Plugin>
<Plugin "disk">
Disk "mmcblk0"
IgnoreSelected false
</Plugin>
<Chain "PostCache">
<Rule>
<Match regex>
Plugin "^cpu\$"
PluginInstance "^[0-9]+\$"
</Match>
<Target write>
Plugin "aggregation"
</Target>
Target stop
</Rule>
Target "write"
</Chain>
EOF
## RELOAD COLLECTD
echo -e "\033[33mReloading collectd so the new configuration is used..."
echo -e "\033[37m"
sudo /etc/init.d/collectd force-reload
## PLACE HTML FILES IN LIGHTTPD'S WWW ROOT
echo -e "\033[33m"
echo "Placing HTML files in Lighttpd's www root directory..."
echo -e "\033[37m"
sudo mkdir /var/www/html/collectd
sudo cp -r $BUILDDIR/collectd/html/* /var/www/html/collectd/
## EDIT CRONTAB
echo -e "\033[33mAdding jobs to crontab..."
echo -e "\033[37m"
chmod 755 $BUILDDIR/collectd/make-collectd-graphs.sh
crontab -l > crontents
echo "*/5 * * * * sudo ${BUILDDIR}/collectd/make-collectd-graphs.sh 1h >/dev/null" >> crontents
echo "*/10 * * * * sudo ${BUILDDIR}/collectd/make-collectd-graphs.sh 6h >/dev/null" >> crontents
echo "2,12,22,32,42,52 * * * * sudo ${BUILDDIR}/collectd/make-collectd-graphs.sh 24h 180 >/dev/null" >> crontents
echo "4,24,44 * * * * sudo ${BUILDDIR}/collectd/make-collectd-graphs.sh 7d 1200 >/dev/null" >> crontents
echo "6 * * * * sudo ${BUILDDIR}/collectd/make-collectd-graphs.sh 30d 5400 >/dev/null" >> crontents
echo "8 */12 * * * sudo ${BUILDDIR}/collectd/make-collectd-graphs.sh 365d 86400 >/dev/null" >> crontents
crontab crontents
rm crontents
echo -e "\033[33m"
echo "Installation and configuration of collectd is now complete."
echo "Please look over the output generated to be sure no errors were encountered."
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE

Wyświetl plik

@ -0,0 +1,107 @@
#!/bin/bash
#####################################################################################
# ADS-B FEEDER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
BUILDDIR=${PWD}
clear
echo -e "\033[31m"
echo "-----------------------------------------------------"
echo " Now ready to set up ADS-B Exchange feed."
echo "-----------------------------------------------------"
echo -e "\033[33mADSBexchange.com is a co-op of ADS-B/Mode S/MLAT feeders from around the world."
echo "PiAware is required to be installed in order to feed this site. If PiAware is not"
echo "currently installed this script will execute the PiAware installation script after"
echo "which this script will continue with the ADS-B Exchange feed setup."
echo ""
echo "http://www.adsbexchange.com/how-to-feed/"
echo "https://github.com/flightaware/piaware"
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
## CHECK THAT PIAWARE IS INSTALLED
echo -e "\e[33m"
printf "Checking if the package piaware is installed..."
if [ $(dpkg-query -W -f='${Status}' piaware 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo -e "\033[31m [NOT INSTALLED]"
echo -e "\033[33mPiAware does not appear to be installed."
echo "PiAware is required in order to feed data to adsbexchange.com."
echo -e "\033[37m"
read -p "Press enter to install PiAware..." CONTINUE
echo -e "\e[33m"
echo "Executing the PiAware installation script..."
echo -e "\033[37m"
chmod 755 ../bash/piaware.sh
../bash/piaware.sh
else
echo -e "\033[32m [OK]\033[37m"
echo ""
fi
## CONFIGURE PIAWARE TO FEED ADS-B EXCHANGE
echo -e "\033[33mAdding the ADS-B Exchange feed to PiAware's configuration..."
echo -e "\033[37m"
MLATRESULTFORMAT=`sudo piaware-config -show | grep mlatResultsFormat`
ORIGINALFORMAT=`sed 's/mlatResultsFormat //g' <<< $MLATRESULTFORMAT`
COMMAND=`sudo piaware-config -mlatResultsFormat "${ORIGINALFORMAT} beast,connect,feed.adsbexchange.com:30005"`
$COMMAND
sudo piaware-config -restart
## ADD SCRIPT TO EXECUTE NETCAT TO FEED ADS-B EXCHANGE
echo -e "\033[33mDownloading ADS-B Exchange maintainance script..."
echo -e "\033[37m"
mkdir $BUILDDIR/adsbexchange/
wget http://bucket.adsbexchange.com/adsbexchange-maint.sh -O $BUILDDIR/adsbexchange/adsbexchange-maint.sh
echo -e "\033[33mSetting permissions and updating rc.d..."
echo -e "\033[37m"
sudo chmod 755 $BUILDDIR/adsbexchange/adsbexchange-maint.sh
echo -e "\033[33mAdding startup line to rc.local..."
echo -e "\033[37m"
lnum=($(sed -n '/exit 0/=' /etc/rc.local))
((lnum>0)) && sudo sed -i "${lnum[$((${#lnum[@]}-1))]}i ${BUILDDIR}/adsbexchange-maint.sh &\n" /etc/rc.local
## START NETCAT ADS-B EXCHANGE FEED
echo -e "\033[33mRunning ADS-B Exchange startup script..."
echo -e "\033[37m"
sudo $BUILDDIR/adsbexchange/adsbexchange-maint.sh start > /dev/null &
echo -e "\033[33mConfiguration of the ADS-B Exchange feed is now complete."
echo "Please look over the output generated to be sure no errors were encountered."
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE

Wyświetl plik

@ -0,0 +1,154 @@
#!/bin/bash
#####################################################################################
# ADS-B FEEDER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
BUILDDIR=${PWD}
## FUNCTIONS
# Function used to check if a package is install and if not install it.
function CheckPackage(){
printf "\e[33mChecking if the package $1 is installed..."
if [ $(dpkg-query -W -f='${Status}' $1 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo -e "\033[31m [NOT INSTALLED]\033[37m"
echo -e "\033[33mInstalling the package $1 and it's dependancies..."
echo -e "\033[37m"
sudo apt-get install -y $1;
echo ""
echo -e "\033[33mThe package $1 has been installed."
else
echo -e "\033[32m [OK]\033[37m"
fi
}
clear
echo -e "\033[31m"
echo "-------------------------------"
echo " Now ready to install PiAware."
echo "-------------------------------"
echo -e "\033[33mPiAware is a package used to forward data read from an ADS-B receiver to FlightAware."
echo "It does this using a program, piaware, aided by some support programs."
echo ""
echo "piaware - establishes an encrypted session to FlightAware and forwards data"
echo "piaware-config - used to configure piaware like with a FlightAware username and password"
echo "piaware-status - used to check the status of piaware"
echo "faup1090 - run by piaware to connect to dump1090 or some other program producing beast-style ADS-B data and translate between its format and FlightAware's"
echo "fa-mlat-client - run by piaware to gather data for multilateration"
echo ""
echo "https://github.com/flightaware/piaware"
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
## CHECK FOR PREREQUISITE PACKAGES
echo -e "\033[33m"
echo "Installing packages needed to build and fulfill dependencies..."
echo -e "\033[37m"
CheckPackage git
CheckPackage build-essential
CheckPackage debhelper
CheckPackage tcl8.5-dev
CheckPackage autoconf
CheckPackage python3-dev
CheckPackage python-virtualenv
# libz-dev appears to have been replaced by zlib1g-dev at least in Ubuntu Vivid Vervet...
# Will need to check if this is the case with Raspbian and Debian as well.
#CheckPackage libz-dev
CheckPackage zlib1g-dev
CheckPackage tclx8.4
CheckPackage tcllib
CheckPackage tcl-tls
CheckPackage itcl3
## DOWNLOAD THE PIAWARE SOURCE
echo -e "\033[33m"
echo "Downloading the source code for PiAware Builder..."
echo -e "\033[37m"
git clone https://github.com/flightaware/piaware_builder.git
## BUILD THE PIAWARE PACKAGE
echo -e "\033[33m"
echo "Building the PiAware package..."
echo -e "\033[37m"
cd $BUILDDIR/piaware_builder
./sensible-build.sh
cd $BUILDDIR/piaware_builder/package
dpkg-buildpackage -b
## INSTALL THE PIAWARE PACKAGE
echo -e "\033[33m"
echo "Installing the PiAware package..."
echo -e "\033[37m"
sudo dpkg -i $BUILDDIR/piaware_builder/piaware_2.1-3_*.deb
## CONFIGURE FLIGHTAWARE
echo -e "\033[33m"
echo "Please supply your FlightAware login in order to claim this device."
echo "After supplying your login PiAware will ask you to enter your password for verification."
echo -e "\033[37m"
read -p "Your FlightAware Login: " FALOGIN
sudo piaware-config -user $FALOGIN -password
echo -e "\033[33m"
echo "PiAware now sends MLAT results to port 30104 by default. This change is to try to avoid accidentally"
echo "feeding MLAT results to a Dump 1090 that is not MLAT-aware and may forward the results on unexpectedly."
echo "Dump 1090 from Mutability should be MLAT-aware meaning it should be safe to remap the MLAT port back to"
echo "it's original port number which saves having to manually configure Dump 1090 later if you decide you"
echo "would like to feed MLAT data to Dump 1090. This choice is left up to you."
echo -e "\033[37m"
read -p "Remap the MLAT port to 30004 in PiAware?: [Y/n] " MLATPORT
if [[ ! $CONTINUE =~ ^[Nn]$ ]]; then
echo -e "\033[33m"
printf "Remapping MLAT results to use port 30004..."
sudo piaware-config -mlatResultsFormat beast,connect,localhost:30004
echo -e "\033[32m [OK]"
fi
echo -e "\e[33m"
echo "Restarting PiAware to ensure all changes are applied..."
echo -e "\033[37m"
sudo /etc/init.d/piaware restart
echo -e "\033[33m"
echo "Installation and configuration of PiAware is now complete."
echo "Please look over the output generated to be sure no errors were encountered."
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE

Wyświetl plik

@ -0,0 +1,142 @@
#!/bin/bash
#####################################################################################
# ADS-B FEEDER #
#####################################################################################
# #
# This script is not meant to be executed directly. #
# Instead execute install.sh to begin the installation process. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
BUILDDIR=${PWD}
## DECLARE THE CURRENT VERSIONS OF THE SOFTWARE
ARMVERSION="3.1.201"
I386VERSION="3.0.2080"
## FUNCTIONS
# Function used to check if a package is install and if not install it.
function CheckPackage(){
printf "\e[33mChecking if the package $1 is installed..."
if [ $(dpkg-query -W -f='${Status}' $1 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo -e "\033[31m [NOT INSTALLED]\033[37m"
echo -e "\033[33mInstalling the package $1 and it's dependancies..."
echo -e "\033[37m"
sudo apt-get install -y $1;
echo ""
echo -e "\033[33mThe package $1 has been installed."
else
echo -e "\033[32m [OK]\033[37m"
fi
}
clear
echo -e "\033[31m"
echo "-----------------------------------------------------"
echo " Now ready to install the Plane Finder ADS-B Client."
echo "-----------------------------------------------------"
echo -e "\033[33mThe Plane Finder ADS-B Client is an easy and accurate way"
echo "to share your ADS-B and MLAT data with Plane Finder. It comes with a"
echo "beautiful user interface that helps you explore and interact with your"
echo "data in realtime."
echo ""
echo "https://planefinder.net/sharing/client"
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
## CHECK FOR PREREQUISITE PACKAGES
echo -e "\033[33m"
echo "Installing packages needed to build and fulfill dependencies..."
echo -e "\033[37m"
if [[ `uname -m` == "x86_64" ]]; then
CheckPackage libc6-i386
else
CheckPackage libc6
fi
## DOWNLOAD THE PLANEFINDER ADS-B CLIENT PACKAGE
echo -e "\033[33m"
echo "Downloading the Plane Finder ADS-B Client package..."
echo -e "\033[37m"
if [[ `uname -m` == "armv7l" ]]; then
wget http://client.planefinder.net/pfclient_${ARMVERSION}_armhf.deb -O $BUILDDIR/pfclient_${ARMVERSION}_armhf.deb
else
wget http://client.planefinder.net/pfclient_${I386VERSION}_i386.deb -O $BUILDDIR/pfclient_${I386VERSION}_i386.deb
fi
## INSTALL THE PLANEFINDER ADS-B CLIENT PACKAGE
echo -e "\033[33m"
echo "Installing the Plane Finder ADS-B Client package..."
echo -e "\033[37m"
if [[ `uname -m` == "armv7l" ]]; then
sudo dpkg -i $BUILDDIR/pfclient_${ARMVERSION}_armhf.deb
else
sudo dpkg -i $BUILDDIR/pfclient_${I386VERSION}_i386.deb
fi
## DISPLAY FINAL SETUP INSTRUCTIONS WHICH CONNOT BE HANDLED BY THIS SCRIPT
echo -e "\033[31m"
echo "------------------------------------------------------"
echo " MAKE SURE TO READ THROUGH THE FOLLOWING INSTRUCTIONS"
echo "------------------------------------------------------"
echo -e "\033[33m"
echo "First off please look over the output generated to be sure no errors were encountered."
echo ""
echo "At this point the Plane Finder ADS-B Client should be installed and running however"
echo "This script is only capable of installing the Plane Finder ADS-B Client. There are still"
echo "a few steps left which you must manually do through the Plane Finder ADS-B Client itself"
echo ""
echo "Visit http://${HOSTNAME}:30053 in your favorite web browser."
echo ""
echo "You will be asked to enter the email address associated with your Plane Finder account."
echo "You will also be asked to enter the latitude and longitude of your receiver."
echo "If you do not know the coordinates you can look them up using one of two page I created to do so."
echo ""
echo "To look up coordinates using a street address goto https://www.swiftbyte.com/toolbox/geocode."
echo "To look up coordinates using your IP address goto https://www.swiftbyte.com/toolbox/myip."
echo ""
echo "Once this information has been entered and submitted your share code will be emailed to you."
echo ""
echo "Next you will also be asked to choose the data format to use as well as network information"
echo "pertaining to Dump 1090. THe following is the information which should be supplied."
echo ""
echo "Data Format: Beast"
echo "Tcp Address: 127.0.0.1"
echo "Tcp Port: 30005"
echo ""
echo "After entering this information click the complete configuration button to do exactly that."
echo "Once you have successfully completed these steps you can continue on with the installation"
echo "of any other features you have choosen for this set of scripts to install."
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE

Wyświetl plik

@ -0,0 +1,21 @@
------------------------------------------------------------------------
The following license covers the files dump1090.db and dump1090.py
which were borrowed from Oliver Jowett's dump1090-tools project.
DUMP1090-TOOLS (https://github.com/mutability/dump1090-tools)
------------------------------------------------------------------------
Copyright (c) 2015, Oliver Jowett <oliver@mutability.co.uk>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Wyświetl plik

@ -0,0 +1,7 @@
dump1090_messages value:DERIVE:0:8000
dump1090_cpu value:DERIVE:0:1200
dump1090_dbfs value:GAUGE:U:0
dump1090_aircraft total:GAUGE:0:500, positions:GAUGE:0:500
dump1090_range value:GAUGE:0:500000
dump1090_tracks value:DERIVE:0:500
dump1090_mlat value:GAUGE:0:500

Wyświetl plik

@ -0,0 +1,235 @@
import collectd
import json, math
from contextlib import closing
from urllib2 import urlopen, URLError
import urlparse
import time
def handle_config(root):
for child in root.children:
instance_name = None
if child.key == 'Instance':
instance_name = child.values[0]
url = None
for ch2 in child.children:
if ch2.key == 'URL':
url = ch2.values[0]
if not url:
collectd.warning('No URL found in dump1090 Instance ' + instance_name)
else:
collectd.register_read(callback=handle_read,
data=(instance_name, urlparse.urlparse(url).hostname, url),
name='dump1090.' + instance_name)
collectd.register_read(callback=handle_read_1min,
data=(instance_name, urlparse.urlparse(url).hostname, url),
name='dump1090.' + instance_name + '.1min',
interval=60)
else:
collectd.warning('Ignored config entry: ' + child.key)
V=collectd.Values(host='', plugin='dump1090', time=0)
def T(provisional):
now = time.time()
if provisional <= now + 60: return provisional
else: return now
def handle_read(data):
instance_name,host,url = data
read_stats(instance_name, host, url)
read_aircraft(instance_name, host, url)
def handle_read_1min(data):
instance_name,host,url = data
read_stats_1min(instance_name, host, url);
def read_stats_1min(instance_name, host, url):
try:
with closing(urlopen(url + '/data/stats.json', None, 5.0)) as stats_file:
stats = json.load(stats_file)
except URLError:
return
# Signal measurements - from the 1 min bucket
if stats['last1min'].has_key('local'):
if stats['last1min']['local'].has_key('signal'):
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_dbfs',
type_instance='signal',
time=T(stats['last1min']['end']),
values = [stats['last1min']['local']['signal']],
interval = 60)
if stats['last1min']['local'].has_key('peak_signal'):
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_dbfs',
type_instance='peak_signal',
time=T(stats['last1min']['end']),
values = [stats['last1min']['local']['peak_signal']],
interval = 60)
if stats['last1min']['local'].has_key('min_signal'):
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_dbfs',
type_instance='min_signal',
time=T(stats['last1min']['end']),
values = [stats['last1min']['local']['min_signal']],
interval = 60)
if stats['last1min']['local'].has_key('noise'):
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_dbfs',
type_instance='noise',
time=T(stats['last1min']['end']),
values = [stats['last1min']['local']['noise']],
interval = 60)
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
type_instance='strong_signals',
time=T(stats['last1min']['end']),
values = [stats['last1min']['local']['strong_signals']],
interval = 60)
def read_stats(instance_name, host, url):
try:
with closing(urlopen(url + '/data/stats.json', None, 5.0)) as stats_file:
stats = json.load(stats_file)
except URLError:
return
# Local message counts
if stats['total'].has_key('local'):
counts = stats['total']['local']['accepted']
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
type_instance='local_accepted',
time=T(stats['total']['end']),
values = [sum(counts)])
for i in xrange(len(counts)):
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
type_instance='local_accepted_%d' % i,
time=T(stats['total']['end']),
values = [counts[i]])
# Remote message counts
if stats['total'].has_key('remote'):
counts = stats['total']['remote']['accepted']
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
type_instance='remote_accepted',
time=T(stats['total']['end']),
values = [sum(counts)])
for i in xrange(len(counts)):
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
type_instance='remote_accepted_%d' % i,
time=T(stats['total']['end']),
values = [counts[i]])
# Position counts
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
type_instance='positions',
time=T(stats['total']['end']),
values = [stats['total']['cpr']['global_ok'] + stats['total']['cpr']['local_ok']])
# Tracks
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_tracks',
type_instance='all',
time=T(stats['total']['end']),
values = [stats['total']['tracks']['all']])
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_tracks',
type_instance='single_message',
time=T(stats['total']['end']),
values = [stats['total']['tracks']['single_message']])
# CPU
for k in stats['total']['cpu'].keys():
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_cpu',
type_instance=k,
time=T(stats['total']['end']),
values = [stats['total']['cpu'][k]])
def greatcircle(lat0, lon0, lat1, lon1):
lat0 = lat0 * math.pi / 180.0;
lon0 = lon0 * math.pi / 180.0;
lat1 = lat1 * math.pi / 180.0;
lon1 = lon1 * math.pi / 180.0;
return 6371e3 * math.acos(math.sin(lat0) * math.sin(lat1) + math.cos(lat0) * math.cos(lat1) * math.cos(abs(lon0 - lon1)))
def read_aircraft(instance_name, host, url):
try:
with closing(urlopen(url + '/data/receiver.json', None, 5.0)) as receiver_file:
receiver = json.load(receiver_file)
if receiver.has_key('lat'):
rlat = float(receiver['lat'])
rlon = float(receiver['lon'])
else:
rlat = rlon = None
with closing(urlopen(url + '/data/aircraft.json', None, 5.0)) as aircraft_file:
aircraft_data = json.load(aircraft_file)
except URLError:
return
total = 0
with_pos = 0
max_range = 0
mlat = 0
for a in aircraft_data['aircraft']:
if a['seen'] < 15: total += 1
if a.has_key('seen_pos') and a['seen_pos'] < 15:
with_pos += 1
if rlat is not None:
distance = greatcircle(rlat, rlon, a['lat'], a['lon'])
if distance > max_range: max_range = distance
if 'lat' in a.get('mlat', ()):
mlat += 1
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_aircraft',
type_instance='recent',
time=aircraft_data['now'],
values = [total, with_pos])
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_mlat',
type_instance='recent',
time=aircraft_data['now'],
values = [mlat])
if max_range > 0:
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_range',
type_instance='max_range',
time=aircraft_data['now'],
values = [max_range])
collectd.register_config(callback=handle_config, name='dump1090')

Wyświetl plik

@ -0,0 +1,246 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ADS-B Feeder</title>
<meta http-equiv="cache-control" content="no-cache" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<style type="text/css">
html, body { height: 100%; }
#footer { height: 60px; background-color: #f5f5f5; }
#push { height: 60px; }
#wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -60px; }
#wrapper > .container { padding-top: 60px; }
.credits { margin: 20px 0; }
.padding { height: 15px; }
</style>
</head>
<body>
<div id="wrapper">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">ADS-B Feeder</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li id="graphs-link" class="active"><a href="/collectd/">Performance Graphs</a></li>
<li id="map-link"><a href="/dump1090/">Live Dump1090 Map</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<h1>Performance Graphs</h1>
<div class="btn-group" role="group">
<button type="button" id="btn-1h" class="btn btn-default btn-sm active" onclick="switchView('1h')">Hourly</button>
<button type="button" id="btn-6h" class="btn btn-default btn-sm" onclick="switchView('6h')">Six Hours</button>
<button type="button" id="btn-24h" class="btn btn-default btn-sm" onclick="switchView('24h')">Daily</button>
<button type="button" id="btn-7d" class="btn btn-default btn-sm" onclick="switchView('7d')">Weekly</button>
<button type="button" id="btn-30d" class="btn btn-default btn-sm" onclick="switchView('30d')">Monthly</button>
<button type="button" id="btn-365d" class="btn btn-default btn-sm" onclick="switchView('365d')">Yearly</button>
</div>
<div class="padding"></div>
<!-- Dump1090 Graphs -->
<div class="panel panel-default">
<div class="panel-heading">Dump1090 Graphs</div>
<div class="panel-body">
<div class="row">
<div class="col-md-12 text-center">
<a id ="dump1090-local_trailing_rate-link" href="#">
<img id="dump1090-local_trailing_rate-image" class="img-responsive" src="#" alt="Message Rate (Trailing)">
</a>
</div>
</div>
<div class="padding"></div>
<div class="row">
<div class="col-md-6 text-center">
<a id ="dump1090-aircraft-link" href="#">
<img id="dump1090-aircraft-image" class="img-responsive" src="#" alt="Aircraft Seen">
</a>
</div>
<div class="col-md-6 text-center">
<a id ="dump1090-tracks-link" href="#">
<img id="dump1090-tracks-image" class="img-responsive" src="#" alt="Tracks Seen">
</a>
</div>
</div>
<div class="padding"></div>
<div class="row">
<div class="col-md-6 text-center">
<a id ="dump1090-range-link" href="#">
<img id="dump1090-range-image" class="img-responsive" src="#" alt="Max Range">
</a>
</div>
<div class="col-md-6 text-center">
<a id ="dump1090-signal-link" href="#">
<img id="dump1090-signal-image" class="img-responsive" src="#" alt="Signal Level">
</a>
</div>
</div>
<div class="padding"></div>
<div class="row">
<div class="col-md-6 text-center">
<a id ="dump1090-local_rate-link" href="#">
<img id="dump1090-local_rate-image" class="img-responsive" src="#" alt="Message Rate">
</a>
</div>
<div class="col-md-6 text-center">
<a id ="dump1090-cpu-link" href="#">
<img id="dump1090-cpu-image" class="img-responsive" src="#" alt="CPU Utilization">
</a>
</div>
</div>
</div>
</div>
<!-- System Graphs -->
<div class="panel panel-default">
<div class="panel-heading">System Graphs</div>
<div class="panel-body">
<div class="row">
<div class="col-md-12 text-center">
<a id ="system-cpu-link" href="#">
<img id="system-cpu-image" class="img-responsive" src="#" alt="Overall CPU Utilization">
</a>
</div>
</div>
<div class="padding"></div>
<div class="row">
<div class="col-md-6 text-center">
<a id ="system-temperature-link" href="#">
<img id="system-temperature-image" class="img-responsive" src="#" alt="Core Temperature">
</a>
</div>
<div class="col-md-6 text-center">
<a id ="system-memory-link" href="#">
<img id="system-memory-image" class="img-responsive" src="#" alt="Memory Utilization">
</a>
</div>
</div>
<div class="padding"></div>
<div class="row">
<div class="col-md-6 text-center">
<a id ="system-wlan0_bandwidth-link" href="#">
<img id="system-wlan0_bandwidth-image" class="img-responsive" src="#" alt="Bandwidth Usage">
</a>
</div>
<div class="col-md-6 text-center">
<a id ="system-df_root-link" href="#">
<img id="system-df_root-image" class="img-responsive" src="#" alt="Disk Space Usage (/)">
</a>
</div>
</div>
<div class="padding"></div>
<div class="row">
<div class="col-md-6 text-center">
<a id ="system-disk_io_iops-link" href="#">
<img id="system-disk_io_iops-image" class="img-responsive" src="#" alt="Disk I/O - IOPS">
</a>
</div>
<div class="col-md-6 text-center">
<a id ="system-disk_io_octets-link" href="#">
<img id="system-disk_io_octets-image" class="img-responsive" src="#" alt="Disk I/O - Bandwidth">
</a>
</div>
</div>
</div>
</div>
</div>
<div id="push"></div>
</div>
<footer id="footer">
<div class="container">
<p class="muted credits">
This ADS-B feeder setup using <a href="https://github.com/jprochazka/adsb-feeder">The ADS-B Feeder Project</a>.
</p>
</div>
</footer>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript">
//*** BEGIN USER DEFINED VARIABLES ***//
// Set the default time frame to use when loading images when the page is first accessed.
// Can be set to 1h, 6h, 24h, 7d, 30d, or 365d.
$timeFrame = '24h';
// Set this to the hostname of the system which is running dump1090.
$hostName = 'localhost';
// Set the page refresh interval in milliseconds.
$refreshInterval = 60000
//*** END USER DEFINED VARIABLES ***//
//*** DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ***//
$(document).ready(function () {
// Display the images for the supplied time frame.
switchView($timeFrame);
// Refresh images contained within the page every X milliseconds.
window.setInterval(function() {
switchView($timeFrame)
}, $refreshInterval);
});
function switchView(newTimeFrame) {
// Set the the $timeFrame variable to the one selected.
$timeFrame = newTimeFrame;
// Set the timestamp variable to be used in querystring.
$timestamp = new Date().getTime() / 1000
// Display images for the requested time frame.
$("#dump1090-local_trailing_rate-image").attr("src", "dump1090-" + $hostName + "-local_trailing_rate-" + $timeFrame + ".png?time=" + $timestamp);
$("#dump1090-local_rate-image").attr("src", "dump1090-" + $hostName + "-local_rate-" + $timeFrame + ".png?time=" + $timestamp);
$("#dump1090-aircraft-image").attr("src", "dump1090-" + $hostName + "-aircraft-" + $timeFrame + ".png?time=" + $timestamp);
$("#dump1090-tracks-image").attr("src", "dump1090-" + $hostName + "-tracks-" + $timeFrame + ".png?time=" + $timestamp);
$("#dump1090-range-image").attr("src", "dump1090-" + $hostName + "-range-" + $timeFrame + ".png?time=" + $timestamp);
$("#dump1090-signal-image").attr("src", "dump1090-" + $hostName + "-signal-" + $timeFrame + ".png?time=" + $timestamp);
$("#dump1090-cpu-image").attr("src", "dump1090-" + $hostName + "-cpu-" + $timeFrame + ".png?time=" + $timestamp);
$("#system-cpu-image").attr("src", "system-" + $hostName + "-cpu-" + $timeFrame + ".png?time=" + $timestamp);
$("#system-wlan0_bandwidth-image").attr("src", "system-" + $hostName + "-wlan0_bandwidth-" + $timeFrame + ".png?time=" + $timestamp);
$("#system-memory-image").attr("src", "system-" + $hostName + "-memory-" + $timeFrame + ".png?time=" + $timestamp);
$("#system-temperature-image").attr("src", "system-" + $hostName + "-temperature-" + $timeFrame + ".png?time=" + $timestamp);
$("#system-df_root-image").attr("src", "system-" + $hostName + "-df_root-" + $timeFrame + ".png?time=" + $timestamp);
$("#system-disk_io_iops-image").attr("src", "system-" + $hostName + "-disk_io_iops-" + $timeFrame + ".png?time=" + $timestamp);
$("#system-disk_io_octets-image").attr("src", "system-" + $hostName + "-disk_io_octets-" + $timeFrame + ".png?time=" + $timestamp);
// Create links to full sized images for the requested time frame.
$("#dump1090-local_trailing_rate-link").attr("href", "dump1090-" + $hostName + "-local_trailing_rate-" + $timeFrame + ".png");
$("#dump1090-local_rate-image-link").attr("href", "dump1090-" + $hostName + "-local_rate-" + $timeFrame + ".png");
$("#dump1090-aircraft-link").attr("href", "dump1090-" + $hostName + "-aircraft-" + $timeFrame + ".png");
$("#dump1090-tracks-link").attr("href", "dump1090-" + $hostName + "-tracks-" + $timeFrame + ".png");
$("#dump1090-range-link").attr("href", "dump1090-" + $hostName + "-range-" + $timeFrame + ".png");
$("#dump1090-signal-link").attr("href", "dump1090-" + $hostName + "-signal-" + $timeFrame + ".png");
$("#dump1090-cpu-link").attr("href", "dump1090-" + $hostName + "-cpu-" + $timeFrame + ".png");
$("#system-cpu-image").attr("href", "system-" + $hostName + "-cpu-" + $timeFrame + ".png");
$("#system-wlan0_bandwidth-image").attr("href", "system-" + $hostName + "-wlan0_bandwidth-" + $timeFrame + ".png");
$("#system-memory-image").attr("href", "system-" + $hostName + "-memory-" + $timeFrame + ".png");
$("#system-temperature-image").attr("href", "system-" + $hostName + "-temperature-" + $timeFrame + ".png");
$("#system-df_root-image-image").attr("href", "system-" + $hostName + "-df_root-" + $timeFrame + ".png");
$("#system-disk_io_iops-image").attr("href", "system-" + $hostName + "-disk_io_iops-" + $timeFrame + ".png");
$("#system-disk_io_octets-image").attr("href", "system-" + $hostName + "-disk_io_octets-" + $timeFrame + ".png");
// Set the button related to the selected time frame to active.
$("#btn-1h").removeClass('active');
$("#btn-6h").removeClass('active');
$("#btn-24h").removeClass('active');
$("#btn-7d").removeClass('active');
$("#btn-30d").removeClass('active');
$("#btn-365d").removeClass('active');
$("#btn-" + $timeFrame).addClass('active');
}
</script>
</body>
</html>

Wyświetl plik

@ -0,0 +1,514 @@
#!/bin/sh
renice -n 5 -p $$
## DUMP1090 GRAPHS
aircraft_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "$3 Aircraft Seen / Tracked" \
--vertical-label "Aircraft" \
--lower-limit 0 \
--units-exponent 0 \
"TEXTALIGN:center" \
"DEF:all=$2/dump1090_aircraft-recent.rrd:total:AVERAGE" \
"DEF:pos=$2/dump1090_aircraft-recent.rrd:positions:AVERAGE" \
"DEF:mlat=$2/dump1090_mlat-recent.rrd:value:AVERAGE" \
"CDEF:noloc=all,pos,-" \
"VDEF:avgac=all,AVERAGE" \
"VDEF:maxac=all,MAXIMUM" \
"AREA:all#00FF00:Aircraft Seen / Tracked, " \
"GPRINT:avgac:Average\:%3.0lf " \
"GPRINT:maxac:Maximum\:%3.0lf " \
"LINE1:pos#0000FF:w/ Positions" \
"LINE1:noloc#FF0000:w/o Positions" \
"LINE1:mlat#000000:mlat" \
--watermark "Drawn: $nowlit";
}
cpu_graph_dump1090() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "$3 CPU Utilization" \
--vertical-label "CPU %" \
--lower-limit 0 \
--upper-limit 100 \
--rigid \
"DEF:demod=$2/dump1090_cpu-demod.rrd:value:AVERAGE" \
"CDEF:demodp=demod,10,/" \
"DEF:reader=$2/dump1090_cpu-reader.rrd:value:AVERAGE" \
"CDEF:readerp=reader,10,/" \
"DEF:background=$2/dump1090_cpu-background.rrd:value:AVERAGE" \
"CDEF:backgroundp=background,10,/" \
"AREA:readerp#008000:USB" \
"AREA:backgroundp#00C000:other:STACK" \
"AREA:demodp#00FF00:demodulator:STACK" \
--watermark "Drawn: $nowlit";
}
tracks_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "$3 Tracks Seen" \
--vertical-label "tracks/hour" \
--lower-limit 0 \
--units-exponent 0 \
"DEF:all=$2/dump1090_tracks-all.rrd:value:AVERAGE" \
"DEF:single=$2/dump1090_tracks-single_message.rrd:value:AVERAGE" \
"CDEF:hall=all,3600,*" \
"CDEF:hsingle=single,3600,*" \
"AREA:hsingle#FF0000:tracks with single message" \
"AREA:hall#00FF00:unique tracks:STACK" \
--watermark "Drawn: $nowlit";
}
## SYSTEM GRAPHS
cpu_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 1110 \
--height 200 \
--step "$5" \
--title "Overall CPU Utilization" \
--vertical-label "CPU / %" \
--lower-limit 0 \
--upper-limit 100 \
--rigid \
--units-exponent 0 \
"DEF:idle=$2/cpu-idle.rrd:value:AVERAGE" \
"DEF:interrupt=$2/cpu-interrupt.rrd:value:AVERAGE" \
"DEF:nice=$2/cpu-nice.rrd:value:AVERAGE" \
"DEF:softirq=$2/cpu-softirq.rrd:value:AVERAGE" \
"DEF:steal=$2/cpu-steal.rrd:value:AVERAGE" \
"DEF:system=$2/cpu-system.rrd:value:AVERAGE" \
"DEF:user=$2/cpu-user.rrd:value:AVERAGE" \
"DEF:wait=$2/cpu-wait.rrd:value:AVERAGE" \
"CDEF:all=idle,interrupt,nice,softirq,steal,system,user,wait,+,+,+,+,+,+,+" \
"CDEF:pinterrupt=100,interrupt,*,all,/" \
"CDEF:pnice=100,nice,*,all,/" \
"CDEF:psoftirq=100,softirq,*,all,/" \
"CDEF:psteal=100,steal,*,all,/" \
"CDEF:psystem=100,system,*,all,/" \
"CDEF:puser=100,user,*,all,/" \
"CDEF:pwait=100,wait,*,all,/" \
"AREA:pinterrupt#000080:irq" \
"AREA:psoftirq#0000C0:softirq:STACK" \
"AREA:psteal#0000FF::STACK" \
"AREA:pwait#C00000:io:STACK" \
"AREA:psystem#FF0000:sys:STACK" \
"AREA:puser#40FF40:user:STACK" \
"AREA:pnice#008000:nice:STACK" \
--watermark "Drawn: $nowlit";
}
df_root_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "Disk Usage (/)" \
--vertical-label "" \
--lower-limit 0 \
"TEXTALIGN:center" \
"DEF:used=$2/df_complex-used.rrd:value:AVERAGE" \
"DEF:reserved=$2/df_complex-reserved.rrd:value:AVERAGE" \
"DEF:free=$2/df_complex-free.rrd:value:AVERAGE" \
"CDEF:totalused=used,reserved,+" \
"AREA:totalused#4169E1:used:STACK" \
"AREA:free#32C734:free:STACK" \
--watermark "Drawn: $nowlit";
}
disk_io_iops_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "Disk I/O - IOPS" \
--vertical-label "IOPS" \
"TEXTALIGN:center" \
"DEF:read=$2/disk_ops.rrd:read:AVERAGE" \
"DEF:write=$2/disk_ops.rrd:write:AVERAGE" \
"CDEF:write_neg=write,-1,*" \
"AREA:read#32CD32:Reads " \
"LINE1:read#336600" \
"GPRINT:read:MAX:Max\:%4.1lf iops" \
"GPRINT:read:AVERAGE:Avg\:%4.1lf iops" \
"GPRINT:read:LAST:Current\:%4.1lf iops\c" \
"TEXTALIGN:center" \
"AREA:write_neg#4169E1:Writes" \
"LINE1:write_neg#0033CC" \
"GPRINT:write:MAX:Max\:%4.1lf iops" \
"GPRINT:write:AVERAGE:Avg\:%4.1lf iops" \
"GPRINT:write:LAST:Current\:%4.1lf iops\c" \
"HRULE:0#000000" \
--watermark "Drawn: $nowlit";
}
disk_io_octets_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "Disk I/O - Bandwidth" \
--vertical-label "Bytes/s" \
"TEXTALIGN:center" \
"DEF:read=$2/disk_octets.rrd:read:AVERAGE" \
"DEF:write=$2/disk_octets.rrd:write:AVERAGE" \
"CDEF:write_neg=write,-1,*" \
"AREA:read#32CD32:Reads " \
"LINE1:read#336600" \
"GPRINT:read:MAX:Max\: %4.1lf %sB/sec" \
"GPRINT:read:AVERAGE:Avg\: %4.1lf %SB/sec" \
"GPRINT:read:LAST:Current\: %4.1lf %SB/sec\c" \
"TEXTALIGN:center" \
"AREA:write_neg#4169E1:Writes" \
"LINE1:write_neg#0033CC" \
"GPRINT:write:MAX:Max\: %4.1lf %sB/sec" \
"GPRINT:write:AVERAGE:Avg\: %4.1lf %SB/sec" \
"GPRINT:write:LAST:Current\: %4.1lf %SB/sec\c" \
"HRULE:0#000000" \
--watermark "Drawn: $nowlit";
}
memory_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "Memory Utilization" \
--vertical-label "" \
"TEXTALIGN:center" \
"DEF:buffered=$2/memory-buffered.rrd:value:AVERAGE" \
"DEF:cached=$2/memory-cached.rrd:value:AVERAGE" \
"DEF:free=$2/memory-free.rrd:value:AVERAGE" \
"DEF:used=$2/memory-used.rrd:value:AVERAGE" \
"AREA:used#4169E1:used:STACK" \
"AREA:buffered#32C734:buffered:STACK" \
"AREA:cached#00FF00:cached:STACK" \
"AREA:free#FFFFFF:free:STACK" \
--watermark "Drawn: $nowlit";
}
temp_graph_imperial() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "Core Temperature" \
--vertical-label "Degrees Fahrenheit" \
--lower-limit 32 \
--upper-limit 212 \
--rigid \
--units-exponent 1 \
"DEF:traw=$2/gauge-cpu_temp.rrd:value:MAX" \
"CDEF:tta=traw,1000,/" \
"CDEF:ttb=tta,1.8,*" \
"CDEF:ttc=ttb,32,+" \
"AREA:ttc#ffcc00" \
--watermark "Drawn: $nowlit";
}
temp_graph_metric() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "Core Temperature" \
--vertical-label "Degrees Celcius" \
--lower-limit 0 \
--upper-limit 100 \
--rigid \
--units-exponent 1 \
"DEF:traw=$2/gauge-cpu_temp.rrd:value:MAX" \
"CDEF:tfin=traw,1000,/" \
"AREA:tfin#ffcc00" \
--watermark "Drawn: $nowlit";
}
wlan0_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "Bandwidth Usage (wlan0)" \
--vertical-label "bytes/sec" \
"TEXTALIGN:center" \
"DEF:rx=$2/if_octets.rrd:rx:AVERAGE" \
"DEF:tx=$2/if_octets.rrd:tx:AVERAGE" \
"CDEF:tx_neg=tx,-1,*" \
"AREA:rx#32CD32:Incoming" \
"LINE1:rx#336600" \
"GPRINT:rx:MAX:Max\:%8.1lf %s" \
"GPRINT:rx:AVERAGE:Avg\:%8.1lf %S" \
"GPRINT:rx:LAST:Current\:%8.1lf %Sbytes/sec\n" \
"AREA:tx_neg#4169E1:Outgoing" \
"LINE1:tx_neg#0033CC" \
"GPRINT:tx:MAX:Max\:%8.1lf %S" \
"GPRINT:tx:AVERAGE:Avg\:%8.1lf %S" \
"GPRINT:tx:LAST:Current\:%8.1lf %Sbytes/sec\n" \
"HRULE:0#000000" \
--watermark "Drawn: $nowlit";
}
## RECEIVER GRAPHS
local_rate_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "$3 Message Rate" \
--vertical-label "messages/second" \
--lower-limit 0 \
--units-exponent 0 \
--right-axis 360:0 \
"DEF:messages=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE" \
"DEF:strong=$2/dump1090_messages-strong_signals.rrd:value:AVERAGE" \
"DEF:positions=$2/dump1090_messages-positions.rrd:value:AVERAGE" \
"CDEF:y2strong=strong,10,*" \
"CDEF:y2positions=positions,10,*" \
"LINE1:messages#0000FF:messages received" \
"AREA:y2strong#FF0000:messages >-3dBFS / hr (RHS)" \
"LINE1:y2positions#00c0FF:positions / hr (RHS)" \
--watermark "Drawn: $nowlit";
}
local_trailing_rate_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 1110 \
--height 200 \
--step "$5" \
--title "$3 Message Rate (Trailing)" \
--vertical-label "messages/second" \
--lower-limit 0 \
--units-exponent 0 \
--right-axis 360:0 \
--slope-mode \
"DEF:messages=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE" \
"DEF:a=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE:end=now-86400:start=end-86400" \
"DEF:b=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE:end=now-172800:start=end-86400" \
"DEF:c=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE:end=now-259200:start=end-86400" \
"DEF:d=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE:end=now-345600:start=end-86400" \
"DEF:e=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE:end=now-432000:start=end-86400" \
"DEF:f=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE:end=now-518400:start=end-86400" \
"DEF:g=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE:end=now-604800:start=end-86400" \
"DEF:amin=$2/dump1090_messages-local_accepted.rrd:value:MIN:end=now-86400:start=end-86400" \
"DEF:bmin=$2/dump1090_messages-local_accepted.rrd:value:MIN:end=now-172800:start=end-86400" \
"DEF:cmin=$2/dump1090_messages-local_accepted.rrd:value:MIN:end=now-259200:start=end-86400" \
"DEF:dmin=$2/dump1090_messages-local_accepted.rrd:value:MIN:end=now-345600:start=end-86400" \
"DEF:emin=$2/dump1090_messages-local_accepted.rrd:value:MIN:end=now-432000:start=end-86400" \
"DEF:fmin=$2/dump1090_messages-local_accepted.rrd:value:MIN:end=now-518400:start=end-86400" \
"DEF:gmin=$2/dump1090_messages-local_accepted.rrd:value:MIN:end=now-604800:start=end-86400" \
"DEF:amax=$2/dump1090_messages-local_accepted.rrd:value:MAX:end=now-86400:start=end-86400" \
"DEF:bmax=$2/dump1090_messages-local_accepted.rrd:value:MAX:end=now-172800:start=end-86400" \
"DEF:cmax=$2/dump1090_messages-local_accepted.rrd:value:MAX:end=now-259200:start=end-86400" \
"DEF:dmax=$2/dump1090_messages-local_accepted.rrd:value:MAX:end=now-345600:start=end-86400" \
"DEF:emax=$2/dump1090_messages-local_accepted.rrd:value:MAX:end=now-432000:start=end-86400" \
"DEF:fmax=$2/dump1090_messages-local_accepted.rrd:value:MAX:end=now-518400:start=end-86400" \
"DEF:gmax=$2/dump1090_messages-local_accepted.rrd:value:MAX:end=now-604800:start=end-86400" \
"DEF:strong=$2/dump1090_messages-strong_signals.rrd:value:AVERAGE" \
"DEF:positions=$2/dump1090_messages-positions.rrd:value:AVERAGE" \
"CDEF:y2strong=strong,10,*" \
"CDEF:y2positions=positions,10,*" \
"SHIFT:a:86400" \
"SHIFT:b:172800" \
"SHIFT:c:259200" \
"SHIFT:d:345600" \
"SHIFT:e:432000" \
"SHIFT:f:518400" \
"SHIFT:g:604800" \
"SHIFT:amin:86400" \
"SHIFT:bmin:172800" \
"SHIFT:cmin:259200" \
"SHIFT:dmin:345600" \
"SHIFT:emin:432000" \
"SHIFT:fmin:518400" \
"SHIFT:gmin:604800" \
"SHIFT:amax:86400" \
"SHIFT:bmax:172800" \
"SHIFT:cmax:259200" \
"SHIFT:dmax:345600" \
"SHIFT:emax:432000" \
"SHIFT:fmax:518400" \
"SHIFT:gmax:604800" \
"CDEF:7dayaverage=a,b,c,d,e,f,g,+,+,+,+,+,+,7,/" \
"CDEF:min1=amin,bmin,MIN" \
"CDEF:min2=cmin,dmin,MIN" \
"CDEF:min3=emin,fmin,MIN" \
"CDEF:min4=min1,min2,MIN" \
"CDEF:min5=min3,gmin,MIN" \
"CDEF:min=min4,min5,MIN" \
"CDEF:max1=amax,bmax,MAX" \
"CDEF:max2=cmax,dmax,MAX" \
"CDEF:max3=emax,fmax,MAX" \
"CDEF:max4=max1,max2,MAX" \
"CDEF:max5=max3,gmax,MAX" \
"CDEF:max=max4,max5,MAX" \
"CDEF:maxarea=max,min,-" \
"LINE1:min#FFFF99:mins" \
"AREA:maxarea#FFFF99:max:STACK" \
"LINE1:7dayaverage#00FF00:7 day average" \
"AREA:y2strong#FF0000:messages >-3dBFS / hr (RHS)" \
"LINE1:y2positions#00c0FF:positions / hr (RHS)" \
"LINE1:messages#0000FF:messages received" \
--watermark "Drawn: $nowlit";
}
range_graph_imperial(){
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "$3 Max Range" \
--vertical-label "miles" \
--lower-limit 0 \
--units-exponent 0 \
"DEF:rangem=$2/dump1090_range-max_range.rrd:value:MAX" \
"CDEF:rangekm=rangem,1000,/" \
"CDEF:rangeml=rangekm,0.621371192,*" \
"LINE1:rangeml#0000FF:max range" \
--watermark "Drawn: $nowlit";
}
range_graph_metric() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "$3 Max Range" \
--vertical-label "kilometers" \
--lower-limit 0 \
--units-exponent 0 \
"DEF:rangem=$2/dump1090_range-max_range.rrd:value:MAX" \
"CDEF:range=rangem,0.001,*" \
"LINE1:range#0000FF:max range" \
--watermark "Drawn: $nowlit";
}
signal_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "$3 Signal Level" \
--vertical-label "dBFS" \
--upper-limit 2 \
--lower-limit -15 \
--rigid \
--units-exponent 0 \
"TEXTALIGN:center" \
"DEF:signal=$2/dump1090_dbfs-signal.rrd:value:AVERAGE" \
"DEF:peak=$2/dump1090_dbfs-peak_signal.rrd:value:AVERAGE" \
"CDEF:us=signal,UN,-100,signal,IF" \
"AREA:-100#00FF00:Mean Level\\:" \
"AREA:us#FFFFFF" \
"GPRINT:signal:AVERAGE:%4.1lf" \
"LINE1:peak#0000FF:Peak Level\\:" \
"GPRINT:peak:MAX:%4.1lf" \
"LINE1:0#000000:Zero dBFS" \
"LINE1:-3#FF0000:-3 dBFS" \
--watermark "Drawn: $nowlit";
}
## HUB GRAPHS
remote_rate_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "$3 Message Rate" \
--vertical-label "messages/second" \
--lower-limit 0 \
--units-exponent 0 \
--right-axis 360:0 \
"DEF:messages=$2/dump1090_messages-remote_accepted.rrd:value:AVERAGE" \
"DEF:positions=$2/dump1090_messages-positions.rrd:value:AVERAGE" \
"CDEF:y2positions=positions,10,*" \
"LINE1:messages#0000FF:messages received" \
"LINE1:y2positions#00c0FF:position / hr (RHS)" \
--watermark "Drawn: $nowlit";
}
dump1090_graphs() {
aircraft_graph /var/www/html/collectd/dump1090-$2-aircraft-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
cpu_graph_dump1090 /var/www/html/collectd/dump1090-$2-cpu-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
tracks_graph /var/www/html/collectd/dump1090-$2-tracks-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
}
system_graphs() {
cpu_graph /var/www/html/collectd/system-$2-cpu-$4.png /var/lib/collectd/rrd/$1/aggregation-cpu-average "$3" "$4" "$5"
df_root_graph /var/www/html/collectd/system-$2-df_root-$4.png /var/lib/collectd/rrd/$1/df-root "$3" "$4" "$5"
disk_io_iops_graph /var/www/html/collectd/system-$2-disk_io_iops-$4.png /var/lib/collectd/rrd/$1/disk-mmcblk0 "$3" "$4" "$5"
disk_io_octets_graph /var/www/html/collectd/system-$2-disk_io_octets-$4.png /var/lib/collectd/rrd/$1/disk-mmcblk0 "$3" "$4" "$5"
memory_graph /var/www/html/collectd/system-$2-memory-$4.png /var/lib/collectd/rrd/$1/memory "$3" "$4" "$5"
temp_graph_imperial /var/www/html/collectd/system-$2-temperature-$4.png /var/lib/collectd/rrd/$1/table-$2 "$3" "$4" "$5"
#temp_graph_metric /var/www/html/collectd/system-$2-temperature-$4.png /var/lib/collectd/rrd/$1/table-$2 "$3" "$4" "$5"
wlan0_graph /var/www/html/collectd/system-$2-wlan0_bandwidth-$4.png /var/lib/collectd/rrd/$1/interface-wlan0 "$3" "$4" "$5"
}
dump1090_receiver_graphs() {
dump1090_graphs "$1" "$2" "$3" "$4" "$5"
system_graphs "$1" "$2" "$3" "$4" "$5"
local_rate_graph /var/www/html/collectd/dump1090-$2-local_rate-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
local_trailing_rate_graph /var/www/html/collectd/dump1090-$2-local_trailing_rate-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
range_graph_imperial /var/www/html/collectd/dump1090-$2-range-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
#range_graph_metric /var/www/html/collectd/dump1090-$2-range-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
signal_graph /var/www/html/collectd/dump1090-$2-signal-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
}
dump1090_hub_graphs() {
dump1090_graphs "$1" "$2" "$3" "$4" "$5"
system_graphs "$1" "$2" "$3" "$4" "$5"
remote_rate_graph /var/www/html/collectd/dump1090-$2-remote_rate-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
}
period="$1"
step="$2"
nowlit=`date '+%m/%d/%y %H:%M %Z'`;
dump1090_receiver_graphs localhost localhost "ADS-B" "$period" "$step"
#hub_graphs localhost rpi "ADS-B" "$period" "$step"

380
install.sh 100755
Wyświetl plik

@ -0,0 +1,380 @@
#!/bin/bash
#####################################################################################
# ADS-B FEEDER #
#####################################################################################
# #
# A set of scripts created to automate the process of installing the software #
# needed to setup a Mode S decoder as well as feeders which are capable of #
# sharing your ADS-B results with many of the most popular ADS-B aggregate sites. #
# #
# Project Hosted On GitHub: https://github.com/jprochazka/adsb-feeder #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (c) 2015 Joseph A. Prochazka #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
SCRIPTDIR=${PWD}
## FUNCTIONS
# Function used to check if a package is install and if not install it.
function CheckPackage(){
printf "\e[33mChecking if the package $1 is installed..."
if [ $(dpkg-query -W -f='${Status}' $1 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo -e "\033[31m [NOT INSTALLED]\033[37m"
echo -e "\033[33mInstalling the package $1..."
echo -e "\033[37m"
sudo apt-get install -y $1;
echo ""
echo -e "\033[33mThe package $1 has been installed."
else
echo -e "\033[32m [OK]\033[37m"
fi
}
clear
## DISPLAY INSTALLATION OPTIONS
echo -e "\033[31m"
echo "##################################"
echo " ADS-B Feeder Installation "
echo "##################################"
echo -e "\033[33m"
echo " MODE S DECODER SELECTION"
echo ""
echo "It is recommended that dump1090-mutability be selected as your mode s decoder."
echo "However you are more than welcome to choose to install the MalcolmRobb version is you so desire."
echo "If the MalcolmRobb version is selected not all installation features will be available to you."
echo ""
echo "Dump1090 (mutability): https://github.com/mutability/dump1090"
echo "Dump1090 (MalcolmRobb): https://github.com/MalcolmRobb/dump1090"
echo ""
echo " 1) Dump1090 (mutability)"
echo " 2) Dump1090 (MalcolmRobb)"
echo " 3) Exit"
echo -e "\033[37m"
read -r -p "Choose an installation option. [1] " DECODER
# If option 3 (Exit) was selected exit this script.
if [[ $DECODER == '3' ]]; then
clear
echo ""
echo "Installation exited."
echo ""
exit
fi
clear
echo -e "\033[31m"
echo "##################################"
echo " ADS-B Feeder Installation "
echo "##################################"
echo -e "\033[33m"
echo " DATA SHARING OPTIONS"
echo ""
echo "Please select the site with which you wish to share the data collected by your new ADS-B feeder."
echo "This script will setup the software needed to feed the selected sites during this installation."
echo ""
echo "FlightAware: http://flightaware.com/"
echo "Plane Finder: https://planefinder.net"
echo "ADS-B Exchange: http://adsbexchange.com/"
echo ""
echo " 1) Share data with FlightAware."
echo " 2) Share data with Plane Finder."
echo " 3) Share data with FlightAware and Plane Finder."
echo " 4) Share data with FlightAware and ADS-B Exchange."
echo " 5) Share data with FlightAware, Plane Finder and ADS-B Exchange."
echo " 6) Do not share data with any external sites."
echo " 7) Exit"
echo -e "\033[37m"
read -r -p "Choose an installation option. [1] " FEED
# If option 7 (Exit) was selected exit this script.
if [[ $FEED == '7' ]]; then
clear
echo ""
echo "Installation exited."
echo ""
exit
fi
clear
# If the MalcolmRobb version of Dump1090 was selected skip additional features.
if [[ $DECODER != '2' ]]; then
echo -e "\033[31m"
echo "##################################"
echo " ADS-B Feeder Installation "
echo "##################################"
echo -e "\033[33m"
echo " ADDITIONAL FEATURES"
echo ""
echo "This script is capable of installing a few additional features of it's own."
echo "Below is a list of additional features currently available for installation by this script."
echo "Look for more features to be added in the near future!"
echo ""
echo "The ADS-B Feeder Project: https://github.com/jprochazka/adsb-feeder"
echo ""
echo " 1) Install web based performance graphs."
echo " 2) Do not install any additional features."
echo " 3) Exit"
echo -e "\033[37m"
read -r -p "Choose an installation option. [1] " FEATURES
# If option 3 (Exit) was selected exit this script.
if [[ $FEATURES == '3' ]]; then
clear
echo ""
echo "Installation exited."
echo ""
exit
fi
clear
fi
## EXPLAIN WHAT IS TO BE DONE
echo -e "\033[31m"
echo "-------------------------------------"
echo " Installation is now ready to begin."
echo "-------------------------------------"
echo -e "\033[33mThe following will be installed or configured on this system."
echo ""
if [[ $DECODER == '' ]] || [[ $DECODER == '1' ]]; then echo " Dump 1090 (mutability): https://github.com/mutability/dump1090"; fi
if [[ $DECODER == '2' ]]; then echo " Dump 1090 (MalcolmRobb): https://github.com/MalcolmRobb/dump1090"; fi
if [[ $FEED == '' ]] || [[ $FEED == '1' ]] || [[ $FEED == '3' ]] || [[ $FEED == '4' ]] || [[ $FEED == '5' ]]; then echo " PiAware by FlightAware: https://github.com/flightaware/piaware"; fi
if [[ $FEED == '2' ]] || [[ $FEED == '3' ]] || [[ $FEED == '5' ]]; then echo " Plane Finder ADS-B Client: https://planefinder.net/sharing/client"; fi
if [[ $FEED == '4' ]] || [[ $FEED == '5' ]]; then echo " ADS-B Exchange via PiAware: http://www.adsbexchange.com/how-to-feed/"; fi
if [[ $FEATURES == '' ]] || [[ $FEATURES == "1" ]]; then echo " Collectd Graphs for Dump1090: https://github.com/jprochazka/adsb-feeder"; fi
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
clear
BUILDDIR="$SCRIPTDIR/build"
## GET THE LATEST LISTS OF PACKAGES AVAILABLE IN REPOSITORIES AND PPAS
echo -e "\033[33m"
echo "Downloading latest package lists for enabled repositories and PPAs..."
echo -e "\033[37m"
sudo apt-get update
clear
## ASK IF THE USER WISHES TO UPDATE THIER SYSTEM AT THIS TIME
echo -e "\033[31m"
echo "-------------------------------------"
echo " Check for system updates."
echo "-------------------------------------"
echo -e "\033[33mIt is recommended that you update your system before continuing the installation."
echo "This script can do this for you at this time if you like."
echo -e "\033[37m"
read -p "Update system before continuing installation? [Y/n] " UPDATE
if [[ ! $UPDATE =~ ^[Nn]$ ]]; then
## UPDATE INSTALLED PACKAGES
# Install any available updates using the command apt-get update.
echo -e "\033[33m"
echo "Downloading and installing the latest updates for your operating system..."
echo -e "\033[37m"
sudo apt-get -y upgrade
echo -e "\033[33m"
echo "Your system should now be up to date."
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
## UPDATE THIS RASPBERRY PI FIRMWARE IF THE USER APPROVES THIS STEP
if [[ `uname -m` == "armv7l" ]]; then
clear
# Ask the user if this is running on a Raspberry Pi and if so do they want to update it's firmware.
echo -e "\033[31m"
echo "-------------------------------------"
echo " Check for firmware updates."
echo "-------------------------------------"
echo -e "\033[33mIf this is a Raspberry Pi this script can update the firmware now as well."
echo "If you choose to update your Raspberry Pi firmware this script will check for the existance"
echo "of the package rpi-update and install it if it is not install already. After confirming that"
echo "rpi-update is installed it will be used to update your firmware."
echo -e "\033[37m"
read -p "Is this a Raspberry Pi and if so do you want to update the firmware now? [y/N] " FIRMWARE
# If the user chose yes check for and install the package rpi-update and use it to update this devices firmware.
if [[ $FIRMWARE =~ ^[Yy]$ ]]; then
CheckPackage rpi-update
echo -e "\033[33m"
echo "Updating Raspberry Pi firmware..."
echo -e "\033[37m"
sudo rpi-update
echo -e "\033[33m"
echo "Your Raspberry Pi firmware is now up to date."
echo "If in fact your firmware was update it is recommended that you restart your device now."
echo "After the reboot execute this script again to enter the installation process once more."
echo -e "\033[37m"
read -p "Would you like to reboot your device now? [y/N] " REBOOT
if [[ $REBOOT =~ ^[Yy]$ ]]; then
sudo reboot
fi
fi
fi
fi
clear
#####################
## MODE S DECODERS
##
## INSTALL DUMP1090-MUTABILITY
if [[ $DECODER == '' ]] || [[ $DECODER == '1' ]]; then
cd $BUILDDIR
echo -e "\033[33mExecuting the dump1090-mutability installation script..."
echo -e "\033[37m"
chmod 755 $SCRIPTDIR/bash/decoders/dump1090-mutability.sh
$SCRIPTDIR/bash/decoders/dump1090-mutability.sh
clear
fi
## INSTALL DUMP1090-MALCOLMROBB
if [[ $DECODER == '2' ]]; then
cd $BUILDDIR
echo -e "\033[33mExecuting the dump1090-MalcolmRobb installation script..."
echo -e "\033[37m"
chmod 755 $SCRIPTDIR/bash/decoders/dump1090-malcolmrobb.sh
$SCRIPTDIR/bash/decoders/dump1090-malcolmrobb.sh
clear
fi
clear
##################
## SITE FEEDERS
##
## INSTALL PIAWARE
if [[ $FEED == '' ]] || [[ $FEED == '1' ]] || [[ $FEED == '3' ]] || [[ $FEED == '4' ]] || [[ $FEED == '5' ]]; then
cd $BUILDDIR
echo -e "\033[33mExecuting the PiAware installation script..."
echo -e "\033[37m"
chmod 755 $SCRIPTDIR/bash/feeders/piaware.sh
$SCRIPTDIR/bash/feeders/piaware.sh
fi
## INSTALL THE PLANE FINDER ADS-B CLIENT
if [[ $FEED == '2' ]] || [[ $FEED == '3' ]] || [[ $FEED == '5' ]]; then
cd $BUILDDIR
echo -e "\033[33mExecuting the Plane Finder ADS=B Client installation script..."
echo -e "\033[37m"
chmod 755 $SCRIPTDIR/bash/feeders/planefinder.sh
$SCRIPTDIR/bash/feeders/planefinder.sh
fi
## FEED ADS-B EXCHANGE USING PIAWARE
if [[ $FEED == '4' ]] || [[ $FEED == '5' ]]; then
cd $BUILDDIR
echo -e "\033[33mExecuting the ADS-B Exchange installation script..."
echo -e "\033[37m"
chmod 755 $SCRIPTDIR/bash/feeders/adsbexchange.sh
$SCRIPTDIR/bash/feeders/adsbexchange.sh
fi
#########################
## ADDITIONAL FEATURES
##
## INSTALL AND CONFIGURE COLLECTD AND GRAPH MAKER
if [[ $FEATURES == '' ]] || [[ $FEATURES == '1' ]]; then
cd $BUILDDIR
echo -e "\033[33mExecuting the collectd installation script..."
echo -e "\033[37m"
chmod 755 $SCRIPTDIR/bash/features/collectd.sh
$SCRIPTDIR/bash/features/collectd.sh
clear
fi
## SAY GOODBYE AND EXIT THE SCRIPT
cd $PWD
clear
echo -e "\033[31m"
echo "##################################"
echo " ADS-B Feeder Installation "
echo "##################################"
echo -e "\033[33m"
echo " INSTALLATION COMPLETE"
echo ""
echo "I hope you enjoyed using this software to install and configure your new or revialized ADS-B feeder."
echo "If you ran into any issues using this script feel free to report them on the project site hosted on GitHub."
echo ""
echo "https://github.com/jprochazka/adsb-feeder."
echo ""
echo "Good luck and happy tracking!"
echo -e "\033[37m"
read -p "Press enter to continue..." CONTINUE
clear
exit