Skip to content

Fix MeshCore nodes missing from dashboard map#51

Closed
KMX415 wants to merge 1 commit into
mainfrom
fix/meshcore-map-position
Closed

Fix MeshCore nodes missing from dashboard map#51
KMX415 wants to merge 1 commit into
mainfrom
fix/meshcore-map-position

Conversation

@KMX415
Copy link
Copy Markdown
Owner

@KMX415 KMX415 commented May 12, 2026

Summary

MeshCore advertisements carry position data on the advertisement packet itself (adv_lat/adv_lon), which the event adapter classifies as PacketType.NODEINFO. MeshcoreDecoder.extract_node_update only consumed lat/lon from PacketType.POSITION packets, so MeshCore node positions silently dropped before the node-repository write and /api/nodes/map returned zero MC nodes.

Fix

extract_node_update now lifts position from both NODEINFO and POSITION packets through a shared _apply_position helper. Empty or zero coordinates are ignored.

Tests

New TestMeshcoreDecoderNodeExtraction (3 tests) in tests/test_meshcore_usb.py:

  • advertisement with position yields a positioned node
  • advertisement with zero position yields a node without position
  • standalone POSITION packets still extract lat/lon (regression guard)

Full suite: 300 passed locally. Bandit clean on src/decode/. Ruff clean.

Migration

None. Existing MeshCore nodes populate on the map after their next advertisement is heard.

Test plan

  • python -m pytest tests/test_meshcore_usb.py
  • Full edge suite green (300 passed)
  • Hardware: validate on RAK V2 with active MeshCore node in range

MeshCore advertises position on the advertisement packet itself (adv_lat/adv_lon), which the event adapter classifies as NODEINFO. extract_node_update only pulled lat/lon from POSITION packets, so coordinates silently dropped before the node-repository write and /api/nodes/map returned zero MeshCore nodes.

Pull position from both NODEINFO and POSITION packets via a shared _apply_position helper. Existing MeshCore nodes populate on the map on their next advertisement; no DB migration needed.

Adds 3 regression tests in TestMeshcoreDecoderNodeExtraction covering advertisement-with-position, advertisement-without-position, and the standalone POSITION-packet path.
KMX415 added a commit that referenced this pull request May 15, 2026
Per-feature click-by-click checklists for v0.7.4 release. Files live alongside
features as they land; boxes get ticked during walkthroughs on .141 and .15.

  README.md            index, cross-cutting checks, sign-off matrix
  foundation.md        sidebar, IA refactor, map zero-scrollbar, audit log
  auth.md              password change, viewer role, sign out, lockout
  terminal.md          PTY, command guide, irreversibles, role gate
  updates.md           apply, branch picker, watchdog rollback
  configuration.md     Identity / Radio / Channels / Transmit / MQTT / GPS
  dangerous.md         restart, clear DB, wipe phantoms, force NodeInfo
  cherry-picks.md      MQTT paths, MeshCore Channel Config, PR #51 map fix
  polish.md            real blips, smart upgrade indicator

Templates structured: status / hardware / pre-conditions / walkthrough /
negative paths / hardware-specific / failure modes / acceptance.
KMX415 added a commit that referenced this pull request May 15, 2026
…shell

Lights up the modules introduced over the past six commits. Each
of those commits left its feature self-contained and importable;
this commit is what makes the dashboard actually render and serve
them. Splitting the wire-up out keeps the per-feature reviews
focused and means a future bisect against any of the new modules
isn't poisoned by churn in server.py / app.js / index.html.

Backend wiring (src/api/server.py):

  Initialised inside the FastAPI lifespan and shut down cleanly:
    - AuditLogWriter         shared sink for every admin action
                             across auth / terminal / update /
                             dangerous routers.
    - SessionManager         PTY session registry; shutdown hook
                             flushes orphaned PTYs on systemctl
                             stop.
    - CommandCatalog         seeded from DEFAULT_CATALOG.
    - ReleaseChannelRegistry seeded from DEFAULT_CHANNELS.
    - UpdateApplier          bound to the host shell runner.
    - DangerousActionRegistry built from the handler factories,
                             closing over the live PipelineCoord
                             so async actions can dispatch through
                             the running event loop.

  app.include_router added for:
    - auth_config_routes   PUT /api/config/auth_lockout
    - terminal_routes      /api/terminal/*  +  /ws
    - update_routes        /api/update/*
    - dangerous_routes     /api/dangerous/*
    - public_radar_routes  /api/public/recent_rx

  pipeline.on_packet now also fires public_radar_routes
  .public_radar_packet_callback so the auth-page radar gets fed
  the live (scrubbed) RX stream.

Frontend wiring (frontend/js/app.js):

  _bootAuthPanel, _bootTerminalPanel, _bootUpdatePanel,
  _bootConfigurationPanel, _bootDangerousPanel attach controllers
  to their sections on first activation and re-bind on hash-route
  re-entry. All five hook into the existing sidebar router and
  do nothing if their host element isn't in the DOM (so legacy
  test pages aren't disturbed).

Frontend shell (frontend/index.html):

  - Settings -> Auth section: card grid for password change, sign
    out everywhere, viewer role, lockout config.
  - Settings -> Updates section: channel picker, version readback,
    apply / rollback buttons, structured log host.
  - Settings -> Dangerous section: action list host with the
    typed-confirmation modal mounted at body level.
  - Terminal section: xterm host, status header, action bar,
    command drawer, dangerous modal.
  - Configuration section: Identity / Radio / Channels / Transmit /
    MQTT / GPS subpanel hosts under the new sidebar IA.
  - <link>s for settings.css, terminal.css, configuration.css.
  - xterm.js + xterm-addon-fit pulled from jsdelivr (vendoring
    follows in a separate commit; the CDN drop is a fallback for
    online-first development boxes).

After this commit, every module shipped in commits 1-6 is reachable
from the dashboard and audited consistently. v0.7.4 is now feature-
complete on the working tree pending the smart upgrade indicator,
xterm vendoring, ottoxgam's MeshCore Channel Config rebase, and
PR #51 (MeshCore map fix).
@KMX415
Copy link
Copy Markdown
Owner Author

KMX415 commented May 15, 2026

Cherry-picked onto eat/v0.7.4 as 8cbd730 alongside the rest of the v0.7.4 train. The CHANGELOG bullet has been moved from the v0.7.3.x section to Unreleased so it folds into the v0.7.4 release header at version-bump time. Full edge suite green locally (535 passed). Closing this PR -- the fix will reach main when feat/v0.7.4 merges. Hardware validation on RAK V2 with a live MeshCore node is on the v0.7.4 hardware-validation checklist.

@KMX415 KMX415 closed this May 15, 2026
@KMX415 KMX415 deleted the fix/meshcore-map-position branch May 15, 2026 01:13
KMX415 added a commit that referenced this pull request May 15, 2026
…ne green

Sweep through foundation / terminal / updates / cherry-picks checklists,
ticking the [x] boxes for unit + route tests that have landed and are
part of the live 556-test suite. Hardware-walkthrough boxes stay [ ];
those are filled when the user runs the click-by-click steps on .141
and .15.

Also updates cherry-picks.md to reflect:
  * PR #35 cherry-pick at 7820f9f with verified Co-Authored-By trailer
  * PR #51 cherry-pick at 8cbd730 with CHANGELOG bullet relocated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant