From 6837045d8b8cb925bb064223314b8db0cea87af8 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 25 Oct 2024 07:39:58 -0700 Subject: [PATCH] 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