Commit Graph
266 Commits
Author SHA1 Message Date
Mathieu Moran 67dc9b897e refactor: merge Test tab into Settings, 3 tabs total
- Settings tab now has credential fields + network test (Test Pi, Test Server)
- Removed standalone Test tab
- Bottom nav: Dashcam, Downloads, Settings
2026-08-12 04:04:21 -04:00
Mathieu Moran 19942dc114 feat: Phase 28.3 — cellular upload relay + Settings tab
- UploadWorker: 40MB chunked upload to yaris.ceaf.dev (SHA256 check,
  /status resume, WorkManager foreground notification, progress)
- ServerApi extended: uploadStatus + uploadChunk endpoints
- CredentialStore: EncryptedSharedPreferences for server URL/device name/API key
- Settings tab: credential entry (server URL, device name, API key)
- Downloads tab: ↑ Upload button per file, upload progress with cancel
- Upload only shown when credentials configured
2026-08-12 04:00:45 -04:00
Mathieu Moran c8e26dde26 feat: Downloads tab UI polish — deleting spinner, progress redesign
- Deleting files show CircularProgressIndicator instead of delete button
- Active download card redesigned: spinner + filename + %, rounded progress bar
- AnimatedVisibility for progress section
- Empty state with icon
- Track _deletingNames in ViewModel for reactive UI
2026-08-12 03:46:33 -04:00
Mathieu Moran b523d77e16 feat: cancel button on active downloads
- ActiveDownload now carries workerId (UUID string) for cancellation
- cancelDownload() calls WorkManager.cancelWorkById()
- Downloads tab shows ✕ button on in-progress download cards
2026-08-12 03:35:03 -04:00
Mathieu Moran 78cd05c4cb docs: add BUG-14 (Nominatim slowness), update PLAN.md Phase 26 (14 bugs)
- BUG-14: Nominatim replaced with offline reverse_geocoder — instant, no network
- PLAN.md Phase 26: 13 → 14 bugs resolved, updated result summary
2026-08-12 03:31:50 -04:00
Mathieu Moran 0ddfe39901 refactor: ditch Nominatim, use reverse_geocoder exclusively for geocoding
Nominatim was slow (rate-limited, 1 req/sec, ~4s timeouts) and unreliable
from Docker/Cloudflare (blocked or throttled). It was the root cause of
location labels failing to appear during trip scrubbing.

- server/app.py: _geocode_cached now uses reverse_geocoder exclusively
  (offline, instant, city/province level). Removed Nominatim HTTP calls,
  ThreadPoolExecutor, concurrent.futures import.
- app.py (Pi): same — reverse_geocoder imported at module level,
  Nominatim + urllib.request removed.
- Batch endpoint simplified to sequential loop with lru_cache + dedup.
  No network dependency at all — geocoding is instant and always works.

reverse_geocoder provides city/province labels (e.g. 'Montreal, Quebec')
which is the right granularity for trip scrubbing.
2026-08-12 03:27:00 -04:00
Mathieu Moran e60b7d7d36 perf: geocode pipeline — batch POST + parallel server, 200→1 roundtrip
JS preload(): replaced N individual GET /api/geocode (concurrency 2) with
a single POST /api/geocode/batch — one HTTP roundtrip instead of up to
N/2 sequential ones. schedLoc debounce reduced 600→200ms.

Server geocode_batch(): ThreadPoolExecutor(max_workers=4) parallelises
Nominatim/reverse_geocoder calls instead of sequential loop. Deduplicates
coords before submitting futures. lru_cache absorbs duplicates within batch.

Pi geocode_batch_route(): deduplicate coords, removed stale 'if label:'
guard (label always non-empty after BUG-13 fix).
2026-08-12 03:15:30 -04:00
Mathieu Moran ad10a873b4 docs: close BUG-13, update PLAN.md Phase 26 (13 bugs resolved)
- BUG-13 moved from Open to Resolved with fix summary
- PLAN.md Phase 26: 12 → 13 bugs, added BUG-13 entry
- deploy memory: Unraid SSH deploy key + updated rebuild command
2026-08-12 03:08:57 -04:00
Mathieu Moran 830981934f fix: BUG-13 — server geocode returns raw coords instead of location names
Root cause: server _geocode_cached() returned None → /api/geocode
returned HTTP 204 with no body. JS frontend treated 204 as success,
r.json() on empty body threw → showed raw-coordinate fallback.

