feat(winkeyer): K3NG keyers, and wait out their reboot

The operator's keyer is a K3NG — an Arduino running an emulation of the
WinKeyer protocol — which changes the diagnosis and nearly broke it.

Checked against K3NG's own source before anything else, because yesterday's
handshake now FAILS a connect where it used to press on regardless. It is
safe: k3ng_keyer.ino implements admin echo (0x04) and echoes the byte back,
0x13 is a documented no-op, and OPTION_WINKEY_STRICT_HOST_OPEN — on by
default — ignores every byte except 0x00 before host open, so the resync
nulls are dropped harmlessly and the echo probe still gets through.

The real cause is in K3NG's options file, beside the feature itself:
"disabling Automatic Software Reset is highly recommended", and an option
to "discard errant serial port bytes at startup" for when it is not. On an
Arduino, DTR is wired to reset through a capacitor: opening the port reboots
the board into its bootloader. Ours spoke 400 ms later, to a keyer that was
not running yet.

So the retry now waits 2.5 s, which recovers it without an operator pressing
connect twice, and the engine list gains a K3NG entry that skips the doomed
fast attempt altogether. Everything else is identical to a K1EL — same
settings panel, same protocol.
This commit is contained in:
2026-08-14 12:40:42 +02:00
parent c495dced0f
commit aca4dc5678
7 changed files with 104 additions and 23 deletions
+7 -2
View File
@@ -289,7 +289,7 @@ const (
keyWKUsePTT = "winkeyer.use_ptt"
keyWKSerialEcho = "winkeyer.serial_echo"
keyWKMacros = "winkeyer.macros" // JSON array of {label,text}
keyWKEngine = "winkeyer.engine" // "winkeyer" | "serial" | "icom" | "flex" | "tci"
keyWKEngine = "winkeyer.engine" // "winkeyer" | "k3ng" | "serial" | "icom" | "flex" | "tci"
keyWKEscClears = "winkeyer.esc_clears_call" // ESC also clears the callsign
keyWKSendOnType = "winkeyer.send_on_type" // key characters live as typed
keyWKEsm = "winkeyer.esm" // Enter-Sends-Message (N1MM-style CW flow)
@@ -16689,8 +16689,13 @@ func (a *App) WinkeyerConnect() error {
cfg := s.Config
// The "serial" engine keys CW on the port's DTR/RTS lines (SCU-17 style)
// instead of talking the K1EL WinKeyer protocol — flag it for the manager.
if s.Engine == "serial" {
// "k3ng" speaks the same protocol as a K1EL and differs only in how long it
// takes to answer after the port opens; the manager needs to know which.
switch s.Engine {
case "serial":
cfg.Type = "serial"
case "k3ng":
cfg.Type = "k3ng"
}
return a.winkeyer.Connect(cfg)
}