udev rules

udev rules

udev rules

Udev rules are a powerful way to manage device-specific configurations and streamline the integration of hardware into your Linux-based ham radio setup. By creating custom rules, you can automatically assign meaningful names to devices, set permissions, and trigger specific actions when devices are connected. This document provides a collection of udev rules tailored for ham radio equipment, ensuring that they are consistently recognized and configured across sessions.

Commands

Debug

Tracking down what is happening when you plug/unplug a device can be helpful when setting up custom rules - you can do that with two simple rules:

# Enable debug level logging
udevadm control --log-priority=debug
# Watch the log messages
journalctl -f

Identify

This command will give you all of the attributes associated with at given device that you can then use to craft your own rules.

udevadm info --attribute-walk --name /dev/<whatever>

Reload

After you make any changes, you can force the system to reload the rules without rebooting.

udevadm control --reload

These are rules that I have gathered over the years playing with different pieces of hardware - your mileage may vary on the value they bring to you.

DigiRig

## DigiRig
ACTION=="add", SUBSYSTEM=="sound", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="013c",  ATTR{id}="SND_DIGIRIG"

DigiRig Lite

SUBSYSTEM=="sound", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="0012", \
    ACTION=="add", \
    ATTR{id}="DR_LITE", \
    GROUP="audio", MODE="0660", SYMLINK+="digirig-lite"

GPS

## GPS
ACTION=="add", ATTRS{product}=="u-blox 7 - GPS/GNSS Receiver", SYMLINK+="gps"

Icom IC-7100

## Icom IC-7100
ACTION=="add", SUBSYSTEM=="tty", ATTRS{serial}=="IC-7100 02009424 A", SYMLINK+="ic7100a", RUN+="/usr/bin/systemctl start rigctld"
ACTION=="remove", SUBSYSTEM=="tty", ATTRS{serial}=="IC-7100 02009424 A", RUN+="/usr/bin/systemctl stop rigctld"
ACTION=="add", SUBSYSTEM=="tty", ATTRS{serial}=="IC-7100 02009424 B", SYMLINK+="ic7100b"
ACTION=="add", SUBSYSTEM=="sound", ATTRS{idVendor}=="08bb", ATTRS{idProduct}=="2901",  ATTR{id}="SND_IC-7100"

Kenwood TH-D74

## Kenwood TH-D74
ACTION=="add", SUBSYSTEM=="tty", ATTRS{product}=="TH-D74", SYMLINK+="thd74"

(tr)uSDX

## (tr)uSDX
ACTION=="add", SUBSYSTEM=="tty", \
       ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523" \
       SYMLINK+="trusdx" \
       RUN+="/usr/bin/stty -F /dev/trusdx raw -echo -echoe -echoctl -hupcl -echoke 38400"

XGG interface for FT-817

## XGG interface for FT-817
ACTION=="add", SUBSYSTEM=="tty", ATTRS{serial}=="AG6A49S9", SYMLINK+="xgg", RUN+="/usr/bin/systemctl start rigctld"
ACTION=="remove", SUBSYSTEM=="tty", ATTRS{serial}=="AG6A49S9", SYMLINK+="xgg", RUN+="/usr/bin/systemctl stop rigctld"
ACTION=="add", SUBSYSTEM=="sound", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="0012",  ATTR{id}="SND_XGG"