mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
Merging feature/ardop. We have ARDOP over Winlink
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
"Forced": false,
|
||||
"Max": 500
|
||||
},
|
||||
"rig": "",
|
||||
"ptt_ctrl": false,
|
||||
"rig": "et-rig",
|
||||
"ptt_ctrl": true,
|
||||
"beacon_interval": 0,
|
||||
"cwid_enabled": true
|
||||
},
|
||||
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/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
|
||||
|
||||
[ -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
|
||||
|
||||
# 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} --logdir ${ET_LOG_DIR}"
|
||||
et-log "Starting ARDOP with: '${CMD}'"
|
||||
${CMD}
|
||||
@@ -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) <command>"
|
||||
echo " <command>"
|
||||
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
|
||||
;;
|
||||
|
||||
Executable
+37
@@ -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
|
||||
+4
-1
@@ -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
|
||||
|
||||
Executable
+7
@@ -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 $?
|
||||
Reference in New Issue
Block a user