meshmonitor icon indicating copy to clipboard operation
meshmonitor copied to clipboard

[FEAT] Meshcore - add PING [zero hops] in ACTIONS

Open kokoshell opened this issue 4 months ago • 1 comments

Hi Yeraze, Please add for Meshcore PING [zero hops] command in ACTIONS menu ... The phone app has it is really useful to detect Direct nodes. Also would be great to mark/color direct nodes in Meshcore too.

Best regards, Kokoshell

kokoshell avatar Jul 28 '26 18:07 kokoshell

Thanks for the report! Classifying this as a Feature Request — not a duplicate of any open or closed issue (checked for existing MeshCore ping/direct-node issues, none found).

Alignment

This fits the project's ongoing MeshCore parity work (see #4391, #3923 for similar "official app has X, MeshMonitor's MeshCore support doesn't yet" gaps), so it's in scope. It's really two related-but-separable asks, so I'll plan them separately.

Part 1 — "Ping [zero hops]" action

Today's MeshCore contact Actions menu (src/components/MeshCore/MeshCoreContactDetailPanel.tsx) has Trace Path, Discover Path, Reset Path, Share, Export, Neighbours, Remove — no Ping.

Looking at the existing trace machinery:

  • MeshCoreManager.traceContactPath() (src/server/meshcoreManager.ts:3788) requires an already-known multi-hop outPath (pathLen > 0) — it won't run for a contact with no cached route.
  • The underlying bridge command explicitly rejects a zero-length path: src/server/meshcoreNativeBackend.ts:1273-1276 — trace_path requires a non-empty path.

So a true zero-hop "Ping" (a direct, no-repeater probe — matching what the phone app's Ping action does) needs a new code path, not just a UI button reusing Trace Path:

  1. Confirm the firmware / meshcore.js companion protocol actually supports CMD_SEND_TRACE_PATH (or equivalent) with an empty hop list to force a direct-only round trip — this is the one open question before implementation.
  2. Add a pingContact(publicKey) method to MeshCoreManager alongside traceContactPath, allowing an empty path and surfacing RTT/SNR (or a clear "no direct response" failure) from the result.
  3. Wire it through useMeshCore.ts and add a Ping button next to Trace/Discover in MeshCoreContactDetailPanel.tsx, gated the same way (Companion-only, write-permission-gated).

Part 2 — Color/mark direct nodes

This one's cheaper than it looks: MeshCoreManager already decodes and tracks per-contact hop count (decodePathLenHopCount(), meshcoreManager.ts:70-78) — pathLen === 0 already means "direct/zero-hop" in the existing data model. No new device command needed here, just a rendering change:

  • MeshCoreMap.tsx marker styling — treat pathLen === 0 contacts distinctly (color/icon), similar to how direct-neighbor status might already be surfaced on the Meshtastic side.
  • Possibly the contact list view too, if one exists outside the map.

This part could ship independently and sooner than Part 1, since it only touches display logic against data MeshMonitor already has.

Next steps

I'll hold here per our workflow — this is a plan for review, not a start signal. If this direction looks right, let me know and I'll open a branch and get going (starting with Part 2, since it's lower-risk, then Part 1 pending confirmation of the empty-path trace behavior with the meshcore.js library).

-- Authored by Roger 🤓


Generated by Claude Code

Yeraze avatar Jul 28 '26 18:07 Yeraze