From 6837045d8b8cb925bb064223314b8db0cea87af8 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 25 Oct 2024 07:39:58 -0700 Subject: [PATCH 1/5] PnP - Initial work to get the DigiRig Mobile to work with a radio (HT or mobile) that does not support CAT. Note: This mode does not yet work as there are issues using the RTS signal to key the PTT while the Hamlib radio ID is to 1 (test mode). --- overlay/etc/skel/.conkyrc | 2 +- overlay/opt/emcomm-tools/bin/et-radio | 8 ++++---- .../{generic-vox.json => digirig-lite.json} | 6 +++--- .../conf/radios.d/digirig-mobile-no-cat.json | 12 ++++++++++++ .../conf/radios.d/yaesu-ft818nd.json | 2 +- .../emcomm-tools/conf/radios.d/yaesu-ft857d.json | 2 +- .../emcomm-tools/conf/radios.d/yaesu-ft897d.json | 2 +- overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh | 16 ++++++++++------ 8 files changed, 33 insertions(+), 17 deletions(-) rename overlay/opt/emcomm-tools/conf/radios.d/{generic-vox.json => digirig-lite.json} (52%) create mode 100644 overlay/opt/emcomm-tools/conf/radios.d/digirig-mobile-no-cat.json diff --git a/overlay/etc/skel/.conkyrc b/overlay/etc/skel/.conkyrc index 54f6fdb..1173e7d 100644 --- a/overlay/etc/skel/.conkyrc +++ b/overlay/etc/skel/.conkyrc @@ -34,7 +34,7 @@ ${font DejaVu Sans:bold:size=10}${color #8d5133}${alignc}INTERFACES ${font DejaVu Sans Mono:size=11}${color yellow}Radio: ${execpi 10 et-system-info active-radio} CAT : ${execpi 10 et-system-info et-cat} GPS : ${execpi 10 et-system-info et-gps} -Audio: ${execpi 10 et-system-info et-audio} ${execpi 10 et-system-info et-audio-card} +Audio: ${execpi 10 et-system-info et-audio} ${font DejaVu Sans:bold:size=9}${color #805f4f}${alignc}${execp /opt/emcomm-tools/bin/et-system-info release} ]]; diff --git a/overlay/opt/emcomm-tools/bin/et-radio b/overlay/opt/emcomm-tools/bin/et-radio index e8e10d1..c1c1bc0 100755 --- a/overlay/opt/emcomm-tools/bin/et-radio +++ b/overlay/opt/emcomm-tools/bin/et-radio @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 11 October 2024 -# Updated : 24 October 2024 +# Updated : 25 October 2024 # Purpose : A script for managaing plug-and-play radios set -e @@ -23,14 +23,14 @@ ACTIVE_RADIO="${ET_HOME}/conf/radios.d/active-radio.json" case $1 in list) - printf "%-20s %-10s %-10s\n" "Radio ID" "Vendor" "Model" + printf "%-24s %-10s %-10s\n" "Radio ID" "Vendor" "Model" find ${ET_HOME}/conf/radios.d -type f -name \*.json | sort -n | while read radio; do ID=$(cat $radio | jq -r .id) VENDOR=$(cat $radio | jq -r .vendor) MODEL=$(cat $radio | jq -r .model) - printf "%-20s %-10s %-10s\n" $ID "$VENDOR" "$MODEL" + printf "%-24s %-10s %-10s\n" $ID "$VENDOR" "$MODEL" done ;; @@ -48,7 +48,7 @@ case $1 in options+=("$ID" "$VENDOR $MODEL") done < <(find $ET_HOME/conf/radios.d -type f | sort) - SELECTED_RADIO=$(dialog --clear --menu "Select a radio:" 15 50 10 "${options[@]}" 3>&1 1>&2 2>&3) + SELECTED_RADIO=$(dialog --clear --menu "Select a radio:" 20 60 10 "${options[@]}" 3>&1 1>&2 2>&3) exit_status=$? # Reset terminal to its original state diff --git a/overlay/opt/emcomm-tools/conf/radios.d/generic-vox.json b/overlay/opt/emcomm-tools/conf/radios.d/digirig-lite.json similarity index 52% rename from overlay/opt/emcomm-tools/conf/radios.d/generic-vox.json rename to overlay/opt/emcomm-tools/conf/radios.d/digirig-lite.json index 6869810..e464b37 100644 --- a/overlay/opt/emcomm-tools/conf/radios.d/generic-vox.json +++ b/overlay/opt/emcomm-tools/conf/radios.d/digirig-lite.json @@ -1,7 +1,7 @@ { - "id": "generic-vox", - "vendor": "Generic", - "model": "VOX", + "id": "digirig-lite", + "vendor": "DigiRig", + "model": "Lite", "rigctrl": { "id": "1", "ptt": "NONE" diff --git a/overlay/opt/emcomm-tools/conf/radios.d/digirig-mobile-no-cat.json b/overlay/opt/emcomm-tools/conf/radios.d/digirig-mobile-no-cat.json new file mode 100644 index 0000000..535bf49 --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/radios.d/digirig-mobile-no-cat.json @@ -0,0 +1,12 @@ +{ + "id": "digirig-mobile-no-cat", + "vendor": "DigiRig", + "model": "Mobile (No CAT)", + "rigctrl": { + "id": "1", + "ptt": "RTS" + }, + "notes": [ + "Uses RTS to trigger PTT" + ] +} diff --git a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft818nd.json b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft818nd.json index d90c413..7a125f5 100644 --- a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft818nd.json +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft818nd.json @@ -1,7 +1,7 @@ { "id": "yaesu-ft818nd", "vendor": "Yaesu", - "model": "FT-818ND", + "model": "FT-818ND (DigiRig)", "rigctrl": { "id": "1041", "baud": "38400", diff --git a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft857d.json b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft857d.json index aecd61e..cfa6f6a 100644 --- a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft857d.json +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft857d.json @@ -1,7 +1,7 @@ { "id": "yaesu-ft857d", "vendor": "Yaesu", - "model": "FT-857D", + "model": "FT-857D (DigiRig)", "rigctrl": { "id": "1022", "baud": "38400", diff --git a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft897d.json b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft897d.json index aa3efcd..cca1bd5 100644 --- a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft897d.json +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft897d.json @@ -1,7 +1,7 @@ { "id": "yaesu-ft897d", "vendor": "Yaesu", - "model": "FT-897D", + "model": "FT-897D (Mobile)", "rigctrl": { "id": "1043", "baud": "38400", diff --git a/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh b/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh index d403f48..451872d 100755 --- a/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh +++ b/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 9 October 2024 -# Updated : 24 October 2024 +# Updated : 25 October 2024 # Purpose : Wrapper startup/shutdown script around systemd/rigctld ET_HOME=/opt/emcomm-tools @@ -29,17 +29,21 @@ do_full_auto() { start() { - # Special case for VOX devices like the DigiRig Lite. + # Special case for VOX devices like the DigiRig Lite and for the DigiRig Mobile + # when connected to a radio that does not support CAT control. if [ -L "${ET_HOME}/conf/radios.d/active-radio.json" ]; then - CUR_RADIO=$(cat "${ET_HOME}/conf/radios.d/active-radio.json" | jq -r .model) - if [ "${CUR_RADIO}" = "VOX" ]; then - et-log "Starting dummy rigctld service for VOX device." + RIG_ID=$(cat "${ET_HOME}/conf/radios.d/active-radio.json" | jq -r .rigctrl.id) + + # All devices that have no CAT control must have their ID set to 1. This + # a special test mode provided by Hamlib's rigctl NET interface. + if [ "${RIG_ID}" = "1" ]; then + et-log "Starting dummy rigctld service for device with no CAT support." ID=$(cat ${ET_HOME}/conf/radios.d/active-radio.json | jq -r .rigctrl.id) PTT=$(cat ${ET_HOME}/conf/radios.d/active-radio.json | jq -r .rigctrl.ptt) CMD="rigctld -m ${ID} -P ${PTT} " - et-log "Starting rigctld with: ${CMD}" + et-log "Starting rigctld n VOX mode with: ${CMD}" $CMD exit 0 From d0d4f5f199d364568977045174a14a67864d08bc Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 25 Oct 2024 11:19:32 -0700 Subject: [PATCH 2/5] PnP - Updated et-system-info to have a better human label with a non CAT device is used; added notes to the DigiRig Mobile (no CAT) radio definition and set the Hamlib ID to 6 for future purposes; updated comments in wrapper-rigctld --- overlay/opt/emcomm-tools/bin/et-system-info | 2 +- .../emcomm-tools/conf/radios.d/digirig-mobile-no-cat.json | 6 ++++-- overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/overlay/opt/emcomm-tools/bin/et-system-info b/overlay/opt/emcomm-tools/bin/et-system-info index 329bc4e..df82ac7 100755 --- a/overlay/opt/emcomm-tools/bin/et-system-info +++ b/overlay/opt/emcomm-tools/bin/et-system-info @@ -101,7 +101,7 @@ case $1 in echo "Connected. Can't access VFO"; fi else - echo "Connected. rigctld not running" + echo "Connected. No rig control" fi else echo "Not connected"; diff --git a/overlay/opt/emcomm-tools/conf/radios.d/digirig-mobile-no-cat.json b/overlay/opt/emcomm-tools/conf/radios.d/digirig-mobile-no-cat.json index 535bf49..c1ef914 100644 --- a/overlay/opt/emcomm-tools/conf/radios.d/digirig-mobile-no-cat.json +++ b/overlay/opt/emcomm-tools/conf/radios.d/digirig-mobile-no-cat.json @@ -3,10 +3,12 @@ "vendor": "DigiRig", "model": "Mobile (No CAT)", "rigctrl": { - "id": "1", + "id": "6", "ptt": "RTS" }, "notes": [ - "Uses RTS to trigger PTT" + "Set your VFO manually", + "Adjust your volume, RF gain and squelch manually", + "This mode uses the RTS signal to trigger the PTT" ] } diff --git a/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh b/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh index 451872d..3819e97 100755 --- a/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh +++ b/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh @@ -34,8 +34,8 @@ start() { if [ -L "${ET_HOME}/conf/radios.d/active-radio.json" ]; then RIG_ID=$(cat "${ET_HOME}/conf/radios.d/active-radio.json" | jq -r .rigctrl.id) - # All devices that have no CAT control must have their ID set to 1. This - # a special test mode provided by Hamlib's rigctl NET interface. + # All VOX devices use the dummy mode provided by Hamlib. This helps maintain + # a cleaner interface by leveraging rigctl NET in applications. if [ "${RIG_ID}" = "1" ]; then et-log "Starting dummy rigctld service for device with no CAT support." From be41c4aaa7dd865e67f2010fb5c6ce1fd5b0b24a Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 25 Oct 2024 11:43:23 -0700 Subject: [PATCH 3/5] JS8Call - Added support for notifying the user if JS8Call can't be started --- overlay/opt/emcomm-tools/bin/et-js8call | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/overlay/opt/emcomm-tools/bin/et-js8call b/overlay/opt/emcomm-tools/bin/et-js8call index c784270..69404d9 100755 --- a/overlay/opt/emcomm-tools/bin/et-js8call +++ b/overlay/opt/emcomm-tools/bin/et-js8call @@ -2,6 +2,7 @@ # # Author : Gaston Gonzalez # Date : 24 October 2024 +# Updated : 25 October 2024 # Purpose : Wrapper script for starting JS8Call with PnP support # # Preconditions @@ -21,6 +22,13 @@ if [ $# -ne 1 ]; then exit 1 fi +notify_user() { + notify-send \ + -t 10000 \ + --app-name="EmComm Tools" \ + "$1" +} + start() { update-config && /usr/bin/js8call & } @@ -59,10 +67,12 @@ update-config () { else et-log "No ET_AUDIO device detected." + notify_user "Can't start JS8Call. No ET_AUDIO device detected." exit 1 fi else et-log "No ET_AUDIO device plugged in." + notify_user "Can't start JS8Call. No supported audio device plugged in." exit 1 fi } From c9743be323620910c14774a0441136cfb5c4f47c Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 25 Oct 2024 14:10:54 -0700 Subject: [PATCH 4/5] PnP - Refactored the PnP implementation to handle the DigiRig Mobile no CAT control use case. Currently, the best workaround for the moment is to restore the JS8Call INI configuration on every startup using a template file. This will wipe out user settings on every start-up, but it is stable for now. I have a couple of long term solutions to preserve the user's settings. --- overlay/opt/emcomm-tools/bin/et-js8call | 21 +++++++++++++-- .../conf/radios.d/yaesu-ft897d.json | 2 +- .../template.d/js8call/JS8Call.no-rigctl.ini | 27 +++++++++++++++++++ .../template.d/js8call/JS8Call.rigctl.ini | 27 +++++++++++++++++++ .../opt/emcomm-tools/sbin/wrapper-rigctld.sh | 7 +++-- 5 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 overlay/opt/emcomm-tools/conf/template.d/js8call/JS8Call.no-rigctl.ini create mode 100644 overlay/opt/emcomm-tools/conf/template.d/js8call/JS8Call.rigctl.ini diff --git a/overlay/opt/emcomm-tools/bin/et-js8call b/overlay/opt/emcomm-tools/bin/et-js8call index 69404d9..02d0d88 100755 --- a/overlay/opt/emcomm-tools/bin/et-js8call +++ b/overlay/opt/emcomm-tools/bin/et-js8call @@ -6,10 +6,12 @@ # Purpose : Wrapper script for starting JS8Call with PnP support # # Preconditions -# 1. Support radio and audio interface are connected and properly detected +# 1. Supported radio and audio interface are connected and properly detected # # Postconditions -# 1. JS8Call is started with audio settings updated +# 1. JS8Call audio settings updated +# 2. JS8Call rig settings updated +# 3. JS8Call started usage() { echo "usage: $(basename $0) " @@ -36,6 +38,20 @@ start() { update-config () { JS8CALL_CONF_FILE="${HOME}/.config/JS8Call.ini" + JS8CALL_TEMPLATE_CONF_FILE=${ET_HOME}/conf/template.d/js8call/JS8Call.rigctl.ini + + # Special case for the DigiRig Mobile when connected to a radio that does + # not support CAT control. + if [ -L "${ET_HOME}/conf/radios.d/active-radio.json" ]; then + RIG_ID=$(cat "${ET_HOME}/conf/radios.d/active-radio.json" | jq -r .rigctrl.id) + + if [ "${RIG_ID}" = "6" ]; then + JS8CALL_TEMPLATE_CONF_FILE=${ET_HOME}/conf/template.d/js8call/JS8Call.no-rigctl.ini + fi + fi + + cp ${JS8CALL_TEMPLATE_CONF_FILE} ${JS8CALL_CONF_FILE} + et-log "Replaced JS8Call configuration with template: ${JS8CALL_TEMPLATE_CONF_FILE}" # 1. Check if the symlink was created by the udev rules if [ -e /dev/et-audio ]; then @@ -75,6 +91,7 @@ update-config () { notify_user "Can't start JS8Call. No supported audio device plugged in." exit 1 fi + } case $1 in diff --git a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft897d.json b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft897d.json index cca1bd5..f2f0356 100644 --- a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft897d.json +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft897d.json @@ -1,7 +1,7 @@ { "id": "yaesu-ft897d", "vendor": "Yaesu", - "model": "FT-897D (Mobile)", + "model": "FT-897D (DigiRig)", "rigctrl": { "id": "1043", "baud": "38400", diff --git a/overlay/opt/emcomm-tools/conf/template.d/js8call/JS8Call.no-rigctl.ini b/overlay/opt/emcomm-tools/conf/template.d/js8call/JS8Call.no-rigctl.ini new file mode 100644 index 0000000..2638a89 --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/js8call/JS8Call.no-rigctl.ini @@ -0,0 +1,27 @@ +[Configuration] +AcceptTCPRequests=true +AutoGrid=true +AutoreplyConfirmation=false +AutoreplyOnAtStartup=true +CATNetworkPort=localhost:4532 +CheckForUpdates=false +HeartbeatAckSNR=true +HideControls=true +Miles=true +MyCall=N0CALL +MyGrid=DM33 +MyGroups=@@TTP,@@TTPNET +Polling=1 +PSKReporter=false +PTTMethod=@Variant(\0\0\0\x7f\0\0\0\x1eTransceiverFactory::PTTMethod\0\0\0\0\xfPTT_method_RTS\0) +PTTport=/dev/et-cat +SubMode=0 +SubModeHB=true +SubModeHBAck=true +Rig=None +SpotToAPRS=false +TCPEnabled=true +TCPMaxConnections=3 +TCPServer=127.0.0.1 +TCPServerPort=2442 +TxIdleWatchdog=0 diff --git a/overlay/opt/emcomm-tools/conf/template.d/js8call/JS8Call.rigctl.ini b/overlay/opt/emcomm-tools/conf/template.d/js8call/JS8Call.rigctl.ini new file mode 100644 index 0000000..e49aea2 --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/js8call/JS8Call.rigctl.ini @@ -0,0 +1,27 @@ +[Configuration] +AcceptTCPRequests=true +AutoGrid=true +AutoreplyConfirmation=false +AutoreplyOnAtStartup=true +CATNetworkPort=localhost:4532 +CheckForUpdates=false +HeartbeatAckSNR=true +HideControls=true +Miles=true +MyCall=N0CALL +MyGrid=DM33 +MyGroups=@@TTP,@@TTPNET +Polling=1 +PSKReporter=false +PTTMethod=@Variant(\0\0\0\x7f\0\0\0\x1eTransceiverFactory::PTTMethod\0\0\0\0\xfPTT_method_CAT\0) +PTTport=localhost:4532 +SubMode=0 +SubModeHB=true +SubModeHBAck=true +Rig=Hamlib NET rigctl +SpotToAPRS=false +TCPEnabled=true +TCPMaxConnections=3 +TCPServer=127.0.0.1 +TCPServerPort=2442 +TxIdleWatchdog=0 diff --git a/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh b/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh index 3819e97..755c283 100755 --- a/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh +++ b/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh @@ -29,21 +29,20 @@ do_full_auto() { start() { - # Special case for VOX devices like the DigiRig Lite and for the DigiRig Mobile - # when connected to a radio that does not support CAT control. + # Special case for the DigiRig Lite. if [ -L "${ET_HOME}/conf/radios.d/active-radio.json" ]; then RIG_ID=$(cat "${ET_HOME}/conf/radios.d/active-radio.json" | jq -r .rigctrl.id) # All VOX devices use the dummy mode provided by Hamlib. This helps maintain # a cleaner interface by leveraging rigctl NET in applications. if [ "${RIG_ID}" = "1" ]; then - et-log "Starting dummy rigctld service for device with no CAT support." + et-log "Starting dummy rigctld service for VOX device." ID=$(cat ${ET_HOME}/conf/radios.d/active-radio.json | jq -r .rigctrl.id) PTT=$(cat ${ET_HOME}/conf/radios.d/active-radio.json | jq -r .rigctrl.ptt) CMD="rigctld -m ${ID} -P ${PTT} " - et-log "Starting rigctld n VOX mode with: ${CMD}" + et-log "Starting rigctld in VOX mode with: ${CMD}" $CMD exit 0 From 2b9e11a9b8f21a5dce828650a2c79ce19c245934 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 25 Oct 2024 14:23:41 -0700 Subject: [PATCH 5/5] PnP - Prevented startup of rigctld for DigiRig Mobile for radios that do not support CAT control. --- overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh b/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh index 755c283..d33753a 100755 --- a/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh +++ b/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh @@ -29,7 +29,7 @@ do_full_auto() { start() { - # Special case for the DigiRig Lite. + # Special cases for the DigiRig Lite and DigiRig Mobile with no CAT. if [ -L "${ET_HOME}/conf/radios.d/active-radio.json" ]; then RIG_ID=$(cat "${ET_HOME}/conf/radios.d/active-radio.json" | jq -r .rigctrl.id) @@ -44,7 +44,15 @@ start() { CMD="rigctld -m ${ID} -P ${PTT} " et-log "Starting rigctld in VOX mode with: ${CMD}" $CMD + exit 0 + fi + # We can't use rigctld in dummy mode like we did with the DigiRig Lite as the Hamlib dummy + # rigs (1 and 6) do not honor the -P flag. Passing -P RTS is ignored. I need to create a custom rig for + # the DigiRig Mobile for radios that do not support CAT control, but haver their PTT triggered via + # the RTS signal. + if [ "${RIG_ID}" = "6" ]; then + et-log "Skipping rigctld startup for DigiRig Mobile since radio does not support CAT control." exit 0 fi fi