Files
pi-car-companion/CAR_TELEMETRY.md
T

41 lines
1.8 KiB
Markdown

# Car telemetry and retention
The Pi samples the MG4 every 10 seconds while ADB is enabled. Speed, gear, and steering
angle come from the verified ArcSoft properties. Battery values come from the read-only
content provider in `cloud.molberg.mgutility`:
```bash
adb shell content call \
--uri content://cloud.molberg.mgutility.vehicle \
--method sample
```
The provider must be present in the installed MG Utility APK. Until it connects to the
SAIC vehicle service, battery fields remain unavailable while the ArcSoft signals and
their history continue working.
## Storage limits
- Raw 10-second samples are retained for 90 days and capped at 800,000 rows.
- Hourly rollups are retained for 10 years and capped at 88,000 rows.
- Lifetime counters and observed records survive raw-data pruning.
- Graph endpoints use indexed time buckets and return compact aggregates rather than
every raw sample.
At the configured interval the raw cap is approximately 90 days. Expected storage is
well below 150 MB, although SQLite page allocation and filesystem details can vary.
## Derived statistics
- Tracked distance integrates consecutive speed samples no more than 60 seconds apart.
- The dashboard's range estimate uses tracked distance per observed SOC consumed. It
waits for at least 10 km and 5 percentage points of discharge before showing a value.
- Charging power is an estimate based on SOC gain over a 2-10 minute window and the
MG4 Luxury 2022 usable-capacity assumption of 61.7 kWh. It is deliberately labeled as
estimated and is capped at 350 kW to reject corrupt samples.
- Peak values mean the highest value observed at a 10-second sampling point. They are
not guaranteed to capture a shorter event between samples.
The collector sends no vehicle-control calls. Installing MG Utility and enabling ADB
remain parked-vehicle administration tasks.