feat(telemetry): add live web dashboard - #3
TheLostLeo wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical deployment, telemetry integration, build, and mission-control issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 4
Open (8)
Deployed server does not serve the React entrypoint · New React migration removes existing mission-control functionality · New Missing React namespace import can break the TypeScript build · New Default telemetry URL points to a nonexistent endpoint · New Telemetry chart window and sample-rate labels are incorrect · New RC RSSI percentage is incorrectly displayed as dBm · New Disk percentage is incorrectly treated as gigabytes · New Failed polls continue showing synthetic healthy live telemetry · New
What changed in this PR
Migrates the telemetry dashboard from legacy static HTML/CSS/JavaScript to React, Vite, TypeScript, and Tailwind.
Changes:
- Adds typed telemetry polling, mock handling, charts, reusable components, and a 3D attitude view.
- Adds frontend build, styling, PostCSS, and Docker configuration.
- Replaces the legacy dashboard assets and logic.
| File | Description |
|---|---|
telemetry/live-web-dashboard/vite.config.ts |
Vite React configuration |
telemetry/live-web-dashboard/tsconfig.node.json |
Vite TypeScript configuration |
telemetry/live-web-dashboard/tsconfig.json |
Application TypeScript settings |
telemetry/live-web-dashboard/tailwind.config.js |
Tailwind theme configuration |
telemetry/live-web-dashboard/style.css |
Removed legacy stylesheet |
telemetry/live-web-dashboard/src/types/telemetry.ts |
Telemetry type definitions |
telemetry/live-web-dashboard/src/styles.css |
Global Tailwind styles |
telemetry/live-web-dashboard/src/main.tsx |
React entrypoint |
telemetry/live-web-dashboard/src/hooks/useTelemetry.ts |
Telemetry polling and state mapping |
telemetry/live-web-dashboard/src/data/telemetry.ts |
Vehicle and chart metadata |
telemetry/live-web-dashboard/src/components/TopBar.tsx |
Dashboard header |
telemetry/live-web-dashboard/src/components/TelemetryChart.tsx |
Telemetry charts |
telemetry/live-web-dashboard/src/components/SbcStatusCard.tsx |
SBC metrics card |
telemetry/live-web-dashboard/src/components/Panel.tsx |
Shared panel components |
telemetry/live-web-dashboard/src/components/NavSignalBox.tsx |
Navigation and signal card |
telemetry/live-web-dashboard/src/components/LinkCard.tsx |
Link health card |
telemetry/live-web-dashboard/src/components/FlightStatusCard.tsx |
Flight status card |
telemetry/live-web-dashboard/src/components/ChartPanel.tsx |
Chart panel wrapper |
telemetry/live-web-dashboard/src/components/BatteryBox.tsx |
Battery card |
telemetry/live-web-dashboard/src/components/AttitudeScene.tsx |
Three.js attitude visualization |
telemetry/live-web-dashboard/src/components/AttitudeIndicator.tsx |
Attitude panel |
telemetry/live-web-dashboard/src/components/AltitudeCard.tsx |
Altitude card |
telemetry/live-web-dashboard/src/App.tsx |
Main dashboard layout |
telemetry/live-web-dashboard/postcss.config.js |
PostCSS configuration |
telemetry/live-web-dashboard/package.json |
Frontend dependencies and scripts |
telemetry/live-web-dashboard/index.html |
React HTML shell |
telemetry/live-web-dashboard/Dockerfile |
Frontend container setup |
telemetry/live-web-dashboard/app.js |
Removed legacy dashboard logic |
.gitignore |
Ignores generated frontend artifacts |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| <main className="flex flex-1 flex-col gap-2 p-2.5"> | ||
| <div className="grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-12"> | ||
| <BatteryBox battery={t.battery} className="min-h-[150px] xl:col-span-3 xl:h-[164px]" /> | ||
| <NavSignalBox nav={t.nav} className="min-h-[150px] xl:col-span-4 xl:h-[164px]" /> | ||
| <AltitudeCard altitude={t.altitude} className="min-h-[150px] xl:col-span-2 xl:h-[164px]" /> | ||
| <LinkCard link={t.link} className="min-h-[150px] xl:col-span-3 xl:h-[164px]" /> |
|
|
||
| const SAMPLES = 64; | ||
| const TICK_MS = 260; | ||
| const LIVE_ENDPOINT = "http://192.168.4.1/telemetry.json"; |
There was a problem hiding this comment.
No code change needed for this one. The dashboard no longer defaults to the Pi /api/telemetry server path. It prompts for the ESP32 IP and polls http://<esp-ip>/telemetry.json; the ESP32 firmware registers that route and returns the live JSON snapshot. Mock fallback data has also been removed.
| heading, | ||
| sats: clamp(Math.round(num(raw.satellites, prev.nav.sats)), 0, 32), | ||
| hdop: num(raw.hdop, prev.nav.hdop), | ||
| rssi: Math.round(num(raw.rc_rssi, prev.nav.rssi)), |
| diskUsed: clamp(num(sbc.disk_percent, prev.sbc.diskUsed), 0, 100), | ||
| diskTotal: prev.sbc.diskTotal, |
Signed-off-by: TheLostLeo <thelostleo224@gmail.com>
e8f185e to
6babc4a
Compare
Co-authored-by: TheLostLeo <166975150+TheLostLeo@users.noreply.github.com>
Reviewed |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The broad dashboard and runtime migration has unresolved critical, functional, deployment, and telemetry issues requiring human review.
Review effort: Lite
Findings: 4
Open (19)
Restore missing sys import for shutdown handling · New Default telemetry URL points to a nonexistent endpoint React migration removes existing mission-control functionality Deployed server does not serve the React entrypoint Update main.py runtime description · New Document laptop-based dashboard deployment · New Replace hardcoded Wi-Fi credentials with secure provisioning · New Preserve mission API and control functionality · New Correct chart sample rate and time window labels · New Compare RSSI using the correct unit · New Fix RSSI signal strength thresholds · New Correct RSSI unit label · New Fix fourfold uptime calculation · New Fix accelerated displayed clock · New Prevent stale telemetry responses after endpoint changes · New Disk percentage is incorrectly treated as gigabytes RC RSSI percentage is incorrectly displayed as dBm Replace deleted web dashboard module documentation · New Fix undefined text-hud-muted utility · New
| from sbc_monitor import SBCMonitor | ||
| from mavlink_manager import MAVLinkManager | ||
| from radio_tx_module import RadioTXModule |
| ### `handheld-nrf-monitor/pi-code/main.py` | ||
| Entry point for the Raspberry Pi companion server. It starts the MAVLink manager, SBC monitor, web dashboard server, NRF24L01+ transmitter, and autonomous grid-search module. |
| npm run build | ||
| ``` | ||
|
|
||
| Then start the Raspberry Pi companion server. It will serve `telemetry/live-web-dashboard/dist/index.html` and the generated `dist/assets/*` files. For local development, run Vite instead: |
| const char* WIFI_STA_SSID = "gamma"; | ||
| const char* WIFI_STA_PASSWORD = "gammared"; | ||
| const char* WIFI_HOSTNAME = "drone-esp32"; | ||
| const char* WIFI_FALLBACK_AP_SSID = "DroneTelemetryESP32"; | ||
| const char* WIFI_FALLBACK_AP_PASSWORD = "drone12345"; |
| from sbc_monitor import SBCMonitor | ||
| from mavlink_manager import MAVLinkManager | ||
| from radio_tx_module import RadioTXModule |
| import type { SbcState } from "../types/telemetry"; | ||
|
|
||
| function formatUptime(ticks: number): string { | ||
| const seconds = ticks * 4; |
| setState((prev) => fromLive(prev, raw, endpoint, latencyMs)); | ||
| } catch (error) { | ||
| failures += 1; | ||
| const detail = errorText(error); | ||
| setState((prev) => | ||
| failures >= OFFLINE_AFTER_FAILURES | ||
| ? markJsonOffline(prev, endpoint, detail) | ||
| : markJsonDegraded(prev, endpoint, detail, failures) | ||
| ); |
| ### `handheld-nrf-monitor/pi-code/modules/web_dashboard_module.py` | ||
| Runs the HTTP/WebSocket server, serves the built dashboard from `live-web-dashboard/dist/`, exposes telemetry APIs, and forwards mission-control requests to the grid-search module. If `dist/` is missing, it returns a build-required error instead of serving Vite source files. |
| dim: "#8b9aab", | ||
| faint: "#5c6a7a" |
b8283fc to
b7b0655
Compare
|
@copilot i want a review on the latest commit |
Reviewed the latest commit ( |
|
fix the issues |
|
@copilot Find the issues in the latest commit from @TheLostLeo |
I reviewed @TheLostLeo’s latest commit (
If you want, I can push a minimal compatibility fix next (deprecated no-op flags + opt-in legacy API mode). |



Change the Front end to react