Skip to content

MeshCore apply does not persist per-channel region_scope on radio #129

@pskillen

Description

@pskillen

Summary

When Meshflow pushes scoped MeshCore channel config to a feeder (apply_mc_channel_config), channel names appear on the device but per-channel region_scope values do not. After apply, disconnecting from the bot and checking the MeshCore Android companion shows a single default scope and every channel slot on that default scope.

Meshflow API mirror can still look correct because post-apply sync merges scope from the apply payload when CHANNEL_INFO omits scope — the gap is device persistence, not API bookkeeping alone.

Reproduction

  1. Configure multiple MC channels with distinct region_scope values in Meshflow (UI or admin).
  2. Apply to radio via bot (WebSocket apply_mc_channel_config or admin push).
  3. Unplug from bot; connect radio to MeshCore Android companion over USB.
  4. Observe channel settings: one scope (e.g. default/sco), all slots on default — not Meshflow’s per-channel scopes.

Current bot behaviour

apply_device_channels (src/meshcore/channels.py):

  1. set_channel(idx, name) — name only, no scope on wire.
  2. set_flood_scope(scope_arg) after each row — documented as active/global flood scope; loop overwrites each call so only the last row’s scope can remain active.

get_channel / CHANNEL_INFO does not return per-channel scope today.

Hypotheses

  • Per-channel scope may require a command we do not call (not part of set_channel).
  • set_flood_scope may be global only, not per-slot NVS.
  • set_flood_scope may be missing or failing on some feeders (check logs for warnings).

Verification

During apply, check logs for:

  • set_flood_scope unavailable
  • set_flood_scope(%r) failed
  • active flood scope=

Confirm apply payload includes region_scope per row.

Documentation

Full investigation log (symptoms, hypotheses, checklist):
https://github.com/pskillen/meshflow-api/blob/main/docs/features/meshcore/mc-channel-sync/bug-channel-scope-read-write.md

Related: meshflow-api #391 (region scope epic), PR meshflow-bot #127.

Code

  • src/meshcore/channels.pyapply_device_channels, _apply_active_flood_scope
  • src/bot.pyon_apply_mc_channel_config

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions