From f53eb1d0f5c52d2ad997d68203dad8d448fcddb3 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 10 Jan 2025 08:11:31 -0700 Subject: [PATCH 1/3] HF BBS - Initial direwolf configuration for 300 baud HF --- .../conf/template.d/packet/direwolf.hf.conf | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.hf.conf diff --git a/overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.hf.conf b/overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.hf.conf new file mode 100644 index 0000000..916776a --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.hf.conf @@ -0,0 +1,32 @@ +# Author : Gaston Gonzalez +# Date : 31 October 2024 +# Updated : 10 January 2025 +# Purpose : Dire Wolf template for basic packet operation + +# Audio settings +ADEVICE {{ET_AUDIO_DEVICE}} +CHANNEL 0 + +# User settings +MYCALL {{ET_CALLSIGN}} + +# Modem settings +MODEM 300 A- 7@30 +PACLEN 60 +FRACK 5 +MAXFRAME 1 +# 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 use Dire Wolf as the packet engine +AGWPORT 8000 +KISSPORT 8001 From 6990d44f588b631436597a1bb5be22189ad0ed54 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 14 Jan 2025 02:10:22 -0700 Subject: [PATCH 2/3] et-mode - Added support for 300, 1200 and 9600 baud packet operation --- .../user/et-service-direwolf-300.service | 20 +++++++++++ .../user/et-service-direwolf-9600.service | 20 +++++++++++ overlay/opt/emcomm-tools/bin/et-direwolf | 30 ++++++++++++++--- overlay/opt/emcomm-tools/bin/et-kill-all | 3 ++ overlay/opt/emcomm-tools/bin/et-mode | 33 +++++++++++++++++-- .../{direwolf.hf.conf => direwolf.300.conf} | 11 ++++--- .../conf/template.d/packet/direwolf.9600.conf | 27 +++++++++++++++ 7 files changed, 132 insertions(+), 12 deletions(-) create mode 100644 overlay/etc/skel/.config/systemd/user/et-service-direwolf-300.service create mode 100644 overlay/etc/skel/.config/systemd/user/et-service-direwolf-9600.service rename overlay/opt/emcomm-tools/conf/template.d/packet/{direwolf.hf.conf => direwolf.300.conf} (60%) create mode 100644 overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.9600.conf diff --git a/overlay/etc/skel/.config/systemd/user/et-service-direwolf-300.service b/overlay/etc/skel/.config/systemd/user/et-service-direwolf-300.service new file mode 100644 index 0000000..ebf1426 --- /dev/null +++ b/overlay/etc/skel/.config/systemd/user/et-service-direwolf-300.service @@ -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 diff --git a/overlay/etc/skel/.config/systemd/user/et-service-direwolf-9600.service b/overlay/etc/skel/.config/systemd/user/et-service-direwolf-9600.service new file mode 100644 index 0000000..845b543 --- /dev/null +++ b/overlay/etc/skel/.config/systemd/user/et-service-direwolf-9600.service @@ -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 diff --git a/overlay/opt/emcomm-tools/bin/et-direwolf b/overlay/opt/emcomm-tools/bin/et-direwolf index a0843a9..e895418 100755 --- a/overlay/opt/emcomm-tools/bin/et-direwolf +++ b/overlay/opt/emcomm-tools/bin/et-direwolf @@ -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 " " 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." diff --git a/overlay/opt/emcomm-tools/bin/et-kill-all b/overlay/opt/emcomm-tools/bin/et-kill-all index 4d4f3dd..3182c39 100755 --- a/overlay/opt/emcomm-tools/bin/et-kill-all +++ b/overlay/opt/emcomm-tools/bin/et-kill-all @@ -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 diff --git a/overlay/opt/emcomm-tools/bin/et-mode b/overlay/opt/emcomm-tools/bin/et-mode index e6e99db..b010c8b 100755 --- a/overlay/opt/emcomm-tools/bin/et-mode +++ b/overlay/opt/emcomm-tools/bin/et-mode @@ -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 ;; diff --git a/overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.hf.conf b/overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.300.conf similarity index 60% rename from overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.hf.conf rename to overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.300.conf index 916776a..438e2e1 100644 --- a/overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.hf.conf +++ b/overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.300.conf @@ -1,7 +1,7 @@ # Author : Gaston Gonzalez # Date : 31 October 2024 -# Updated : 10 January 2025 -# Purpose : Dire Wolf template for basic packet operation +# Updated : 13 January 2025 +# Purpose : Dire Wolf template for 300 baud packet operation # Audio settings ADEVICE {{ET_AUDIO_DEVICE}} @@ -11,11 +11,13 @@ CHANNEL 0 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 -# Settings from The Modern Ham (KN4MKB) + +# More modem settings from The Modern Ham (KN4MKB) PERSIST 63 SLOTTIME 12 RETRY 10 @@ -27,6 +29,7 @@ TXTAIL 30 # EmComm Tools uses Hamlib's rig control daemon for all radio interfaces. PTT RIG 2 localhost:4532 -# Enable ports to allow other applications use Dire Wolf as the packet engine +# Enable ports to allow other applications to use Dire Wolf as the +# packet engine. AGWPORT 8000 KISSPORT 8001 diff --git a/overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.9600.conf b/overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.9600.conf new file mode 100644 index 0000000..572e31e --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/packet/direwolf.9600.conf @@ -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 From e675f40249e523e50f41befdd681a18b93c220c8 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 14 Jan 2025 02:27:16 -0700 Subject: [PATCH 3/3] et-mode - Add user message if 9600 packet operation is selected --- overlay/opt/emcomm-tools/bin/et-mode | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/overlay/opt/emcomm-tools/bin/et-mode b/overlay/opt/emcomm-tools/bin/et-mode index b010c8b..b1e5862 100755 --- a/overlay/opt/emcomm-tools/bin/et-mode +++ b/overlay/opt/emcomm-tools/bin/et-mode @@ -72,9 +72,13 @@ select_direwolf_mode () { 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) + 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