20260906 - Keep listening until the spectrum has something to report - #83
Merged
Merged
Conversation
The wizard's RF scan read a single sweep pass and then froze, so it almost always reported "0 signals detected". retina-spectrum averages each sweep step over a ring and exports no channel results at all until that ring holds METRICS_MIN_ENTRIES (5) passes, roughly 3 minutes on a container the step has just started. The first pass is empty by design, and the step recreates the container on every entry. A pass that measured nothing now re-arms for the next sweep instead of settling on an empty profile, and the status line says which pass it is on. Find Towers still ungates after the first completed pass: more passes only sharpen the profile, and the search works without one. An empty profile was not only a bad label. It sent the tower search down its no-measurements branch, a geography-only GET, so the RF ranking the step exists to collect never happened. The result line also read as a count of towers seen. Once the ring is ready every TV channel in the step plan is emitted whether or not a pilot was found, so it now says "N channels measured". Co-Authored-By: Claude Opus 5 (1M context) <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.
The setup wizard's RF scan step almost always printed "0 signals detected". It is not a rendering bug: the measurement array really is empty, and on a fresh container it cannot be anything else.
Why
Two things that only break together.
retina-spectrum suppresses every channel result until it has 5 sweep passes. All per-channel analysis sits behind
if (ring.ready())(src/main.cpp:633), andready()iscount >= METRICS_MIN_ENTRIES, which is 5 (src/config.h:11). Each step's averaging ring gets one push per pass, so passes 1-4 emit"channels":[]in every step event. At roughly 35s a pass that is about 3 minutes of silence by design.The wizard read one pass and froze. Accumulation ran only between one
startand the followingcomplete; oncompletethe phase becamedoneand the nextstartwas ignored. So the number shown was the channel count of the first full sweep the browser saw, and it never updated however long the user waited.Entering the location step runs
docker compose up -d retina-spectrum, and leaving reverts to radar, which stops and removes the container. Fresh container, empty rings, every time.It cost more than the label: with no measurements,
/towers/searchtakes its geography-only GET branch, so the RF profile the step exists to collect was never used for ranking.What changed
static/setup.jsonly.completethat measured nothing returns the phase towaitinginstead of freezing, so the nextstartre-arms accumulation. It settles on the first pass that actually reports channels.spectrumGatingstill clears after the first completed pass, so Find Towers unlocks at about a minute as before. Waiting longer now improves the profile instead of doing nothing.Not fixed here
The 3 minute wait itself is retina-spectrum's
METRICS_MIN_ENTRIES = 5and needs a spectrum release to shorten. The post-completion shortcut atmain.cpp:913also sends a lonecompleteand closes, which the wizard ignores and then reconnects to every 3s. Harmless while the sweep loop is continuous.Testing
Deployed to owl-ded9 (
88:a2:9e:9d:de:d9) for a live wizard run. Not yet confirmed end to end against a full 5 pass sweep.🤖 Generated with Claude Code