[debug](trx-backend-soapysdr,trx-frontend-http): add RDS diagnostics

Add server-side debug log when RDS data is decoded (PI, PS, PTY).
Extend the RDS panel with active mode, frame counter, and a raw JSON
dump of the last spectrum frame (bins excluded) to help diagnose why
RDS remains absent from the SSE stream.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-02-28 09:31:24 +01:00
parent 88e0be0cdd
commit 855d21fd8a
4 changed files with 25 additions and 3 deletions
@@ -350,6 +350,7 @@ function syncTopBarAccess() {
let overviewDrawPending = false;
let lastSpectrumData = null;
let rdsFrameCount = 0;
let lastControl;
let lastTxEn = null;
let lastHasTx = true;
@@ -3099,6 +3100,7 @@ function startSpectrumStreaming() {
}
try {
lastSpectrumData = JSON.parse(evt.data);
rdsFrameCount++;
pushOverviewWaterfallFrame(lastSpectrumData);
refreshCenterFreqDisplay();
scheduleSpectrumDraw();
@@ -3125,6 +3127,7 @@ function stopSpectrumStreaming() {
}
spectrumDrawPending = false;
lastSpectrumData = null;
rdsFrameCount = 0;
overviewWaterfallRows = [];
overviewWaterfallPushCount = 0;
_wfResetOffscreen();
@@ -3155,6 +3158,7 @@ function updateRdsPsOverlay(rds) {
// RDS debug panel
const statusEl = document.getElementById("rds-status");
const modeEl = document.getElementById("rds-mode");
const piEl = document.getElementById("rds-pi");
const psEl = document.getElementById("rds-ps");
const ptyEl = document.getElementById("rds-pty");
@@ -3162,6 +3166,11 @@ function updateRdsPsOverlay(rds) {
const rawEl = document.getElementById("rds-raw");
if (!statusEl) return;
// Always show the current mode, frame counter, and a sanitised spectrum snapshot
if (modeEl) modeEl.textContent = document.getElementById("mode")?.value || "--";
const framesEl = document.getElementById("rds-frames");
if (framesEl) framesEl.textContent = String(rdsFrameCount);
if (!rds) {
statusEl.textContent = "No signal";
statusEl.className = "rds-value rds-no-signal";
@@ -3169,7 +3178,10 @@ function updateRdsPsOverlay(rds) {
psEl.textContent = "--";
ptyEl.textContent = "--";
ptyNameEl.textContent = "--";
rawEl.textContent = "--";
if (rawEl && lastSpectrumData) {
const { bins: _b, ...rest } = lastSpectrumData;
rawEl.textContent = JSON.stringify(rest, null, 2);
}
return;
}
@@ -3344,7 +3356,7 @@ function drawSpectrum(data) {
ctx.stroke();
ctx.restore();
// Peak markers for easier snap-tune targeting.
// ── Peak markers for easier snap-tune targeting ──────────────────────────
const markerPeaks = visibleSpectrumPeakIndices(data);
if (markerPeaks.length > 0) {
ctx.save();