Server 2.4.0, app 2.11.1: ABRP forwarding removed from the server
The car sends live data to ABRP itself, and the car and the server go over the same mobile connection: when the car cannot reach ABRP, it cannot reach the server either, so the server's fallback bought nothing. The forwarder, its ABRP_* settings and abrpSentUtc are gone; the server only stores. The app stops sending abrpSentUtc (the server ignores unknown fields, so 2.11.0 keeps working) and its texts no longer promise a server fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
This commit is contained in:
+2
-2
@@ -34,8 +34,8 @@ android {
|
||||
applicationId "com.stinnesbeck.nilsmg4"
|
||||
minSdk 27
|
||||
targetSdk 36
|
||||
versionCode 73
|
||||
versionName "2.11.0"
|
||||
versionCode 74
|
||||
versionName "2.11.1"
|
||||
|
||||
// Nothing about the server ships in the APK: its URL and ingest token are entered in
|
||||
// the app's Server tab (ServerConfig), and the database is only reachable by the server.
|
||||
|
||||
@@ -8,9 +8,8 @@ import android.content.SharedPreferences;
|
||||
* sending) and the user token (which car in which ABRP account). Kept in {@link SecurePrefs}
|
||||
* next to the server settings, entered on the Live data tab or imported from a config file.
|
||||
*
|
||||
* With both set, the car sends to ABRP itself, so ABRP keeps getting live data when the car
|
||||
* server is down; the server then only forwards what the car could not deliver. Without them,
|
||||
* the server forwards as before.
|
||||
* The car is the only one that sends to ABRP: the server stores live data but does not forward
|
||||
* it. Without these, ABRP gets no live data.
|
||||
*/
|
||||
final class AbrpConfig {
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* Foreground service that polls vehicle telemetry every 15 s, integrates consumption locally,
|
||||
* syncs it to the car server in 2-minute delta chunks, and sends live telemetry samples that
|
||||
* the server stores and forwards to ABRP ({@link TelemetryUploader}). The car itself never
|
||||
* talks to ABRP and holds no ABRP credentials.
|
||||
* the server stores and, with ABRP credentials set, that go straight to ABRP
|
||||
* ({@link TelemetryUploader}).
|
||||
*
|
||||
* Always-on by design: started at boot (BootReceiver) and on app open, never gated on
|
||||
* credentials or a toggle. The only thing it needs is a network, and a missing one is
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Live telemetry to the car server, which stores it and forwards the newest sample to ABRP.
|
||||
* Live telemetry to the car server, which stores it, and the newest sample straight to ABRP.
|
||||
*
|
||||
* Called on every service tick. While the car is in use every tick becomes a sample; the
|
||||
* queue is sent when {@link UploadCadence} says so — every tick on a state change, otherwise
|
||||
@@ -193,8 +193,6 @@ final class TelemetryUploader {
|
||||
JSONObject body = new JSONObject()
|
||||
.put("installationId", config.installationId)
|
||||
.put("samples", samples);
|
||||
// What the car already delivered to ABRP itself; the server forwards only newer samples.
|
||||
if (lastAbrpUtc > 0) body.put("abrpSentUtc", lastAbrpUtc);
|
||||
return ServerHttp.request("POST", config.url + "/v1/telemetry", config.token, body);
|
||||
}
|
||||
|
||||
@@ -209,7 +207,7 @@ final class TelemetryUploader {
|
||||
/**
|
||||
* Sends the newest queued sample straight to ABRP when ABRP credentials are set: once per
|
||||
* upload, only if it is newer than the last one sent and still live. It stays queued for
|
||||
* the server either way.
|
||||
* the server either way; the server does not forward to ABRP.
|
||||
*/
|
||||
private void sendNewestToAbrp() {
|
||||
AbrpConfig abrp = AbrpConfig.get(context);
|
||||
|
||||
@@ -122,12 +122,12 @@
|
||||
<string name="hint_steering_keys">The last key reports the car sent, newest first. If double-pressing the voice key does not open the app, a photo of this list shows how the car reports it.</string>
|
||||
<string name="steering_keys_empty">No key reports received yet. Press a steering-wheel key.</string>
|
||||
<string name="label_abrp_upload_enabled">Send live data</string>
|
||||
<string name="hint_abrp_upload_enabled">To your server, which stores it, and to ABRP: straight from the car when the ABRP credentials below are set, otherwise forwarded by the server. Consumption and charging tracking keep running when this is off.</string>
|
||||
<string name="hint_abrp_direct">With your ABRP API key and user token here, the car sends live data to ABRP itself, so ABRP keeps getting it while your server is down. The server then forwards only what the car could not send. Leave both empty to let the server forward everything.</string>
|
||||
<string name="hint_abrp_upload_enabled">To your server, which stores it, and straight to ABRP when the ABRP credentials below are set. Consumption and charging tracking keep running when this is off.</string>
|
||||
<string name="hint_abrp_direct">The car sends live data to ABRP itself with your ABRP API key and user token. Without them, ABRP gets no live data; your server only stores it.</string>
|
||||
<string name="hint_abrp_api_key">ABRP API key</string>
|
||||
<string name="hint_abrp_token">ABRP user token</string>
|
||||
<string name="abrp_saved">Saved: the car sends live data to ABRP directly</string>
|
||||
<string name="abrp_cleared">Cleared: the server forwards live data to ABRP</string>
|
||||
<string name="abrp_cleared">Cleared: ABRP gets no live data</string>
|
||||
<string name="abrp_invalid">Enter both, without spaces, or leave both empty</string>
|
||||
<string name="abrp_testing">Checking with ABRP…</string>
|
||||
<string name="abrp_test_ok">ABRP accepted these credentials</string>
|
||||
|
||||
Reference in New Issue
Block a user