Fixed devices for CAT control

Submitted by Thomas Nilsson on

The problem with the increased number on the /dev/ttyUSB0, /dev/ttyUSB1... can be handled in the following way which I am using on my Linux Mint 20.3 for my IC-7100. This description is by no way complete, so some Linux knowledge is needed as it requires root / sudo access to be setup:

In the directory /etc/udev/rules.d/ I have a file called 80-ICOM-IC-7100.rules with the following content:

# Put this file in /etc/udev/rules.d
#
# Your IC-7100 serial number
# ENV{SERIAL_NUMBER}="03000000"
ENV{MAJOR}!="?*", GOTO="ic7100_rules_end"
SUBSYSTEMS=="usb-serial", GOTO="ic7100_usb_rules"
GOTO="ic7100_rules_end"

LABEL="ic7100_usb_rules"

# ICOM IC-7100
ENV{ID_SERIAL_SHORT} == "IC-7100_03000000_A", SYMLINK+="icom7100-CAT", MODE="660", GROUP="dialout"
ENV{ID_SERIAL_SHORT} == "IC-7100_03000000_B", SYMLINK+="icom7100-AUX", MODE="660", GROUP="dialout"

LABEL="ic7100_rules_end"

You MUST find the serial number of your own rig, the important part to update is the 03000000 in the file above at three places. One way to find the serial number is to use the following command when the rig is connected and from what is returned find the serial number. The string returned should actually exactly match the strings above, except for the A and B at the end. Be sure to use a device, "/dev/ttyUSB0", that you know is your rig.

# udevadm info /dev/ttyUSB0 | grep ID_SERIAL_SHORT

The answer will be something like

E: ID_SERIAL_SHORT=IC-7100_03001234_A

where the part after the = exactly matches the first rule (string) in the file above.

Anyhow the setup give you two devices named as below. Note that sometimes you might have to reboot your computer to get them created. (Technically there are other ways, which doesn't require a reboot, but those seem to vary a lot between different distributions.)

/dev/icom7100-AUX
/dev/icom7100-CAT

The neat thing is that you never after this need to think of if it is /dev/ttyUSB0 ..1 etc. Also if you re-plug your radio you don't need to care. It will always be the same name. It can also be extended to handle more than one rig.

There is nothing that say that this is for ICOM only. The trick is to find a suitable match for your udev-rule. The way I do it is to attach the rig, figure out which ports that are created. Without the above setup it is probably something like /dev/ttyUSB0. Then run the following command and find something that is significant for your rig only. The serial number is always a good candidate!

# udevadm info /dev/ttyUSB0 | less

More on udev is found on the manpage and in some tutorials [1] & [2]. Just Google on "write udev files".

Good luck!