mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
Audio - Added dummy rig control support for the DigiRig Lite to maintain the rigctl NET interface consistently for all radio-based applications
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
# Author : Gaston Gonzalez
|
# Author : Gaston Gonzalez
|
||||||
# Date : 14 October 2024
|
# Date : 14 October 2024
|
||||||
|
# Updated : 24 October 2024
|
||||||
# Purpose : udev rules for generic remove events
|
# Purpose : udev rules for generic remove events
|
||||||
#
|
#
|
||||||
# Preconditions:
|
# Preconditions:
|
||||||
# 1. CAT control device is unplugged
|
# 1. CAT control device (or DigiRig Lite) is unplugged
|
||||||
#
|
#
|
||||||
# Postconditions:
|
# Postconditions:
|
||||||
# 1. rigctld is stopped
|
# 1. rigctld is stopped
|
||||||
@@ -11,3 +12,8 @@
|
|||||||
SUBSYSTEM=="tty", ENV{ET_SUBDEVICE}=="CAT", \
|
SUBSYSTEM=="tty", ENV{ET_SUBDEVICE}=="CAT", \
|
||||||
ACTION=="remove", \
|
ACTION=="remove", \
|
||||||
RUN+="/opt/emcomm-tools/sbin/wrapper-rigctld.sh stop"
|
RUN+="/opt/emcomm-tools/sbin/wrapper-rigctld.sh stop"
|
||||||
|
|
||||||
|
|
||||||
|
SUBSYSTEM=="sound",ENV{ET_SUBDEVICE}=="AUDIO", \
|
||||||
|
ACTION=="remove", \
|
||||||
|
RUN+="/opt/emcomm-tools/sbin/wrapper-rigctld.sh stop"
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
# Author : Gaston Gonzalez
|
|
||||||
# Date : 17 October 2024
|
|
||||||
# Updated : 21 October 2024
|
|
||||||
# Purpose : udev rules for the DigiRig Lite
|
|
||||||
#
|
|
||||||
# Preconditions:
|
|
||||||
# 1. DigiRig Lite connected via USB cable
|
|
||||||
#
|
|
||||||
# Postconditions:
|
|
||||||
# 1. /dev/et-audio created
|
|
||||||
|
|
||||||
SUBSYSTEM=="sound", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="0012", ENV{ET_DEVICE}=="", \
|
|
||||||
ACTION=="add", \
|
|
||||||
ATTR{id}="ET_AUDIO", \
|
|
||||||
ENV{ET_DEVICE}="DIGIRIG_LITE", ENV{ET_SUBDEVICE}="AUDIO", GROUP="audio", MODE="0660", SYMLINK+="et-audio"
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Author : Gaston Gonzalez
|
||||||
|
# Date : 17 October 2024
|
||||||
|
# Updated : 24 October 2024
|
||||||
|
# Purpose : udev rules for the DigiRig Lite
|
||||||
|
#
|
||||||
|
# Preconditions:
|
||||||
|
# 1. The radio is set to 'generic-vox' using et-radio.
|
||||||
|
# 2. DigiRig Lite connected via USB cable
|
||||||
|
#
|
||||||
|
# Postconditions:
|
||||||
|
# 1. /dev/et-audio created
|
||||||
|
# 2. rigctld is started
|
||||||
|
|
||||||
|
# The DigiRig Lite has no CAT control, but rigctld is started to minimize the configuration needed
|
||||||
|
# by the various amateur radio applications. EmComm Tools treats rigctl NET as its abstraction layer.
|
||||||
|
# A dummy rig control configuration is specifed in the 'generic-vox' radio configuration.
|
||||||
|
SUBSYSTEM=="sound", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="0012", ENV{ET_DEVICE}=="", \
|
||||||
|
ACTION=="add", \
|
||||||
|
ATTR{id}="ET_AUDIO", \
|
||||||
|
ENV{ET_DEVICE}="DIGIRIG_LITE", ENV{ET_SUBDEVICE}="AUDIO", GROUP="audio", MODE="0660", SYMLINK+="et-audio" \
|
||||||
|
RUN+="/usr/bin/systemctl start rigctld"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Rig Control Service
|
Description=Rig Control Service
|
||||||
ConditionPathExists=/dev/et-cat
|
#ConditionPathExists=/dev/et-cat
|
||||||
After=multi-user.target
|
After=multi-user.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"id": "generic-vox",
|
||||||
|
"vendor": "Generic",
|
||||||
|
"model": "VOX",
|
||||||
|
"rigctrl": {
|
||||||
|
"id": "1",
|
||||||
|
"ptt": "NONE"
|
||||||
|
},
|
||||||
|
"notes": [
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Author : Gaston Gonzalez
|
# Author : Gaston Gonzalez
|
||||||
# Date : 9 October 2024
|
# Date : 9 October 2024
|
||||||
|
# Updated : 24 October 2024
|
||||||
# Purpose : Wrapper startup/shutdown script around systemd/rigctld
|
# Purpose : Wrapper startup/shutdown script around systemd/rigctld
|
||||||
|
|
||||||
ET_HOME=/opt/emcomm-tools
|
ET_HOME=/opt/emcomm-tools
|
||||||
@@ -27,6 +28,24 @@ do_full_auto() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
|
||||||
|
# Special case for VOX devices like the DigiRig Lite.
|
||||||
|
if [ -L "${ET_HOME}/conf/radios.d/active-radio.json" ]; then
|
||||||
|
CUR_RADIO=$(cat "${ET_HOME}/conf/radios.d/active-radio.json" | jq -r .model)
|
||||||
|
if [ "${CUR_RADIO}" = "VOX" ]; then
|
||||||
|
et-log "Starting dummy rigctld service for VOX device."
|
||||||
|
|
||||||
|
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 with: ${CMD}"
|
||||||
|
$CMD
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -e ${CAT_DEVICE} ]; then
|
if [ ! -e ${CAT_DEVICE} ]; then
|
||||||
et-log "No CAT device found. ${CAT_DEVICE} symlink is missing."
|
et-log "No CAT device found. ${CAT_DEVICE} symlink is missing."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user