From d09187e9e7ad17a1c7e136279bc18b96126bdfdd Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 5 Nov 2024 15:23:16 -0700 Subject: [PATCH 1/5] ARDOP - Initial ARDOP installation script --- scripts/install-ardop.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 scripts/install-ardop.sh diff --git a/scripts/install-ardop.sh b/scripts/install-ardop.sh new file mode 100755 index 0000000..0063b71 --- /dev/null +++ b/scripts/install-ardop.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 5 November 2024 +# Purpose : Install ARDOP modem +set -e +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR + +VERSION=1.0.4.1.3 +DOWNLOAD_FILE=ardopcf_amd64_Linux_64 +BIN_FILE=ardopcf +INSTALL_DIR=/opt/ardop-${VERSION} +INSTALL_BIN_DIR="${INSTALL_DIR}/bin" +LINK_PATH=/opt/ardop + +et-log "Installing ARDOP..." + +if [ ! -e ${INSTALL_BIN_DIR} ]; then + et-log "Creating ARDOP install directory: ${INSTALL_BIN_DIR}" + mkdir -v -p ${INSTALL_BIN_DIR} +fi + +if [ ! -e ${INSTALL_BIN_DIR}/${BIN_FILE} ]; then + URL="https://github.com/pflarue/ardop/releases/download/${VERSION}/${DOWNLOAD_FILE}" + + et-log "Downloading ARDOP: ${URL}" + curl -s -L -o ${BIN_FILE} --fail ${URL} + + mv -v ${BIN_FILE} ${INSTALL_BIN_DIR} +fi + +chmod 755 ${INSTALL_BIN_DIR}/${BIN_FILE} + +[ -e ${LINK_PATH} ] && rm ${LINK_PATH} +ln -s ${INSTALL_DIR} ${LINK_PATH} + +stow -v -d /opt ardop -t /usr/local From 05114a4fcd89b54d84b1c1f7907b22fd73e16c30 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 5 Nov 2024 15:44:10 -0700 Subject: [PATCH 2/5] ARDOP - Added ARDOP to main installer; Added ARDOP configuration to Winlink configuration template; added initial validation test script --- overlay/etc/skel/.config/pat/config.json | 4 ++-- scripts/install.sh | 5 ++++- tests/test-ardop.sh | 7 +++++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100755 tests/test-ardop.sh diff --git a/overlay/etc/skel/.config/pat/config.json b/overlay/etc/skel/.config/pat/config.json index ecb6cbe..5d6d6e6 100644 --- a/overlay/etc/skel/.config/pat/config.json +++ b/overlay/etc/skel/.config/pat/config.json @@ -41,8 +41,8 @@ "Forced": false, "Max": 500 }, - "rig": "", - "ptt_ctrl": false, + "rig": "et-rig", + "ptt_ctrl": true, "beacon_interval": 0, "cwid_enabled": true }, diff --git a/scripts/install.sh b/scripts/install.sh index d72a41f..2812229 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 4 November 2024 +# Updated : 5 November 2024 # Purpose : Main installer for EmComm Tools OS Community . ./env.sh @@ -39,6 +39,9 @@ exitIfNotRoot ./install-direwolf.sh ./install-yaac.sh +# Install modems +./install-ardop.sh + ./install-winlink.sh ./install-audio-tools.sh diff --git a/tests/test-ardop.sh b/tests/test-ardop.sh new file mode 100755 index 0000000..e3e713a --- /dev/null +++ b/tests/test-ardop.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 5 November 2024 +# Purpose : Test ARDOP Winlink installation + +OUT=$(ardopcf -h | grep "1.0.4.1.3") +exit $? From 5b151ed4f8f59884d3a74a9f819ecace5ac177c9 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 5 Nov 2024 15:58:48 -0700 Subject: [PATCH 3/5] ARDOP - Initial wrapper command for ARDOP modem --- overlay/opt/emcomm-tools/bin/et-ardop | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 overlay/opt/emcomm-tools/bin/et-ardop diff --git a/overlay/opt/emcomm-tools/bin/et-ardop b/overlay/opt/emcomm-tools/bin/et-ardop new file mode 100755 index 0000000..5d13111 --- /dev/null +++ b/overlay/opt/emcomm-tools/bin/et-ardop @@ -0,0 +1,46 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 5 November 2024 +# Purpose : Wrapper script for starting ARDOP +# +# Preconditions: +# 1. Supported radio and audio interface are connected and properly detected +# +# Postconditions: +# 1. Audio settings updated +# 2. ARDOP modem started +# +# Assumptions: +# 1. The application using the ARDOP modem is responsible for keying the PTT. + +ARDOP_PORT=8515 + +# 1. Check if the symlink was created by the udev rules +if [ -e /dev/et-audio ]; then + + # 2. Check that this device was properly tagged with the ET_AUDIO env variable with a udev rule + APLAY_OUT=$(arecord -l | grep ET_AUDIO) + if [ $? -eq 0 ]; then + AUDIO_CARD=$(echo $APLAY_OUT | cut -d":" -f1 | awk '{print $2}') + AUDIO_DEVICE=$(echo $APLAY_OUT | cut -d"," -f2 | cut -d":" -f1 | awk '{print $2}') + ARDOP_AUDIO_DEVICE="plughw:${AUDIO_CARD},${AUDIO_DEVICE}" + + # 3. Update audio device + et-log "Using '${ARDOP_AUDIO_DEVICE}' as audio device for ARDOP." + + # 4. Configure ALSA settings for sound card + /opt/emcomm-tools/bin/et-audio update-config + + else + et-log "Can't start ARDOP modem. No ET_AUDIO device detected." + exit 1 + fi +else + et-log "No ET_AUDIO device plugged in. No supported audio device plugged it." + exit 1 +fi + +CMD="ardopcf ${ARDOP_PORT} ${ARDOP_AUDIO_DEVICE} ${ARDOP_AUDIO_DEVICE}" +et-log "Starting ARDOP with: '${CMD}'" +${CMD} From c9a0480c0d4a96f04c9007875fb764ea601020ec Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 5 Nov 2024 16:33:39 -0700 Subject: [PATCH 4/5] ARDOP - Added ARDOP mode to Winlink --- overlay/opt/emcomm-tools/bin/et-winlink | 59 ++++++++++++++++--------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/overlay/opt/emcomm-tools/bin/et-winlink b/overlay/opt/emcomm-tools/bin/et-winlink index e20e292..9cf6b7e 100755 --- a/overlay/opt/emcomm-tools/bin/et-winlink +++ b/overlay/opt/emcomm-tools/bin/et-winlink @@ -2,16 +2,16 @@ # # Author : Gaston Gonzalez # Date : 4 November 2024 +# Updated : 5 November 2024 # Purpose : Wrapper script for starting YAAC with PnP support # # Preconditions: # 1. Supported radio and audio interface are connected and properly detected -# 2. Appropriate modem is started (Dire Wolf or ARDOP). +# 2. Appropriate modem is started: Dire Wolf (et-direwolf) or ARDOP (et-ardop). # # Postconditions: -# 1. Callsign and Winlink password are updated +# 1. Callsign, Winlink password, and grid are updated are updated # 2. pat http is started -set -e PAT_CONF_FILE=${HOME}/.config/pat/config.json PAT_CONF_FILE_TEMPLATE=/etc/skel/.config/pat/config.json @@ -19,6 +19,7 @@ PAT_CONF_FILE_TEMPLATE=/etc/skel/.config/pat/config.json usage() { echo "usage: $(basename $0) " echo " " + echo " start-ardop - Start Pat Winlink in ardop mode" echo " start-packet - Start Pat Winlink in packet mode" echo " update-config - Update configuration for selected mode" } @@ -30,32 +31,43 @@ fi notify_user() { notify-send \ - -t 5000 \ + -t 10000 \ --app-name="EmComm Tools" \ "$1" } -start_packet() { - update_config - - if [ $? -eq 0 ]; then +start_ardop() { - RIGCTLD_OUT=$(ps -ef | grep [d]irewolf) - if [ $? -ne 0 ]; then - et-log "Can't start Pat in packet mode. Dire Wolf not running." - notify_user "Can't start Pat. Dire Wolf not running." - exit 1 - fi - - CMD="pat http" - et-log "Starting Pat with: ${CMD}" - - ${CMD} - - else - et-log "Error updating configuration. Can't start Pat" + ps -ef | grep "[a]rdopcf" + if [ $? -ne 0 ]; then + et-log "Can't start Pat in ARDOP mode. ARDOP not running. Run: et-ardop" + notify_user "ARDOP not running. Run: et-ardop" exit 1 fi + + update_config + + CMD="pat http" + et-log "Starting Pat with: ${CMD}" + + ${CMD} +} + +start_packet() { + + RIGCTLD_OUT=$(ps -ef | grep "[d]irewolf") + if [ $? -ne 0 ]; then + et-log "Can't start Pat in packet mode. Dire Wolf not running. Run: et-direwolf simple-packet" + notify_user "Dire Wolf not running. Run: et-direwolf simple-packet" + exit 1 + fi + + update_config + + CMD="pat http" + et-log "Starting Pat with: ${CMD}" + + ${CMD} } update_config () { @@ -80,6 +92,9 @@ update_config () { } case $1 in + start-ardop) + start_ardop + ;; start-packet) start_packet ;; From 0dfdb34d4b8b3ee17492c4ebc07d2835d79f527d Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 5 Nov 2024 16:46:52 -0700 Subject: [PATCH 5/5] ARDOP - Added support for logging to users home directory --- overlay/etc/skel/.bash_profile | 4 +++- overlay/opt/emcomm-tools/bin/et-ardop | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/overlay/etc/skel/.bash_profile b/overlay/etc/skel/.bash_profile index 85352f9..61996bc 100644 --- a/overlay/etc/skel/.bash_profile +++ b/overlay/etc/skel/.bash_profile @@ -1,6 +1,6 @@ # Author : Gaston Gonzalez # Date : 23 April 2024 -# Updated : 25 October 2024 +# Updated : 5 November 2024 # Description : bash profile # All user accounts should be in the 'et-data' group to allow data sharing with @@ -26,3 +26,5 @@ cat /etc/motd echo -e "${NC}" export ET_USER_CONFIG=${HOME}/.config/emcomm-tools/user.json +export ET_LOG_DIR=${HOME}/.local/share/emcomm-tools + diff --git a/overlay/opt/emcomm-tools/bin/et-ardop b/overlay/opt/emcomm-tools/bin/et-ardop index 5d13111..8f6bc5d 100755 --- a/overlay/opt/emcomm-tools/bin/et-ardop +++ b/overlay/opt/emcomm-tools/bin/et-ardop @@ -16,6 +16,9 @@ ARDOP_PORT=8515 +[ -z ${ET_LOG_DIR} ] && ET_LOG_DIR="${HOME}/.local/share/emcomm-tools" +[ ! -e ${ET_LOG_DIR} ] && mkdir -p ${ET_LOG_DIR} + # 1. Check if the symlink was created by the udev rules if [ -e /dev/et-audio ]; then @@ -41,6 +44,6 @@ else exit 1 fi -CMD="ardopcf ${ARDOP_PORT} ${ARDOP_AUDIO_DEVICE} ${ARDOP_AUDIO_DEVICE}" +CMD="ardopcf ${ARDOP_PORT} ${ARDOP_AUDIO_DEVICE} ${ARDOP_AUDIO_DEVICE} --logdir ${ET_LOG_DIR}" et-log "Starting ARDOP with: '${CMD}'" ${CMD}