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..62f39b6 --- /dev/null +++ b/overlay/etc/udev/rules.d/79-et-digirig-dr891.rules @@ -0,0 +1,37 @@ +# 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 +# +# 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. + +# 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" + +# 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" + +# Audio device will only match if PROGRAM above matches (exit status=0) +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" 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." ;; 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" ] } 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..0f3f4f9 --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/radios.d/yaesu-ft891.json @@ -0,0 +1,36 @@ +{ + "id": "yaesu-ft891", + "vendor": "Yaesu", + "model": "FT-891 (DR-891)", + "rigctrl": { + "id": "1036", + "baud": "38400", + "ptt": "RTS" + }, + "notes": [ + "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": [ + "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." + ] +} 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