mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
fldigi Initial fldigi wrapper script. This is WiP. I need to port the configuration update logic from the test script under src/et-portaudio. Added fldigi to the list of services/modes to kill
This commit is contained in:
Executable
+73
@@ -0,0 +1,73 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Author : Gaston Gonzalez
|
||||||
|
# Date : 2 October 2025
|
||||||
|
# Purpose : Wrapper script for starting fldigi with PnP support
|
||||||
|
#
|
||||||
|
# Preconditions
|
||||||
|
# 1. Supported radio and audio interface are connected and properly detected
|
||||||
|
#
|
||||||
|
# Postconditions
|
||||||
|
# 1. Stop all running EmComm Tools modes
|
||||||
|
# 2. fldigi core settings updated (e.g., CAT, audio, user config and ETC defaults)
|
||||||
|
# 3. fldigi started
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "usage: $(basename $0) <command>"
|
||||||
|
echo " start - Update config and start fldigi"
|
||||||
|
echo " update-config - Update config"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $# -ne 1 ]]; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
notify_user() {
|
||||||
|
notify-send \
|
||||||
|
-t 5000 \
|
||||||
|
--app-name="EmComm Tools" \
|
||||||
|
"$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
/opt/emcomm-tools/bin/et-kill-all && update-config && /usr/local/bin/fldigi &
|
||||||
|
}
|
||||||
|
|
||||||
|
update-config () {
|
||||||
|
|
||||||
|
# 1. Check if the audio symlink was created by the udev rules
|
||||||
|
if [[ -e /dev/et-audio ]]; then
|
||||||
|
|
||||||
|
# 2. Check that this device was properly tagged with the ET_AUDIO env variable
|
||||||
|
APLAY_OUT=$(arecord -l | grep ET_AUDIO)
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
|
||||||
|
## Configure ALSA settings for sound card
|
||||||
|
/opt/emcomm-tools/bin/et-audio update-config
|
||||||
|
|
||||||
|
else
|
||||||
|
et-log "No ET_AUDIO device detected."
|
||||||
|
notify_user "Can't start fldigi. No ET_AUDIO device detected."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
et-log "No ET_AUDIO device plugged in."
|
||||||
|
notify_user "Can't start fldigi. No supported audio device plugged in."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
update-config)
|
||||||
|
update-config
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid command."
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Author : Gaston Gonzalez
|
# Author : Gaston Gonzalez
|
||||||
# Date : 12 November 2024
|
# Date : 12 November 2024
|
||||||
# Updated : 7 February 2025
|
# Updated : 2 October 2025
|
||||||
# Purpose : Stops all EmComm Tools sound-based services (i.e. modems) and
|
# Purpose : Stops all EmComm Tools sound-based services (i.e. modems) and
|
||||||
# amatuer radio applications to ensure a clean start for the next mode.
|
# amatuer radio applications to ensure a clean start for the next mode.
|
||||||
|
|
||||||
@@ -33,6 +33,10 @@ stop_all_services() {
|
|||||||
pkill et-vara
|
pkill et-vara
|
||||||
pkill VARA
|
pkill VARA
|
||||||
|
|
||||||
|
# Stop fldigi
|
||||||
|
pkill fldigi
|
||||||
|
pkill et-fldigi
|
||||||
|
|
||||||
stop_pat
|
stop_pat
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user