Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ body:

# or relevant YAML / sdkconfig lines / collector command

- type: textarea
id: diagnostic_report
attributes:
label: Diagnostic report (optional)
description: In the Web Monitor, connect to the device and select Generate report. Review the preview, then paste the fenced JSON or attach the downloaded file.

- type: textarea
id: logs
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runs:

- name: Build static pages
shell: bash
run: python3 .github/scripts/build_static_pages.py
run: python3 .github/scripts/build_static_pages.py --site-revision "$(git rev-parse HEAD)"

- uses: ./.github/actions/setup-doxygen

Expand Down
4 changes: 4 additions & 0 deletions .github/cla-signatures.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
{
"login": "mgoodfellow",
"signedAt": "2026-10-28"
},
{
"login": "FhDBro",
"signedAt": "2026-11-01"
}
]
}
13 changes: 13 additions & 0 deletions .github/scripts/build_static_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

from __future__ import annotations

import argparse
import re
import sys
from html import escape
from html.parser import HTMLParser
Expand Down Expand Up @@ -315,4 +317,15 @@ def build() -> None:


if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--site-revision", help="Git commit to identify a deployed application shell")
args = parser.parse_args()
if args.site_revision and not re.fullmatch(r"[a-f0-9]{40}", args.site_revision):
parser.error("site revision must be a full Git commit hash")
build()
if args.site_revision:
# Interactive routes load the root application shell.
shell = WEB_ROOT / "index.html"
marker = f'<meta name="espectre-site-revision" content="{args.site_revision}">'
content = re.sub(r'<meta name="espectre-site-revision" content="[^"]*">\n', "", shell.read_text())
shell.write_text(content.replace("<head>", "<head>\n" + marker, 1))
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## [3.3.0] - Work in progress

- The Web Monitor can copy or download a local diagnostic report with 30-second CSI and Wi-Fi statistics, recent motion and faults, redacted device state, and browser and site versions.
- **Micro** sends a single valid CORS origin on Direct responses so the Web Monitor can open the event stream and collect a diagnostic report.

---

