From 66fa7d3744b5352c198cf0ae07452f863175e96c Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Mon, 11 Nov 2024 13:38:44 -0700 Subject: [PATCH 1/6] FT-891 - Initial experimental support for the Yaesu FT-891 via the DigiRig DR-891. This radio is a pain! --- ...emove.rules => 75-et-generic-remove.rules} | 0 .../udev/rules.d/79-et-digirig-dr891.rules | 36 +++++++++++++++ .../conf/radios.d/yaesu-ft891.json | 16 +++++++ overlay/opt/emcomm-tools/sbin/udev-tester.sh | 44 +++++++++++++++++++ 4 files changed, 96 insertions(+) rename overlay/etc/udev/rules.d/{79-et-generic-remove.rules => 75-et-generic-remove.rules} (100%) create mode 100644 overlay/etc/udev/rules.d/79-et-digirig-dr891.rules create mode 100644 overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json create mode 100755 overlay/opt/emcomm-tools/sbin/udev-tester.sh diff --git a/overlay/etc/udev/rules.d/79-et-generic-remove.rules b/overlay/etc/udev/rules.d/75-et-generic-remove.rules similarity index 100% rename from overlay/etc/udev/rules.d/79-et-generic-remove.rules rename to overlay/etc/udev/rules.d/75-et-generic-remove.rules diff --git a/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules b/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules new file mode 100644 index 0000000..57ca857 --- /dev/null +++ b/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules @@ -0,0 +1,36 @@ +# Author : Gaston Gonzalez +# Date : 11 November 2024 +# Purpose : udev rules for the Yaesu FT-891 via the DigiRig DR-891 +# +# Preconditions: +# 1. Yaesu FT-891 is selected via et-radio +# 2. Yaesu FT-891 is connected via DR-891 USB cable +# +# Postconditions: +# 1. /dev/et-cat created +# 2. /dev/et-audio created +# 3. rigctld is started +# + +# Ensure that the FT-891 is set as the current radio configuration. +# If it is, set ET_DEVICE=FT-891 to allow following rules to match. +SUBSYSTEM=="tty|sound", PROGRAM="/opt/emcomm-tools/sbin/udev-tester.sh yaesu-ft891", \ + ENV{ET_DEVICE}="FT-891" + +# CAT control device will only match if PROGRAM above matches (exit status=0) +#SUBSYSTEM=="tty", ENV{ET_DEVICE}=="FT-891", \ +# 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" + +SUBSYSTEMS=="usb", ENV{ET_DEVICE}=="FT-891", ATTRS{bInterfaceProtocol}=="00", \ + 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", ENV{ET_DEVICE}=="FT-891", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="0012", \ + ACTION=="add", \ + ATTR{id}="ET_AUDIO", \ + ENV{ET_SUBDEVICE}="AUDIO", GROUP="audio", MODE="0660", SYMLINK+="et-audio" diff --git a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json new file mode 100644 index 0000000..b6edeff --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json @@ -0,0 +1,16 @@ +{ + "id": "yaesu-ft891", + "vendor": "Yaesu", + "model": "FT-891 (DR-891)", + "rigctrl": { + "id": "1036", + "baud": "38400", + "ptt": "RTS" + }, + "notes": [ + "TODO" + ], + "fieldNotes": [ + "TODO" + ] +} diff --git a/overlay/opt/emcomm-tools/sbin/udev-tester.sh b/overlay/opt/emcomm-tools/sbin/udev-tester.sh new file mode 100755 index 0000000..781c92a --- /dev/null +++ b/overlay/opt/emcomm-tools/sbin/udev-tester.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 11 October 2024 +# 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. +# +# Exit Statuses: +# 0 udev rule should match +# 1 udev rule should not match. + +ET_HOME=/opt/emcomm-tools +ACTIVE_RADIO="${ET_HOME}/conf/radios.d/active-radio.json" + +# Exit with a 0 exit success if, and only if, the currently selected radio is +# a Yaesu FT-891. +test_yaesu_ft891() { + 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-ft891" ]]; then + exit 0 + fi + fi + + exit 1 +} + +usage() { + echo "usage: $(basename $0) " +} + +if [ $# -ne 1 ]; then + usage + exit 1 +fi + +case $1 in + yaesu-ft891) + test_yaesu_ft891 + ;; +esac + +exit 1 From 8e851da803c5210ab072aa6826727f2fcb3f7d2f Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Mon, 11 Nov 2024 13:48:37 -0700 Subject: [PATCH 2/6] FT-891 - Changed PTT method per my field cards. Update radio configuration with notes and field notes (not yet used) --- .../conf/radios.d/yaesu-ft891.json | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json index b6edeff..2bb8ed5 100644 --- a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json @@ -5,12 +5,32 @@ "rigctrl": { "id": "1036", "baud": "38400", - "ptt": "RTS" + "ptt": "RIG" }, "notes": [ - "TODO" + "05-06 CAT RATE = 38400bps", + "05-07 CAT TOT = 100ms", + "05-08 CAT RTS = DISABLE", + "08-01 DATA MODE = OTHERS", + "08-02 PSK TONE = 1500Hz", + "08-03 OTHER DISP = 1500Hz", + "08-04 OTHER SHIFT = 1500Hz", + "08-05 DATA LCUT FREQ = OFF", + "08-07 DATA HCUT FREQ = OFF", + "08-09 DATA IN SELECT = REAR", + "08-10 DATA PTT SELECT = DAKY", + "08-11 DATA OUT LEVEL = 50", + "08-12 DATA BFO = USB", + "11-07 SSB BFO = AUTO", + "For digital operation always set Mode = DATA", + "For digital operation always set WDH = 3000" ], "fieldNotes": [ - "TODO" + "Long press [BAND] and select DATA using the VFO knob", + "Short press [F] multiple times and stop at FUNCTION-1 screen", + "Use the MFK to select WDH", + "Short press the MFK, then rotate to set the WDH value to 3000", + "Long press [F] to exit", + "Set digital output power via menu 16-03." ] } From 49f75d4017a2952b79955fa9c93ad4ec988048b3 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Mon, 11 Nov 2024 13:54:51 -0700 Subject: [PATCH 3/6] FT-891 - Rolled back PTT method to RTS. There was a typo in the BMAC field card --- overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json index 2bb8ed5..0f3f4f9 100644 --- a/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json @@ -5,7 +5,7 @@ "rigctrl": { "id": "1036", "baud": "38400", - "ptt": "RIG" + "ptt": "RTS" }, "notes": [ "05-06 CAT RATE = 38400bps", From 1ee06b5bcf08ea2372fbf3baaa8fe3957ea2ca26 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Mon, 11 Nov 2024 14:22:19 -0700 Subject: [PATCH 4/6] FT-891 - Added support for configuring audio levels for the FT-891. Note: The interface detection for CAT control is still switching between ttyUSB4 and ttyUSB5. This radio is close to being dropped. It is not a friendly radio for digital modes --- .../etc/udev/rules.d/79-et-digirig-dr891.rules | 18 +++++++++++------- overlay/opt/emcomm-tools/bin/et-audio | 14 +++++++++++++- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules b/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules index 57ca857..fe2f725 100644 --- a/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules +++ b/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules @@ -17,18 +17,22 @@ SUBSYSTEM=="tty|sound", PROGRAM="/opt/emcomm-tools/sbin/udev-tester.sh yaesu-ft891", \ ENV{ET_DEVICE}="FT-891" -# CAT control device will only match if PROGRAM above matches (exit status=0) -#SUBSYSTEM=="tty", ENV{ET_DEVICE}=="FT-891", \ -# 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" - SUBSYSTEMS=="usb", ENV{ET_DEVICE}=="FT-891", ATTRS{bInterfaceProtocol}=="00", \ + ACTION=="add", \ + ENV{ET_FIRST_CAT_DEVICE}="yes" + +# CAT control device will only match if PROGRAM above matches (exit status=0) +SUBSYSTEM=="tty", ENV{ET_DEVICE}=="FT-891", ENV{ET_FIRST_CAT_DEVICE}="yes", \ + 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" +#SUBSYSTEMS=="usb", SUBSYSTEM=="tty", ENV{ET_DEVICE}=="FT-891", ATTRS{bInterfaceProtocol}=="00", \ +# 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", ENV{ET_DEVICE}=="FT-891", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="0012", \ ACTION=="add", \ diff --git a/overlay/opt/emcomm-tools/bin/et-audio b/overlay/opt/emcomm-tools/bin/et-audio index 432486e..2f921e5 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 : 4 November 2024 +# Updated : 11 November 2024 # Purpose : Configures ET audio device with sane defaults # # Preconditions @@ -73,6 +73,18 @@ update-config () { et-log "Applied amixer settings for ${ET_DEVICE_NAME}" ;; + "FT-891") + # 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." ;; From 4d012319c4d343e40e865b4f049958515b605765 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Mon, 11 Nov 2024 14:49:41 -0700 Subject: [PATCH 5/6] FT-891 - Refactored udev rules te hopefully detect the correct serial device for use as /dev/et-cat. I advise against using this FT-891 and this platform for EmComm --- .../udev/rules.d/79-et-digirig-dr891.rules | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules b/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules index fe2f725..62f39b6 100644 --- a/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules +++ b/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules @@ -11,30 +11,27 @@ # 2. /dev/et-audio created # 3. rigctld is started # +# CAUTION: The FT-891 is an experimental device that may impact the stability of the platform and may +# not work 100% of the time. This device support is best effort only. -# Ensure that the FT-891 is set as the current radio configuration. -# If it is, set ET_DEVICE=FT-891 to allow following rules to match. -SUBSYSTEM=="tty|sound", PROGRAM="/opt/emcomm-tools/sbin/udev-tester.sh yaesu-ft891", \ +# Special rule to ensure that the first serial interface (/dev/ttyUSB4) is tagged as ET_DEVICE=FT-891 so +# that it can be used in the next CAT control rule. The second serial device will not work (/dev/ttyUSB5) +# if it is incorrectly detected as the /dev/et-cat device. +KERNEL=="ttyUSB[0-9]*", SUBSYSTEM=="tty", PROGRAM="/opt/emcomm-tools/sbin/udev-tester.sh yaesu-ft891", \ + ATTRS{bInterfaceNumber}=="00", \ ENV{ET_DEVICE}="FT-891" -SUBSYSTEMS=="usb", ENV{ET_DEVICE}=="FT-891", ATTRS{bInterfaceProtocol}=="00", \ - ACTION=="add", \ - ENV{ET_FIRST_CAT_DEVICE}="yes" - # CAT control device will only match if PROGRAM above matches (exit status=0) -SUBSYSTEM=="tty", ENV{ET_DEVICE}=="FT-891", ENV{ET_FIRST_CAT_DEVICE}="yes", \ +SUBSYSTEM=="tty", ENV{ET_DEVICE}=="FT-891", \ 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" -#SUBSYSTEMS=="usb", SUBSYSTEM=="tty", ENV{ET_DEVICE}=="FT-891", ATTRS{bInterfaceProtocol}=="00", \ -# 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", ENV{ET_DEVICE}=="FT-891", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="0012", \ +SUBSYSTEM=="sound", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="0012", \ + PROGRAM="/opt/emcomm-tools/sbin/udev-tester.sh yaesu-ft891", \ ACTION=="add", \ + ENV{ET_DEVICE}="FT-891", \ ATTR{id}="ET_AUDIO", \ ENV{ET_SUBDEVICE}="AUDIO", GROUP="audio", MODE="0660", SYMLINK+="et-audio" From 80045bf5ab7db759d8ac91952ff117f69b442ef1 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 12 Nov 2024 07:29:08 -0700 Subject: [PATCH 6/6] et-radio Updated notes for DigiRig Mobile while testing a radio transition from the FT-891 to the DigiRig Mobile. --- .../opt/emcomm-tools/conf/radios.d/digirig-mobile-no-cat.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 c1ef914..5d8084b 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 @@ -8,7 +8,6 @@ }, "notes": [ "Set your VFO manually", - "Adjust your volume, RF gain and squelch manually", - "This mode uses the RTS signal to trigger the PTT" + "Adjust your volume, RF gain and squelch manually" ] }