Server fixes:
- _geocode_cached() now always returns a non-empty string (coordinate
  fallback when both Nominatim and reverse_geocoder fail)
- /api/geocode always returns HTTP 200 with {label: '...'} (never 204)
- /api/geocode/batch always includes every coord key in result dict
- Nominatim call: jsonv2 + accept-language=en (aligned with Pi)
- reverse_geocoder: mode=1 (aligned with Pi)

Pi alignment:
- _geocode_cached() now checks for empty reverse_geocoder label before
  returning, falling through to coordinate string (same guard as server)
2026-08-12 02:53:44 -04:00
Mathieu Moran 81a0bfebd5 docs: add BUG-13 — server web UI shows raw coords instead of geocoded location
- Trips 18517, 18516 show (x,y) instead of address/street name
- Likely regression in geocoding pipeline or cache lookup
- Plan: rework server-side geocoding, backport to Pi if simple
2026-08-12 02:49:04 -04:00
Mathieu Moran b670fc5480 folder: delete github agent temp folder 2026-08-12 02:35:44 -04:00
Mathieu Moran 555af3694e docs: reformat FEATURES.md — summary table with dates, numerical order
- All 10 FEATs now in strict numerical order under single Feature ideas section
- Added summary table (ID, Status, Created, Title, Phase) for quick scanning
- Created dates sourced from git history (ef3a951 through bc29a01)
- Removed orphan Ideas that landed section (FEAT-06/07 merged into main flow)
2026-08-12 02:34:36 -04:00
Mathieu Moran 7a6c1750c9 docs: update Phase 28.1/28.2 status in PLAN.md + android/plan.md
- PLAN.md: Phase 28 header now shows 28.1 ✅, 28.2 ✅, 28.3–28.7 pending
- PLAN.md: added 28.1 gate-pass + 28.2 dashcam browser/download summaries
- android/plan.md: 28.2 rewritten from NOT STARTED to DONE with real
  implementation details (PiApi, DashcamScreen, DashcamViewModel,
  WorkManager DownloadWorker, Coil thumbnails, bottom nav)
2026-08-12 02:29:22 -04:00
Mathieu Moran e19511fc67 fix: downloads use WorkManager foreground service + inline progress
- DownloadWorker: foreground service with notification + setProgressAsync
- ActiveDownload state tracked via WorkManager LiveData observation
- Downloads tab shows progress bar + % for in-flight downloads
- Survives screen lock / background
- Fixed FGS type for Android 14+ (FOREGROUND_SERVICE_TYPE_DATA_SYNC)
2026-08-12 02:27:33 -04:00
Mathieu Moran bc29a01337 docs: FEAT-05 DTC sync shipped — multi-device selector, portal DTC page, Pi snapshot upload 2026-08-12 02:20:48 -04:00
Mathieu Moran ed2b3aacfc feat: downloads tab + public Movies/yaris-obd/ folder
- Downloads now go to Movies/yaris-obd/ (visible in file managers)
- New Downloads tab: list downloaded files, tap to play (system player),
  delete button
- FileProvider added for video playback intent
- Downloaded files auto-refresh after each download
2026-08-12 01:56:18 -04:00
Mathieu Moran e30b85d218 feat: portal-wide device selector — session-based, all pages now use selected device
- _portal_device_id() reads from session, falls back to DEVICE_NAME env var
- GET/POST /api/v1/portal/select-device for selector data + set
- Dropdown in server base.html topbar, JS populates from API, page reloads on change
- All portal pages (overview, trips, dashcam, DTC, device settings) now use selected device
2026-08-12 01:40:51 -04:00
Mathieu Moran 1556c65131 fix: delete uses @HTTP hasBody + JsonObject return type
- Retrofit @DELETE doesn't support @Body — switched to @HTTP(method=DELETE, hasBody=true)
- Return type changed from Map<String,Any?> to JsonObject (kotlinx-serialization
  can't deserialize untyped maps)
- Fixed double-slash in download URL (baseUrl trailing slash)
- Cleaned up download progress tracking (emit outside withContext(IO))
2026-08-12 01:35:11 -04:00
Mathieu Moran 3916f9879e feat: FEAT-05 — DTC history sync to remote server
- Server: dtc_events table (migrate_phase27_dtc.sql), db.py helpers
  (upsert_dtc_snapshot, list_dtc_events, delete_dtc_event)
- Server API: POST /api/v1/dtc/batch (device auth), GET/DELETE /api/v1/portal/dtc
- Server portal: /dtc page with code, description, MIL, status, timestamps, delete
- Server nav: DTC history in sidebar + mobile bottom nav
- Pi: _upload_dtc_snapshot() in app_upload.py — uploads when snapshot changes,
  skips when OBD disconnected or unchanged
2026-08-12 01:23:23 -04:00
Mathieu Moran 13cb8b4361 docs: Phase 27 DONE (3 shipped) — odometer sync, trip ID, hotspot docs; FEAT-08 shipped, FEAT-09 wontfix 2026-08-12 01:16:53 -04:00
Mathieu Moran 22bbee3b30 feat: Phase 28.2 — dashcam video browser + WiFi download
- DashcamScreen: LazyColumn of imported Pi videos with thumbnails (Coil),
  file size, date, upload status, converting progress
- DashcamViewModel: Retrofit-backed video list + download to phone storage
  + delete local copy
- PiApi extended: listVideos, getVideoFile (streaming), getThumbnail, deleteVideo
- DTOs: VideoListResponse, VideoFile, ConvertProgress
- Bottom nav: Dashcam tab + Test tab
- Verified: video list loads from real Pi over yaris 911 hotspot
2026-08-12 01:14:20 -04:00
Mathieu Moran 348bfdc48c feat: Phase 28.1 gate passed — dual-network test works
- Simplified to single OkHttpClient — Android OS routes correctly:
  10.42.0.1 → WiFi (Pi hotspot subnet)
  yaris.ceaf.dev → cellular (WiFi has no internet)
- Removed NetworkBinder-based per-socket binding (EPERM on Pixel,
  OS-routed approach works better for this use case)
- Verified on real Pixel: Pi GPS + server health both return 200
  simultaneously while connected to "yaris 911" hotspot
2026-08-12 01:09:13 -04:00
Mathieu Moran f1606ad1f6 fix: remove runBlocking(Dispatchers.Main) deadlock — app now starts
- NetworkBinder functions were suspend but never actually suspended
  (ConnectivityManager calls are synchronous) — made them plain fun
- MainActivity.discoverNetworks() now calls them directly, no coroutine
- Wrapped in try/catch so network discovery failure doesn't crash Activity
- Removed unused awaitNetwork() extension + coroutine imports
2026-08-12 00:54:27 -04:00
Mathieu Moran 40f92d8703 feat: Phase 28.1 — gradle wrapper + debug APK builds successfully
- gradlew + gradle-wrapper.jar (Gradle 8.11.1)
- Fixed manifest icon to @android:mipmap/sym_def_app_icon (no custom asset needed yet)
- Added adaptive icon XML + colors for future custom icon
- Removed deprecated buildfeatures.buildconfig from gradle.properties
- 17MB debug APK builds: ./gradlew assembleDebug
- local.properties auto-ignored (contains SDK path)
2026-08-12 00:48:05 -04:00
Mathieu Moran 8d64b1e8b0 feat: Phase 28.1.2 — dual-network binding + OkHttp clients
- NetworkBinder: discovers Pi hotspot WiFi (no-internet) and cellular networks
  via ConnectivityManager, creates per-network socket-bound OkHttpClients
- DualNetworkTestScreen: real OkHttp calls to 10.42.0.1/api/gps/status and
  yaris.ceaf.dev/health, simultaneous "Test Both" gate button
- MainActivity: discovers networks at startup, passes bound clients to screen
- Retrofit interfaces (PiApi, ServerApi) + DTOs (GpsStatus, HealthResponse)
- Uncommented OkHttp/Retrofit/kotlinx-serialization deps in build.gradle.kts
2026-08-12 00:34:41 -04:00
Mathieu Moran f1c83a2ee7 init: android project scaffold (Phase 28.1)
- Kotlin DSL build with version catalog (AGP 8.7, Kotlin 2.1, Compose BOM 2025.01)
- app module: Compose + Material 3, dark theme, network security config
- DualNetworkTestScreen — Phase 28.1 gate screen (buttons wired in 28.1.2)
- YarisApp, MainActivity, YarisOBDTheme
- ProGuard rules for Retrofit/OkHttp/Kotlinx Serialization/Coil/MapLibre/Room
- cleartext allowed for 10.42.0.1 + yaris.local
- gradle wrapper properties (needs Android Studio to generate wrapper jar)
2026-08-12 00:26:54 -04:00
Mathieu Moran 69109762a8 fix: always send device config on save — sync toggle now works both ways 2026-08-12 00:16:57 -04:00
Mathieu Moran 79222c8bb5 fix: disabling sync via settings page no longer returns spurious error 400 2026-08-12 00:02:54 -04:00
Mathieu Moran 0fea9718bc fix: prevent sync from overwriting Pi odometer — odometer is Pi→Server only 2026-08-11 23:53:42 -04:00
Mathieu Moran 0b2162a595 style: odometer field uses plaintext display — no stepper arrows, grey background 2026-08-11 23:44:05 -04:00
Mathieu Moran d35cea367f fix: odometer sync is Pi→Server only — portal displays read-only value from DB 2026-08-11 22:14:46 -04:00
Mathieu Moran 7de8948e08 docs: update Hardware and Architecture sections — dual-radio, GPIO power, 4G modem, phone hotspot uplink 2026-08-11 22:06:05 -04:00
Mathieu Moran 44cd8bd192 feat: odometer_baseline field on server portal device settings page 2026-08-11 19:52:51 -04:00
Mathieu Moran 32de77131c feat: odometer baseline syncs to server — push on save, pull on sync, +/api/device-config/push endpoint 2026-08-11 19:31:52 -04:00
Mathieu Moran 878ba4a958 fix: skip device config save when sync is enabled — prevents 'Invalid device config' blocking settings save 2026-08-11 18:57:40 -04:00
Mathieu Moran 34253b3ffb feat: manual odometer baseline — Settings field computes baseline + trip distance, Dashboard shows (manual) label 2026-08-11 18:51:11 -04:00
Mathieu Moran 887a001723 docs: Phase 27 started — 7 feature candidates ready 2026-08-11 18:40:35 -04:00
Mathieu Moran 19c538389b docs: Phase 26 rewritten — all 12 bugs documented consistently. Phase 27/28 cleaned up. 2026-08-11 18:29:03 -04:00
Mathieu Moran 9ebfea8be3 docs: readme updated, BUGS.md cleaned — all 12 bugs in Resolved, Open section empty 2026-08-11 18:25:07 -04:00
Mathieu Moran f017a301f3 docs: Phase 26 complete, Phase 27 ready — 7 feature candidates 2026-08-11 18:20:07 -04:00
Mathieu Moran 341437c2d4 docs: Phase 26 COMPLETE — BUG-02 closed, all 12 bugs resolved. GPS has 7 sats, needs clear sky for fix. 2026-08-11 18:17:31 -04:00
Mathieu Moran 0f6d9b20a2 docs: Phase 26 DONE — BUG-01 closed, all 11 bugs resolved. BUG-06/12 moved to Resolved. 2026-08-11 17:19:42 -04:00
Mathieu Moran e54391b5c9 docs: FEAT-06/07/08/09 — trip ID column, hotspot auto-connect, predictable IP, mDNS 2026-08-11 17:17:12 -04:00
Mathieu Moran 4704bb79f1 docs: BUG-01 test steps documented, FEAT-07 phone-hotspot auto-connect shipped 2026-08-11 17:11:34 -04:00
Mathieu Moran b4d622827a docs: revert BUG-01 — AP tested but phone-hotspot uplink not yet verified 2026-08-11 17:06:39 -04:00
Mathieu Moran ea47cff489 docs: BUG-01 closed — tested on iOS + Android, yaris.local resolves, Phase 26 DONE 2026-08-11 17:04:20 -04:00
Mathieu Moran 675ee67260 docs: revert BUG-01 to IN PROGRESS — needs owner test before closing 2026-08-11 16:47:58 -04:00
Mathieu Moran dc1c1e5f06 docs: BUG-01 closed — dual-radio bench-verified, Phase 26 DONE (11 closed, 1 hardware) 2026-08-11 16:46:57 -04:00
Mathieu Moran 0f76ae3f84 docs: Phase 26 updated — 10 closed, BUG-11/12 and GPS lat/lon fix documented 2026-08-11 16:43:06 -04:00
Mathieu Moran a4a92cc69b fix: Socket gps_location now passes lat/lon to renderGpsStatus, preventing overwrite with blanks 2026-08-11 16:37:01 -04:00