Documentation

Welcome to Drive Assist (DriveMem)

Transparency, Control, and Safety for the Geely EX2 / Geometry E (IHU629G)

Welcome to Drive Assist! This guide provides complete and transparent disclosure of what this application does, what vehicle data it accesses, what actuators it can control, the exact boundary between mapped hardware signals and running software, and the safety measures designed to protect you, your vehicle, and your privacy.


🧭 Philosophy & Purpose

Factory electric vehicle infotainment units often isolate data and forget driver preferences every time the car turns off. Drive Assist runs natively on the Android head unit (IHU629G) to:

  1. Preserve Driver Comfort & Preferences: Automatically restore your chosen driving dynamics (Eco/Comfort/Sport and Creep Mode) upon startup.
  2. Provide Local-First Telemetry: Send vehicle diagnostics directly to your personal Home Assistant server without proprietary subscription clouds.
  3. Enhance Road Trips: Stream live battery consumption and state of charge directly to A Better Routeplanner (ABRP) for precise route and charging predictions.
  4. Offer Smart Dashcam Recording: Record camera feeds with live telemetry overlays and easy USB export.

🚗 Live Vehicle Interface: Comfort View

The primary driver interface is designed specifically for the Geely EX2 (IHU629G) landscape screen (1920x1080 @ 160 dpi / 1.0 density factor), providing instant at-a-glance status and tactile climate controls:

Drive Assist Comfort View Figure 1: Drive Assist Comfort View running live on the Geely EX2 / Geometry E IHU629G head unit. Showcases outdoor ambient temperature (20°C), the 11-column Comfort Ruler HVAC scale (C5..0..W5), real-time high-voltage charging card (69% SoC, 16 min elapsed, ~175 min remaining to 100%), window purge and recirculation quick-toggles, and the left-rail navigation dock.


⚖️ Mapped Capabilities vs. What the APK Actually Does

During the reverse-engineering of the IHU629G platform, over a hundred hardware signals and function IDs were identified and documented in our DATA-CATALOG.md and field-catalog.md. However, there is a strict difference between what the vehicle hardware exposes and what Drive Assist actually executes.

flowchart TD
    subgraph MAPPED["Vehicle Hardware Signals (Mapped / Researched)"]
        M1["Powertrain & VHAL Telemetry"]
        M2["TPMS Tire Pressures (Read-Only)"]
        M3["Exterior Lights & Wipers (Read-Only)"]
        M4["Direct CAN / Steering / Brakes (Strictly Probed / Unused)"]
        M5["BMS High-Voltage Pack Diagnostics (OBD2)"]
    end

    subgraph APK["What the APK Actually Runs (Active Software)"]
        A1["Drive Mode & Creep Persistence Engine"]
        A2["Comfort Ruler HVAC Climate Controller"]
        A3["Continuous Dashcam Loop (EVS HAL + WebVTT Subtitles)"]
        A4["Home Assistant MQTT Reporter & Dynamic Context Panel"]
        A5["ABRP Live Telemetry Streamer"]
        A6["Bluetooth OBD2 BMS Reader (When Paired)"]
        A7["Manual Cabin Doors & Window Actuation (Parked Only)"]
        A8["Ambient Interior Light Strip Control"]
    end

    M1 --> A1 & A4 & A5
    M5 --> A6 --> A4 & A5
    M1 --> A2

1. What the APK ACTUALLY Implements

2. What is Mapped as Read-Only (Never Actuated by the APK)


🔌 The OBD2 Connection Reality & Pairing Requirement

An optional Bluetooth OBD2 dongle can provide finer battery readings directly from the Battery Management System (BMS ECU 0x7E2). Drive Assist remains usable without it.

[!IMPORTANT] Tested IHU629G behavior: The tested vLinker MC+ could not pair from the car’s standard Bluetooth settings screen. Other adapters are untested and may work normally.

Why Standard Pairing Fails

  1. The head unit’s factory Android 9 Bluetooth stack has an internal auto-pairing PIN hardcoded in /system/etc/bluetooth/btDefSetting.json set to "pairingCode": "0000".
  2. Standard OBD2 / ELM327 adapters (such as the tested vLinker MC+) expect PIN "1234" by default.
  3. When pairing is initiated, the head unit silently sends "0000" to the dongle without ever displaying a PIN entry prompt on the screen and without broadcasting ACTION_PAIRING_REQUEST.
  4. The dongle immediately rejects "0000" with AUTHENTICATION_FAILURE (UNBOND_REASON_AUTH_FAILED).

This fix is optional and separate from installing Drive Assist. install.sh does not run it. Only run it yourself if you’re pairing an OBD2 dongle — see the scripts in bt-pin-fix/ below.

[!WARNING] This is a persistent, system-wide change, not a normal setup step. It edits /system, so uninstalling Drive Assist and factory-resetting the car do not undo it. While active, it changes the automatic simple-pairing PIN for all Bluetooth devices, not just the dongle. Perform it only while parked, and avoid interrupting an active Bluetooth call or media session.

You don’t need to leave it changed. The PIN is only checked at the moment of pairing — once the dongle is paired, the car remembers it by a stored bond key, not the PIN. Pair the dongle, then run bt-pin-fix/revert-pin-0000.sh right away. The dongle stays paired with the PIN back at factory 0000. The scripts replace the complete configuration file from the tested firmware; do not apply or revert them after an IHU update without checking the on-car configuration first.

Optional pairing workarounds

