App 2.11.0, server 2.3.0: live data straight to ABRP; settings regrouped

ABRP keeps getting live data while the car server is down: with an ABRP
API key and user token set in the app (Live data tab, or abrp_api_key /
abrp_token in the config file), the car sends the newest sample to ABRP
itself at every upload. It tells the server the newest sample ABRP took
(abrpSentUtc), and the server forwards only newer ones, so ABRP gets
each sample once. Without credentials in the app the server forwards
everything, as before. The credentials sit in encrypted storage, go in
the request body, and neither they nor ABRP's answer are logged.

Settings are grouped by what they are for:
- Live data (was Upload): on/off, ABRP credentials, upload frequency.
- Settings (replaces the Wi-Fi tab): full screen and voice key,
  usable capacity and manual SoH (were on Consumption), charging price
  (was on Charging), Wi-Fi.
Charging and Live data get icons of their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
This commit is contained in:
2026-10-18 12:15:21 +02:00
co-authored by Claude Opus 5.5
parent 087f193f8c
commit ca2f899403
36 changed files with 636 additions and 163 deletions
+21 -13
View File
@@ -47,32 +47,36 @@ vehicle there, so every value shows as a dash).
## How it fits together
```
car ──live telemetry───▶ car.k8s.stinnesbeck.com (Go) ──▶ ABRP
──daily chunks─────▶ │
──charging sessions▶ ▼
InfluxDB 2 ◀── Grafana
car ──live telemetry───▶ car.k8s.stinnesbeck.com (Go) ──▶ ABRP (what the car did not send)
│ ──daily chunks─────▶ │
│ ──charging sessions▶ ▼
│ InfluxDB 2 ◀── Grafana
└──live telemetry (optional, direct)──────────────────▶ ABRP
```
The ABRP credentials live only on the server, never in the APK. The car authenticates with a
token of its own, obtained by pairing with a phone (below).
With ABRP credentials set in the app (Live data tab), the car sends live data to ABRP itself,
so ABRP keeps getting it while the server is down; the server then forwards only samples the
car could not deliver. Without them in the app, the server forwards everything with its own
ABRP credentials. The car authenticates with the server using a token of its own, obtained by
pairing with a phone (below).
## The app
| Tab | What it shows |
|---|---|
| **Overview** | Battery, range, range estimates at current power and at the 5-minute average, power, speed; odometer, climate setpoint and tyre pressures |
| **Overview** | Battery, range, range since start and at the 5-minute average with their usage, power, speed; odometer, climate setpoint and tyre pressures |
| **Consumption** | Daily and period consumption, efficiency |
| **Charging** | Charging sessions and curves, cost in euro |
| **Upload** | Live telemetry on/off, full screen, voice key, upload cadence |
| **Live data** | Live data on/off, ABRP credentials for sending directly from the car, upload frequency |
| **Server** | Server URL, pairing by QR code, ingest token, installation ID, config import |
| **Wi-Fi** | Joins a network the head unit already knows (e.g. the phone hotspot) |
| **Settings** | Full screen, voice key, battery (usable capacity, manual SoH), charging price, Wi-Fi |
| **Logs** | Upload log and the last steering-wheel key reports |
- **Opening the app:** the MG4 launcher does not list third-party apps. **Double-press the
voice key** on the steering wheel and the app comes to the front (switch on the Upload tab,
on by default).
voice key** on the steering wheel and the app comes to the front (switch on the Settings
tab, on by default).
- **Full screen:** hides SAIC's top and bottom bars while the app is open; a swipe from the
edge shows them briefly (Upload tab, on by default).
edge shows them briefly (Settings tab, on by default).
- **Live telemetry:** every 15 s while driving or charging, much less often while parked. A
value the car cannot read is left out, never sent as zero, so ABRP is never told the battery
is empty because a read failed.
@@ -113,7 +117,9 @@ pointed at this repository's releases (see `SPECS.md`).
2. On the **Server** tab the URL is already `https://car.k8s.stinnesbeck.com`.
3. Tap **Pair with phone**. Scan the QR code with a phone (or open the address shown and enter
the code), and approve with the server's approval password. The car receives its token.
4. On the **Upload** tab, turn live telemetry on. The service starts with the car from then on.
4. On the **Live data** tab, turn live data on. The service starts with the car from then on.
5. Optional: enter your ABRP API key and user token on the same tab, so the car also sends
live data straight to ABRP.
### Config file
@@ -135,6 +141,8 @@ installation_id = only to carry over history from an install older than 2.9.0
interval_sec = 60 # 15 / 30 / 60 / 120 / 300
boost_low_soc = true
low_soc_percent = 20
abrp_api_key = optional: your ABRP API key, to send to ABRP directly
abrp_token = optional: your ABRP user token
```
After a successful import the app deletes the file, since it holds the token; credentials live