~/Rev_
← projects

#D/Xcan

Decouple your car from the dealer's word. A from-scratch scan tool for Linux: every module, every trouble code and every data identifier a car will answer, on ~$30 of hardware.

2026-11-15 → 2026-11-30

The problem

D/Xcan. Decouple your car from the dealer's word.
D/Xcan. Decouple your car from the dealer's word.

Dealer and enterprise scan tools cost thousands of dollars, and cheap OBD dongles only show the emissions slice of a car: engine codes and a few dozen sensors. A modern car has a dozen or more computers (airbag, ABS, steering, body, cluster, radar, camera) that a $20 dongle never talks to. I wanted to see all of it, from my own laptop, on Linux, with a tool I can read and change.

Status: v0.1.0, validated end to end against a simulated vehicle. The first on-car session on my 2022 Genesis G70 is next.

What I built

The stack: a zero-dependency Rust core, with egui only for the desktop app.
The stack: a zero-dependency Rust core, with egui only for the desktop app.

A diagnostic stack written from the CAN frame up, in Rust, with no third-party crates in the core:

  1. Transport: SocketCAN through raw AF_CAN syscalls, an ELM327/OBDLink serial driver, and an in-process simulator. Every byte that reaches the car passes through code in the repo.
  2. ISO-TP (ISO 15765-2) in userspace: segmentation, flow control and multi-ECU reassembly, so every frame can be traced (V01).
  3. OBD-II (SAE J1979): supported-PID discovery, 6-PID batched polling, freeze frames, and stored, pending and permanent codes.
  4. UDS (ISO 14229): module identification, DTCs with status bits, data identifiers, and KWP2000 local IDs, which Hyundai and Kia still use.
  5. Discovery and sweeps: finds every module on the bus, then reads every identifier each module answers. All of it is read-only.
  6. **A desktop app (dxc-gui, egui) and a CLI (dxc)** on top: dashboard, live data, trouble codes, module tree, DID explorer and a CAN monitor. The CLI is a single ~800 KB binary with nothing to install.

Every module, not just the engine

Module scan against the built-in simulator.
Module scan against the built-in simulator.

One scan addresses every diagnostic ID on the bus, then reads each module's part number, software version and fault-code count. The trouble-code read below covers five modules at once, including codes a generic OBD-II scanner never sees.

Trouble codes from five modules in one read (simulator).
Trouble codes from five modules in one read (simulator).

The part generic scanners skip

Sweep, then watch: changed bytes are highlighted (simulator).
Sweep, then watch: changed bytes are highlighted (simulator).

Manufacturers don't publish what their modules' data identifiers mean, which is why dealer tools cost what they do. D/Xcan closes that gap one signal at a time:

  1. Sweep a module's identifier space (read-only)
  2. Watch one identifier while I change something in the car (shift gears, open a door, press the brake), and see which byte moves
  3. Save it as a signal (byte, length, scale, offset, unit) into a JSON vehicle profile

The profile is the asset. Every confirmed signal makes the tool permanently smarter for that car.

Live data

Simulator drive cycle at ~10 Hz, recorded with dxc live --csv.
Simulator drive cycle at ~10 Hz, recorded with dxc live --csv.

Polled six PIDs per request, recorded to CSV, and charted per series.

Hardware: no solder, ~$30–50

The whole hookup. The car's bus is already terminated, so the adapter's 120 Ω switch stays off.
The whole hookup. The car's bus is already terminated, so the adapter's 120 Ω switch stays off.

A CANable-style USB-to-CAN adapter (it appears in Linux as can0 with no driver install), plus an OBD-II pigtail screwed into its terminals: pin 6 to CAN-H, pin 14 to CAN-L, pin 5 to ground. A Raspberry Pi with a $15 CAN HAT works the same way.

By the numbers

9 builds · ~6,500 lines of Rust · 29 tests · 105 OBD-II PID decoders · 286 generic fault-code descriptions · a 10-module simulated vehicle · 0 third-party crates in the core · one ~800 KB binary.

Why Rust

The first prototype was Python. I rewrote it in Rust before the first release: a scan tool should be one file you copy onto a laptop or a Raspberry Pi and run, with no interpreter or packages to install. The rewrite kept the same layers and the same simulator, and every test was ported first, so behavior stayed identical.

