Phase 12: remove phone-relay dashcam upload feature

Removes the phone-relay feature entirely per the Phase 11 finding
that it hit a fundamental phone-OS limitation (a browser page can't
route WiFi and cellular traffic simultaneously, no code fix possible)
- see PLAN.md for the full test writeup.

- app.py: dropped /api/dash/pending, /api/dash/file/<path>,
  /api/dash/relay/config, /api/dash/relay/heartbeat,
  /api/dash/relay/stop, /api/dash/relay/mark_uploaded routes and
  their now-unused imports (os, send_file, abort, safe_join).
- modules/app_upload.py: dropped list_pending_dashcam_files(),
  relay_heartbeat()/relay_stop()/is_relay_active(),
  RELAY_LEASE_SECONDS/_relay_lease_until, and the relay-lease check
  inside _upload_dashcam_files()/get_status(). Kept the chunked
  upload protocol, dashcam_hash_cache/_hash_dashcam_file() (still
  used by the Pi's own background uploader), and DASHCAM_CHUNK_SIZE -
  none of that was relay-specific.
- templates/dash.html: removed the 'Relay via phone' card.
- static/js/dash.js: removed all relay JS (relayOneFile,
  fetchChunkWithRetry, uploadChunkWithRetry, heartbeat timers,
  pending-file list rendering).
- server/app.py: removed the CORS after_request hook, added solely
  for the phone's cross-origin browser calls (the Pi's own Python
  requests-based client was never subject to CORS).
- readme.md: dropped the phone-relay feature bullet, updated the
  project-status blurb to explain the removal + point at the planned
  native Android app as the real fix for that use case.
- PLAN.md: marked Phase 12 done with a verification writeup.

Verified: py_compile on all touched Python files, node --check on
dash.js, grepped all touched files for any leftover relay/RELAY
reference (none), and smoke-tested by importing app.py + hitting it
with Flask's test client - app starts cleanly, every relay route is
gone from url_map, and both / and /dash still render HTTP 200 with
zero 'relay' occurrences in /dash's HTML.

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-09 17:12:30 -04:00
co-authored by Copilot
parent 0b729adb28
commit f17c5c8681
7 changed files with 46 additions and 430 deletions
+11 -9
View File
@@ -42,9 +42,6 @@ i have a dream
Dashcam videos upload in resumable 40MB chunks (works around tunnel body-size limits and keeps
the Pi's memory footprint flat regardless of file size); a UI toggle can pause dashcam uploads
independently while trip logs keep syncing
- 📱 **Phone-relay upload** — if the Pi's own WiFi is slow/congested, open `/dash` on your phone
to download pending dashcam files locally and re-upload them straight to the remote server
using the phone's own network instead, automatically pausing the Pi's own upload meanwhile
- 🗄️ Local SQLite trip logging, retried/synced to the remote server with automatic backoff
- 🔌 Runs fully headless as a `systemd` service, autostarting on boot
@@ -78,9 +75,14 @@ For the remote server (receives trip logs + dashcam uploads), see [server/README
## Project status
This project was revived after a couple of years on the shelf. All 11 planned phases are done and
the full pipeline — OBD/GPS logging, offline web UI, WiFi hotspot, dashcam retrieval, remote
upload, and phone-relay upload — has been verified against real hardware end-to-end, including a
full real dashcam import and upload run. Only the SIM868 cellular fallback (for uploading while
out of WiFi range) and the phone-relay feature's real-phone/live-network test remain untested.
Full phase-by-phase history in [PLAN.md](./PLAN.md).
This project was revived after a couple of years on the shelf. The first 11 planned phases are
done and the full pipeline — OBD/GPS logging, offline web UI, WiFi hotspot, dashcam retrieval, and
remote upload — has been verified against real hardware end-to-end, including a full real dashcam
import and upload run. A phone-relay upload feature was built and tested but ultimately removed:
real-world testing showed it hit a fundamental phone-OS limitation (a browser page can't use WiFi
and cellular simultaneously), so it couldn't actually deliver on its "upload from the road without
the Pi's slow WiFi" goal — see [PLAN.md](./PLAN.md) for the full writeup. That capability is now
planned as a native Android app (further down the roadmap) instead. Only the SIM868 cellular
fallback (for uploading while out of WiFi range) remains untested (no SIM card available yet).
Full phase-by-phase history and the current roadmap (dashcam/video file browsers, OBD hardening,
power-loss resilience, trip history, alerts, and more) are in [PLAN.md](./PLAN.md).