Skip to content
erickramer42Public

About

OBD-II scan tool and data logger for Windows, Linux and Android: live gauges and charts, whole-car profiles of up to 32 modules, alerts and condition-triggered recording, trouble codes by name, UDS reads, plugins, OBDb imports. J2534, ELM327 (USB, Bluetooth, WiFi), SocketCAN. Qt-free C++17 core behind a C ABI; Qt 6/QML app, havne-cli, Python.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

Havne

From Norwegian havn, a harbor or port: Havne reaches a car through its ports. The verb havne is to end up somewhere, as in havne i grøfta, in the ditch; staying out of it is still your job.

CI Coverage Release OpenSSF Scorecard OpenSSF Best Practices

Havne reads a car through J2534, ELM327 or SocketCAN adapters on Windows, Linux and Android: live data, trouble codes, and recordings to replay or share, scrubbed, from an app, havne-cli or Python. Download.

Warning

Experimental. Tested on one car. Read DISCLAIMER.md before connecting it.

The Dashboard through a quarter mile

The Dashboard, simulated.

Engineering highlights

  • Vendor drivers run out of process. Each J2534 DLL runs in a surrogate of its own architecture, so a crashing driver ends its process, not the app (ADR-0025).
  • Fast paths, measured. Decoding allocates nothing per frame; a recorded engine start replays at over 300,000 frames a second on the dev machine, and CI reruns it (load test).
  • Measured on a real car. A second controller on its bus showed Havne's adapter read adding 52 ms; fixing it cut latency from 65.5-73.7 ms to 16.4 ms (session sheet).
  • Protocol logic with no I/O, fuzzed. The request engine, ISO-TP and the ELM327 layer take no I/O or clock, so rules are unit tests; parsers run fuzzed in CI (ADR-0015).
  • A user's signals are data. Signal files are JSON that core reads from bytes and refuses at load with line and column, so every platform loads them alike (ADR-0051).
  • Scrubbed by construction, then checked. An export plans the file from ISO-TP reassembly, then searches every message for the car's VIN and writes nothing on a match (ADR-0054).
  • A stable C ABI. Opaque handles, flat functions and POD structs with reserved room; CI compiles the headers as strict C and compares the ABI with the last release's (ADR-0001).
  • Tested in tiers, downloads checkable. A harness tier drives the J2534 stack against a fake driver, 32-bit included; each release carries signed provenance and an SBOM (testing.md, ADR-0035).

What it does

  • Live data: a Dashboard of eight gauge kinds, Live's table and chart, a Light look, Night in amber or red, optionally scheduled, and a phone's drive view (ADR-0057, ADR-0059).
  • Adapters: J2534 on Windows; ELM327 over serial, Bluetooth or WiFi, kept running in the background on Android; SocketCAN on Linux, asking so far on a virtual bus (docs/linux.md).
  • Diagnose: each ECU's stored, pending and permanent codes with titles, readiness, the freeze frame and an inspection verdict; a clear asks first and saves the report (ADR-0037).
  • Profiles, chosen by the URI: obd2 polls every Service 01 reading the car supports, uds-generic the identifiers you name, raw logs frames (ADR-0039).
  • Your own signals: signal files and plugins for Service 01 PIDs and Service 22 DIDs on up to 32 modules, written in Settings or imported from an OBDb set, all kept as plugins in one list (signal-files.md).
  • Alerts and armed recording: a condition file names a test of a signal or the link; the app shows an alert as a band, and an armed recorder records around each firing (condition-files.md, ADR-0063).
  • Record and review: every frame and value of a session; the Recordings page pans, zooms, overlays a second run and shows the frames; replay:// plays one back (ADR-0049).
  • Analysis log: Start log records the picked signals at the bus's own rate, and havne-cli export writes them as a wide CSV, a row a sweep (ADR-0056).
  • Share: havne-cli and the app export a recording scrubbed as pcapng, CSV or a folder, save a health report, and import candump logs and other loggers' CSVs (ADR-0054).
  • havne-cli and Python: any session as JSON lines or iterators, recordings viewed and exported offline, the simulated car served as an ELM327 adapter (ADR-0031, ADR-0053).
  • A simulated vehicle: a modeled car through a cold start, pulls onto the limiter and a quarter mile, so every page runs with no hardware.
