Merged feature/packet

This commit is contained in:
Gaston Gonzalez
2024-11-03 12:51:05 -07:00
13 changed files with 229 additions and 4 deletions
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE map SYSTEM "http://java.sun.com/dtd/preferences.dtd">
<map MAP_XML_VERSION="1.0"/>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE map SYSTEM "http://java.sun.com/dtd/preferences.dtd">
<map MAP_XML_VERSION="1.0">
<entry key="ambiguity" value="1.6666666E-4"/>
<entry key="beaconName" value="MYCALL"/>
<entry key="ctcss" value="TOFF"/>
<entry key="decayRatio" value="2"/>
<entry key="digipeaters" value="WIDE1-1;WIDE1-1,WIDE2-1"/>
<entry key="directionality" value="0"/>
<entry key="enabled" value="true"/>
<entry key="fixedAltitudeM" value="NaN"/>
<entry key="freeText" value="ETC R3"/>
<entry key="gain" value="0"/>
<entry key="height" value="0"/>
<entry key="initialRateSecs" value="60"/>
<entry key="latitude" value="33.0"/>
<entry key="longitude" value="-112.0"/>
<entry key="monitorFreq" value="0.0"/>
<entry key="offset" value="0"/>
<entry key="positionType" value="NO_TIME_W_MESSAGING"/>
<entry key="power" value="0"/>
<entry key="reportAltitude" value="false"/>
<entry key="reportSpeed" value="false"/>
<entry key="showDFS" value="false"/>
<entry key="showPHG" value="false"/>
<entry key="slowRateSecs" value="1800"/>
<entry key="status" value="7"/>
<entry key="symTableId" value="/"/>
<entry key="symbolCode" value="["/>
<entry key="type" value="POSITION"/>
<entry key="useGpsForPosition" value="true"/>
<entry key="useWeather" value="false"/>
</map>
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE map SYSTEM "http://java.sun.com/dtd/preferences.dtd">
<map MAP_XML_VERSION="1.0"/>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE map SYSTEM "http://java.sun.com/dtd/preferences.dtd">
<map MAP_XML_VERSION="1.0">
<entry key="TEMP1" value="true,false,false"/>
<entry key="WIDE1" value="true,false,true"/>
<entry key="WIDE2" value="true,false,true"/>
</map>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE map SYSTEM "http://java.sun.com/dtd/preferences.dtd">
<map MAP_XML_VERSION="1.0">
<entry key="Port1" value="KISS-over-TCP,localhost,8001,N0CAL,,true,TEMP1;;true;false;1;0/-120/10;0;MYCALL"/>
<entry key="Port2" value="GPSD,localhost,2947,,,false;;true;false;1;0/-120/10;0;"/>
</map>
+9
View File
@@ -2,6 +2,7 @@
#
# Author : Gaston Gonzalez
# Date : 1 November 2024
# Updated : 3 November 2024
# Purpose : Wrapper script for starting Dire Wolf with PnP support
#
# Preconditions:
@@ -55,6 +56,14 @@ start() {
update-config
if [ $? -eq 0 ]; then
RIGCTLD_OUT=$(systemctl status rigctld)
if [ $? -ne 0 ]; then
et-log "Can't start Dire Wolf. rigctld not running. Ensure radio is selected."
notify_user "Can't start Dire Wolf. rigctld not running."
exit 1
fi
CMD="direwolf -c ${DIREWOLF_CONF_FILE} -t 0 -p"
et-log "Starting Dire Wolf with: '${CMD}'"
echo
+4 -1
View File
@@ -2,7 +2,7 @@
#
# Author : Gaston Gonzalez
# Date : 11 October 2024
# Updated : 28 October 2024
# Updated : 3 November 2024
# Purpose : A script for managaing plug-and-play radios
set -e
@@ -48,6 +48,9 @@ if [ $exit_status -eq 0 ]; then
printf "\nConfiguration Notes\n"
cat ${ACTIVE_RADIO} | jq -r '.notes[] | "* \(.)"'
printf "\n** Plug in radio. If already connected, reconnect it.\n"
else
echo "No radio selected."
fi
+95
View File
@@ -0,0 +1,95 @@
#!/bin/bash
#
# Author : Gaston Gonzalez
# Date : 3 November 2024
# Purpose : Wrapper script for starting YAAC with PnP support
#
# Preconditions:
# 1. Supported radio and audio interface are connected and properly detected
# 2. Dire Wolf is started
#
# Postconditions:
# 1. YAAC is started
# 2. Callsign is updated in YAAC
YAAC_CONF_DIR=${HOME}/.java/.userPrefs/org/ka2ddo/yaac
YAAC_CONF_FILE_PORTS=${YAAC_CONF_DIR}/Ports/prefs.xml
YAAC_CONF_FILE_PORTS_TEMPLATE=/etc/skel/.java/.userPrefs/org/ka2ddo/yaac/Ports/prefs.xml
usage() {
echo "usage: $(basename $0) <command>"
echo " <command>"
echo " start - Start YAAC"
echo " update-config - Update configuration for selected mode"
}
if [ $# -ne 1 ]; then
usage
exit 1
fi
notify_user() {
notify-send \
-t 5000 \
--app-name="EmComm Tools" \
"$1"
}
start() {
update-config
if [ $? -eq 0 ]; then
RIGCTLD_OUT=$(ps -ef | grep [d]irewolf)
if [ $? -ne 0 ]; then
et-log "Can't start YAAC. Dire Wolf not running."
notify_user "Can't start YAAC. Dire Wolf not running."
exit 1
fi
CMD="java -jar /opt/yaac/YAAC.jar"
et-log "Starting YAAC with: ${CMD}"
${CMD}
else
et-log "Error updating configuration. Can't start YAAC"
exit 1
fi
}
update-config () {
[ -z "$ET_USER_CONFIG" ] && ET_USER_CONFIG="${HOME}/.config/emcomm-tools/user.json"
CALLSIGN=$(cat ${ET_USER_CONFIG} | jq -r .callsign)
if [ "${CALLSIGN}" = "N0CALL" ]; then
notify_user "Can't start YAAC. No callsign set. Run: et-user."
exit 1
fi
et-log "Updating YAAC ports file: ${YAAC_CONF_FILE_PORTS}..."
cp -v ${YAAC_CONF_FILE_PORTS_TEMPLATE} ${YAAC_CONF_FILE_PORTS}
sed -i "s|N0CAL|${CALLSIGN}|g" ${YAAC_CONF_FILE_PORTS}
echo "Generated the configuration below..."
echo
cat ${YAAC_CONF_FILE_PORTS}
echo
}
case $1 in
start)
start
;;
update-config)
update-config
;;
*)
echo "Invalid command."
usage
exit 1
;;
esac
+2 -2
View File
@@ -2,7 +2,7 @@
#
# Author : Gaston Gonzalez
# Date : 16 March 2024
# Updated : 6 October 2024
# Updated : 11 November 2024
# Purpose : Install base tools and configuration
set -e
@@ -21,7 +21,7 @@ apt install \
gpg \
jq \
net-tools \
openjdk-11-jdk \
openjdk-20-jdk \
openssh-server \
screen \
stow \
+41
View File
@@ -0,0 +1,41 @@
#!/bin/bash
# Author : Gaston Gonzalez
# Date : 3 November 2024
# Purpose : Install YAAC
set -e
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR
VERSION=latest
ZIP_FILE=YAAC.zip
INSTALL_DIR=/opt/yaac-${VERSION}
LINK_PATH=/opt/yaac
et-log "Installing YAAC..."
if [ ! -e ${ET_DIST_DIR}/${ZIP_FILE} ]; then
URL=https://www.ka2ddo.org/ka2ddo/${ZIP_FILE}
et-log "Downloading YAAC: ${URL}"
curl -s -L -o ${ZIP_FILE} --fail ${URL}
[ ! -e ${ET_DIST_DIR} ] && mkdir ${ET_DIST_DIR}
[ ! -e ${ET_SRC_DIR} ] && mkdir ${ET_SRC_DIR}
mv -v ${ZIP_FILE} ${ET_DIST_DIR}
fi
CWD_DIR=$(pwd)
if [ ! -e ${INSTALL_DIR} ]; then
mkdir -v ${INSTALL_DIR} && cd ${INSTALL_DIR}
unzip ${ET_DIST_DIR}/${ZIP_FILE}
else
et-log "${INSTALL_DIR} already exists."
fi
[ -e ${LINK_PATH} ] && rm ${LINK_PATH}
ln -s ${INSTALL_DIR} ${LINK_PATH}
cd ${CWD_DIR}
+3 -1
View File
@@ -2,7 +2,7 @@
#
# Author : Gaston Gonzalez
# Date : 16 March 2024
# Updated : 30 October 2024
# Updated : 3 November 2024
# Purpose : Main installer for EmComm Tools OS Community
. ./env.sh
@@ -35,6 +35,8 @@ exitIfNotRoot
./install-conky.sh
# Install packet tool chain
./install-direwolf.sh
./install-yaac.sh
./install-audio-tools.sh
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# Author : Gaston Gonzalez
# Date : 3 November 2024
# Purpose : Post installation validation script
PATH=.:$PATH
ls test-*.sh | while read test_case; do
eval ${test_case}
if [[ $? -eq 0 ]]; then
printf "%20s %s\n" "${test_case}" "[PASSED]"
else
printf "%20s %s\n" "${test_case}" "[FAILED]"
fi
done
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
# Author : Gaston Gonzalez
# Date : 3 November 2024
# Purpose : Test Java installation
# We need to redirect stderr to stdout otherwise grep will not match.
JAVA_OUT=$(java -version 2>&1 | grep 20.0.1)
exit $?