Know twin interfaces by their USB socket, and say so
check / lint-and-test (push) Failing after 4m13s
check / packages (push) Successful in 25s

Two interfaces with the same vendor, product and serial number (none, often)
share a /dev/serial/by-id name, which udev points at whichever came last, so
their serial ports are named by /dev/serial/by-path instead. radio and
radio configure say when an interface has a twin, and that its sound card
goes by the order the two came up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Young
2026-11-29 13:41:06 -07:00
co-authored by Claude Opus 5.5
parent d910982ea7
commit 7697a785d3
5 changed files with 100 additions and 9 deletions
+2
View File
@@ -73,6 +73,8 @@ It also gives WSJT-X, JS8Call, fldigi, Dire Wolf, not1mm's voice keyer and POTAC
A radio with no CAT can be set up too, on an interface that keys it: rigctld then runs Hamlib's Dummy radio, which only keys the radio, and the programs reach it as before. A sound card with no serial port (an AIOC, a CM108 cable, a SignaLink) is numbered after the radios in `radio`'s list: `radio configure 2` keys the radio through its CM108 PTT pin if it has one, or leaves it to the radio's VOX. For an interface with a serial port, such as a Digirig on a handheld, say how it keys the radio: `radio configure --no-cat --ptt rts` (or `dtr`, `cm108` or `vox`).
Two interfaces of the same kind with no serial number of their own (two CH340 cables, two CM108 cables) can only be told apart by the USB socket each is plugged into. `radio` then knows their serial ports (by `/dev/serial/by-path`) and PTT by socket, and says so. Their sound cards go by the order the two came up, which may change between boots: keep each in its socket, and if the radios get each other's audio, run `radio configure` again.
A radio `radio` recognises by its USB serial number (most Icoms) is set up by itself when you plug it in, as if you'd run `radio configure`, unless the radio set up already is plugged in. A notification says what it did, and `journalctl --user -u hampack-radio-plugged` has the details. Programs that are running are skipped, as is Graywolf if it's running, since stopping it needs sudo; run `radio configure` for those afterwards. Radios it would have to ask what they are, and interfaces with no CAT, are left for you to set up, since asking raises the port's DTR and RTS lines, which may key the transmitter while nobody's there. A udev rule, `/etc/udev/rules.d/70-hampack-radio.rules`, starts the `hampack-radio-plugged` user service when a USB serial port appears. To turn it off, run `systemctl --user mask hampack-radio-plugged`.
flrig can't reach a radio through rigctld, and the two can't share its port, so `radio configure` leaves flrig alone. If you'd rather flrig controlled the radio, run `radio configure --flrig`: flrig gets the radio, and rigctld passes the other programs through it, using Hamlib's FLRig support. flrig then starts when you log in (unless you have it starting already), so it's there before the other programs; leave it running. `radio configure` without --flrig gives the radio back to rigctld, and stops flrig starting at login. `radio configure` also says which sound card is the radio's.