Drive viewCodesDashboard at night
The phone's drive view in a pull at 6,044 rpm, boost 16.0 psi Codes on the test phone: the inspection verdict, the check-engine light, and stored, pending and permanent codes with their titles The phone layout's Dashboard with Night on in red
The drive view: every bar hidden, the gauges filling the screen in a pull Reading and clearing codes on the test phone Night in red, for a dark cabin

The Recordings viewer on a minute of the simulated car: rpm, throttle, lambda and boost through two pulls, each marked by a band

A pull in the Recordings viewer: each unit in its own pane on one time axis, the cursor's values beside them, lambda going lean on the limiter's fuel cut.

Every page on a desktop or laptop and on the phone, in Dark and in Night's amber and red: docs/screenshots.md.

Architecture

 QML pages: Home · Dashboard · Live · Diagnostics · Activity · Recordings · Settings
   ▼  properties and list models, GUI thread only
 SessionBridge (app/)          the app's caller of the core: worker → GUI
   │                           marshaling, 100 ms coalescing, link health
   │   havne-cli (cli/)        a second front end: a session as JSON lines
   │   havne (python/)         a third: ctypes over the shared core, frames and values from its pull queue
   ▼  C ABI: core.h · signals.h · profile.h · plugin.h · obdb.h · j2534.h · serial.h
             stream.h · socketcan.h · vin.h · sim.h · recording.h · queue.h
             conditions.h
 ecuio-core (core/)            no Qt, ever: sessions, profiles, signal files, plugins, decoding, recordings
   ├── mock://    a scripted drive on a vehicle model
   ├── replay://  a recording's frames.csv at its own pace
   ├── elm327://  a serial port, a WiFi socket, or a link the app opens
   ├── socketcan:// a Linux CAN interface, listening or through ISO-TP
   │              (havne-cli play drives the simulated car on a virtual one,
   │               havne-cli sim answers as its engine ECU)
   └── j2534://   a surrogate process per driver, over a named pipe
          ├── ecuio-j2534-surrogate.exe      (32-bit drivers)
          └── ecuio-j2534-surrogate-x64.exe  (64-bit drivers)

Three rules shape it: the core never links Qt; the UI receives final display values, so decoding and units have one home; and the C ABI is the boundary. docs/architecture.md walks through it, a frame's path from transport to screen included.

Where to look in the code:

File What it shows
core/src/request_engine.h The request engine (its parts are the request_engine_*.h beside it): pacing, the probe, the DID scan and identification, with no I/O and no clock, so every rule is a unit test
core/src/isotp.h ISO-TP on classic CAN, shared by ELM327 and SocketCAN: reassembly, Flow Control, the timers, with no I/O and no clock; fuzzed
core/src/elm327_protocol.h A pure protocol layer: line reading and frame parsing; fuzzed
core/src/j2534_surrogate_client.cpp, _ops.cpp, _io.cpp, surrogate/surrogate_main.cpp Both ends of the out-of-process driver host: the pipe's protections, late replies, a child that dies
core/src/recorder_writer.cpp, core/src/recording_reader.cpp and its five parts beside it (recording_reader_*.cpp) Recordings in core: the worker's single-producer ring to a writer thread that never holds the session, and a reader that answers the viewer from one pass's index; the reader fuzzed
core/src/signal_file.cpp, core/src/plugin_manifest.cpp A user's signals and a manufacturer's plugins read as data: a strict JSON reader over bytes, each refusal with its line and column, one build of a signal set for both; fuzzed
core/src/scrub.cpp, core/src/export*.cpp The scrubbed exports: the plan from the frames' reassembly, then the check of every message and the file, which fails the export rather than write the car's identity
core/src/queue.cpp, python/havne/session.py The pull queue: the worker copies into a ring and never waits, the caller's thread reads in batches; Python's iterators over it
core/src/link_health.h The link's state machine, shared by both adapter transports
app/sessionbridge.cpp, app/bridge_recorder.cpp The worker-to-GUI boundary: backpressure, coalescing, recording
cli/cmd_stream.cpp, cli/line_ring.h A second front end over the public headers alone: lines formatted on the worker with no allocation, a ring that drops for a live bus and waits for a replay
core/src/mock_drive_cycle.h, core/src/mock_drive_model.h The simulated vehicle: the physics and the phases in the model, the drive cycle's stepping and encoding beside it
core/src/sim_ecu.h The simulated ECU behind havne-cli sim: what it answers, as the simulated car or a recording of the test car, with faults on request; pure, so every answer is a unit test

