From 791618f96fe6865d80e6ebd8cd586f3b4b73cd07 Mon Sep 17 00:00:00 2001 From: ssmithx Date: Sat, 4 Jul 2026 08:01:13 +0000 Subject: [PATCH] fix(mesh): widen RNode KISS-detect read window from 800ms to 2.5s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Confirmed on real hardware: a genuine Heltec V4 RNode (firmware 1.86, verified via rnodeconf --info against the same port) prints extra boot/status chatter over the same serial line before answering KISS commands. Replaying the exact probe bytes and timing budget our Rust probe_rnode() uses showed DETECT_RESP arriving ~1.05s after the write — past the old 800ms deadline, so a real, correctly-flashed, correctly- responding RNode was being timed out and misclassified as "not an RNode". 2.5s leaves comfortable margin. Non-RNode devices (Meshcore/Meshtastic) already budget ~5s each, so this doesn't meaningfully slow down detection when the port turns out to be something else. Co-Authored-By: Claude Sonnet 5 --- core/archipelago/src/mesh/reticulum.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/archipelago/src/mesh/reticulum.rs b/core/archipelago/src/mesh/reticulum.rs index d6c557d2..5af0b667 100644 --- a/core/archipelago/src/mesh/reticulum.rs +++ b/core/archipelago/src/mesh/reticulum.rs @@ -47,7 +47,14 @@ const KISS_CMD_PLATFORM: u8 = 0x48; const KISS_CMD_MCU: u8 = 0x49; const PROBE_BAUD: u32 = 115200; -const PROBE_READ_TIMEOUT: Duration = Duration::from_millis(800); +// 800ms was too tight for real hardware: confirmed on a genuine Heltec V4 +// RNode (firmware 1.86, verified via `rnodeconf --info`) that prints extra +// boot/status chatter on the same serial line before answering KISS +// commands — DETECT_RESP measured arriving ~1.05s after the probe write in +// that case. 2.5s leaves comfortable margin without meaningfully slowing +// down detection of non-RNode devices (Meshcore/Meshtastic already budget +// ~5s each). +const PROBE_READ_TIMEOUT: Duration = Duration::from_millis(2500); /// Prefix marking an LXMF `content` string as base64 of a raw binary /// typed-envelope payload rather than literal text. LXMF `content` travels