Known gaps

  • Validated against the simulator only. The first on-car session on my 2022 Genesis G70 is next.
  • The Genesis's security gateway lets reads through. Actuator tests and coding need a Hyundai-issued certificate, so they're out of scope by design (V03).
  • Pre-2008 protocols (J1850, K-line) aren't supported yet.

Next

First on-car scan → correct the G70 profile → reverse-engineer the first ten Genesis-specific signals → legacy protocols through an STN adapter → DBC import for decoding broadcast traffic.

Entries35
Active days9
Lanes fed1
Writeups4

Skills it built

Builds Computer Science
35 · 0m

Writeups

2026-11-29First Drive: 36,084 Requests, Zero Missed, and the Bus Flood That Got Me ThereA $30 USB-to-CAN adapter, a Linux laptop and a diagnostic stack I wrote in Rust logged a cold start and two drives in my G70. Every request answered, cross-checked frame for frame by Wireshark. The first attempt filled the car's bus with one frame 9.38 million times.2026-11-15Design: Reading Every Module on a 2022 Genesis, and Where the Security Gateway Draws the LineSince 2018, Hyundai, Kia and Genesis vehicles put a security gateway between the OBD port and the modules. Here's what I expect it to allow, what it blocks, and how I'll test both.2026-11-15A Test Car in Software: Simulating Ten ECUs to Build a Scan Tool Without a CarBefore plugging into a real car, I built one in software: ten modules, live physics, fault codes, and the awkward behaviors real ECUs have. Every feature was proven against it first.2026-11-15ISO-TP in Userspace: Why I Didn't Use the Kernel's CAN_ISOTP SocketLinux ships an ISO-TP socket. I wrote my own anyway, because a diagnostic tool has to see every frame, speak to many ECUs at once, and run the same way on adapters that aren't SocketCAN.

Timeline

