Skip to main content

Talking to the bike

· 4 min read
Massimo Di Stefano
FastGIS author

This was the week the app stopped inferring what the motorcycle was doing and started asking it. A Bluetooth OBD-II adapter, two garage sessions, one surprise hiding in monitor mode — and by the end, live engine data on the phone and a gear indicator nobody sold us.

The three-day arc

The OBD-II work had been parked for months as a deliberately unmerged spike: a pure ELM327 protocol layer with tests, a BLE transport, and a diagnostic screen — all waiting on one question no amount of code review could answer: does the bike actually respond? Motorcycles are notorious for implementing a thin, inconsistent slice of the OBD-II standard, or none at all.

Then the adapter arrived (a Vgate iCar Pro 2S), and the question got answered in stages.

Bench day. Ignition on, scan, connect — and the first quiet surprise: the adapter advertises the 18F0 BLE service, not the FFF0 layout its own documentation suggests. The transport's autodiscovery fallback (any service with one notifiable and one writable characteristic) carried the day, and 18F0 is now first in the known-layouts list. Then the second surprise: the KTM 890 ignores 0100, the standard "which PIDs do you support?" query. A capability-first design would have concluded the bike supports nothing. Polling PIDs directly told a different story: RPM, speed, coolant, throttle, load and battery voltage, all live, all plausible — 12.5 V with the engine off, 14.2 V charging the moment it fired up.

Probe day. The owner's real asks were odometer and fuel. So the screen grew an extended probe: ask each interesting PID once per connection and report answered / no-answer, honestly, per line. The verdict on the 890: fuel level, true odometer, fuel rate, mass-air-flow and gear — silent. But distance-since-codes-cleared (31) answers, and that is enough: anchor it once against the dash and the app can track total distance from then on. Maintenance tracking gets ECU-exact kilometres; fuel planning stays on the learned-consumption path that never needed the ECU at all.

The hunt

The best part of the week came from the signals OBD-II doesn't hand over. The ELM327 has a monitor mode that eavesdrops on the bike's broadcast CAN bus — received wisdom says cheap clones drop frames and give up. Filtered tightly, this one doesn't. Twenty-five broadcast CAN IDs reach the diagnostic connector, and among them:

  • Gear position, plainly broadcast — decoded and confirmed through all six gears against prediction,
  • the IMU cluster, identified by a sign flip while riding circles,
  • a speed frame whose fields go to zero at a standstill — raw material for a wheel-speed odometer with far finer resolution than the 1 km ticks of PID 31.

The capture tooling moved from a laptop script into the app itself, with GPS interleaved into every log as the calibration reference. And because the next step is a calibration ride, the capture screen now has three glove-sized buttons — 20 / 40 / 60 km/h — that stamp labelled steady-speed windows straight into the log while riding. Tap when you're holding the speed, tap again when you leave it.

Where this lands

Live engine data is on the phone today (More → OBD-II (Bluetooth)), the screen keeps itself awake, and the whole feature works with CarPlay active — which on this bike means always, since the head unit comes up with the ignition. The plan from here: fuse the fine-but-drifting wheel-speed integral with the coarse-but-honest kilometre counter, fold the proven signals into ride recordings, and give the rally-roadbook mode the distance source it has been waiting for.

The bike had a lot to say. We just had to stop asking politely and start listening.