Repository navigation
feat: automatic uplink ping scope (v1.22.0) - #19
Merged
Merged
Conversation
…anion (v1.22.0)
A fixed uplinkScope ("be") reaches almost nobody just over the border: of
the Limburg border repeaters in CoreScope's node_declared_regions, many in NL
declare only *, nl or nl-li. uplinkScope is now a preference list
("de,nl,be"). Per ping, src/autoscope.js counts how many of the repeaters
heard directly in the last 5 minutes forward each candidate (the companion's
default scope first, then the list) and takes the most forwarded. With none
forwarded but *, the ping goes out un-scoped (fw v12+); with nothing known,
in the companion's default scope (CMD_GET_DEFAULT_FLOOD_SCOPE, fw v10+).
Declared regions come from CoreScope GET /api/nodes/declared-regions
(uplinkRegionsUrl, default corescopeUrl + that path, every 30 min) merged
with this session's own region answers. The MQTT payload is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Users just over the border in NL or DE get a ping sent in
be, which many repeaters there do not forward (livenode_declared_regions: e.g. NL-NWS-RP02, NL-KERKR, the VRZL repeaters declare only*,nlornl-li).What
src/autoscope.js(new):parseScopeList,mergeRegionTable(CoreScope list plus this session's answers, session wins),matchHeard(unique prefixes only),chooseScope, default-scope frames (CMD_GET_DEFAULT_FLOOD_SCOPE64 / resp 28, fw v10+; un-scoped[54][1], fw v12+).uplinkScopein order. The one most of the repeaters heard directly in the last 5 min forward wins; ties go to the order. None but*: un-scoped. Nothing known: companion default.src/app.js: reads the companion's default scope at ping setup, records direct hears (advert, discover, rxlog), fetchesuplinkRegionsUrlevery 30 min, logs the chosen scope and the counts.src/config.js:uplinkRegionsUrl, defaultcorescopeUrl + /api/nodes/declared-regions.coredrive-rx-v57,docs/releases/v1.22.0.md. Payload unchanged.Tests
test/autoscope.test.mjs(11): list parsing, firmware frames, merge, prefix matching, Belgium, the border case, ties, companion default outside the list, un-scoped, fallbacks.npm test: 428 pass.vite buildOK.🤖 Generated with Claude Code