diff --git a/overlay/etc/udev/rules.d/76-et-tx500mp.rules b/overlay/etc/udev/rules.d/76-et-tx500mp.rules new file mode 100644 index 0000000..7678a0b --- /dev/null +++ b/overlay/etc/udev/rules.d/76-et-tx500mp.rules @@ -0,0 +1,31 @@ +# Author : Gaston Gonzalez +# Date : 1 September 2025 +# Updated : 2 September 2025 +# Purpose : udev rules for the TX-500MP +# +# Preconditions: +# 1. Lab599 TX-500MP (DigiRig Lite) is selected via et-radio +# 2. Lan599 TX-500MP is connected via USB-A cable +# +# Postconditions: +# 1. /dev/et-cat created +# 2. /dev/et-audio created +# 3. rigctld is started +# +KERNEL=="ttyUSB[0-9]*", SUBSYSTEM=="tty", PROGRAM="/opt/emcomm-tools/sbin/udev-tester.sh lab599-tx500mp", \ + ENV{ET_DEVICE}="TX-500MP" + +# CAT control device will only match if PROGRAM above matches (exit status=0) +SUBSYSTEM=="tty", ENV{ET_DEVICE}=="TX-500MP", \ + ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001",\ + 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/opt/emcomm-tools/conf/radios.d/lab599-tx500mp.json b/overlay/opt/emcomm-tools/conf/radios.d/lab599-tx500mp.json new file mode 100644 index 0000000..bc46764 --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/radios.d/lab599-tx500mp.json @@ -0,0 +1,21 @@ +{ + "id": "lab599-tx500mp", + "vendor": "Lab599", + "model": "TX-500MP (DigiRig Lite)", + "rigctrl": { + "id": "2014", + "baud": "9600", + "ptt": "NONE", + "pttOnly": "false" + }, + "notes": [ + "1. Set MENU 36 CAT PROTOCOL = TS2000", + "2. Set MODE = DIGI", + "3. Plug-in CAT cable", + "4. Plug-in DigiRig Lite", + " * Do not enable VOX on radio" + + ], + "fieldNotes": [ + ] +} diff --git a/overlay/opt/emcomm-tools/sbin/udev-tester.sh b/overlay/opt/emcomm-tools/sbin/udev-tester.sh index 9f60211..d3f5be7 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 : 21 May 2025 +# Updated : 1 September 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 Lab599 TX-500MP. +test_lab599_tx500mp() { + 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" == "lab599-tx500mp" ]]; then + exit 0 + fi + fi + + exit 1 +} + # Exit with a 0 exit status if, and only if, the currently selected radio is # a Yaesu FTX-1. test_yaesu_ftx1() { @@ -107,6 +121,13 @@ case $1 in ;; digirig-mobile) test_digirig_mobile + ;; + lab599-tx500mp) + test_lab599_tx500mp + ;; + *) + echo "$1 is not supported." + ;; esac exit 1