Do not use either workaround unless the particular adapter fails normal pairing. Root ADB is required to override the system PIN:

  1. Method A — Modifying btDefSetting.json: Use the repository script; do not copy a hand-edited configuration file to the car:
    ./bt-pin-fix/apply-pin-1234.sh <CAR_IP>
    

    Once updated, pairing from the car’s screen or companion app succeeds immediately with PIN 1234.

  2. Method B — Headless Pairing via modehelper: The companion app modehelper has system-level BLUETOOTH_PRIVILEGED rights and provides command-line pairing via broadcast:
    adb shell am broadcast -a com.geely.modehelper.BT_PAIR --es addr <DONGLE_MAC> --es pin 1234 -n com.geely.modehelper/.BtPairReceiver
    

[!TIP] OBD2 is Completely Optional: If you do not have an OBD2 dongle or have not performed the ADB pairing setup, Drive Assist operates seamlessly using the car’s built-in VHAL. Battery SoC (whole-percent) and charging telemetry continue to report normally to Home Assistant and ABRP.


👁️ What the App Sees (Data Read)

Drive Assist reads data from the vehicle’s internal Vehicle Hardware Abstraction Layer (VHAL), OEM adaptation layers (VehicleModules), onboard GNSS (GPS), and optional Bluetooth OBD2 dongles.

1. High-Voltage Battery & Charging

| Data Field | Source | Description | Precision | | :— | :— | :— | :— | | State of Charge (SoC) | VHAL / OBD2 | Battery percentage | Integer % (VHAL) or 0.1% (OBD2) | | Pack Voltage & Current | OBD2 / BMS | High-voltage pack electrical measurements | Real-time Volts (V) and Amperes (A) | | Instant Power | OBD2 / VHAL | Energy flow into or out of the pack | Kilowatts (kW), +/- for regen/discharge | | Battery Temperature | OBD2 / BMS | High-voltage pack core temperature | Degrees Celsius (°C) | | Charging Cable Status | VHAL | Physical plug insertion detection | Plugged in / Disconnected | | Charging State & Limits | VHAL | AC charging active/idle, 16A vs 32A limit | Current limit setting, charging status |

2. Dynamics & Powertrain

| Data Field | Source | Description | | :— | :— | :— | | Vehicle Speed | Cluster / VHAL | Wheel speed sensors in km/h | | Selected Gear | Transmission ECU | Active gear position (P, R, N, D) | | Odometer | Instrument Cluster | Total accumulated mileage in kilometers | | Estimated Range | Cluster ECU | Remaining driving range estimated by car | | Drive Mode | VHAL | Active drive profile (ECO, COMFORT, SPORT) | | Creep Mode | VHAL | Low-speed accelerator release crawl setting |

3. Environment & Location

| Data Field | Source | Description | | :— | :— | :— | | GPS Position | IHU GNSS | Latitude, longitude, altitude, heading, accuracy | | Outside Temperature | HVAC ECU | Ambient air sensor behind front bumper (°C) |

4. Body, Cabin & Peripherals

| Data Field | Source | Description | | :— | :— | :— | | Doors & Latches | Body Controller | Open/closed status of doors, trunk, and hood | | Windows | Window Modules | Window height / cracked ventilation status | | HVAC & Climate | HVAC Controller | Fan speed, target temp, compressor status, recirculation | | Tire Pressures & Temps | TPMS | Direct pressure (bar/psi) and temperature per tire (Read-only) | | External Lighting | Lighting Module | Position lights, low beams, high beams (Read-only) | | Cameras | EVS HAL | Front and rear cameras via native video stream | | Media Playback | Android Media | Active song, artist, album art, playback state |


🛡️ Safety Boundaries & Actuator Limitations

[!CAUTION] Non-Negotiable Safety Boundaries: Drive Assist is engineered with absolute physical and software firewalls. It interacts exclusively with comfort, body, and infotainment controllers.

What the App CAN Control

What the App CANNOT Touch


🔒 Security & Privacy Safeguards

1. Remote Commands Lock (“Aceitar Comandos do HA”)

In the MQTT settings, the Accept Commands from HA switch is a master safety override:

2. Touch Cooldown Prevention

To prevent accidental repeated clicks on the vehicle touchscreen while driving or parking:

3. Moving Vehicle Safeguards

4. ADB Security Gate (Maintenance Access)

Android Debug Bridge (ADB) allows low-level terminal debugging:

5. Data Privacy & Local-First Architecture


⚠️ Risks & Considerations

Consideration Details Best Practice
12V Auxiliary Battery Frequent background polling or prolonged parked Wi-Fi connection could theoretically deplete the 12V battery. Drive Assist halts background polling when the car is parked and off. The IHU automatically enters deep standby when the car is locked.
Bluetooth PIN Override Optional workaround only: it replaces a complete, firmware-specific /system Bluetooth configuration and changes the automatic simple-pairing PIN globally while active. It survives uninstall and factory reset. Use only while parked and only for the tested pairing failure; restore 0000 immediately after the dongle bonds. Do not apply or revert the bundled file after an IHU update until the on-car file has been checked.
Network Tethering Streaming high-frequency telemetry (MQTT/ABRP) consumes mobile data if tethered via personal hotspot. At 10s intervals, telemetry consumes approximately 2–5 MB per driving hour.
Firmware Updates Official dealership firmware updates to the IHU may overwrite root access or system modifications. Always back up configuration files and follow the update guide in docs/GUIA-ADB-IHU629G.md.

📚 User Documentation Guides

Detailed step-by-step guides for configuring each integration: