fix: send RNode TCP activity detect() keepalives#15
Open
rinchen wants to merge 2 commits into
Open
Conversation
- Port Python RNodeInterface ACTIVITY_KEEPALIVE (3.5s) into the TCP write loop: when idle, send build_detect_sequence() so Wi‑Fi RNodes do not close the socket at ~ACTIVITY_TIMEOUT (6s). - Track last_write on every successful write; serial-only paths without beacons still block on recv (no spin). - Add parity constant test and TCP mock asserting idle detect frames. Without this, rnsd-rs / mesh-client sidecars flap Wi‑Fi RNodes every ~6–7s up / 5s reconnect (peer FIN: "RNode TCP socket closed").
6 tasks
rinchen
added a commit
to Colorado-Mesh/mesh-client
that referenced
this pull request
Jul 20, 2026
* fix(reticulum): overlay RNode TCP activity keepalive - Add rsReticulum-rnode-tcp-activity-keepalive.patch (Python ACTIVITY_KEEPALIVE parity: idle detect() every 3.5s so Wi‑Fi RNodes do not FIN at ~6s). - Wire apply script into ensure-rsReticulum-patches / clone-ratspeak-stack. - Track upstream ratspeak/rsReticulum#15 in update.sh RATSPEAK_PATCH_ENTRIES. Ships the fix in mesh-client builds while the upstream PR may or may not merge. * fix(reticulum): harden macOS BLE RNode pairing UX and reconnect - Surface Admin Start pairing PIN prominently (large PIN + status) and warn that the radio display may stay blank; never use Meshtastic 123456. - Extend BLE connect grace / connecting hint to 60s to match OS passkey. - Latch blePairingTimedOut from sidecar logs into Connection + Diagnostics. - Debounce pairing-transition reconnects (1s → 30s) via rsReticulum overlay. - Document wrong-PIN / Admin PIN location / empty macOS Bluetooth list. Reporter used 123456 after Admin Start pairing showed no on-display PIN; 7s hold + real PIN connected. These changes make that path clearer and less thrashy while the OS passkey dialog is open. * fix(reticulum): address PR #698 review findings - Fail closed on rsReticulum overlay apply (match packet-tap); document BLE debounce overlay in sidecar README. - Isolate Admin pairing pending timer/generation so disable/re-pair cannot clear a newer attempt; cover with fake-timer unit tests. - Neutralize blePairingTimedOut copy (passkey exchange timed out), parse BLE iface names without backtracking regex, use <output> for pairing status, derive local-health delays from MS_PER_SECOND, and axe-test the new alert. - Translate pairing/timeout strings across locales; fix IT wifi netmask typo. * fix(reticulum): wait for BT PIN before closing flasher port - startBluetoothPairing now settles on CMD_BT_PIN or timeout (not the KISS write), so runWithRNode no longer closes USB before the PIN arrives. - Cover PIN delivery and timeout with fake-timer SerialPort mocks. - Strengthen rsReticulum overlay "already present" guards to require const declaration + use site; bound BLE iface name parse whitespace for Sonar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wi‑Fi / TCP RNodes (
tcp://host:7633) close the socket after ~6 seconds without host KISS writes. Python Reticulum prevents this withTCPConnection.ACTIVITY_KEEPALIVE(3.5s) by callingself.detect()when idle (RNodeInterface.py). rsReticulum already applied OS TCP keepalive and reconnect-on-EOF, but never sent the application-level detect keepalive, so interfaces flapped (~6.7s up, thenRECONNECT_WAIT5s).last_writeon every successful write in the RNode write loop.build_detect_sequence()when idle ≥ 3.5s (100ms undercfg(test)).Evidence
mesh-client developer dump (Heltec V4 / ESP32-S3, firmware 1.86,
tcp://192.168.1.110:7633): peer FIN withRNode TCP socket closedat mean 6.73s after open, then exact 5s reconnect — same withrnsd-rs.Test plan
cargo test -p rns-interface --features rnode-tcp --lib rnode::cargo clippy -p rns-interface --features rnode-tcp -- -D warningsRNode TCP activity keepalive (detect)and noRNode TCP socket closedcycle