Skip to content

20260906 - Keep listening until the spectrum has something to report - #83

Merged
Purple10101 merged 1 commit into
mainfrom
20260906-spectrum-scan-passes
Sep 6, 2026
Merged

Purple10101 merged 1 commit into
mainfrom
20260906-spectrum-scan-passes

Conversation

@Purple10101

Copy link
Copy Markdown
Collaborator

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), and ready() is count >= 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 start and the following complete; on complete the phase became done and the next start was 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/search takes its geography-only GET branch, so the RF profile the step exists to collect was never used for ranking.

What changed

static/setup.js only.

  • A complete that measured nothing returns the phase to waiting instead of freezing, so the next start re-arms accumulation. It settles on the first pass that actually reports channels.
  • spectrumGating still 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.
  • Copy: "Averaging the spectrum, pass N of about 5. Channels appear after about 3 minutes…" while it waits, then "RF profile captured: N channels measured". The old "N signals detected" read as a detection count, but once the ring is ready every TV channel in the step plan is emitted whether or not a pilot was found.

Not fixed here

The 3 minute wait itself is retina-spectrum's METRICS_MIN_ENTRIES = 5 and needs a spectrum release to shorten. The post-completion shortcut at main.cpp:913 also sends a lone complete and 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

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>
@Purple10101
Purple10101 merged commit aea280c into main Sep 6, 2026
3 checks passed
@Purple10101
Purple10101 deleted the 20260906-spectrum-scan-passes branch September 6, 2026 15:51
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