Set up a radio radio knows when it's plugged in, with radio configure --auto
check / lint-and-test (push) Successful in 3m57s
check / packages (push) Successful in 24s

A udev rule starts the hampack-radio-plugged user service when a USB serial
port appears, and it runs `radio configure --auto`. That sets up a radio
recognised by its USB serial number, unless the radio set up already is
plugged in, and says what it did in a desktop notification. It never asks a
radio what it is, since that may key the transmitter, and never asks for
sudo, so a running Graywolf is skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Young
2026-11-28 16:32:05 -07:00
co-authored by Claude Opus 5.5
parent f2e29ab46d
commit 8d15d2c81e
11 changed files with 309 additions and 18 deletions
+31
View File
@@ -168,6 +168,37 @@ With a Digirig, an AIOC or another CM108-family interface plugged in, after
|------|--------|-----------|-----|----------------|-------|
| 2026-11-28 | 1cccdcd | C-Media USB Audio Device, 0d8c:0012, no radio attached | Yes, but from another rule (60-xara-ptt.rules); HamPack's rule not yet installed here | Not tried | Steps 1, 3 and 5 pass: `radio` lists it as "PTT through CM108 on /dev/hidraw3" and leaves out a Logitech BRIO webcam; Dire Wolf's `cm108` marks it `**`. Hamlib 4.7.2 `rigctl -m 1 -p /dev/input/by-id/...-if03-hidraw -P CM108 T 0` opens the by-id link, detects it as CM108-compatible and sets GPIO3, with no error. Getting PTT state (`t`) gives "Feature not implemented", which is Hamlib's CM108 support, and doesn't matter to the programs |
## Setting up a radio when it's plugged in
After `update` has installed `/etc/udev/rules.d/70-hampack-radio.rules` and
`~/.config/systemd/user/hampack-radio-plugged.service`, with an Icom that
`radio` recognises by its USB serial number (an IC-7300, say), on a dummy
load or an antenna:
1. Move `~/.local/state/HamPack/radio` aside, if it's there, so no radio is
set up. Quit WSJT-X and the rest, and plug the radio in. Within a few
seconds a notification says "HamPack set up the Icom IC-7300", and
`journalctl --user -u hampack-radio-plugged` shows `radio configure`'s
output, including the radio's sound card by PipeWire's name. If it says
PipeWire didn't list the card, note it: it waited up to 10 seconds.
2. `systemctl --user status hampack-rigctld` is running, and WSJT-X's
"Test CAT" works.
3. Unplug the radio and plug it in again: the journal says it stays set up,
and there's no notification.
4. With WSJT-X running, and Graywolf running, move the state file aside and
plug in again: the notification says WSJT-X and Graywolf were skipped, and
nothing asked for a password.
5. Plug in a Yaesu or a Digirig instead: nothing is set up, and the radio's
TX indicator never lights.
6. Log in with the radio plugged in and not set up: note whether it's set up
at login, too (systemd may only act on the rule when the port appears).
7. `systemctl --user mask hampack-radio-plugged`, then plug in: nothing
happens. `systemctl --user unmask hampack-radio-plugged` afterwards.
| Date | Commit | Radio | Set up | Notification | Left alone when set up | Notes |
|------|--------|-------|--------|--------------|------------------------|-------|
| | | | | | | |
## Pairing radios with sound cards
- Two radios plugged in at once: each gets its own sound card.