- 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
- add multi-device portal device management, key rotation, and sync request APIs
- add Pi settings UI for remote server URL, device name, and API key
- add local test-connection and sync-now actions
- make upload and config sync reuse dynamic shared credentials
- add Phase 25.5c migration and docs updates
Co-authored-by: Copilot <[email protected]>
- Add database migration (migrate_phase25_5a.sql):
* Add owner_name, car_model, device_name, avatar_path columns to devices table
* Add config_version and config_updated_at for cache invalidation
- Add server/modules/device_config.py:
* get_device_config(device_id): retrieve config for Pi sync
* update_device_config(device_id, data): update config with validation
- Add server API endpoints:
* GET /api/device-config (authenticated with device_key, Pi fetches config)
* POST /api/device-config (authenticated as user, admin updates config)
- Enhance server/modules/db.py:
* Add get_device_by_id() function to retrieve all device config fields
Phase 25.5a enables server-side device identity management and connection-driven sync.
Pi will fetch from this endpoint when internet available, keeping config in sync.
Co-authored-by: Copilot <[email protected]>