2026-11-30Builds
build-33: capture, preflight, email login
notes
Stack: Rust (zero-dep core), pcapng, SocketCAN, Vercel + Neon, Resend Solved: polled live logging to Wireshark-ready pcapng with marks, flood guard and auto back-off; GO/NO-GO preflight; decode fixes from the first scan; email one-time-code login replacing GitHub for users Lesson: prove the method before the test - listen-only on a gateway-isolated port floods it, and ctrlmode sticks until you turn it off
2026-11-30Builds
D/Xcan · 13 commits
notes
- capture: clippy - ci: run the email sign-in tests - can-up: always listen-only off - capture: simulator end-to-end test (directions, marks, pace, summary) - capture: flood test with a bus that repeats one frame forever - email one-time-code login - decode fixes from the first scan - dxc capture + dxc preflight - capture: only real diagnostic refusals trigger back-off - capture: confirm each mark on its own line - capture: the file says why the flood guard stopped it - capture: no empty file left behind when the interface won't open - can-up: works with adapters that refuse restart-ms (SH-C31A)
2026-11-23Builds
D/Xcan · 5 commits
notes
- chore: redeploy to pick up OAuth env - feat: in-app licensing flow + write authorization gate (build-30) - feat: enforce write authorization in the GUI (build-31) - fix: add .js extension to _ca imports so the OAuth functions load under ESM (build-32) - chore: rotate CA key to production key
2026-11-22Builds
D/Xcan · 5 commits
notes
- feat: license activation backend + verify crate (build-28b) - feat: verify example to check a real token from Rust (build-28c) - feat: OAuth account + ownership attestation layer (build-29) - fix: verify example handles WrongType; self-test scripts use a stable key (build-29a) - chore: lock ed25519 deps for the license crate
2026-11-21Builds
D/Xcan · 8 commits
notes
- feat: write-mode v2 safety — reversibility, battery watchdog, audit chain, dry-run (build-22b) - fix: dry-run sends nothing — skip identify/discovery (build-22b-2) - feat: bidirectional actuator tests with auto-return to ECU (build-23) - feat: per-DTC freeze-frame / snapshot reader (build-24) - feat: resolve the standard DTCs that read "Unknown" on the first scan (build-25) - feat(gui): surface write-mode safety — fix routine regression, dry-run, events, audit (build-26) - feat: first-run legal acceptance gate for Write mode (build-27) - feat: per-device fingerprint for licensing (build-28)
2026-11-20Builds
D/Xcan · 2 commits
notes
- feat: interpreter layer — baselines, plain-language verdict, faults vs catalogue (build-22a) - feat: readable identifiers and less report noise (build-22a-2)
2026-11-18Builds
D/Xcan · 1 commit
notes
- feat: code-enforced write guard for protected identifiers (build-21)
2026-11-17Builds
build-20 · Guarded write and service functions
notes
A write framework built so a mistake can't brick a module or lock it out. - write.rs: every write runs preconditions → backup → (security) → write → read-back verify → journal, with one-click undo. Preconditions (stationary, engine off/on, minimum battery voltage) are read from the car first and fail closed when a value can't be read; nothing is sent until they pass. - Security access (0x27) never brute-forces: it computes a key only with a known algorithm for that exact module, sends it once, and stops the instant a module reports exceededNumberOfAttempts (0x36) or requiredTimeDelay (0x37). No manufacturer key algorithms are bundled; only a simulator test algorithm and the trivial zero key ship. - procedures.rs: service functions (battery registration, service mode, coded-feature toggle) as declarative guarded steps, each run through the same gate and journaled. - Simulator: a security-gated, writable body module (coding bytes, battery DID, routines) and a parked variant (speed and rpm zero) so write preconditions pass deterministically. - CLI: `dxc service`, `dxc service run <id>`, `dxc write-did`, `--sim-parked`; all writes need --write and a typed confirmation and print the backup and an undo command. - GUI: Service / write tab with the catalogue, live precondition results, the change journal and per-entry Undo; a run-confirmation dialog. - 57 tests, including guarded write + undo, a wrong key tried only once, a moving vehicle blocking writes, and a full procedure run.
2026-11-17Builds
build-19 · CAN FD diagnostics
notes
- ISO-TP for CAN FD (ISO 15765-2:2016): escape single frames up to 62 bytes, 64-byte first and consecutive frames, 32-bit lengths over 4095, padding to valid CAN FD lengths; reassembly of all of them - CanFrame gains the bit-rate-switch flag and FD length validation - Link FD policy: Off, Auto (classic, answering any ECU that replies in CAN FD in kind) and On (for ECUs that ignore classic frames) - SocketCAN opens in FD mode when the interface is up with `fd on`, sends with BRS; scripts/can-up.sh gains an `fd` mode - slcan: CAN FD frames (d/D/b/B, hex DLC) and the Yn data-bitrate command, for FD firmware such as the CANable 2.0 and DSD TECH SH-C31A - Auto-detect sends CAN FD frames only on a bus where it heard CAN FD traffic (or a SocketCAN interface brought up with fd on): classic controllers treat FD frames as errors - Simulator: ECUs answer in the format they're asked in; a CAN-FD-only variant of the car - CLI --fd / --no-fd and `--sim --fd`; GUI "Simulator (CAN FD)" source - 52 tests
2026-11-17Builds
build-18 · Diagnostics over Ethernet (DoIP) and a wire-level safety test
notes
- DoIP (ISO 13400-2) on std TCP/UDP, so it works on every OS: vehicle discovery by broadcast (limited and link-local), routing activation with protocol version fallback, alive-check answers, diagnostic messages with ack/nack handling and response-pending, functional OBD-II requests - Logical address L is presented as request id L / response id L + 8, so OBD-II, UDS, module scans and the report work unchanged over Ethernet - Module discovery sweeps DoIP logical-address ranges (quick and full); gateways refuse unknown addresses at once, so sweeps stay fast - Auto-detect and `dxc adapters` find DoIP vehicles; CLI --doip [IP|sim]; GUI Ethernet (DoIP) source - Simulated DoIP gateway on localhost in front of the simulated car - Safety: a test records every frame of identify, full module scan, all codes, the full report and a DID sweep, and fails if any state-changing service is sent; DID sweeps in extended session return the module to the default session; the CLI clear prompt explains the readiness reset - README: Ethernet setup, precise safety model - 47 tests
2026-11-17Builds
build-17 · Health report: every value, monitor tests, VIN decode, findings
notes
- Report: one read-only pass collects identity, every supported PID from every OBD-II ECU, mode 06 results, every module's codes (or the J1939 snapshot on heavy vehicles) and the findings drawn from them; JSON export - PID catalog 105 -> 161: MAF A/B, exhaust gas temperatures, engine run time, throttle G and cylinder fuel rate decoded; 50 more standardized PIDs named and shown raw. PIDs with uncertain lengths are read one per request so they can't break a batch; unknown PIDs are never dropped - Mode 06: supported-monitor discovery, SAE J1979 unit/scaling ids (signed ones only where the mapping is certain), monitor and test names, pass/fail on raw counts, misfire counts per cylinder - VIN: offline maker table, region, model year, plant, serial, check digit (mandatory for anything sold in North America) - Findings with evidence: check-engine light, active codes (deduplicated), fuel trims per bank and bank imbalance (warm, closed loop only), charging voltage, overheating and slow warm-up, catalyst temperature, failed monitor tests, misfires, J1939 lamps, oil pressure, DEF level - Simulator: mode 06 with a failing catalyst and a misfiring cylinder; valid simulator VINs - CLI: `dxc report [--json FILE]`. GUI: Health report tab with export - Profiles and logs use the right folders on macOS and Windows - 44 tests
2026-11-17Builds
build-16 · J1939 for trucks, buses, tractors and equipment
notes
- j1939: identifier parsing, 65 common SPNs across 26 parameter groups (SAE J1939-71) with not-available and error states kept distinct - BAM transport protocol reassembly, PGN requests, VIN / component / software identification, DM1 and DM2 codes with lamp status, SPN names and FMI text - Undecoded parameter groups stay visible as raw bytes - Session: when no OBD-II ECU answers, identify() listens for J1939 and fills VIN and component info; j1939_snapshot() works on SocketCAN and slcan - detect: recognises J1939 traffic - Simulated J1939 truck (engine, transmission, cluster, aftertreatment, body controller) with two active codes and one previous code - CLI: `dxc j1939`, `--sim-truck`; US units for fuel economy and volume - GUI: Heavy duty (J1939) tab, simulated truck source; trucks skip the OBD-II module scan - 40 tests
2026-11-17Builds
build-15 · Windows, macOS and Linux packages on GitHub Actions
notes
- .github/workflows/build.yml: tests on every push; build-NN tags package all three systems as run artifacts; vX.Y.Z tags publish a GitHub Release with fixed asset names so /releases/latest/download links never change - Windows: per-user Inno Setup installer (Start menu, optional PATH) plus a portable zip; the app no longer opens a console window behind it - macOS: universal (Apple silicon + Intel) D-Xcan.app in a .dmg, ad-hoc signed until Developer ID signing is set up - Linux: .deb (binaries, menu entry, icon, udev helper) and a tarball - Optional RELEASE_REPO/RELEASE_TOKEN to publish downloads from a public repository while the source stays private - README: download table, first-run notes for SmartScreen and Gatekeeper, how to ship a release
2026-11-17Builds
build-14 · Universal adapter layer with auto-detect
notes
Plug in any supported adapter and press Connect: D/Xcan finds the adapter, the bitrate and the vehicle protocol on its own. - slcan driver: CANable-class sticks as a raw CAN bus on Linux, macOS and Windows (no driver), including listen-only mode for safe bitrate sniffing - Cross-platform serial ports with no crates (stty on Linux/macOS, Win32 comm API on Windows) - ELM327/STN/OBDLink: protocol search (ATSP0 + ATDPN) and pre-CAN protocols (ISO 9141-2, KWP2000, J1850 VPW/PWM) for 1996-2007 cars, with numbered mode 09 frames joined so the VIN reads the same as on CAN - detect: adapters() and autodetect(); listens first, then asks OBD-II on 11- and 29-bit ids at 500k and 250k, then looks for J1939 broadcasts - Session falls back to 29-bit OBD-II automatically - SocketCAN, localtime and SIGPIPE handling gated per OS so the crate builds on macOS and Windows - CLI: auto-detect by default, --slcan, --bitrate, `dxc adapters`; sniff works on slcan through the session's own bus - GUI: Auto-detect (default) and slcan sources, live detection progress, status bar shows the adapter and protocol in use - scripts/can-autoup.sh: udev rule so SocketCAN adapters come up on plug-in - 35 tests, including a full session through a simulated slcan stick and a J1850 car behind an ELM327
2026-11-17Builds
D/Xcan · 7 commits
notes
- feat: J1939 for trucks, buses, tractors and equipment (build-16) - build: Windows, macOS and Linux packages on GitHub Actions (build-15) - feat: diagnostics over Ethernet (DoIP) and a wire-level safety test (build-18) - feat: health report: every value, monitor tests, VIN decode, findings (build-17) - feat: universal adapter layer with auto-detect (build-14) - feat: CAN FD diagnostics (build-19) - feat: guarded write and service functions (build-20)
2026-11-16Builds
D/Xcan · 6 commits
notes
- feat: smog-check readiness, boost gauge, and a UI polish pass (build-09) - chore: track the desktop app lockfile and Zed settings - fix(gui): drawn status marks, chart and odometer precision (build-10) - feat(gui): draggable dividers on every split tab (build-11) - fix(gui): live charts fill their panel without a scrollbar (build-12) - feat(gui): readable fixed-size live charts; Plot only for numbers (build-13)
2026-11-16Builds
v0.1.0 · D/Xcan v0.1.0
2026-11-15Builds
build-13 · Readable fixed-size live charts; Plot only for numbers
notes
Charts no longer shrink to fit: each is a fixed 200 px with a time axis and a bold title showing the current value plus min and max, so two fit the default split and more scroll. Text values (fuel system status, OBD standard…) can't be ticked for Plot any more, since there's nothing to draw. The Poll and Plot column headings explain themselves on hover.
2026-11-15Builds
build-12 · Draggable dividers on every split tab
notes
Live data, Trouble codes, Modules and the DID explorer each split into two areas. Those splits are now resizable panels: drag the line between them to give the charts, the code details, the module list or the watch view more room. Sizes are kept while the app runs. Also makes the outline-dot stroke width an explicit f32, which silences a future-incompatibility warning.
2026-11-15Builds
build-11 · Draggable dividers on every split tab
notes
Live data, Trouble codes, Modules and the DID explorer each split into two areas. Those splits are now resizable panels: drag the line between them to give the charts, the code details, the module list or the watch view more room. Sizes are kept while the app runs. Also makes the outline-dot stroke width an explicit f32, which silences a future-incompatibility warning.
2026-11-15Builds
build-10 · Drawn status marks, chart and odometer precision
notes
The fonts egui bundles have no check mark or bullet glyphs, so readiness monitors, the status bar and verified signals showed empty squares. They're now painted dots: filled when ready or connected, an outline when not. Chart labels use the same per-unit precision as the table (23 mph, not 22.99), and the dashboard shows the odometer in whole miles or kilometres.
2026-11-15Builds
build-09 · Smog-check readiness, boost gauge, and a UI polish pass
notes
Core: insight module turns PID 01 into a readiness summary and an inspection verdict (check-engine light, monitors not ready, federal allowance by model year from the VIN), plus boost/vacuum from MAP minus barometric pressure. Per-unit display precision (whole rpm and degrees, one decimal for pressures and percentages) and local wall-clock time without a date crate. `dxc info` prints readiness and the smog-check verdict. Desktop app: readiness card on the dashboard with every monitor, clickable check-engine line, boost tile with peak hold, tiles that flow to the window width. Trouble codes and text PIDs (fuel system, O2 sensors present, OBD standard) are read on connect. PID 01 shows a one-line summary instead of a sentence that pushed the table off screen. One module picker in the DID explorer, and switching to KWP sets a valid 00-FF range. Status bar keeps the connection visible; messages fade. Log uses local time. Header reads D/Xcan.
2026-11-15Builds
build-08 · D/Xcan brand, docs, hardware guide, screenshots and installer
notes
D/Xcan wordmark and app icon, README with architecture, real dxc screenshots from the simulator, no-solder wiring guide for cheap CANable / MCP2515 adapters, and scripts/install.sh for ~/.local/bin plus a menu entry.
2026-11-15Builds
build-07 · dxc-gui desktop app (egui)
notes
Dashboard tiles, live data with charts and CSV recording, trouble codes across all modules with freeze frames and guarded clearing, modules with decoded signals, DID explorer with watch and save-as-signal into the user profile, cansniffer-style CAN monitor with candump recording. All vehicle I/O on one worker thread; the monitor has its own receiver. Separate package so the core keeps building offline with zero crates.
2026-11-15Builds
build-06 · dxc command line
notes
info, modules (--brief/--quick/--ext), dtc, clear (--write + typed confirmation), live (--csv, --us), signals, did (--watch highlights changing bytes), sweep (22/21, extended session), save-signal, sniff. One ~800 KB static-feeling binary with no runtime dependencies.
2026-11-15Builds
build-05 · Simulated Genesis-like vehicle, vehicle profiles, ELM327 link, end-to-end tests
notes
Ten simulated modules with live drive-cycle physics, OBD + UDS, fault codes, a gateway that refuses 0x14 on some modules and an airbag module that answers 0x78 first. JSON vehicle profiles with declarative signal decoding and user overrides in ~/.config/dxcan. ELM327/OBDLink support over a raw serial line. Session ties it all together; the stack tests run it frame by frame.
2026-11-15Builds
build-04 · ISO 14229 client, module discovery and DID sweeper
notes
UDS session control, tester present, 0x22 DIDs, KWP 0x21 local IDs (common on Hyundai/Kia), 0x19 DTC reads with status bits, guarded 0x14 clear, full NRC table and 0x78 response-pending handling. Discovery sweeps 11-bit (and optional 29-bit) request addresses with a harmless 10 01. Read-only DID sweeps keep 'exists but locked' answers and diff bytes between reads.
2026-11-15Builds
build-03 · J1979 client, 105 PID decoders and DTC codec
notes
Supported-PID discovery across the 0x00..0xA0 bitmap chain, 6-PID batched polling with single-PID fallback, freeze frames, stored/pending/permanent codes, mode 04 clear, mode 09 VIN and calibration IDs. OBD and UDS (3-byte + status) DTC formats with a generic description database, loaded by a small strict JSON parser so the core stays dependency-free.
2026-11-15Builds
build-02 · DiagLink request/response layer and simulated CAN bus
notes
DiagLink abstracts 'send a request, get the response' over any raw bus: physical transact, functional broadcast (0x7DF) collecting every ECU's answer, address probing for discovery and an optional per-frame trace. SimBus runs ISO-TP-speaking virtual ECUs in-process for tests, plus passive monitor taps.
2026-11-15Builds
build-01 · CAN frame type, SocketCAN transport and userspace ISO-TP
notes
SocketCAN through raw AF_CAN syscalls with no crates (classic + FD framing, kernel filters, interface listing). ISO-TP segmentation/reassembly in userspace so every frame can be traced: single/first/consecutive frames, flow control with BS/STmin, sequence wrap, multi-source reassembly.
2026-11-15Builds
Smog-check readiness and boost gauge: the first features that answer a question instead of showing a number
2026-11-15Builds
Desktop app runs end to end against the simulator: dashboard, trouble codes, modules, DID explorer, CAN monitor
2026-11-15Builds
Rewritten in Rust before the first release: zero-dependency core, one ~800 KB binary, every test ported first
2026-11-15Builds
Prototype built in Python against a 10-module simulated Genesis: ISO-TP, OBD-II, UDS, module discovery and identifier sweeps
2026-11-15Builds
D/Xcan · 9 commits
notes
- feat(link): DiagLink request/response layer and simulated CAN bus - feat(core): CAN frame type, SocketCAN transport and userspace ISO-TP - feat(obd): J1979 client, 105 PID decoders and DTC codec - feat(uds): ISO 14229 client, module discovery and DID sweeper - feat(sim): simulated Genesis-like vehicle, vehicle profiles, ELM327 link, end-to-end tests - feat(cli): dxc command line - feat(gui): dxc-gui desktop app (egui) - build: D/Xcan brand, docs, hardware guide, screenshots and installer - fix(gui): borrow error on the Live toggle, explicit f32 plot width
D/Xcan