Keying a Radio Off a Serial Line
The node software keys push-to-talk one way; the audio interface keys it another. Bridging that gap took a small daemon that holds the serial line, keys on request, and can never get stuck transmitting.
Overview
The analog node connects to a handheld through a small sound-card interface. That interface keys push-to-talk by toggling a line on its serial port. The node software, on the other hand, expects to key through a different mechanism entirely. The two did not meet, so nothing transmitted. Closing that gap took a small, careful daemon.
The mismatch
The node’s sound-card driver keys transmit through one standard method. The interface in front of it keys transmit by raising a control line on its USB serial port. Those are two different worlds, and neither knows about the other. Something had to sit in the middle and translate “key now” into “raise that serial line.”
The daemon
It is deliberately small. It holds the serial port open with the key line down, listens on a local socket for a key or unkey request, and raises or lowers the line to match. Two safety properties matter more than anything else it does:
- It cannot get stuck transmitting. A timeout drops the line if a key request is never followed by an unkey. A radio that keys and never stops is the worst failure mode there is, so it is designed out.
- It drops the line on exit. However the daemon stops, it releases transmit first.
The node software drives it through its own event hooks, so keying stays in step with the node’s own notion of transmit. And a hotplug rule re-probes the interface when it is plugged or unplugged, so the whole thing heals itself if the cable is bumped.
Result
Verified keying a handheld on UHF, with the node driving transmit through the daemon and releasing cleanly every time.
Lessons
- Put a timeout on anything that can transmit. Stuck-keyed is the failure that matters. Make it impossible, not unlikely.
- Self-heal on hotplug. USB gets bumped. The system should recover without a human.
- A tiny single-purpose daemon beats patching the big program. Small, readable, and it only does the one dangerous thing, carefully.