mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
YAAC - Added Bluetooth TNC support to YAAC for the UV Pro and VGC VR-N76
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
#
|
||||
# Author : Gaston Gonzalez
|
||||
# Date : 3 November 2024
|
||||
# Updated : 4 November 2024
|
||||
# Updated : 16 March 2025
|
||||
# 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
|
||||
# 2. Dire Wolf is started or Bluetooth TNC is connected
|
||||
#
|
||||
# Postconditions:
|
||||
# 1. Callsign is updated in YAAC
|
||||
@@ -39,20 +39,23 @@ notify_user() {
|
||||
start() {
|
||||
update-config
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
if [[ $? -eq 0 ]]; then
|
||||
CMD="java -jar /opt/yaac/YAAC.jar"
|
||||
|
||||
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."
|
||||
PS_OUT=$(ps -ef | grep "[r]fcomm0")
|
||||
if [[ $? -eq 0 ]]; then
|
||||
et-log "Starting YAAC in Bluetooth mode with: ${CMD}"
|
||||
${CMD}
|
||||
fi
|
||||
|
||||
PS_OUT=$(ps -ef | grep [d]irewolf)
|
||||
if [[ $? -eq 0 ]]; then
|
||||
et-log "Starting YAAC in Dire Wolf mode with: ${CMD}"
|
||||
else
|
||||
et-log "Can't start YAAC. Dire Wolf or Bluetooth TNC services 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
|
||||
@@ -74,18 +77,29 @@ update-config () {
|
||||
cp -v ${YAAC_CONF_FILE_PORTS_TEMPLATE} ${YAAC_CONF_FILE_PORTS}
|
||||
sed -i "s|{{ET_CALLSIGN}}|${CALLSIGN}|g" ${YAAC_CONF_FILE_PORTS}
|
||||
|
||||
|
||||
# Add GPS port only if it is available
|
||||
systemctl status gpsd --no-pager > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
if [[ $? -ne 0 ]]; then
|
||||
et-log "GPS not connected. Removing GPS port from configuration."
|
||||
sed -i '/GPSD/d' ${YAAC_CONF_FILE_PORTS}
|
||||
fi
|
||||
|
||||
PS_OUT=$(ps -ef | grep "[r]fcomm0")
|
||||
if [[ $? -ne 0 ]]; then
|
||||
et-log "Bluetooth TNC not connected. Removing rfcomm port from configuration."
|
||||
sed -i '/Serial_TNC/d' ${YAAC_CONF_FILE_PORTS}
|
||||
fi
|
||||
|
||||
PS_OUT=$(ps -ef | grep "[d]irewolf")
|
||||
if [[ $? -ne 0 ]]; then
|
||||
et-log "Dire Wolf not running. Removing KISS over TCP port from configuration."
|
||||
sed -i '/KISS-over-TCP/d' ${YAAC_CONF_FILE_PORTS}
|
||||
fi
|
||||
|
||||
echo "Generated the configuration below..."
|
||||
echo
|
||||
cat ${YAAC_CONF_FILE_PORTS}
|
||||
echo
|
||||
|
||||
}
|
||||
|
||||
case $1 in
|
||||
|
||||
Reference in New Issue
Block a user