diff --git a/README.md b/README.md index f53f583..fce44d7 100644 --- a/README.md +++ b/README.md @@ -99,12 +99,19 @@ Put a `config.json` in the served directory (next to `index.html`). Start from t "mqttUrl": "wss://broker.yourdomain:8084/ws", "mqttUsername": "coredrive-rx", "mqttPassword": "", - "resolveUrl": "https://corescope.yourdomain/api/nodes/resolve" + "resolveUrl": "https://corescope.yourdomain/api/nodes/resolve", + "fullRfLog": false } ``` > `mqttPassword` is a **publish-only, ACL-constrained** account — it is shipped to browsers, so treat > it as shared, not a secret. `resolveUrl` is optional (see CORS below); omit it and the app shows -> heard-key prefixes instead of node names. +> heard-key prefixes instead of node names. `fullRfLog` is optional (default `false`); when `true`, +> packets the direct-only rule can't attribute (a DIRECT-route path, or noise) are queued and +> published too, as diagnostic-only rows — never coverage. **This is pure waste unless the CoreScope +> ingestor also has `clientRxObservations.enabled: true`**: with it off, the ingestor decodes and +> discards every one of these packets, writing no row and logging no warning, while `fullRfLog` +> multiplies your normal upload volume. Confirm the ingestor-side flag with your CoreScope sysop +> before turning this on. Changing any value later is just a `config.json` edit + page refresh — no rebuild. diff --git a/public/sw.js b/public/sw.js index 30cb532..99cc682 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,7 +1,7 @@ // Minimal service worker: makes the app installable and lets the shell load // offline. Network-first (always fresh online), cache fallback (offline). // Only the static app assets go through fetch; MQTT runs over WSS (not cached). -const CACHE = 'coredrive-rx-v13'; +const CACHE = 'coredrive-rx-v14'; self.addEventListener('install', () => self.skipWaiting()); self.addEventListener('activate', (e) => e.waitUntil((async () => { diff --git a/src/app.js b/src/app.js index 30315d4..e48a6a3 100644 --- a/src/app.js +++ b/src/app.js @@ -292,14 +292,19 @@ async function processFrame(dv) { // transmitter removed itself from the path's front), and 1-byte hops are collision-prone — // both are called out. Everything else (tx / no advert) is pure noise, verbose only. const lastHop = pkt && pkt.hops.length ? pkt.hops[pkt.hops.length - 1] : null; - const logged = getConfig() && getConfig().fullRfLog; + const cfg = getConfig(); + const logged = cfg && cfg.fullRfLog; const suffix = logged ? ', logged' : ', skipped'; if (lastHop && pkt.hops.length && !isFloodRoute(pkt.routeType)) dbg('direct route — transmitter not in path' + suffix, 'st'); else if (lastHop && lastHop.length === 2) dbg('1-byte path-hash (' + lastHop + ') — seen' + suffix, 'st'); else if (state.verbose) dbg('not attributable (tx / no advert)' + suffix + sig, 'no'); - // fullRfLog: the packet is not coverage and must move NO coverage state — - // no counters, no SNR meter, no hex, no beep. It is queued and nothing else. + // fullRfLog: the packet is not coverage, so the counters, SNR meter, + // recently-heard list, beeper and map hexes must not move. The motion/ + // idle-gate state below IS deliberately shared with the coverage path — + // updateMotion is a pure function of the latest GPS fix and now, the same + // fix already drives it on every GPS callback, and applying the idle gate + // here is the point (a stationary phone shouldn't queue RF-log rows either). if (!logged) return; const rfFix = currentFix(); let rfCapture = false; @@ -310,7 +315,7 @@ async function processFrame(dv) { rfCapture = rfDec.capture; } const rfRec = buildRfLogRecord({ - hk, fullRfLog: true, rawHex, snr: f.snr, rssi: f.rssi, + hk, fullRfLog: logged, rawHex, snr: f.snr, rssi: f.rssi, fix: rfFix, captureAllowed: rfCapture, nowISO: new Date().toISOString(), }); if (!rfRec) return;