## [3.2.2] - 2026-11-25 - Raw Wi-Fi targets and Direct Wi-Fi recovery
Expand Down
7 changes: 7 additions & 0 deletions docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Most problems can be fixed from the browser: the [troubleshooting guide](https:/
- [Calibration stalls or startup quality is poor](#calibration-stalls-or-startup-quality-is-poor)
- [Tuning essentials](#tuning-essentials)
- [Device not reachable](#device-not-reachable)
- [Diagnostic report](#diagnostic-report)

## Check the sensing input

Expand Down Expand Up @@ -132,3 +133,9 @@ From the browser, follow [device not reachable](https://espectre.dev/guides/trou
You can connect with the device IP, its name, its 16-character ID, or the last 6 characters of the ID. Names and short IDs rely on mDNS. If discovery fails, run `./espectre devices`, enter the IP, or look it up in your router's DHCP list. See [browser bootstrap](DISCOVERY.md#browser-bootstrap) for how discovery works.

Once connected, go back to [Check the sensing input](#check-the-sensing-input).

## Diagnostic report

In [Live motion](https://espectre.dev/tools/monitor/), expand **Diagnostics** and select **Generate report**. The monitor samples CSI occupancy, packet rates, and Wi-Fi signal for 30 seconds. It includes the latest motion observed on this connection and its fault events. The report uses the diagnostic fields advertised by the connected firmware. If no samples arrive, the report still includes device state and marks sampling as `no_samples`. A measured rate of zero is a valid sample.

The browser masks device and network identifiers before displaying the preview. Review it, then select **Copy fenced JSON** to paste it into an issue, or **Download JSON** to save a file.
2 changes: 1 addition & 1 deletion docs/web/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<title>Page not found | ESPectre</title>
<meta name="robots" content="noindex">
<link rel="icon" type="image/png" href="/assets/images/brand/favicon.png">
<link rel="stylesheet" href="/assets/css/styles.css?v=5361ca3eba09">
<link rel="stylesheet" href="/assets/css/styles.css?v=0822fa8e3d9a">
<script src="/assets/js/route-registry.js?v=9031c8877a5c" defer></script>
<script src="/assets/js/navigation.js?v=25f9cd8c252d" defer></script>
<script src="/assets/js/analytics.js?v=da6e9acb484e" defer></script>
Expand Down
99 changes: 98 additions & 1 deletion docs/web/assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2206,6 +2206,99 @@ body.modal-open { overflow: hidden; }
.device-live-diagnostics > summary small { margin-left: auto; color: var(--dim); font-size: 11.5px; }
.device-live-diagnostics .diag-grid { padding: 0 18px 18px; }
.device-live-diagnostics .tool-note { margin: 0; padding: 0 18px 18px; }
.diag-report-panel {
border-top: 1px solid var(--border);
padding: 16px 18px;
display: flex;
flex-direction: column;
gap: 12px;
}
.diag-report-card {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 12px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--surface2);
}
.diag-report-card strong {
display: block;
font-size: 12px;
}
.diag-report-card p {
margin: 2px 0 0;
color: var(--dim);
font-size: 11px;
line-height: 1.4;
}
.diag-report-progress {
display: flex;
flex-direction: column;
gap: 8px;
padding: 12px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--surface2);
}
.diag-report-progress-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.diag-report-track {
width: 100%;
height: 6px;
background: var(--surface-soft, rgba(0, 0, 0, 0.06));
border-radius: 999px;
overflow: hidden;
}
.diag-report-bar {
height: 100%;
background: var(--accent);
transition: width 0.3s ease;
}
.diag-report-status {
font-size: 12px;
color: var(--text);
}
.diag-report-result {
display: flex;
flex-direction: column;
gap: 10px;
}
.diag-report-result-header {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 10px;
}
.diag-report-result-title {
font-size: 12px;
font-weight: 600;
color: var(--text);
}
.diag-report-actions {
display: flex;
align-items: center;
gap: 8px;
}
.diag-report-preview {
margin: 0;
padding: 12px;
max-height: 240px;
overflow: auto;
font-family: var(--font-mono, monospace);
font-size: 11px;
line-height: 1.45;
background: var(--surface-soft, rgba(0, 0, 0, 0.04));
border: 1px solid var(--border);
border-radius: 8px;
white-space: pre;
}
/* Theremin */

.theremin-stage {
Expand Down Expand Up @@ -3928,6 +4021,9 @@ body.modal-open { overflow: hidden; }
.live-controls-grid { grid-template-columns: minmax(0, 1fr); }
.live-control-wide { grid-column: auto; }
.live-calibration { align-items: stretch; flex-direction: column; }
.diag-report-card { align-items: stretch; flex-direction: column; }
.diag-report-result-header { align-items: stretch; flex-direction: column; }
.diag-report-actions { flex-direction: column; }
.device-live-diagnostics > summary { align-items: flex-start; flex-direction: column; gap: 4px; position: relative; }
.device-live-diagnostics > summary small { margin-left: 0; padding-right: 24px; }
.device-live-diagnostics > summary::after { position: absolute; right: 18px; top: 18px; }
Expand All @@ -3949,7 +4045,8 @@ body.modal-open { overflow: hidden; }
.scrolly-caption,
.scrolly-nav span,
.scrolly-cue,
.scrolly-skip { transition: none; }
.scrolly-skip,
.diag-report-bar { transition: none; }
.scene-ui-dot,
.pulse,
.spinner,
Expand Down
12 changes: 7 additions & 5 deletions docs/web/assets/js/browser-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
: /Firefox\//i.test(userAgent) ? 'firefox'
: /(?:Chrome|CriOS)\//i.test(userAgent) ? 'chrome'
: /Safari\//i.test(userAgent) ? 'safari' : 'other';
const versionMatch = userAgent.match(browser === 'edge' ? /Edg\/(\d+)/i
: browser === 'firefox' ? /Firefox\/(\d+)/i
: browser === 'chrome' ? /(?:Chrome|CriOS)\/(\d+)/i
: browser === 'safari' ? /Version\/(\d+)/i : null);
const browserMajor = versionMatch ? Number(versionMatch[1]) : 0;
const versionMatch = userAgent.match(browser === 'edge' ? /Edg\/(\d+(?:\.\d+)*)/i
: browser === 'firefox' ? /Firefox\/(\d+(?:\.\d+)*)/i
: browser === 'chrome' ? /(?:Chrome|CriOS)\/(\d+(?:\.\d+)*)/i
: browser === 'safari' ? /Version\/(\d+(?:\.\d+)*)/i : null);
const browserVersion = versionMatch?.[1] || null;
const browserMajor = parseInt(browserVersion, 10) || 0;
const operatingSystem = ios ? 'ios'
: android ? 'android'
: /mac/i.test(platform) ? 'macos'
Expand All @@ -45,6 +46,7 @@
serial,
browser,
browserMajor,
browserVersion,
operatingSystem,
hostedDirect,
// ESPectre supports browser flashing only on desktop Chrome or Edge.
Expand Down
17 changes: 15 additions & 2 deletions docs/web/assets/js/direct-discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@

function ingestDirectEvent(name, data) {
if (name === 'motion') {
if (directClient?.connected && Number.isFinite(data.score)) {
directResourceSession(directClient).motion = {
score: data.score,
state: data.state,
timestamp_ms: data.timestamp_ms ?? null
};
}
applySensingCadence(data);
applyLiveTelemetry(
Number(data.score ?? 0),
Expand All @@ -199,14 +206,20 @@
return;
}
if (name === 'ota') applyOtaStatus(data);
if (name === 'fault') toast(data.message || 'The device reported a runtime fault.');
if (name === 'fault') {
if (directClient?.connected) {
const at = Date.now();
directResourceSession(directClient).faults.push({ at, timestamp: new Date(at).toISOString(), fault: data });
}
toast(data.message || 'The device reported a runtime fault.');
}
}

const directResourceSessions = new WeakMap();

function directResourceSession(client) {
if (!directResourceSessions.has(client)) {
directResourceSessions.set(client, { snapshots: new Map(), pending: new Map() });
directResourceSessions.set(client, { snapshots: new Map(), pending: new Map(), faults: [] });
}
return directResourceSessions.get(client);
}
Expand Down
Loading
Loading