Try it

Download from the latest release:

  • Windows 10 or 11 (x64): unzip and run havne.exe. It isn't code-signed, so SmartScreen may ask first (More info, then Run anyway).
  • Android 12 or later: open the APK on the phone; it's signed with Havne's release key, so each release installs over the last.
  • Linux (x86_64 or 64-bit ARM; glibc 2.39 or later): make the AppImage executable and run it (docs/linux.md).
  • Python 3.11 or later: pip install the wheel for your platform, then python read_pids.py mock://demo (read_pids.py) prints the simulated car's readings.

Then press Demo data on Home (or mock://demo under WiFi and other addresses on Settings' Connection page) and Connect; with Record sessions on, each run opens afterward on the Recordings page.

To build from source you need CMake 3.21+, Qt 6.12 and a C++17 compiler:

cmake -B build -DCMAKE_PREFIX_PATH=<qt-install>/<kit>
cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failure

-DHAVNE_BUILD_CORE_ONLY=ON builds the core, havne-cli and their tests without Qt; havne-cli stream mock://demo --values then streams the simulated car as JSON lines. docs/development.md covers the other platforms and troubleshooting.

Status

v0.9.0, the whole car's groundwork, is the latest release. Next:

Version Plan
v0.9.1-v0.11.0 v0.9.1, a vehicle's plugins read together and the conversation tier behind safety gates; writes over more transports (v0.9.2); discovery of the whole bus; the scan tool
1.0.0 The finished reader: frozen and hardened, full featured on Windows, Linux and Android

STATUS.md holds what works, what's verified, the known issues and the roadmap; CHANGELOG.md what each release changed.

Documentation

Document What's in it
docs/user-guide.md Using the app, task by task: connecting, live values, the Dashboard, logs, recordings, alerts, codes, vehicles, the drive view
docs/addresses.md Every address form and option, with its default and an example
docs/architecture.md How the parts fit together and why, and a map of the other docs
docs/adr/ The architecture decision records
docs/testing.md Test tiers, which areas each reaches, and what isn't verified
docs/testing-inventory.md What each test pins, by area, with the evidence
docs/performance.md Measured costs: per frame, a recording, reply timing, a connect
docs/signal-files.md Writing your own signals: the format, what's refused at load, using a file, importing an OBDb set
docs/condition-files.md Writing conditions: tests of a signal or the link, alerts, armed recording
plugins/README.md Plugins: the package, its variants, the example for the simulated car
docs/j2534.md, docs/surrogate.md, docs/elm327.md How each adapter transport works
docs/linux.md Havne on Linux: the AppImage, the core packages, adapters and permissions, SocketCAN, tracing
docs/ios.md Havne on iPhone: installing CI's unsigned build with your own Apple ID, what works there
docs/screenshots.md Every page on a desktop or laptop and on the phone, in Dark and in Night's amber and red
docs/development.md Builds, tests, troubleshooting
docs/ci.md, docs/mobile-build.md, docs/packaging.md CI and the C ABI check; the Android and iOS builds; the Linux packages, the SBOM and releases
docs/bench-sessions/ Real-hardware sessions, their run sheets, and what only hardware can confirm
docs/engineering-log.md Milestones and lessons learned
CONTRIBUTING.md, SECURITY.md Where to start, the rules a change follows, reporting a vulnerability

License

MIT; see LICENSE. Havne uses Qt under LGPL-3.0; Qt isn't bundled in this repository. Havne is an independent project, not affiliated with or endorsed by The Qt Company.

About

OBD-II scan tool and data logger for Windows, Linux and Android: live gauges and charts, whole-car profiles of up to 32 modules, alerts and condition-triggered recording, trouble codes by name, UDS reads, plugins, OBDb imports. J2534, ELM327 (USB, Bluetooth, WiFi), SocketCAN. Qt-free C++17 core behind a C ABI; Qt 6/QML app, havne-cli, Python.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages