From 585be5090fcda21391775c92ae60838cb7c201c6 Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Wed, 4 Jun 2025 07:40:48 -0700 Subject: [PATCH 1/3] Misc RF Tools - Added initial support for the RTL-SDR CLI tools and development libraries, dump1090 for ADB-S aircraft tracking, and SPLAT! for VHF/UHF prediction. Also, fixed an issue where the Paracon test script was not being run --- scripts/install-dump1090.sh | 50 +++++++++++++++++++++++++ scripts/install-rf-analysis-tools.sh | 12 ++++++ scripts/install-sdr-tools.sh | 12 ++++++ scripts/install.sh | 9 ++++- tests/test-dump1090.sh | 7 ++++ tests/{test-paracon => test-paracon.sh} | 0 6 files changed, 89 insertions(+), 1 deletion(-) create mode 100755 scripts/install-dump1090.sh create mode 100755 scripts/install-rf-analysis-tools.sh create mode 100755 scripts/install-sdr-tools.sh create mode 100755 tests/test-dump1090.sh rename tests/{test-paracon => test-paracon.sh} (100%) diff --git a/scripts/install-dump1090.sh b/scripts/install-dump1090.sh new file mode 100755 index 0000000..f31fcda --- /dev/null +++ b/scripts/install-dump1090.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 4 June 2025 +# Purpose : Install dump1090 (ADB-S aircraft tracking) +set -e +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR + +. ./env.sh + +APP=dump1090 +VERSION=master +DOWNLOAD_FILE=master.zip +BIN_FILE=dump1090 +INSTALL_DIR="/opt/${APP}-${VERSION}" +INSTALL_BIN_DIR="${INSTALL_DIR}/bin" +LINK_PATH="/opt/${APP}" + +if [[ ! -e ${ET_DIST_DIR}/${DOWNLOAD_FILE} ]]; then + + URL="https://github.com/antirez/dump1090/archive/refs/heads/${DOWNLOAD_FILE}" + + et-log "Downloading ${APP}: ${URL}" + curl -s -L -o ${DOWNLOAD_FILE} --fail ${URL} + + mv -v ${DOWNLOAD_FILE} ${ET_DIST_DIR} +fi + +CWD_DIR=`pwd` + +# Only build once +if [[ ! -e "${ET_SRC_DIR}/${APP}/${BIN_FILE}" ]]; then + cd ${ET_SRC_DIR} + unzip -o ${ET_DIST_DIR}/${DOWNLOAD_FILE} + + cd dump1090-master + + et-log "Building ${APP}.." + make +fi + +[[ ! -e ${INSTALL_BIN_DIR} ]] && mkdir -v -p ${INSTALL_BIN_DIR} +cp -v "${ET_SRC_DIR}/${APP}-master/${BIN_FILE}" ${INSTALL_BIN_DIR} + +[[ -e ${LINK_PATH} ]] && rm ${LINK_PATH} +ln -s ${INSTALL_DIR} ${LINK_PATH} + +stow -v -d /opt ${APP} -t /usr/local + +cd $CWD_DIR diff --git a/scripts/install-rf-analysis-tools.sh b/scripts/install-rf-analysis-tools.sh new file mode 100755 index 0000000..6bdfee1 --- /dev/null +++ b/scripts/install-rf-analysis-tools.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 22 May 2024 +# Updated : 4 June 2025 +# Purpose : Install RF prediction and analysis tools +set -e + +et-log "Installing RF prediction and analysis tools..." +apt install \ + splat \ + -y diff --git a/scripts/install-sdr-tools.sh b/scripts/install-sdr-tools.sh new file mode 100755 index 0000000..8bb01ad --- /dev/null +++ b/scripts/install-sdr-tools.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 4 June 2025 +# Purpose : Install SDR tools +set -e + +et-log "Installing SDR tools..." +apt install \ + rtl-sdr \ + librtlsdr-dev \ + -y diff --git a/scripts/install.sh b/scripts/install.sh index 8d8a6e3..c44aa48 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 26 April 2025 +# Updated : 4 June 2025 # Purpose : Main installer for EmComm Tools Community (ETC) . ./env.sh @@ -66,3 +66,10 @@ exitIfNotRoot ./install-python.sh ./install-mbutil.sh ./install-gis-tools.sh + +# Install RF analysis and prediction tools +./install-rf-analysis-tools.sh + +# Install SDR tools +./install-sdr-tools.sh +./install-dump1090.sh diff --git a/tests/test-dump1090.sh b/tests/test-dump1090.sh new file mode 100755 index 0000000..23764fd --- /dev/null +++ b/tests/test-dump1090.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 5 May 2025 +# Purpose : Test dump1090 installation + +OUT=$(which dump1090) +exit $? diff --git a/tests/test-paracon b/tests/test-paracon.sh similarity index 100% rename from tests/test-paracon rename to tests/test-paracon.sh From 7c5eb879552c7336399306e689a9b1ffcc182479 Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Thu, 5 Jun 2025 04:35:46 -0700 Subject: [PATCH 2/3] Misc RF Tools - Cleaned up the install for the initial dump1090 setup. A separate branch will be created to complete the et-aircraft/ads-b feature. --- overlay/opt/emcomm-tools/bin/et-aircraft | 48 ++++++++++++++++++++++++ overlay/opt/emcomm-tools/bin/et-common | 7 ++++ scripts/install-dump1090.sh | 10 ++++- 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100755 overlay/opt/emcomm-tools/bin/et-aircraft diff --git a/overlay/opt/emcomm-tools/bin/et-aircraft b/overlay/opt/emcomm-tools/bin/et-aircraft new file mode 100755 index 0000000..b583a2e --- /dev/null +++ b/overlay/opt/emcomm-tools/bin/et-aircraft @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 4 June 2025 +# Update : 5 June 2025 +# Purpose : Wrapper script around dump1090 +# +# Preconditions: +# 1. RTL-SDR is connected and detected +# +# Postconditions: +# 1. dump1099 is launched +# 2. A map is launched + +# TODO: Update installer to copy map file +# TODO: Check for RTL-SDR device +# TODO: Change port from 8080 to 1090 +# TODO: Add a systemd user service to start dump1090 +# TODO: Use local offline map +# TODO: Move map to current position +# TODO: Use icon and add to launcher + +source /opt/emcomm-tools/bin/et-common + +DUMP1090_CONF_DIR="${HOME}/.local/share/emcomm-tools/dump1090" +DUMP1090_MAP_HTML="${DUMP1090_CONF_DIR}/gmap.html" + +if [[ ! -e ${DUMP1090_MAP_HTML} ]]; then + et-log "Map HTML not found: ${DUMP1090_MAP_HTML}" + notify-user "Map HTML not found: ${DUMP1090_MAP_HTML}" + exit 1 +fi + +CWD_DIR=$(pwd) + +cd ${DUMP1090_CONF_DIR} + +# replace with systemd +CMD="dump1090 --net --net-http-port 1090" +et-log "Starting dump1090 in ${DUMP1090_CONF_DIR} with: ${CMD}" + +${CMD} + +if [[ $? -ne 0 ]]; then + notify-user "RTL-SDR not detected. Please connect it and retry." +fi + +cd ${CWD_DIR} diff --git a/overlay/opt/emcomm-tools/bin/et-common b/overlay/opt/emcomm-tools/bin/et-common index b6b1539..d14f2f9 100755 --- a/overlay/opt/emcomm-tools/bin/et-common +++ b/overlay/opt/emcomm-tools/bin/et-common @@ -1,6 +1,7 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 1 February 2025 +# Updated : 5 June 2025 # Purpose : Common environment variables and functions export ESC="\x1B" @@ -11,7 +12,13 @@ export WHITE="${ESC}[97m" export YELLOW="${ESC}[1;33m" export NC="${ESC}[0m" +# Display an error message in the terminal show-err-dialog() { local message="$1" dialog --title "Notification" --msgbox "$message" 8 60 } + +# Display a notification message as a UI popup in the desktop +notify-user() { + notify-send -t 5000 --app-name="EmComm Tools" "$1" +} diff --git a/scripts/install-dump1090.sh b/scripts/install-dump1090.sh index f31fcda..cd0adf1 100755 --- a/scripts/install-dump1090.sh +++ b/scripts/install-dump1090.sh @@ -1,6 +1,7 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 4 June 2025 +# Updated : 5 June 2025 # Purpose : Install dump1090 (ADB-S aircraft tracking) set -e trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG @@ -10,15 +11,16 @@ trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR APP=dump1090 VERSION=master -DOWNLOAD_FILE=master.zip +DOWNLOAD_FILE=dump1090-master.zip BIN_FILE=dump1090 INSTALL_DIR="/opt/${APP}-${VERSION}" INSTALL_BIN_DIR="${INSTALL_DIR}/bin" LINK_PATH="/opt/${APP}" +DUMP1090_CONF_DIR="/etc/skel/.local/share/emcomm-tools/dump1090" if [[ ! -e ${ET_DIST_DIR}/${DOWNLOAD_FILE} ]]; then - URL="https://github.com/antirez/dump1090/archive/refs/heads/${DOWNLOAD_FILE}" + URL="https://github.com/antirez/dump1090/archive/refs/heads/master.zip" et-log "Downloading ${APP}: ${URL}" curl -s -L -o ${DOWNLOAD_FILE} --fail ${URL} @@ -42,6 +44,10 @@ fi [[ ! -e ${INSTALL_BIN_DIR} ]] && mkdir -v -p ${INSTALL_BIN_DIR} cp -v "${ET_SRC_DIR}/${APP}-master/${BIN_FILE}" ${INSTALL_BIN_DIR} +# Install HTML map +[[ ! -e ${DUMP1090_CONF_DIR} ]] && mkdir -v -p ${DUMP1090_CONF_DIR} +cp -v "${ET_SRC_DIR}/${APP}-master/gmap.html" ${DUMP1090_CONF_DIR} + [[ -e ${LINK_PATH} ]] && rm ${LINK_PATH} ln -s ${INSTALL_DIR} ${LINK_PATH} From 7464400673ce9460c06f554aa7611c944af4a6bc Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Thu, 5 Jun 2025 04:38:00 -0700 Subject: [PATCH 3/3] Misc RF Tools - Cleaned up TODO items in et-aircraft --- overlay/opt/emcomm-tools/bin/et-aircraft | 2 -- 1 file changed, 2 deletions(-) diff --git a/overlay/opt/emcomm-tools/bin/et-aircraft b/overlay/opt/emcomm-tools/bin/et-aircraft index b583a2e..3870507 100755 --- a/overlay/opt/emcomm-tools/bin/et-aircraft +++ b/overlay/opt/emcomm-tools/bin/et-aircraft @@ -12,9 +12,7 @@ # 1. dump1099 is launched # 2. A map is launched -# TODO: Update installer to copy map file # TODO: Check for RTL-SDR device -# TODO: Change port from 8080 to 1090 # TODO: Add a systemd user service to start dump1090 # TODO: Use local offline map # TODO: Move map to current position