From 34aea9b593e3cbcd9ac9e70312734080e7e93854 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 12 Nov 2024 07:43:20 -0700 Subject: [PATCH] Issue - Fixed issue to ensure that all relevant EmComm Tools modes and services are stopped before starting JS8Call. Only one application can use the audio card at a time since this platform uses ALSA --- overlay/opt/emcomm-tools/bin/et-js8call | 9 +++++---- overlay/opt/emcomm-tools/bin/et-kill-all | 20 ++++++++++++++++++++ overlay/opt/emcomm-tools/bin/et-mode | 12 +++--------- 3 files changed, 28 insertions(+), 13 deletions(-) create mode 100755 overlay/opt/emcomm-tools/bin/et-kill-all diff --git a/overlay/opt/emcomm-tools/bin/et-js8call b/overlay/opt/emcomm-tools/bin/et-js8call index 4393151..c5efad9 100755 --- a/overlay/opt/emcomm-tools/bin/et-js8call +++ b/overlay/opt/emcomm-tools/bin/et-js8call @@ -2,15 +2,16 @@ # # Author : Gaston Gonzalez # Date : 24 October 2024 -# Updated : 1 November 2024 +# Updated : 12 November 2024 # Purpose : Wrapper script for starting JS8Call with PnP support # # Preconditions # 1. Supported radio and audio interface are connected and properly detected # # Postconditions -# 1. JS8Call audio settings updated -# 2. JS8Call started +# 1. Stop all running EmComm Tools modes and services +# 2. JS8Call audio settings updated +# 3. JS8Call started usage() { echo "usage: $(basename $0) " @@ -31,7 +32,7 @@ notify_user() { } start() { - update-config && /usr/bin/js8call & + /opt/emcomm-tools/bin/et-kill-all && update-config && /usr/bin/js8call & } update-config () { diff --git a/overlay/opt/emcomm-tools/bin/et-kill-all b/overlay/opt/emcomm-tools/bin/et-kill-all new file mode 100755 index 0000000..4d4f3dd --- /dev/null +++ b/overlay/opt/emcomm-tools/bin/et-kill-all @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 12 November 2024 +# Purpose : Stops all EmComm Tools sound-based services (i.e. modems) and +# amatuer radio applications to ensure a clean start for the next mode. + +# 1. Attempt to stop all EmComm Tools services regardless if they are running. +# 2. Stop the applications first, then the modems. +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-simple + systemctl --user stop et-service-direwolf-aprs-digipeater + systemctl --user stop et-service-direwolf-packet-digipeater +} + +et-log "Stopping all services" +stop_all_services diff --git a/overlay/opt/emcomm-tools/bin/et-mode b/overlay/opt/emcomm-tools/bin/et-mode index 0bd7300..1e105c0 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 : 8 November 2024 +# Updated : 12 November 2024 # Purpose : Configures the system for a specific mode of operation # Use a simple text file to save the state of the last mode selected @@ -16,15 +16,9 @@ MODE_ID_PACKET_DIGIPEATER="packet-digipeater" MODE_ID_WINLINK_ARDOP="winlink-ardop" MODE_ID_WINLINK_PACKET="winlink-packet" -# 1. Attempt to stop all EmComm Tools services regardless if they are running. -# 2. Stop the applications first, then the modems. +# Attempt to stop all EmComm Tools services regardless if they are running. 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-simple - systemctl --user stop et-service-direwolf-aprs-digipeater - systemctl --user stop et-service-direwolf-packet-digipeater + et-kill-all } exit_on_service_failure() {