et-mode - Added support for 300, 1200 and 9600 baud packet operation

This commit is contained in:
Gaston Gonzalez
2025-01-14 02:10:22 -07:00
parent f53eb1d0f5
commit 6990d44f58
7 changed files with 132 additions and 12 deletions
+25 -5
View File
@@ -2,7 +2,7 @@
#
# Author : Gaston Gonzalez
# Date : 1 November 2024
# Updated : 8 November 2024
# Updated : 14 January 2025
# Purpose : Wrapper script for starting Dire Wolf with PnP support
#
# Preconditions:
@@ -23,7 +23,9 @@ usage() {
echo " <type>"
echo " aprs-digipeater - Run in RF-only APRS digipeater mode"
echo " packet-digipeater - Run in RF-only packet digipeater mode"
echo " simple - Run in simple packet mode"
echo " simple - Run in simple (1200 baud) packet mode"
echo " 300 - Run in 300 baud packet mode (HF)"
echo " 9600 - Run in 9600 baud packet mode (VHF/UHF)"
}
if [ $# -ne 2 ]; then
@@ -31,6 +33,16 @@ if [ $# -ne 2 ]; then
exit 1
fi
check_9600_baud () {
# For 9600 baud operation, we use the /dev/et-cat device directly
# in direwolf, instead of going through rigctl.
if [ ! -e /dev/et-cat ]; then
et-log "PTT devices not found for 9600 baud operation."
exit 1
fi
}
MODE=$2
case "${MODE}" in
aprs-digipeater)
@@ -42,6 +54,13 @@ case "${MODE}" in
simple)
DIREWOLF_TEMPLATE_CONF_FILE="${ET_HOME}/conf/template.d/packet/direwolf.${MODE}.conf"
;;
300)
DIREWOLF_TEMPLATE_CONF_FILE="${ET_HOME}/conf/template.d/packet/direwolf.${MODE}.conf"
;;
9600)
check_9600_baud
DIREWOLF_TEMPLATE_CONF_FILE="${ET_HOME}/conf/template.d/packet/direwolf.${MODE}.conf"
;;
*)
et-log "Can't started Dire Wolf. Mode '${MODE}' not supported"
usage
@@ -60,7 +79,7 @@ notify_user() {
[ ! -e ${ET_LOG_DIR} ] && mkdir -p ${ET_LOG_DIR}
start() {
update-config
update_config
if [ $? -eq 0 ]; then
@@ -81,7 +100,8 @@ start() {
fi
}
update-config () {
update_config () {
et-log "Attempting to start Dire Wolf in mode: '${MODE}'"
@@ -140,7 +160,7 @@ case $1 in
start
;;
update-config)
update-config
update_config
;;
*)
echo "Invalid command."
+3
View File
@@ -2,6 +2,7 @@
#
# Author : Gaston Gonzalez
# Date : 12 November 2024
# Updated : 13 January 2025
# Purpose : Stops all EmComm Tools sound-based services (i.e. modems) and
# amatuer radio applications to ensure a clean start for the next mode.
@@ -11,6 +12,8 @@ stop_all_services() {
systemctl --user stop et-service-winlink-ardop
systemctl --user stop et-service-winlink-packet
systemctl --user stop et-service-ardop
systemctl --user stop et-service-direwolf-300
systemctl --user stop et-service-direwolf-9600
systemctl --user stop et-service-direwolf-simple
systemctl --user stop et-service-direwolf-aprs-digipeater
systemctl --user stop et-service-direwolf-packet-digipeater
+30 -3
View File
@@ -2,7 +2,7 @@
#
# Author : Gaston Gonzalez
# Date : 6 November 2024
# Updated : 5 December 2024
# Updated : 14 January 2025
# Purpose : Configures the system for a specific mode of operation
# Use a simple text file to save the state of the last mode selected
@@ -19,6 +19,9 @@ MODE_ID_PACKET_DIGIPEATER="packet-digipeater"
MODE_ID_WINLINK_ARDOP="winlink-ardop"
MODE_ID_WINLINK_PACKET="winlink-packet"
# Default to 1200 baud
PACKET_MODE=simple
# Attempt to stop all EmComm Tools services regardless if they are running.
stop_all_services() {
et-kill-all
@@ -63,6 +66,23 @@ start_and_wait_for_service() {
exit_on_service_failure ${systemd_unit_name}
}
select_direwolf_mode () {
packet_mode=()
packet_mode+=("simple" "1200 baud (default for VHF/UHF)")
packet_mode+=("9600" "9600 baud (VHF/UHF)")
packet_mode+=("300" "300 baud (HF)")
PACKET_MODE=$(dialog --clear --menu "Select a modem" 16 65 10 "${packet_mode[@]}" 3>&1 1>&2 2>&3)
exit_status=$?
tput sgr 0 && clear
if [ ${exit_status} -ne 0 ]; then
et-log "No modem selected. Mode will not be started."
exit 1
fi
}
# Build list of options
options=()
options+=("${MODE_ID_NONE}" "No mode selected")
@@ -100,12 +120,19 @@ if [ $exit_status -eq 0 ]; then
et-yaac start
;;
${MODE_ID_BBS_CLIENT})
start_and_wait_for_service et-service-direwolf-simple
select_direwolf_mode
et-log "Using ${PACKET_MODE} as the modem speed."
start_and_wait_for_service et-service-direwolf-${PACKET_MODE}
et-log "Starting Paracon."
et-paracon start
;;
${MODE_ID_BBS_CLIENT2})
start_and_wait_for_service et-service-direwolf-simple
select_direwolf_mode
et-log "Using ${PACKET_MODE} as the modem speed."
start_and_wait_for_service et-service-direwolf-${PACKET_MODE}
et-log "Starting QtTermTCP."
et-qttermtcp start
;;