From b9a212543ad7493bce479124b429393bd4b2f5a9 Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Sat, 31 May 2025 04:20:21 -0700 Subject: [PATCH 1/6] FTX-1 - Added initial PNP support for the Yaesu FTX-1 Field; Disablled brltty udev rules --- overlay/etc/udev/rules.d/78-et-ftx1.rules | 38 +++++++++++++++++++ overlay/etc/udev/rules.d/85-brltty.rules | 5 +++ overlay/opt/emcomm-tools/bin/et-js8call | 28 +++++++++++++- .../conf/radios.d/yaesu-ftx1.json | 20 ++++++++++ overlay/opt/emcomm-tools/sbin/udev-tester.sh | 19 +++++++++- .../opt/emcomm-tools/sbin/wrapper-rigctld.sh | 17 +++++++-- 6 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 overlay/etc/udev/rules.d/78-et-ftx1.rules create mode 100644 overlay/etc/udev/rules.d/85-brltty.rules create mode 100644 overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json diff --git a/overlay/etc/udev/rules.d/78-et-ftx1.rules b/overlay/etc/udev/rules.d/78-et-ftx1.rules new file mode 100644 index 0000000..b33cb23 --- /dev/null +++ b/overlay/etc/udev/rules.d/78-et-ftx1.rules @@ -0,0 +1,38 @@ +# Author : Gaston Gonzalez +# Date : 21 May 2025 +# Updated : 16 May 2025 +# Purpose : udev rules for the Yaesu FTX-1 via USB-C +# +# Preconditions: +# 1. Yaesu FTX-1 is selected via et-radio +# 2. Yaesu FTX-1 is connected via USB-C cable +# +# Postconditions: +# 1. /dev/et-cat created +# 2. /dev/et-audio created +# 3. rigctld is started +# +# Note: As of 05/21/25 Yaesu has not published their CAT control command specification. This is a +# temporary integration that does not include CAT control support. It will only key the PTT +# and provide audio in/out. You MUST set the frequency and mode yourself. + +# Special rule to ensure that the second serial interface (/dev/ttyUSB5) is tagged as ET_DEVICE=FTX-1 so +# that it can be used in the next CAT control rule. +KERNEL=="ttyUSB[0-9]*", SUBSYSTEM=="tty", PROGRAM="/opt/emcomm-tools/sbin/udev-tester.sh yaesu-ftx1", \ + ATTRS{bInterfaceNumber}=="01", \ + ENV{ET_DEVICE}="FTX-1" + +# CAT control device will only match if PROGRAM above matches (exit status=0) +SUBSYSTEM=="tty", ENV{ET_DEVICE}=="FTX-1", \ + ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea70",\ + ACTION=="add", \ + ENV{ET_SUBDEVICE}="CAT", GROUP="dialout", MODE="0660", SYMLINK+="et-cat", \ + RUN+="/usr/bin/systemctl start rigctld" + +# Audio device will only match if PROGRAM above matches (exit status=0) +SUBSYSTEM=="sound", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="0016", \ + PROGRAM="/opt/emcomm-tools/sbin/udev-tester.sh yaesu-ftx1", \ + ACTION=="add", \ + ENV{ET_DEVICE}="FTX-1", \ + ATTR{id}="ET_AUDIO", \ + ENV{ET_SUBDEVICE}="AUDIO", GROUP="audio", MODE="0660", SYMLINK+="et-audio" diff --git a/overlay/etc/udev/rules.d/85-brltty.rules b/overlay/etc/udev/rules.d/85-brltty.rules new file mode 100644 index 0000000..043452d --- /dev/null +++ b/overlay/etc/udev/rules.d/85-brltty.rules @@ -0,0 +1,5 @@ +# Author : Gaston Gonzalez +# Date : 31 May 2025 +# Purpose : Empty udev rule to prevent the BRLTTY subsystem from +# invoking /lib/udev/rules.d/85-brltty.rules. These rules +# hijacking many USB devices used by ETC. diff --git a/overlay/opt/emcomm-tools/bin/et-js8call b/overlay/opt/emcomm-tools/bin/et-js8call index 9f5783b..d0d002f 100755 --- a/overlay/opt/emcomm-tools/bin/et-js8call +++ b/overlay/opt/emcomm-tools/bin/et-js8call @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 24 October 2024 -# Updated : 20 November 2024 +# Updated : 26 May 2025 # Purpose : Wrapper script for starting JS8Call with PnP support # # Preconditions @@ -13,6 +13,10 @@ # 2. JS8Call audio settings updated # 3. JS8Call started +ET_HOME=/opt/emcomm-tools +ACTIVE_RADIO="${ET_HOME}/conf/radios.d/active-radio.json" +CAT_DEVICE=/dev/et-cat + usage() { echo "usage: $(basename $0) " echo " start - Update config and start JS8Call" @@ -63,6 +67,28 @@ update-config () { ET_RELEASE=$(et-system-info release) sed -i "s|^MyInfo.*|MyInfo=${ET_RELEASE}|" ${JS8CALL_CONF_FILE} + + # Set PTT to use Hamlib for both CAT control and PTT (default) + sed -i "s|^PTTport.*|PTTport=localhost:4532|" ${JS8CALL_CONF_FILE} + sed -i "s|PTT_method_[A-Z][A-Z][A-Z]|PTT_method_CAT|" ${JS8CALL_CONF_FILE} + + # Special case for select radios that only need to key the PTT, but do not + # have CAT control support or VOX support. This edge case was added for + # radios like the Yaesu FTX-1 Field before Yaesu published their CAT commands. + 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}" = "1" ]; then + PTT_ONLY=$(cat ${ET_HOME}/conf/radios.d/active-radio.json | jq -r .rigctrl.pttOnly) + + if [ "${PTT_ONLY}" = "true" ]; then + et-log "Configued JS8Call for PTT-only mode" + sed -i "s|PTT_method_[A-Z][A-Z][A-Z]|PTT_method_RTS|" ${JS8CALL_CONF_FILE} + sed -i "s|^PTTport.*|PTTport=/dev/et-cat|" ${JS8CALL_CONF_FILE} + fi + fi + fi + et-log "Updated JS8Call configuration with user callsign '${CALLSIGN}' and grid: '${GRID}'" # 1. Check if the symlink was created by the udev rules diff --git a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json new file mode 100644 index 0000000..9fb516b --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json @@ -0,0 +1,20 @@ +{ + "id": "yaesu-ftx1", + "vendor": "Yaesu", + "model": "FTX-1 (No CAT)", + "rigctrl": { + "id": "1", + "baud": "38400", + "ptt": "RTS", + "pttOnly": "true" + }, + "notes": [ + "Tune radio to desired frequency.", + "Long press [MODE] and set desired mode.", + "Use 'DATA-U' for most HF operation", + "Use 'TODO' for FM packet operation", + "Under MODE, long press 'PRESET' and select FT8" + ], + "fieldNotes": [ + ] +} diff --git a/overlay/opt/emcomm-tools/sbin/udev-tester.sh b/overlay/opt/emcomm-tools/sbin/udev-tester.sh index 28565b4..9f60211 100755 --- a/overlay/opt/emcomm-tools/sbin/udev-tester.sh +++ b/overlay/opt/emcomm-tools/sbin/udev-tester.sh @@ -1,7 +1,7 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 11 October 2024 -# Updated : 8 December 2024 +# Updated : 21 May 2025 # Purpose : Perform tests that can be used by the udev subsystem to aid # in rule development. This is intended to by used with the PROGRAM # directive inside of a udev rule. @@ -13,6 +13,20 @@ ET_HOME=/opt/emcomm-tools ACTIVE_RADIO="${ET_HOME}/conf/radios.d/active-radio.json" +# Exit with a 0 exit status if, and only if, the currently selected radio is +# a Yaesu FTX-1. +test_yaesu_ftx1() { + if [ -L "${ET_HOME}/conf/radios.d/active-radio.json" ]; then + ID=$(cat "${ET_HOME}/conf/radios.d/active-radio.json" | jq -r .id) + + if [[ "$ID" == "yaesu-ftx1" ]]; then + exit 0 + fi + fi + + exit 1 +} + # Exit with a 0 exit status if, and only if, the currently selected radio is # a Yaesu FT-891. test_yaesu_ft891() { @@ -82,6 +96,9 @@ if [ $# -ne 1 ]; then fi case $1 in + yaesu-ftx1) + test_yaesu_ftx1 + ;; yaesu-ft891) test_yaesu_ft891 ;; diff --git a/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh b/overlay/opt/emcomm-tools/sbin/wrapper-rigctld.sh index 165a638..1c1b9ab 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 : 28 October 2024 +# Updated : 31 May 2025 # Purpose : Wrapper startup/shutdown script around systemd/rigctld ET_HOME=/opt/emcomm-tools @@ -41,8 +41,19 @@ start() { 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 in VOX mode with: ${CMD}" + # Special case for select radios that only need to key the PTT, but do + # do not have CAT control support. This edge case was added for radios + # like the Yaesu FTX-1 Field before Yaesu published their CAT commands. + PTT_ONLY=$(cat ${ET_HOME}/conf/radios.d/active-radio.json | jq -r .rigctrl.pttOnly) + + if [ "${PTT_ONLY}" = "true" ]; then + CMD="rigctld -m ${ID} -p ${CAT_DEVICE} -P ${PTT} " + et-log "Starting rigctld in PTT-only mode with: ${CMD}" + else + CMD="rigctld -m ${ID} -P ${PTT} " + et-log "Starting rigctld in VOX mode with: ${CMD}" + fi + $CMD exit 0 fi From 7fa45bf0e3b8ecbb5b7a6311620a7b7bc784c7ca Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Sat, 31 May 2025 05:06:01 -0700 Subject: [PATCH 2/6] FTX-1 - Added support for basic audio settings. Updated operating notes --- overlay/opt/emcomm-tools/bin/et-audio | 14 +++++++++++++- .../opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json | 13 +++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/overlay/opt/emcomm-tools/bin/et-audio b/overlay/opt/emcomm-tools/bin/et-audio index 2f921e5..dc33bde 100755 --- a/overlay/opt/emcomm-tools/bin/et-audio +++ b/overlay/opt/emcomm-tools/bin/et-audio @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 31 October 2024 -# Updated : 11 November 2024 +# Updated : 31 May 2024 # Purpose : Configures ET audio device with sane defaults # # Preconditions @@ -85,6 +85,18 @@ update-config () { et-log "Applied amixer settings for ${ET_DEVICE_NAME}" ;; + "FTX-1") + # Unmute Speaker a set volume. Adjust if remote station can't decode you. Your TX controls. + amixer -q -c ${AUDIO_CARD} sset Speaker Playback Switch 42% unmute + # Unmute Mic + amixer -q -c ${AUDIO_CARD} sset Mic Playback Switch 52% unmute + # Set "L/R Capture" to 19. Adjust if you can't decode received audio. Your RX controls. + amixer -q -c ${AUDIO_CARD} sset Mic Capture Switch 31% unmute + # Disable Auto Gain Control + amixer -q -c ${AUDIO_CARD} sset 'Auto Gain Control' mute + + et-log "Applied amixer settings for ${ET_DEVICE_NAME}" + ;; *) et-log "No ALSA configuration specified for this ET_DEVICE." ;; diff --git a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json index 9fb516b..67c6bd7 100644 --- a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json @@ -10,10 +10,15 @@ }, "notes": [ "Tune radio to desired frequency.", - "Long press [MODE] and set desired mode.", - "Use 'DATA-U' for most HF operation", - "Use 'TODO' for FM packet operation", - "Under MODE, long press 'PRESET' and select FT8" + "Long press [MODE], then set accordingly for HF or VHF/UHF.", + "For HF operation:", + "- First, select 'DATA-U'.", + "- Then, long press 'PRESET' and select 'FT8'.", + "- The 'PREEST' button should be highlighted in blue.", + "For VHF/UHF FM operation:", + "- First, select 'FM'.", + "- Then, long press 'PRESET' and select 'FT8'.", + "- The 'PRESET' button should be highlighted in blue." ], "fieldNotes": [ ] From a4c07473a1bfbb3e5c0d76c50eb39c45882df45c Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Sat, 31 May 2025 13:29:01 -0700 Subject: [PATCH 3/6] FTX-1 - Removed earlier logic for selectively changing the PTT settings. The FTX-1 uses Hamlib just like every device, so no need for this initial prototype logic. Note: CAT control is not support. No manual from Yaesu yet. --- overlay/opt/emcomm-tools/bin/et-js8call | 28 +------------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/overlay/opt/emcomm-tools/bin/et-js8call b/overlay/opt/emcomm-tools/bin/et-js8call index d0d002f..9f5783b 100755 --- a/overlay/opt/emcomm-tools/bin/et-js8call +++ b/overlay/opt/emcomm-tools/bin/et-js8call @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 24 October 2024 -# Updated : 26 May 2025 +# Updated : 20 November 2024 # Purpose : Wrapper script for starting JS8Call with PnP support # # Preconditions @@ -13,10 +13,6 @@ # 2. JS8Call audio settings updated # 3. JS8Call started -ET_HOME=/opt/emcomm-tools -ACTIVE_RADIO="${ET_HOME}/conf/radios.d/active-radio.json" -CAT_DEVICE=/dev/et-cat - usage() { echo "usage: $(basename $0) " echo " start - Update config and start JS8Call" @@ -67,28 +63,6 @@ update-config () { ET_RELEASE=$(et-system-info release) sed -i "s|^MyInfo.*|MyInfo=${ET_RELEASE}|" ${JS8CALL_CONF_FILE} - - # Set PTT to use Hamlib for both CAT control and PTT (default) - sed -i "s|^PTTport.*|PTTport=localhost:4532|" ${JS8CALL_CONF_FILE} - sed -i "s|PTT_method_[A-Z][A-Z][A-Z]|PTT_method_CAT|" ${JS8CALL_CONF_FILE} - - # Special case for select radios that only need to key the PTT, but do not - # have CAT control support or VOX support. This edge case was added for - # radios like the Yaesu FTX-1 Field before Yaesu published their CAT commands. - 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}" = "1" ]; then - PTT_ONLY=$(cat ${ET_HOME}/conf/radios.d/active-radio.json | jq -r .rigctrl.pttOnly) - - if [ "${PTT_ONLY}" = "true" ]; then - et-log "Configued JS8Call for PTT-only mode" - sed -i "s|PTT_method_[A-Z][A-Z][A-Z]|PTT_method_RTS|" ${JS8CALL_CONF_FILE} - sed -i "s|^PTTport.*|PTTport=/dev/et-cat|" ${JS8CALL_CONF_FILE} - fi - fi - fi - et-log "Updated JS8Call configuration with user callsign '${CALLSIGN}' and grid: '${GRID}'" # 1. Check if the symlink was created by the udev rules From b4b7f868492701ab4f45204d6834a8da49fdd935 Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Wed, 4 Jun 2025 06:01:37 -0700 Subject: [PATCH 4/6] FTX-1 - Renamed and moved FTX-1 rules to process before FT-991A --- overlay/etc/udev/rules.d/{78-et-ftx1.rules => 77-et-ftx1.rules} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename overlay/etc/udev/rules.d/{78-et-ftx1.rules => 77-et-ftx1.rules} (100%) diff --git a/overlay/etc/udev/rules.d/78-et-ftx1.rules b/overlay/etc/udev/rules.d/77-et-ftx1.rules similarity index 100% rename from overlay/etc/udev/rules.d/78-et-ftx1.rules rename to overlay/etc/udev/rules.d/77-et-ftx1.rules From 2c8027c45772b5e585bfd6becd5d43b7d18955ad Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Wed, 4 Jun 2025 06:03:47 -0700 Subject: [PATCH 5/6] FTX-1 - Updated comments for brltty udev override --- overlay/etc/udev/rules.d/85-brltty.rules | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/overlay/etc/udev/rules.d/85-brltty.rules b/overlay/etc/udev/rules.d/85-brltty.rules index 043452d..ba00dcb 100644 --- a/overlay/etc/udev/rules.d/85-brltty.rules +++ b/overlay/etc/udev/rules.d/85-brltty.rules @@ -1,5 +1,7 @@ # Author : Gaston Gonzalez # Date : 31 May 2025 +# Updated : 4 June 2025 # Purpose : Empty udev rule to prevent the BRLTTY subsystem from # invoking /lib/udev/rules.d/85-brltty.rules. These rules -# hijacking many USB devices used by ETC. +# hijack some USB devices used by ETC operators. The Bionics +# MicroFox-50 was one of these hijacked devices. From 83467ecebf4faf4b1f66fca0956b2931beef8afa Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Wed, 4 Jun 2025 06:06:15 -0700 Subject: [PATCH 6/6] FTX-1 - Fixed typo in the notes section for the FTX-1 radio configuration --- overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json index 67c6bd7..4883b13 100644 --- a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ftx1.json @@ -14,7 +14,7 @@ "For HF operation:", "- First, select 'DATA-U'.", "- Then, long press 'PRESET' and select 'FT8'.", - "- The 'PREEST' button should be highlighted in blue.", + "- The 'PRESET' button should be highlighted in blue.", "For VHF/UHF FM operation:", "- First, select 'FM'.", "- Then, long press 'PRESET' and select 'FT8'.",