PnP Added initial plug-and-play support for the Yaesu FT-991A via the on-board USB

This commit is contained in:
Gaston Gonzalez
2024-12-08 17:47:44 -07:00
parent 7a97cb2093
commit 37f5f7980a
3 changed files with 89 additions and 3 deletions
@@ -0,0 +1,37 @@
# Author : Gaston Gonzalez
# Date : 8 December 2024
# Purpose : udev rules for the Yaesu FT-991A via native USB
#
# Preconditions:
# 1. Yaesu FT-991A is selected via et-radio
# 2. Yaesu FT-991A is powered on and connected via USB cable
#
# Postconditions:
# 1. /dev/et-cat created
# 2. /dev/et-audio created
# 3. rigctld is started
#
# CAUTION: The FT-991A 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-ft991a", \
ATTRS{bInterfaceNumber}=="00", \
ENV{ET_DEVICE}="FT-991A"
# CAT control device will only match if PROGRAM above matches (exit status=0)
SUBSYSTEM=="tty", ENV{ET_DEVICE}=="FT-991A", \
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}=="08bb", ATTRS{idProduct}=="29b3", \
PROGRAM="/opt/emcomm-tools/sbin/udev-tester.sh yaesu-ft991a", \
ACTION=="add", \
ENV{ET_DEVICE}="FT-991A", \
ATTR{id}="ET_AUDIO", \
ENV{ET_SUBDEVICE}="AUDIO", GROUP="audio", MODE="0660", SYMLINK+="et-audio"
@@ -0,0 +1,32 @@
{
"id": "yaesu-ft991a",
"vendor": "Yaesu",
"model": "FT-991A",
"rigctrl": {
"id": "1035",
"baud": "38400",
"ptt": "RIG"
},
"notes": [
"031 CAT RATE = 38400bps",
"032 CAT TOT = 100ms",
"033 CAT RTS = DISABLE",
"062 DATA MODE = OTHERS",
"064 OTHER DISP (SSB) = 1500Hz",
"065 OTHER SHIFT (SSB) = 1500Hz",
"066 DATA LCUT FREQ = OFF",
"068 DATA HCUT FREQ = OFF",
"070 DATA IN SELECT = REAR",
"071 DATA PTT SELECT = DAKY",
"072 DATA PORT SELECT = USB",
"073 DATA OUT LEVEL = 50",
"076 FM PKT PTT SELECT = DAKY",
"077 FM PKT PORT SELECT = USB",
"078 FM PKT TX GAIN = 50",
"079 FM PKT MODE = 1200",
"For HF digital operation always set Mode = DATA-USB",
"For HF digital operation always set WDH = 3000Hz"
],
"fieldNotes": [
]
}
+20 -3
View File
@@ -1,7 +1,7 @@
#!/bin/bash
# Author : Gaston Gonzalez
# Date : 11 October 2024
# Updated : 21 November 2024
# Updated : 8 December 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.
@@ -13,7 +13,7 @@
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
# Exit with a 0 exit status 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
@@ -27,7 +27,21 @@ test_yaesu_ft891() {
exit 1
}
# Exit with a 0 exit success if, and only if, the currently selected radio
# Exit with a 0 exit status if, and only if, the currently selected radio is
# a Yaesu FT-991A.
test_yaesu_ft991a() {
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-ft991a" ]]; then
exit 0
fi
fi
exit 1
}
# Exit with a 0 exit status if, and only if, the currently selected radio
# uses a DigiRig Mobile.
test_digirig_mobile() {
if [ -L "${ET_HOME}/conf/radios.d/active-radio.json" ]; then
@@ -71,6 +85,9 @@ case $1 in
yaesu-ft891)
test_yaesu_ft891
;;
yaesu-ft991a)
test_yaesu_ft991a
;;
digirig-mobile)
test_digirig_mobile
esac