MeshCore Repeaters admin (Ping / trace)¶
Developer reference for MeshCore repeater admin RPCs, trace/ping, neighbors paging, CLI, or waiting-message drain. Repo-wide rules live in AGENTS.md.
Repeaters & Rooms ops tab: RepeatersPanel.tsx lists both hw_model === 'Repeater' and hw_model === 'Room' (All / Repeaters / Rooms filter). Tab label is tabs.repeaters (Repeaters, under the Network rail section); in-panel title is repeatersPanel.title (Repeaters & Rooms). Rooms BBS stays on the Rooms tab; Manage there jumps here via pendingFocusNodeId. Open room on a room row jumps back to Rooms. Admin passwords use meshcoreInfraAdminSecrets.ts (two app_settings prefixes; room forget clears admin only). Room CLI goes through sendRepeaterCliCommand / thin sendRoomAdminCliCommand alias (forwards confirmedDanger); room remote CLI requires ACL admin password (not guest BBS). Room-only CLI pills: get acl, allow.read.only on|off + ACL setperm form.
Row actions (v6): each row shows Ping (plus Open room on Room rows) and one overflow menu (MenuButton, "More actions for {name}") with Status, Neighbors, Sensor (LPP), Configure, CLI and Remove. A failed request shows as a red menu item whose description carries the translated error (aria-describedby); a failed ping turns the Ping button into a red Error button with the error under it. Remove keeps its two-step confirm: choosing it shows a focused Confirm? button in the row, and blurring that button cancels. A row spinner (role="status") shows while Status, Neighbors, Sensor, CLI or Remove is in flight.
Room Ping (KNOWN-GOOD — do not “parity” with repeater TRACE): Room firmware never answers TRACE / TraceData. Repeaters Ping on a Room uses the same Status RPC as the Status action (meshcoreShouldPingRoomViaStatus → runMeshcoreRepeaterStatusRequest), admin hops (resolveMeshcoreAdminHopsAway with routeBytes ?? [] so a missing map entry is known-empty → 0-hop), timeout flood escalation without Room BBS login, and runMeshcoreRoomStatusWithNotFoundRestore (one addMeshcoreNodeContactToRadio restore+retry on companion ERR_NOT_FOUND, aborted if the ping session goes stale mid-restore). Do not copy TRACE prep (resolveMeshcorePingHopsAway, refreshRepeaterContactPathFromRadio, usable-path width checks, radio 0xFF / direct-first planning) into this branch — Status is pubkey-framed. Success records meshcoreRoomStatusPingTraceResult (fromStatusPing) so the panel can show SNR without stamping hops from synthetic TraceData. Locked by meshcoreRoomStatusPing.test.ts, useMeshcoreRuntime.room-ping.contract.test.ts, and the KNOWN-GOOD comment in useMeshcoreRuntime traceRoute.
Configuration panel¶
Choose Configure from a repeater or room row menu. Manage on the Rooms tab opens the same panel for that room. Section summaries explain the settings inside; opening a section reads its settings and unopened sections generate no radio traffic. The header reports the local radio connection, and section badges count pending changes while individual edited fields are marked. Identity/location, radio parameters, and routing/adverts are shared. Rooms also expose guest access and ACL permissions. Advanced opens the existing CLI for firmware-specific options and confirmed reboot commands.
Owner info in the detail modal. For Repeater, Room and Sensor contacts the modal reads owner info automatically once per connection per node (cached in memory, Refresh button, no route-priming ping). When an admin password is resolvable it uses authenticated CLI get owner.info (firmware 1.12+). Without a password it uses companion CMD_SEND_ANON_REQ subtype OWNER (0x02) — same BinaryResponse path as region discovery — so nearby nodes still show owner text when the firmware supports it. The modal also shows a Remote clock strip from ANON BASIC (0x03) or the clock carried on an OWNER reply (feature flags: bridge / forwarding disabled). Editing owner.info remains Configure → Identity for Repeater and Room only; Sensor is read-only. CLI replies keep the >-prefixed parser (meshcoreOwnerInfo.ts); ANON OWNER maps into the same entry shape. Companion firmware has no owner.info, so Chat contacts show nothing.
For repeaters, Regions and flood scope reads both region default and the bare region command, sequentially through the same authenticated CLI queue. The region list shows hierarchy, the home marker (^), and each entry's flood flag (F); * describes unscoped traffic. Listing support is independent of default-scope support, so older firmware can still show its configured regions. Refresh rereads both, and applying a default rereads the list because firmware may create that region or allow its floods. Room servers retain the default-scope form without requesting a repeater region tree.
Region discovery (Radio → Regional flood scope): an explicit Discover regions action queries nearby Repeater and Room contacts with a resolvable 32-byte pubkey via companion CMD_SEND_ANON_REQ (57) subtype REGIONS (0x01) — the same anonymous path as Liam’s MeshCore app / MeshMonitor. No admin password; not packet sniffing. Firmware answers direct-only and rate-limits anonymous requests (~4 / 3 min). Reads run sequentially (capped), never automatically on connect. The BinaryResponse carries a repeater clock plus a CSV of flood-allowed region names (* dropped as legacy). Results merge into a per-radio directory in app settings (meshcoreDiscoveredRegions, keyed by meshcore:pk:<64hex>). Public names normalize to #name for flood-scope presets and the channel scope picker. Full authenticated region trees (hierarchy, home ^, flood F) remain on Repeater Configure → Regions. The directory is a convenience catalog, not membership or geography. Implementation: meshcoreAnonRequestRpc.ts, meshcoreRegionDiscovery.ts, meshcoreRegionDiscoveryStorage.ts, MeshcoreFloodScopeSection.tsx.
meshcoreRepeaterRegions.ts parses the firmware tree. CommonCLI limits the reply to 159 bytes plus NUL, without pagination; a full buffer produces a warning and an incomplete final row is omitted. Serial access is needed to inspect a longer tree. Unsupported or failed reads show an explanation instead of an empty list. RepeaterCommandService correlates multiline replies using the leading token while preserving sender checks and the full body. See the upstream CLI reference and firmware implementation.
The companion's manual Advert action is in the app header. Network → Contacts has no duplicate Advert button. Remote advert / advert.zerohop CLI commands still act on the selected repeater or room.
Apply validates all edited fields before sending, writes only changed values, and reads each value back before reporting success. Radio frequency/bandwidth/SF/CR are one set radio exchange. Firmware rejection or timeout keeps edits available and stops subsequent writes; earlier confirmed changes remain saved. Refresh is disabled while there are edits, so use Discard edits first. Unsupported settings are disabled without substituting defaults. Radio changes that require reboot show a notice; reboot stays an explicit CLI action.
Admin routing decisions use repeaterAdminRouting.resolveHopsAway, shared by the panel and runtime. A known empty companion route is direct even if the displayed advert hop count retains an older multi-hop value; an unknown companion route retains the displayed hop fallback. This controls pre-CLI Ping, waiting-message drain/trace waits, and the zero-hop login timeout policy. Room CLI ACL login also restores an evicted companion contact and retries once on ERR_NOT_FOUND, using the room admin password and the same recovery/error handling as repeater login. A silent remote still times out; this does not prove why firmware omitted its response.
Implementation: MeshcoreInfraConfigPanel.tsx, meshcoreInfraConfig.ts. Commands use the existing authenticated, token-matched CLI path. meshcoreRepeaterCliQueue.ts serializes full command/reply exchanges per identity and node, while preserving companion queue release at RESP_SENT. Connection/setup generation and caller lifetime are checked before transmission; a closed panel or replaced connection stops pending configuration commands. Password/private-key commands and replies are redacted in CLI history, including late token replies after timeout. String setters retain the trailing delimiter needed to clear guest passwords and owner information.
Guest password changes affect the remote room server. Locally saved guest login credentials are managed separately. Room ACL changes report the setperm acknowledgement and keep the public-key form on failure. Refresh ACL is separate: upstream room firmware exposes the listing only over serial, so an empty or unsupported RF listing shows the existing serial-access hint without turning a saved permission into an error.
MeshCore firmware serializes traceroutes — one active trace cycle per RF link. mesh-client enforces:
- Trace queue (
meshcoreRepeaterRpcInFlight.ts): global ping queue; duplicate clicks coalesce per node. - Companion queue (
repeaterRemoteRpcQueue.ts): serializes RPC sends (Status, Telemetry, Neighbors binary req, trace SendTracePath, CLI login). - Companion remote request slot (
meshcoreCompanionRequestQueue.ts): serializes complete Login (including Room BBS), Status, Telemetry and binary request/reply exchanges on each connection, across all nodes. Companion firmware clears every pending remote request when starting another of these commands; releasing only at SENT lets the second command erase the first reply's association. Reply, timeout, radio rejection and send failure release this slot. Queued Room login cancellation rejects immediately and skips transmission. Cancelling a transmitted Room login also rejects the caller immediately, but retains its slot and listeners until the companion replies or the request fails; a late guest reply cannot satisfy a subsequent admin login. The separate send queue still releases at SENT, so CLI text, trace sends and waiting-message polls can run while a remote request waits. A replacement connection has its own slot. - Queued send (
meshcoreRepeaterRpcQueuedSend.ts): queue slot ends atRESP_SENT; response listeners run outside the slot. - Admin idle (
meshcoreTraceRadioIdle.ts):beforeSendwaits for TraceData in flight only (not pending route registration), soft budgetMESHCORE_REPEATER_ADMIN_RF_IDLE_MS(15s) then proceeds. Same-node admin soft-settles ping wrapper forMESHCORE_REPEATER_PING_SETTLE_SOFT_MS(10s) and proceeds without throwing if still busy. - 0-hop contract (
meshcoreRepeaterTracePath.ts,meshcoreZeroHopRepeaterWorkingState.test.ts): Status/Telemetry/Neighbors use pubkey-framed frames (no contact-list gate). Ping seeds a per-contact pubkey prefix sized from that contact’s packedoutPathLen(1–3 bytes; plain lengths still 1-byte); direct retry escalates to full pubkey only whenhopsAway === 0. The radio sends all 64 path bytes with a contact and only the length byte says how many are the route, so a contact the radio lists as direct (length0x00,0x40or0x80) can still carry an older route's bytes or a stale UI hop count from an advert. When the app shows hops for such a contact, the ping reads the contact from the radio again andmeshcoreTracePingHopsAwaytreats radio-direct as zero hops (leftover buffer bytes are not a route). For radio0xFF(no route) with displayed hops, ping tries a hash-sized dest prefix direct first, then a full-key entry, before planning a relay path. A zero-hop ping never seeds a stored path that is not the destination's own key prefix. When the radio has no route to a contact (length0xFF, which a Status or Telemetry flood resend leaves when no path comes back, or a never-routed advert neighbour) and the app shows it 1+ hops away, the ping first tries it direct as one 8-byte entry that only its key matches (meshcoreTracePingTriesDirectFirst, waitingMESHCORE_TRACE_PING_DIRECT_FIRST_EXTRA_MSpast the radio's estimate), whether or not leftover path bytes remain; if that is not answered it uses the planned or synthesized route. A ping teaches the radio no route, so every ping repeats the direct try until a Status, Telemetry or login reply relearns one. A zero-hop reply to an 8-byte entry is stored as the repeater's own prefix at the path hash size (meshcoreTraceZeroHopStoredPath): room login and admin count hops from the stored bytes and would read 8 bytes as seven. Multi-hop ping requires hash-segment path (≥2 bytes), never full destination pubkey. On the wire (meshcoreTraceWirePath.ts) trace hops are sized the way firmware reads them:1 << (flags & 3)bytes each (1, 2, 4 or 8), independent of the path hash mode. A 2-byte hash is sent with flags 1, a 3-byte hash is cut to 2 bytes, and the full-pubkey retry goes out as one 8-byte entry (flags 3); sent with flags 0 those would be read as several 1-byte hops and never complete. Status/Telemetry/Neighbors throw on disconnect (MESHCORE_ERR_NOT_CONNECTED) so RepeatersPanel / node-detail toasts fire — do not bare-return. - One active traceroute: firmware allows one TraceData cycle;
meshcoreTracePathMultiplexwaits for prior TraceData before the nextSendTracePath. Room-login active traces use the same global ping queue (runMeshcoreRepeaterRpcOnce('trace')) and cancel the multiplex handle on route-resolve timeout. - Neighbors paging (
MESHCORE_NEIGHBORS_PAGE_SIZE= 50 request cap,MeshcoreRequestNeighborsOpts.offset,mergeMeshcoreNeighborPage,meshcoreGetNeighboursBinary.ts): first fetch replaces the cache;offset > 0appends whenoffset === cache.length(dedupe byprefixHex). In-flight coalesce keys by offset so refresh and Load more do not share one closed-over fetch. Firmware reply buffers often return fewer rows than requested (~11 at 6-byte prefixes); UI Load more on RepeatersPanel and NodeDetailModal continues fromneighbours.length. - Trace route priming (
meshcoreTraceRoutePrime.ts,meshcoreRepeaterTracePath.ts, constants/wait helpers inmeshcoreHookPreamble.ts): when multi-hop but outPath bytes are missing, passive PathUpdated (129) wait + contact refresh first (15s + 5s × hops, cap 45s/round). For 2+ hops, if passive fails, up to two flood-advert rounds as fallback (listener registered before each advert). 1-hop prefers the reverse of a recent RF packet path heard from that node (meshcoreBestInboundRfOutboundPath, also recorded into path history on RF hop updates), then path history (even when the radio reports0xFF), then may synthesize a[relayPrefix]intermediate from a known 0-hop Repeater or Room (newestlast_heardfirst); 2-hop may prepend a relay prefix to a stored 1-hop intermediate. Prefix width follows path hash mode (1/2/3 bytes). BeforeSendTracePath, multi-hop ping expands to an auto-return path[...out, dest, ...out.reverse()]so TraceData returns to the companion (a one-way[relay, dest]never reaches us; a relay may forward the packet twice because the TRACE packet hash covers the SNR count). The round trip is built from relay hashes only, and stored routes come in two shapes (meshcoreTraceOutboundFromStoredPath): with 1-byte hashes a stored route is its relays plus one trailing byte (a plain contactoutPathLenofnis sliced asn + 1bytes, and room login and repeater admin count hops aslength - 1), and that trailing byte is never sent as a hop; with 2- and 3-byte hashes it is exactly the radio's relay hashes. The contact'soutPathLenbyte is read bymeshcoreRadioContactRoute(hop count in the low 6 bits, hash size code in the high 2; meshcore.js hands 3-byte lengths over as negative int8), and a routed contact is traced at the size its own length packs, whatever the companion's path hash mode. Skip priming when a usable stored/history/inbound path exists, or when 1-hop synthesis is available. Blind synthesis with radio0xFF, a clean path buffer, and no inbound RF/history evidence is aborted withmeshcore.errors.pingNoRouteafter the direct try (UI hops alone are not enough). Ping/trace may also fast-fail withmeshcore.errors.pingNoRoutewhen priming and synthesis cannot produce a hash-segment path. - Prefix-matched push RPCs (
meshcoreRepeaterPrefixPushRpc.ts): Status, Telemetry, and repeater admin login share pubkey-prefix listeners; login registers LoginFail as an auxiliary event while waiting for LoginSuccess. - Timeouts: Status/Telemetry/Neighbors reply arm =
clamp(est + 5s, 15s, 60s)viameshcoreRepeaterReplyWaitMs(no-est fallback = hop-scaledmeshcoreRepeaterRpcTimeoutMs, then capped at 60s). Admin/login/CLI SENT wait = 10s; ping end-to-end = 56s (MESHCORE_TRACE_PING_TOTAL_TIMEOUT_MS= 2×8s direct-first + 30s TraceData + 10s slack); TraceData wait after SENT = 30s (MESHCORE_TRACE_TIMEOUT_MS); trace SENT wait = 45s. - Route escalation (
meshcoreRepeaterRouteEscalation.ts): on timeout only (never radioERRor SENT-ack timeouts),resetContactPath+ one flood resend when the prior route was direct or unknown (and reset succeeds); already-flood routes skip.meshcoreRepeaterRouteKindreads the radio contact'soutPathLenbyte the way firmware does:0xFF(OUT_PATH_UNKNOWN) is flood, and0is a known zero-hop route sent direct, so a stale zero-hop route also gets the flood resend; 30s per-node cooldown after a successful reset. Applied to Status/Telemetry/Neighbors and CLI login. - Route on a missed reply (
MeshcoreRepeaterRouteMode,meshcoreRepeaterRouteModeStorage.ts): each repeater or room row's menu has a "When a reply is missed" group. Auto (the default) is the route escalation above. Direct only replaces the reset and flood with one resend on the same route, with no cooldown. It adds no flood, but it cannot make an unknown route direct: when the radio already holds0xFF(for example after an earlier Auto reset) the send floods, as in Auto, until a reply teaches the radio a route. Zero-hop writes the radio contact with zero hops before every send (setMeshcoreRadioContactZeroHop: the packed length keeps the path hash size,0x00,0x40or0x80, from the contact's own route or the companion's mode, and the contact keeps its own type, flags and name), then behaves as Direct only; when the write fails nothing is sent. The write is skipped when the cached radio length already has zero hops and the stored path has no relays. Repeater Ping (TRACE) does not go through this wrapper and ignores the choice; Room Ping (Status) follows it. The login fallback logs in before the same-route resend, as it does before the flood resend. The choice is saved in localStorage (mesh-client:meshcoreRepeaterRouteModes:v1) by the repeater's public key, only for non-Auto modes, and a row whose public key is unknown cannot set it. A badge beside the hop count shows a non-Auto mode. - Login: Optional for telemetry when password saved; Status and Neighbors send no login on the first attempt. Repeater firmware answers requests only for a companion in its access list and drops the rest silently (guest entries are not saved across a reboot), so when Status or Neighbors times out and a repeater admin password is saved or entered,
withMeshcoreRepeaterLoginFallbacklogs in once and asks again (on the flood resend when the route was direct). Repeater and Room CLI require an admin password (firmware drops CLI unlessisAdmin()). Room login rejects immediately on prefix-matched LoginFail. Repeater admin login matches meshcore.js — LoginFail alone does not reject; timeout after LoginFail is reported as timeout, not wrong password. Blind same-path timeout retry is off; callers escalate via flood instead. - Repeater CLI danger: destructive commands (
meshcoreRepeaterCliDanger.ts:reboot|erase|clkreboot|factory|shutdown|poweroff) require confirm modal in Repeaters panel; runtime rejects unconfirmed sends (meshcore.errors.cliDangerNotConfirmed). Commands longer than 512 characters (REPEATER_CLI_MAX_COMMAND_LENGTH) are rejected before send. Multi-hop CLI auto-pings once per session when no trace exists (RepeatersPanel→onPing) as an advisory prime — CLI still proceeds if ping fails. CLI tokens are keyed per node; wire TXT timestamps are strictly increasing per node. Safe quick pills includeclock,clock sync,clear stats,advert,advert.zerohop,board,stats-*,get role(firmware CLI tokens as labels). A second Radio pill row (RADIO_CLI_QUICK_COMMANDS) carries MeshCore v1.17+ CommonCLI booleans:get/set radio.rxgain on|off,get/set radio.fem.rxgain on|off,get/set radio.fem.txgain on|off(Station G3),get/set cad on|off(upstream default off — hardware CAD can lock the radio ~4s), andget pwrmgt.bootreason. Unsupported boards replyError: unsupported; no firmware-version gating. Companion firmware cannot set FEM gains (1.17.1), so there is no companion RadioPanel UI for them. - Per-node admin passwords:
meshcoreInfraAdminSecrets.tsfacade overmeshcoreRepeaterCredentialStorage.ts/meshcoreRoomCredentialStorage.ts(separate prefixes); ops modal viauseMeshcoreRepeaterRemoteAuth.tsx; room admin-only persist allowed; ops Forget on a room clears admin only (guest/auto-login unchanged). Accordion lists both kinds. - Waiting-message drain: event 131 →
meshcoreWaitingMessagesDrain.ts/meshcoreProcessWaitingMessageItem.ts; silent auto-drain vs manual Sync now (MeshcoreWaitingMessagesHeaderIndicator.tsxin the App header viameshcoreWaitingMessagesStatusText.ts; queued backlog visible on any protocol tab; active sync spinner and paused/deferred state only on the MeshCore tab); defers during TraceData/admin RPC. Silent bulkgetWaitingMessagescircuit-opens after 2 consecutive timeouts (MESHCORE_WAITING_MESSAGES_SILENT_BULK_TIMEOUT_TRIP) and skips bulk until reconnect/success; disconnect bumps the attempt id so a late timeout cannot trip the next connection. Repeater CLI waits for drain idle beforerunMeshcoreRepeaterRpcOnce(waiting inside the once slot deadlocks because in-flight defers drain). CLI_DATA waiting items updatelast_heardonly — Protocol’s liveContactMsgRecvpath ownsmeshcore_cli_response(drain must not re-dispatch or CLI history doubles). Wire-originated<history lines are appended only inhandleCliResponse(meshcoreConnSideEffects.ts):RepeaterCommandService.ingestResponseresolves the pending token, returnsduplicatefor an identical settled re-delivery (token+body+sender), orunmatchedfor stray/late replies; the runtime keeps>sent lines and local[Error: …]only (source-policymeshcore-cli-received-single-writer). CLI RPC uses a uniquecoalesceKeyso exchanges never share an in-flight slot. If drain is busy at start or SENT, CLI timeout is padded byMESHCORE_WAITING_MESSAGES_SILENT_TIMEOUT_MS(45s), capped atREPEATER_CLI_MAX_TIMEOUT_MS. While CLI awaits a reply,beginMeshcoreCliReplyHoldblocks new traces and keeps silent drain from deferring on TraceData; 0-hop CLI also preempts pending traces and force-kicksprocessWaitingMessages({ force: true })on a short interval. - Repeater CLI clock:
clock/clock syncare firmware tokens.clock syncuses the companion/computer UTC unix timestamp; MeshCore firmware refuses to set time backwards (ERR: clock cannot go backwards). Do not auto-clkreboot; toastrepeatersPanel.cliClockCannotGoBackwardsand leaveclkrebootbehind the danger confirm. Optional companionsyncDeviceTime()runs before repeaterclock sync. - Cross-traffic: Room sync/auto-login defer while
meshcoreCompanionRepeaterRfBusy(); waiting-messages drain defers during TraceData.
Noise-floor trend (node detail)¶
MeshCore node detail (NodeDetailModal + NoiseFloorTrendChart) keeps a selected-node noise-floor trend while that panel is open: samples from Status (remote) or local companion radio stats into noiseFloorHistoryStore, with sparkline + min/max/last (meshcore/noiseFloorHistory.ts, same scaling as EnvironmentSparklines). Remote Status refreshes on MESHCORE_NOISE_FLOOR_TREND_POLL_MS only after the user has loaded repeater stats for that node (showRepeaterStats) and only while the document is visible — never a global always-on poll — so airtime and the serialized companion remote-request slot stay protected. Overlapping poll ticks are skipped while a Status request is in flight. Zero dBm is a real reading; an empty series shows a clear empty state.
Do not change behavior guarded by meshcoreZeroHopRepeaterWorkingState.test.ts without explicit user request. See ../meshcore-meshtastic-parity.md.