Merge pull request #21 from thetechprepper/feature/hf-bbs-client

Merging support for 300, 1200, and 9600 baud packet
This commit is contained in:
thetechprepper
2025-01-14 05:11:51 -07:00
committed by GitHub
7 changed files with 164 additions and 8 deletions
@@ -0,0 +1,20 @@
# Author : Gaston Gonzalez
# Date : 13 January 2025
# Purpose : User systemd unit file for EmComm Tools Dire Wolf 300 baud
# : packet service.
#
# Usage:
# Check status : systemctl --user status et-service-direwolf-300
# Start service : systemctl --user start et-service-direwolf-300
# Stop service : systemctl --user stop et-service-direwolf-300
# Reload this config : systemctl --user daemon-reload
[Unit]
Description=EmComm Tools Dire Wolf 300 baud packet service
[Service]
ExecStart=/opt/emcomm-tools/bin/et-direwolf start 300
Restart=no
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,20 @@
# Author : Gaston Gonzalez
# Date : 13 January 2025
# Purpose : User systemd unit file for EmComm Tools Dire Wolf 9600 baud
# : packet service.
#
# Usage:
# Check status : systemctl --user status et-service-direwolf-9600
# Start service : systemctl --user start et-service-direwolf-9600
# Stop service : systemctl --user stop et-service-direwolf-9600
# Reload this config : systemctl --user daemon-reload
[Unit]
Description=EmComm Tools Dire Wolf 9600 baud packet service
[Service]
ExecStart=/opt/emcomm-tools/bin/et-direwolf start 9600
Restart=no
[Install]
WantedBy=multi-user.target
+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
+34 -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,27 @@ 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" 10 60 10 "${packet_mode[@]}" 3>&1 1>&2 2>&3)
exit_status=$?
if [ "${PACKET_MODE}" == "9600" ]; then
dialog --title "Note on 9600 Baud" --msgbox "9600 baud is only supported on limited radios and typically requires a special cable.\n\nDon't forget to set the packet settings to 9600 on the radio." 0 0
fi
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 +124,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
;;
@@ -0,0 +1,35 @@
# Author : Gaston Gonzalez
# Date : 31 October 2024
# Updated : 13 January 2025
# Purpose : Dire Wolf template for 300 baud packet operation
# Audio settings
ADEVICE {{ET_AUDIO_DEVICE}}
CHANNEL 0
# User settings
MYCALL {{ET_CALLSIGN}}
# Modem settings
# Use 7 decoders spaced 30 Hz apart to improve chances of decode on HF.
MODEM 300 A- 7@30
PACLEN 60
FRACK 5
MAXFRAME 1
# More modem settings from The Modern Ham (KN4MKB)
PERSIST 63
SLOTTIME 12
RETRY 10
DWAIT 0
TXDELAY 50
TXTAIL 30
# Rig control settings. Do not change this.
# EmComm Tools uses Hamlib's rig control daemon for all radio interfaces.
PTT RIG 2 localhost:4532
# Enable ports to allow other applications to use Dire Wolf as the
# packet engine.
AGWPORT 8000
KISSPORT 8001
@@ -0,0 +1,27 @@
# Author : Gaston Gonzalez
# Date : 12 January 2025
# Purpose : Dire Wolf template for 9600 baud packet operation
# Audio settings
ADEVICE {{ET_AUDIO_DEVICE}}
ARATE 48000
CHANNEL 0
# User settings
MYCALL {{ET_CALLSIGN}}
# Modem settings
MODEM 9600
# Use TXDELAY fro UZ7HO: 15 * 10 = 150ms
TXDELAY 15
# Use TXTAIL from UZ7HO: 5 * 10 = 50ms
TXTAIL 5
# For 9600 baud, use RTS to key the PTT. This is the only case
# where we do not use Hamlib's rigctl in EmComm Tools.
PTT /dev/et-cat RTS
# Enable ports to allow other applications to use Dire Wolf as the
# packet engine.
AGWPORT 8000
KISSPORT 8001