kopia lustrzana https://github.com/jprochazka/adsb-receiver
Updating and integrating RTL-SDR OGN script.
rodzic
4fc71c1917
commit
98d9051ff9
|
|
@ -31,37 +31,138 @@
|
||||||
# #
|
# #
|
||||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||||
|
|
||||||
### VARIABLES
|
## INCLUDE EXTERNAL SCRIPTS
|
||||||
|
|
||||||
PROJECTROOTDIRECTORY="$PWD"
|
source $RECEIVER_BASH_DIRECTORY/variables.sh
|
||||||
BASHDIRECTORY="$PROJECTROOTDIRECTORY/bash"
|
source $RECEIVER_BASH_DIRECTORY/functions.sh
|
||||||
BUILDDIRECTORY="$PROJECTROOTDIRECTORY/build"
|
|
||||||
BUILDDIRECTORY_RTLSDROGN="$BUILDDIRECTORY/rtlsdr-ogn"
|
|
||||||
|
|
||||||
DECODER_NAME="RTLSDR-OGN"
|
# Source the automated install configuration file if this is an automated installation.
|
||||||
DECODER_WEBSITE="http://wiki.glidernet.org"
|
if [ $RECEIVER_AUTOMATED_INSTALL -eq "true" ]; then
|
||||||
|
source $RECEIVER_CONFIGURATION_FILE
|
||||||
### INCLUDE EXTERNAL SCRIPTS
|
|
||||||
|
|
||||||
source $BASHDIRECTORY/variables.sh
|
|
||||||
source $BASHDIRECTORY/functions.sh
|
|
||||||
|
|
||||||
### BEGIN SETUP
|
|
||||||
|
|
||||||
clear
|
|
||||||
|
|
||||||
echo "http://wiki.glidernet.org"
|
|
||||||
echo ""
|
|
||||||
echo -e "\033[31mBEFORE CONTINUING:\033[33m"
|
|
||||||
echo "RTLSDR-OGN requires it's own dedicated dongle."
|
|
||||||
echo ""
|
|
||||||
echo -e "\033[37m"
|
|
||||||
if [[ ! -z ${VERBOSE} ]] ; then
|
|
||||||
read -p "Press enter to continue..." CONTINUE
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### CHECK FOR PREREQUISITE PACKAGES
|
## BEGIN SETUP
|
||||||
|
|
||||||
|
if [ $RECEIVER_AUTOMATED_INSTALL -eq "false" ]; then
|
||||||
|
clear
|
||||||
|
echo -e "\n\e[91m $RECEIVER_PROJECT_TITLE"
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
echo -e "\e[92m Setting up RTL-SDR OGN..."
|
||||||
|
echo -e "\e[93m----------------------------------------------------------------------------------------------------\e[96m"
|
||||||
|
echo ""
|
||||||
|
if [ $RECEIVER_AUTOMATED_INSTALL -eq "false" ]; then
|
||||||
|
whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "RTL-SDR OGN Setup" --yesno "The objective of the Open Glider Network is to create and maintain a unified tracking platform for gliders and other GA aircraft. Currently OGN focuses on tracking aircraft equipped with FLARM, FLARM-compatible devices or OGN tracker.\n\nPlease note you will need a dedicated RTL-SDR dongle to use this software.\n\n http://wiki.glidernet.org\n\nContinue setup by installing RTL-SDR OGN?" 14 78
|
||||||
|
if [ $? -eq 1 ]; then
|
||||||
|
# Setup has been halted by the user.
|
||||||
|
echo -e "\e[91m \e[5mINSTALLATION HALTED!\e[25m"
|
||||||
|
echo -e " Setup has been halted at the request of the user."
|
||||||
|
echo ""
|
||||||
|
echo -e "\e[93m----------------------------------------------------------------------------------------------------"
|
||||||
|
echo -e "\e[92m RTL-SDR OGN setup halted.\e[39m"
|
||||||
|
echo ""
|
||||||
|
read -p "Press enter to continue..." CONTINUE
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
## ASK FOR DEVICE ASSIGNMENTS
|
||||||
|
|
||||||
|
# Check if the dump1090-mutability package is installed.
|
||||||
|
echo -e "\e[95m Checking for the existance of existing decoders...\e[97m"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Check if the dump1090-mutability package is installed.
|
||||||
|
echo -e "\e[94m Checking if the dump1090-mutability package is installed...\e[97m"
|
||||||
|
if [ $(dpkg-query -W -f='${STATUS}' dump1090-mutability 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
|
||||||
|
DUMP1090_IS_INSTALLED="true"
|
||||||
|
else
|
||||||
|
DUMP1090_IS_INSTALLED="false"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if the dump978 binaries exist.
|
||||||
|
echo -e "\e[94m Checking if the dump978 binaries exist on this device...\e[97m"
|
||||||
|
if [ -f $RECIEVER_BUILD_DIRECTORY/dump978/dump978 ] && [ -f $RECIEVER_BUILD_DIRECTORY/dump978/uat2text ] && [ -f $RECIEVER_BUILD_DIRECTORY/dump978/uat2esnt ] && [ -f $RECIEVER_BUILD_DIRECTORY/dump978/uat2json ]; then
|
||||||
|
DUMP978_IS_INSTALLED="true"
|
||||||
|
else
|
||||||
|
DUMP978_IS_INSTALLED="false"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If either dump1090 or dump978 is installed we must assign RTL-SDR dongles for each of these decoders.
|
||||||
|
if [ $DUMP1090_IS_INSTALLED -eq "true" ] || [ $DUMP978_IS_INSTALLED -eq "true" ]; then
|
||||||
|
if [ $DUMP1090_IS_INSTALLED -eq "true" ]; then
|
||||||
|
# The dump1090-mutability package appear to be installed.
|
||||||
|
if [ $RECEIVER_AUTOMATED_INSTALL -eq "false" ]; then
|
||||||
|
# Ask the user which USB device is to be used for dump1090.
|
||||||
|
DUMP1090_USB_DEVICE=$(whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "Dump1090 RTL-SDR Dongle" --nocancel --inputbox "\nEnter the ID for your dump1090 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
|
||||||
|
while [ -z $DUMP1090_USB_DEVICE ]; do
|
||||||
|
DUMP1090_USB_DEVICE=$(whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "Dump1090 RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the ID for your dump1090 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
|
||||||
|
done
|
||||||
|
else
|
||||||
|
|
||||||
|
### GET DONGLE ID FROM THE INSTALLATION CONFIGURATION FILE...
|
||||||
|
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ $DUMP978_IS_INSTALLED -eq "true" ]; then
|
||||||
|
# The dump978 binaries appear to exist on this device.
|
||||||
|
if [ $RECEIVER_AUTOMATED_INSTALL -eq "false" ]; then
|
||||||
|
# Ask the user which USB device is to be use for dump978.
|
||||||
|
DUMP978_USB_DEVICE=$(whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "Dump978 RTL-SDR Dongle" --nocancel --inputbox "\nEnter the ID for your dump978 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
|
||||||
|
while [ -z $DUMP978_USB_DEVICE ]; do
|
||||||
|
DUMP978_USB_DEVICE=$(whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "Dump978 RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the ID for your dump978 RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
|
||||||
|
done
|
||||||
|
else
|
||||||
|
|
||||||
|
### GET DONGLE ID FROM THE INSTALLATION CONFIGURATION FILE...
|
||||||
|
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $RECEIVER_AUTOMATED_INSTALL -eq "false" ]; then
|
||||||
|
# Ask the user which USB device is to be use for RTL-SDR OGN.
|
||||||
|
RTLSDROGN_USB_DEVICE=$(whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "RTL-SDR OGN RTL-SDR Dongle" --nocancel --inputbox "\nEnter the ID for your RTL-SDR OGN RTL-SDR dongle." 8 78 3>&1 1>&2 2>&3)
|
||||||
|
while [ -z $DUMP978_USB_DEVICE ]; do
|
||||||
|
RTLSDROGN_USB_DEVICE=$(whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "RTL-SDR OGN RTL-SDR Dongle (REQUIRED)" --nocancel --inputbox "\nEnter the ID for your RTL-SDR OGN RTL-SDR dongle." 8 78 3>&1 $
|
||||||
|
done
|
||||||
|
else
|
||||||
|
|
||||||
|
### GET DONGLE ID FROM THE INSTALLATION CONFIGURATION FILE...
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Assign the specified RTL-SDR dongle to dump1090.
|
||||||
|
if [ $DUMP1090_IS_INSTALLED -eq "true" ]; then
|
||||||
|
echo -e "\e[94m Assigning RTL-SDR dongle \"DUMP1090_USB_DEVICE\" to dump1090-mutability...\e[97m"
|
||||||
|
ChangeConfig "DEVICE" $DUMP1090_USB_DEVICE "/etc/default/dump1090-mutability"
|
||||||
|
echo -e "\e[94m Reloading dump1090-mutability...\e[97m"
|
||||||
|
echo ""
|
||||||
|
sudo /etc/init.d/dump1090-mutability force-reload
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Assign the specified RTL-SDR dongle to dump978
|
||||||
|
if [ $DUMP978_IS_INSTALLED -eq "true" ]; then
|
||||||
|
echo -e "\e[94m Assigning RTL-SDR dongle \"$DUMP978_USB_DEVICE\" to dump978...\e[97m"
|
||||||
|
|
||||||
|
### ADD DEVICE TO MAINTENANCE SCRIPT...
|
||||||
|
|
||||||
|
### KILL EXISTING DUMP978 PROCESSES...
|
||||||
|
|
||||||
|
### RESTART DUMP978...
|
||||||
|
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
### ASSIGN RTL-SDR DONGLE FOR RTL-SDR OGN...
|
||||||
|
|
||||||
|
|
||||||
|
## CHECK FOR PREREQUISITE PACKAGES
|
||||||
|
|
||||||
|
echo -e "\e[95m Installing packages needed to fulfill dependencies...\e[97m"
|
||||||
|
echo ""
|
||||||
CheckPackage git
|
CheckPackage git
|
||||||
CheckPackage rtl-sdr
|
CheckPackage rtl-sdr
|
||||||
CheckPackage librtlsdr-dev
|
CheckPackage librtlsdr-dev
|
||||||
|
|
@ -76,63 +177,99 @@ CheckPackage telnet
|
||||||
CheckPackage wget
|
CheckPackage wget
|
||||||
CheckPackage lynx
|
CheckPackage lynx
|
||||||
|
|
||||||
### BLACKLIST UNWANTED RTL-SDR MODULES FROM BEING LOADED
|
echo -e "\e[95m Configuring this device to run the RTL-SDR OGN binaries...\e[97m"
|
||||||
|
echo ""
|
||||||
|
|
||||||
echo -e "\033[33mStopping unwanted kernel modules from being loaded..."
|
## BLACKLIST UNWANTED RTL-SDR MODULES FROM BEING LOADED
|
||||||
echo -e "\033[37m"
|
|
||||||
sudo tee /etc/modprobe.d/rtlsdr-blacklist.conf > /dev/null <<EOF
|
echo -e "\e[94m Stopping unwanted kernel modules from being loaded...\e[97m"
|
||||||
blacklist dvb_usb_rtl28xxu
|
if [ ! -f /etc/modprobe.d/rtlsdr-blacklist.conf ]; then
|
||||||
blacklist dvb_usb_v2
|
echo -e "\e[94m Stopping unwanted kernel modules from being loaded...\e[97m"
|
||||||
blacklist rtl_2830
|
sudo tee /etc/modprobe.d/rtlsdr-blacklist.conf > /dev/null <<EOF
|
||||||
blacklist rtl_2832
|
blacklist dvb_usb_rtl28xxu
|
||||||
blacklist r820t
|
blacklist dvb_usb_v2
|
||||||
blacklist rtl2830
|
blacklist rtl_2830
|
||||||
blacklist rtl2832
|
blacklist rtl_2832
|
||||||
|
blacklist r820t
|
||||||
|
blacklist rtl2830
|
||||||
|
blacklist rtl2832
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
### CHECK FOR EXISTING INSTALL AND IF SO STOP IT
|
## CHECK FOR EXISTING INSTALL AND IF SO STOP IT
|
||||||
|
|
||||||
if [[ -f /etc/init.d/rtlsdr-ogn ]] ; then
|
if [ -f /etc/init.d/rtlsdr-ogn ] ; then
|
||||||
|
echo -e "\e[94m Stopping the RTL-SDR OGN service...\e[97m"
|
||||||
sudo service rtlsdr-ogn stop
|
sudo service rtlsdr-ogn stop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### DOWNLOAD AND SET UP THE BINARIES
|
### DOWNLOAD AND SET UP THE BINARIES
|
||||||
|
|
||||||
# Create build directory if not already present.
|
# Create build directory if not already present.
|
||||||
if [[ ! -d ${BUILDDIRECTORY_RTLSDROGN} ]] ; then
|
if [ ! -d $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn ] ; then
|
||||||
mkdir ${BUILDDIRECTORY_RTLSDROGN}
|
echo -e "\e[94m Creating the directory ($RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn)...\e[97m"
|
||||||
|
mkdir $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn
|
||||||
fi
|
fi
|
||||||
cd ${BUILDDIRECTORY_RTLSDROGN}
|
|
||||||
|
# Enter the RTL-SDR OGN build directory.
|
||||||
|
echo -e "\e[94m Entering the directory ($RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn)...\e[97m"
|
||||||
|
cd $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn
|
||||||
|
|
||||||
# Download and extract the proper binaries.
|
# Download and extract the proper binaries.
|
||||||
case `uname -m` in
|
case `uname -m` in
|
||||||
"armv6l")
|
"armv6l")
|
||||||
# Raspberry Pi 1
|
# Raspberry Pi 1
|
||||||
wget http://download.glidernet.org/rpi-gpu/rtlsdr-ogn-bin-RPI-GPU-latest.tgz -O $BUILDDIRECTORY_RTLSDROGN/rtlsdr-ogn-bin-RPI-GPU-latest.tgz
|
echo -e "\e[94m Downloading the latest RTL-SDR OGN RPI-GPU binaries...\e[97m"
|
||||||
tar xvzf rtlsdr-ogn-bin-RPI-GPU-latest.tgz -C $BUILDDIRECTORY_RTLSDROGN
|
echo ""
|
||||||
|
wget http://download.glidernet.org/rpi-gpu/rtlsdr-ogn-bin-RPI-GPU-latest.tgz -O $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn/rtlsdr-ogn-bin-RPI-GPU-latest.tgz
|
||||||
|
echo ""
|
||||||
|
echo -e "\e[94m Extracting the latest RTL-SDR OGN RPI-GPU binaries from the archive...\e[97m"
|
||||||
|
echo ""
|
||||||
|
tar xvzf rtlsdr-ogn-bin-RPI-GPU-latest.tgz -C $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn
|
||||||
;;
|
;;
|
||||||
"armv7l")
|
"armv7l")
|
||||||
# Raspberry Pi 2
|
# Raspberry Pi 2
|
||||||
wget http://download.glidernet.org/arm/rtlsdr-ogn-bin-ARM-latest.tgz -O $BUILDDIRECTORY_RTLSDROGN/rtlsdr-ogn-bin-ARM-latest.tgz
|
echo -e "\e[94m Downloading the latest RTL-SDR OGN ARM binaries...\e[97m"
|
||||||
tar xvzf rtlsdr-ogn-bin-ARM-latest.tgz -C $BUILDDIRECTORY_RTLSDROGN
|
echo ""
|
||||||
|
wget http://download.glidernet.org/arm/rtlsdr-ogn-bin-ARM-latest.tgz -O $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn/rtlsdr-ogn-bin-ARM-latest.tgz
|
||||||
|
echo ""
|
||||||
|
echo -e "\e[94m Extracting the latest RTL-SDR OGN ARM binaries from the archive...\e[97m"
|
||||||
|
echo ""
|
||||||
|
tar xvzf rtlsdr-ogn-bin-ARM-latest.tgz -C $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn
|
||||||
;;
|
;;
|
||||||
"x86_64")
|
"x86_64")
|
||||||
# 64 Bit
|
# 64 Bit
|
||||||
wget http://download.glidernet.org/x64/rtlsdr-ogn-bin-x64-latest.tgz -O $BUILDDIRECTORY_RTLSDROGN/rtlsdr-ogn-bin-x64-latest.tgz
|
echo -e "\e[94m Downloading the latest RTL-SDR OGN x64 binaries...\e[97m"
|
||||||
tar xvzf rtlsdr-ogn-bin-x64-latest.tgz -C $BUILDDIRECTORY_RTLSDROGN
|
echo ""
|
||||||
|
wget http://download.glidernet.org/x64/rtlsdr-ogn-bin-x64-latest.tgz -O $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn/rtlsdr-ogn-bin-x64-latest.tgz
|
||||||
|
echo ""
|
||||||
|
echo -e "\e[94m Extracting the latest RTL-SDR OGN x64 binaries from the archive...\e[97m"
|
||||||
|
echo ""
|
||||||
|
tar xvzf rtlsdr-ogn-bin-x64-latest.tgz -C $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# 32 Bit (default install if no others matched)
|
# 32 Bit (default install if no others matched)
|
||||||
wget http://download.glidernet.org/x86/rtlsdr-ogn-bin-x86-latest.tgz -O $BUILDDIRECTORY_RTLSDROGN/rtlsdr-ogn-bin-x86-latest.tgz
|
echo -e "\e[94m Downloading the latest RTL-SDR OGN x86 binaries...\e[97m"
|
||||||
tar xvzf rtlsdr-ogn-bin-x86-latest.tgz -C $BUILDDIRECTORY_RTLSDROGN
|
echo ""
|
||||||
|
wget http://download.glidernet.org/x86/rtlsdr-ogn-bin-x86-latest.tgz -O $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn/rtlsdr-ogn-bin-x86-latest.tgz
|
||||||
|
echo ""
|
||||||
|
echo -e "\e[94m Extracting the latest RTL-SDR OGN x86 binaries from the archive...\e[97m"
|
||||||
|
echo ""
|
||||||
|
tar xvzf rtlsdr-ogn-bin-x86-latest.tgz -C $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Enter the directory containing the binaries that were downloaded.
|
||||||
|
echo ""
|
||||||
|
echo -e "\e[94m Entering the directory containing the RTL-SDR binaries...\e[97m"
|
||||||
|
cd $RECEIVER_BUILD_DIRECTORY/rtlsdr-ogn/rtlsdr-ogn
|
||||||
|
|
||||||
# Create named pipe.
|
# Create named pipe.
|
||||||
cd $BUILDDIRECTORY_RTLSDROGN/rtlsdr-ogn
|
echo -e "\e[94m Creating named pipe...\e[97m"
|
||||||
sudo mkfifo ogn-rf.fifo
|
sudo mkfifo ogn-rf.fifo
|
||||||
|
|
||||||
# Set file permissions.
|
# Set file permissions.
|
||||||
|
echo -e "\e[94m Setting proper file permissions...\e[97m"
|
||||||
sudo chown root gsm_scan
|
sudo chown root gsm_scan
|
||||||
sudo chmod a+s gsm_scan
|
sudo chmod a+s gsm_scan
|
||||||
sudo chown root ogn-rf
|
sudo chown root ogn-rf
|
||||||
|
|
@ -142,18 +279,21 @@ sudo chmod a+s rtlsdr-ogn
|
||||||
|
|
||||||
# Check if kernel v4.1 or higher is being used.
|
# Check if kernel v4.1 or higher is being used.
|
||||||
|
|
||||||
|
echo -e "\e[94m Getting the version of the kernel currently running...\e[97m"
|
||||||
KERNEL=`uname -r`
|
KERNEL=`uname -r`
|
||||||
VERSION="`echo $KERNEL | cut -d \. -f 1`.`echo $KERNEL | cut -d \. -f 2`"
|
KERNEL_VERSION="`echo $KERNEL | cut -d \. -f 1`.`echo $KERNEL | cut -d \. -f 2`"
|
||||||
|
|
||||||
if [[ $VERSION < 4.1 ]] ; then
|
if [[ $KERNEL_VERSION < 4.1 ]] ; then
|
||||||
# Kernel is older than version 4.1.
|
# Kernel is older than version 4.1.
|
||||||
|
echo -e "\e[94m Executing mknod for older kernels...\e[97m"
|
||||||
sudo mknod gpu_dev c 100 0
|
sudo mknod gpu_dev c 100 0
|
||||||
else
|
else
|
||||||
# Kernel is version 4.1 or newer.
|
# Kernel is version 4.1 or newer.
|
||||||
|
echo -e "\e[94m Executing mknod for newer kernels...\e[97m"
|
||||||
sudo mknod gpu_dev c 249 0
|
sudo mknod gpu_dev c 249 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### CREATE THE CONFIGURATION FILE
|
## CREATE THE CONFIGURATION FILE
|
||||||
|
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
|
|
@ -164,13 +304,17 @@ fi
|
||||||
|
|
||||||
### INSTALL AS A SERVICE
|
### INSTALL AS A SERVICE
|
||||||
|
|
||||||
echo -e "\033[33mDownloading and setting permissions on the init script..."
|
echo -e "\e[94m Downloading and setting permissions on the init script...\e[97m"
|
||||||
echo -e "\033[37m"
|
echo -e ""
|
||||||
sudo wget http://download.glidernet.org/common/service/rtlsdr-ogn -O /etc/init.d/rtlsdr-ogn
|
sudo wget http://download.glidernet.org/common/service/rtlsdr-ogn -O /etc/init.d/rtlsdr-ogn
|
||||||
sudo chmod +x /etc/init.d/rtlsdr-ogn
|
sudo chmod +x /etc/init.d/rtlsdr-ogn
|
||||||
|
|
||||||
echo -e "\033[33mCreating file /etc/rtlsdr-ogn.conf..."
|
#################
|
||||||
echo -e "\033[37m"
|
# ASSIGN DEVICE #
|
||||||
|
#################
|
||||||
|
|
||||||
|
echo -e "\e[94m Creating the file /etc/rtlsdr-ogn.conf...\e[97m"
|
||||||
|
echo -e ""
|
||||||
sudo tee /etc/rtlsdr-ogn.conf > /dev/null <<EOF
|
sudo tee /etc/rtlsdr-ogn.conf > /dev/null <<EOF
|
||||||
#shellbox configuration file
|
#shellbox configuration file
|
||||||
#Starts commands inside a "box" with a telnet-like server.
|
#Starts commands inside a "box" with a telnet-like server.
|
||||||
|
|
@ -181,26 +325,24 @@ sudo tee /etc/rtlsdr-ogn.conf > /dev/null <<EOF
|
||||||
50001 pi ${BUILDDIRECTORY_RTLSDROGN}/rtlsdr-ogn ./ogn-decode rtlsdr-ogn.conf
|
50001 pi ${BUILDDIRECTORY_RTLSDROGN}/rtlsdr-ogn ./ogn-decode rtlsdr-ogn.conf
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo -e "\033[33mSetting up rtlsdr-ogn as a service..."
|
echo -e "\e[94m Setting up rtlsdr-ogn as a service...\e[97m"
|
||||||
echo -e "\033[37m"
|
echo -e ""
|
||||||
sudo update-rc.d rtlsdr-ogn defaults
|
sudo update-rc.d rtlsdr-ogn defaults
|
||||||
|
|
||||||
echo -e "\033[33mStarting the rtlsdr-ogn service..."
|
echo -e "\e[94m Starting the rtlsdr-ogn service...\e[97m"
|
||||||
echo -e "\033[37m"
|
echo -e ""
|
||||||
sudo service rtlsdr-ogn start
|
sudo service rtlsdr-ogn start
|
||||||
|
|
||||||
### SETUP COMPLETE
|
## RTL-SDR OGN SETUP COMPLETE
|
||||||
|
|
||||||
# Enter into the project root directory.
|
# Enter into the project root directory.
|
||||||
echo -e "\e[94m Entering the $ADSB_PROJECTTITLE root directory...\e[97m"
|
echo -e "\e[94m Entering the ADS-B Receiver Project root directory...\e[97m"
|
||||||
cd $PROJECTROOTDIRECTORY
|
cd $RECIEVER_ROOT_DIRECTORY
|
||||||
|
|
||||||
echo -e ""
|
echo ""
|
||||||
echo -e "\e[93m-------------------------------------------------------------------------------------------------------"
|
echo -e "\e[93m----------------------------------------------------------------------------------------------------"
|
||||||
echo -e "\e[92m ${DECODER_NAME} setup is complete.\e[39m"
|
echo -e "\e[92m RTL-SDR OGN setup is complete.\e[39m"
|
||||||
echo -e ""
|
echo ""
|
||||||
if [[ ! -z ${VERBOSE} ]] ; then
|
read -p "Press enter to continue..." CONTINUE
|
||||||
read -p "Press enter to continue..." CONTINUE
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
||||||
54
bash/main.sh
54
bash/main.sh
|
|
@ -67,7 +67,6 @@ function InstallDump1090Fa() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Execute the dump978 setup script.
|
# Execute the dump978 setup script.
|
||||||
function InstallDump978() {
|
function InstallDump978() {
|
||||||
chmod +x $RECEIVER_BASH_DIRECTORY/decoders/dump978.sh
|
chmod +x $RECEIVER_BASH_DIRECTORY/decoders/dump978.sh
|
||||||
|
|
@ -77,6 +76,15 @@ function InstallDump978() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Execute the RTL-SDR OGN setup script.
|
||||||
|
function InstallRtlsdrOgn() {
|
||||||
|
chmod +x $RECEIVER_BASH_DIRECTORY/decoders/rtlsdr-ogn.sh
|
||||||
|
$RECEIVER_BASH_DIRECTORY/decoders/rtlsdr-ogn.sh
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
## FEEDERS
|
## FEEDERS
|
||||||
|
|
||||||
# Execute the PiAware setup script
|
# Execute the PiAware setup script
|
||||||
|
|
@ -247,6 +255,35 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/init.d/rtlsdr-ogn ]; then
|
||||||
|
# The RTL-SDR OGN exist on this device.
|
||||||
|
if [ $RECEIVER_AUTOMATED_INSTALL -eq "false" ]; then
|
||||||
|
# Check if a newer version of the binaries are available.
|
||||||
|
if [ ! -d $RECIEVER_BUILD_DIRECTORY/rtlsdr-ogn/rtlsdr-ogn-$RTLSDROGN_VERSION ]; then
|
||||||
|
whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "Dump978 Installed" --defaultno --yesno "A newer version of the RTL-SDR OGN binaries is available.\n\nWould you like to setup the newer binaries on this device?" 14 65
|
||||||
|
case $? in
|
||||||
|
0) RTLSDROGN_DO_UPGRADE="true" ;;
|
||||||
|
1) RTLSDROGN_DO_UPGRADE="false" ;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
# Refer to the installation configuration to decide if dump978 is to be rebuilt from source or not.
|
||||||
|
if [ $RTLSDROGN_UPGRADE -eq "true" ]; then
|
||||||
|
RTLSDROGN_DO_UPGRADE="true"
|
||||||
|
else
|
||||||
|
RTLSDROGN_DO_UPGRADE="false"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# The RTL-SDR OGN binaries do not appear to exist on this device.
|
||||||
|
if [ $RECEIVER_AUTOMATED_INSTALL -eq "false" ]; then
|
||||||
|
whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "Dump978 Not Installed" --defaultno --yesno "The goal the OGN project is to create a unified platform for tracking aircraft equipped with FLARM (or FLARM-compatible) emitters and OGN trackers.\n\nRTL-SDR OGN will require an additional RTL-SDR dongle to run.\nFLARM is generally only used within Europe.\n\nDo you wish to setup RTL-SDR OGN?" 10 65
|
||||||
|
case $? in
|
||||||
|
0) RTLSDROGN_INSTALL="true" ;;
|
||||||
|
1) RTLSDROGN_INSTALL="false" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
## Feeder Selection Menu
|
## Feeder Selection Menu
|
||||||
|
|
||||||
# Declare the FEEDER_LIST array and the FEEDER_CHOICES file which will store choices for feeders which are available for install.
|
# Declare the FEEDER_LIST array and the FEEDER_CHOICES file which will store choices for feeders which are available for install.
|
||||||
|
|
@ -547,6 +584,15 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# RTL-SDR OGN
|
||||||
|
if [ $RTLSDROGN_INSTALL -eq "true" ] || [ $RTLSDROGN_UPGRADE -eq "true" ]; then
|
||||||
|
if [ $RTLSDROGN_DO_UPGRADE -eq "true" ]; then
|
||||||
|
CONFIRMATION="$CONFIRMATION\n * RTL-SDR OGN (upgrade)"
|
||||||
|
else
|
||||||
|
CONFIRMATION="$CONFIRMATION\n * RTL-SDR OGN"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# If PiAware is required add it to the list.
|
# If PiAware is required add it to the list.
|
||||||
if [ $DUMP1090_FORK -e "fa" ]; then
|
if [ $DUMP1090_FORK -e "fa" ]; then
|
||||||
CONFIRMATION="$CONFIRMATION\n * FlightAware PiAware"
|
CONFIRMATION="$CONFIRMATION\n * FlightAware PiAware"
|
||||||
|
|
@ -619,7 +665,7 @@ fi
|
||||||
|
|
||||||
# Ask for confirmation before moving on.
|
# Ask for confirmation before moving on.
|
||||||
CONFIRMATION="${CONFIRMATION}Do you wish to continue setup?"
|
CONFIRMATION="${CONFIRMATION}Do you wish to continue setup?"
|
||||||
if ! (whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "Confirm You Wish To Continue" --yesno "$CONFIRMATION" 20 78) then
|
if ! (whiptail --backtitle "$RECEIVER_PROJECT_TITLE" --title "Confirm You Wish To Continue" --yesno "$CONFIRMATION" 21 78) then
|
||||||
echo -e "\033[31m"
|
echo -e "\033[31m"
|
||||||
echo " Installation canceled by user."
|
echo " Installation canceled by user."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -641,6 +687,10 @@ if [ $DUMP978_INSTALL -eq "true" ] || [ $DUMP978_UPGRADE -eq "true" ]; then
|
||||||
InstallDump978
|
InstallDump978
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $RTLSDROGN_INSTALL -eq "true" ] || [ $RTLSDROGN_UPGRADE -eq "true" ]; then
|
||||||
|
InstallRtlsdrOgn
|
||||||
|
fi
|
||||||
|
|
||||||
## Feeders
|
## Feeders
|
||||||
|
|
||||||
# Moved execution of functions outside of while loop.
|
# Moved execution of functions outside of while loop.
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,9 @@
|
||||||
# The ADS-B Receiver Project
|
# The ADS-B Receiver Project
|
||||||
PROJECT_VERSION="2.6.0"
|
PROJECT_VERSION="2.6.0"
|
||||||
|
|
||||||
|
# RTL-SDR OGN
|
||||||
|
RTLSDROGN_VERSION="0.2.5"
|
||||||
|
|
||||||
# FlightAware PiAware
|
# FlightAware PiAware
|
||||||
PIAWARE_VERSION="3.1.0"
|
PIAWARE_VERSION="3.1.0"
|
||||||
|
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue