From c9743be323620910c14774a0441136cfb5c4f47c Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 25 Oct 2024 14:10:54 -0700 Subject: [PATCH] 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