fix(steppir): a silent controller wedged the driver for good

io.ReadFull cannot be used on a serial port, and it was.

On Windows a serial read that times out returns (0, nil) — on this transport a
timeout is not an error. io.ReadFull loops while err == nil, so a controller
that goes quiet for one poll, or answers with a truncated frame, spins it
forever. It holds ioMu throughout, and that is the whole failure the operator
sees:

  - the poll goroutine never returns, so nothing is ever logged about a fault
    and the cached status keeps the antenna looking connected;
  - every command blocks on the same mutex, and the trace line sat AFTER the
    lock, so even the attempt left no trace.

One dropped reply on a 4800-baud link therefore stopped the antenna responding
until OpsLog was restarted, with a log that showed the antenna starting, a few
status frames, and then nothing — which is exactly how it was reported.

Reads are now bounded: three seconds for an 11-byte frame that takes 23 ms on
the wire. Giving up returns an error, and the poll loop already knows what to do
with one — say so and reconnect. The command trace moved ahead of the lock, so
what the operator asked for is in the log even when the answer is not.

The SPE driver reads through a bufio.Reader, whose ErrNoProgress guard already
covers this; the ADIF parser reads a file. This was the only exposed one.
This commit is contained in:
2026-08-16 00:33:32 +02:00
parent 331db58705
commit b49599150c
3 changed files with 161 additions and 2 deletions
+2
View File
@@ -8,6 +8,7 @@
"DX cluster: the log times the connection and the first spot, so a slow first launch can be told apart from a quiet node.",
"Generic HTTP relay: its URLs were never actually sent — fixed. {value} sends the relay's label, {relay-1} counts from zero, no host needed.",
"Switching profile now reconnects the amplifier, antenna, Antenna Genius and tuner — they stayed on the previous profile's ports until you saved Settings.",
"SteppIR: one missed reply used to wedge the link — the antenna stopped responding, with nothing at all in the log. It now recovers on its own.",
"The log now says when a motorized antenna is connected but tracking is off, instead of a line that read like a fault.",
"DXHunter spot clicks tune the rig again: the frequency it sends is read in whatever unit it uses, not always as MHz."
],
@@ -17,6 +18,7 @@
"Cluster DX : le journal chronomètre la connexion et le premier spot, pour distinguer un premier lancement lent dun nœud silencieux.",
"Relais HTTP générique : ses URL n’étaient jamais envoyées — corrigé. {value} envoie le libellé du relais, {relay-1} compte de zéro, hôte inutile.",
"Changer de profil reconnecte lampli, lantenne, lAntenna Genius et le tuner — ils restaient sur les ports du profil précédent jusqu’à un Enregistrer.",
"SteppIR : une seule réponse manquée bloquait la liaison — lantenne ne répondait plus, sans rien dans le journal. Elle se rétablit maintenant seule.",
"Le journal indique désormais quune antenne motorisée est connectée mais que le suivi est désactivé, au lieu dune ligne qui ressemblait à une panne.",
"Les clics de spot DXHunter accordent à nouveau le rig : la fréquence envoyée est lue dans son unité réelle, plus toujours en MHz."
]