A Rust CLI tool for communicating with the Ford Fusion 2017 SEL via OBD-II. It performs diagnostics and configuration through FORScan-compatible adapters using CAN bus protocols (HS-CAN + MS-CAN).
Named in tribute to Michael Faraday, whose work on electromagnetism underpins all electrical/CAN communication in vehicles. The project aims to partially replace FORScan for scriptable, version-controllable automotive operations while serving as a deep exercise in automotive protocols.
- Standard diagnostics β Read DTCs, live data, and vehicle information via SAE J1979
- Proprietary reads β Read "as-built" data and Ford-specific DIDs via UDS (ISO 14229)
- Configuration writes β Modify as-built blocks with Security Access, including mandatory snapshots and rollback capability
- Scriptable operations β Replace manual FORScan workflows with version-controllable CLI commands
- Reusable library β Produce a decoupled
faraday-corelibrary for other projects
Target Vehicle: Ford Fusion 2017 SEL (Brazilian/Mercosur market, assembled in Hermosillo)
Supported Adapters:
- Primary: Vgate vLinker FS (USB/Bluetooth variants)
- Compatible: OBDLink EX, ELS27 with STN chips
CAN Bus Architecture:
- HS-CAN (500 kbps): PCM, TCM, ABS, RCM, PSCM - pins 6/14
- MS-CAN (125 kbps): BCM, IPC, APIM, HVAC, DSM, PAM - pins 3/11
The project follows a strict 5-layer architecture:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLI Layer (faraday-cli) β Command parsing with clap β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Command Layer β High-level operations β
β ReadDTCs, ReadAsBuilt, WriteAsBuilt, etc. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Protocol Layer β J1979 (OBD-II) + UDS (ISO 14229) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Transport Layer β ISO-TP (ISO 15765-2) over CAN β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Link Layer β ELM327 AT commands and SocketCAN β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Understanding Ford vehicle diagnostics requires knowledge of various automotive protocols, bus architectures, and diagnostic concepts. The following documentation provides detailed explanations of the technical terms and concepts used throughout this project:
- DTCs - Diagnostic Trouble Codes: standardized fault codes stored in vehicle modules
- As-Built - Configuration data that defines vehicle feature behavior and settings
- DIDs - Data Identifiers used to access specific data within vehicle modules
- UDS - Unified Diagnostic Services (ISO 14229): advanced diagnostic protocol
- FORScan - Popular Ford diagnostic software and its relationship to Faraday
- Adapters - OBD-II adapters and their differences, compatibility requirements
- Device Detection - Guide for identifying and configuring OBD-II adapter device paths
- HS-CAN - High-Speed CAN bus: powertrain modules (PCM, TCM, ABS, RCM, PSCM) via pins 6/14
- MS-CAN - Medium-Speed CAN bus: body control modules (BCM, IPC, APIM, HVAC, DSM, PAM) via pins 3/11
Each document is written specifically for the Ford Fusion 2017 SEL context and explains how these concepts apply to the Faraday project's implementation.
faraday/
βββ Cargo.toml # [workspace]
βββ crates/
β βββ faraday-core/ # Core library: link + transport + protocol + commands
β βββ faraday-cli/ # CLI binary (clap), produces `faraday` executable
β βββ faraday-asbuilt/ # As-built blocks catalog (data-only)
β βββ faraday-tui/ # Live data viewer (ratatui)
β βββ faraday-emu/ # PTY-based ECU emulator, produces `faraday-emu` executable
βββ docs/SPEC.md # Technical specification
# Capture an as-built snapshot before making changes
faraday --adapter /tmp/faraday-dev asbuilt snapshot --module bcm
faraday --adapter /tmp/faraday-dev asbuilt snapshot --module bcm --output ./my_backup.json
# Preview a write without touching the vehicle (dry-run)
faraday --adapter /tmp/faraday-dev asbuilt write --module bcm --feature drl_enabled --value true --dry-run
# Write a feature value (auto-captures snapshot, prompts for confirmation)
faraday --adapter /tmp/faraday-dev asbuilt write --module bcm --feature drl_enabled --value true
faraday --adapter /tmp/faraday-dev asbuilt write --module ipc --feature speed_units --value mph --yes
# Restore all blocks from a snapshot file
faraday --adapter /tmp/faraday-dev asbuilt restore ~/.local/share/faraday/snapshots/bcm_2026-05-10T14-30-00Z.jsonSupported value formats:
- Boolean features:
true/false,on/off,1/0,enabled/disabled - Enumerated features: value name (case-insensitive) or numeric key
- Numeric features: integer within the feature's defined range
Each write appends an entry to ~/.local/share/faraday/audit.jsonl.
Write Operation Safety:
- Mandatory snapshots before any write operation
- Validation against known blocks in
faraday-asbuilt - Block writes to programming DIDs (
F1xx,F0xx) --dry-runmode required for real writes- Double confirmation for configuration changes
- Audit logging in
~/.local/share/faraday/audit.jsonl
Operational Requirements: Configuration writes should only occur with:
- Engine off, ignition in KOEO (Key On Engine Off)
- Battery voltage β₯ 12.4V
- No active communication DTCs
CLI commands: read-dtc, clear-dtc, live <pids>, vin
- Status: Complete and functional
CLI commands: read-did --module <module> <did>, session --module <module> extended
- Status: Complete with full UDS implementation
CLI commands: asbuilt dump --module <module>, asbuilt show --module <module> --feature <feature>
- Status: Complete and functional
- Core library: β
faraday-asbuiltcrate with full decoding and DID mapping - CLI commands: β
asbuilt dumpandasbuilt showimplemented - MS-CAN support: β Automatic CAN bus switching per module
CLI commands: asbuilt write, asbuilt snapshot, asbuilt restore
- Protocol support: β UDS 0x27 (SecurityAccess) + 0x2E (WriteDataByIdentifier)
- Seedβkey algorithm: β Ford FORScan configuration-access algorithm (requires hardware validation)
- Feature-level writes: β
asbuilt write --module bcm --feature drl_enabled --value true - Snapshots: β
Auto-captured before each write;
asbuilt snapshot --module bcm - Rollback: β
asbuilt restore <snapshot.json> - Dry-run: β
--dry-runshows diff without touching the vehicle - Audit logging: β
~/.local/share/faraday/audit.jsonl(JSONL, one entry per operation) - Safety guards: β
Programming DID block (
F0xx/F1xx), interactive confirmation,--yesfor scripts
Live data TUI, YAML profiles, structured logging, documentation
- Live data TUI: β
Complete (
faraday-tuifully functional) - YAML profiles: β
faraday profile apply my-fusion.yml/faraday profile validate - Structured logging: β
Per-command session JSONL (
~/.local/share/faraday/sessions.jsonl) + audit log - Documentation: β Complete and comprehensive
Phase 6: Comprehensive Hidden Diagnostic TUI β
Transform faraday-tui from a basic 5-PID viewer into a professional multi-tab diagnostic interface covering all major vehicle systems reachable via HS-CAN and MS-CAN.
- Tab-based navigation (number keys
1β9, arrow keys) - Real-time status bar with connection state, battery voltage, and update rate
- Context-sensitive help per tab
- Pause/resume (
p), data reset (r)
Standard OBD-II extensions (PIDs 0x06β0x62):
- Short/long-term fuel trim (both banks)
- Ignition timing advance
- O2 sensor voltages and fuel-air equivalence ratio
- EGR commanded position and error
- Engine fuel rate Β· driver demand torque Β· actual torque
- Ford-specific: cylinder misfire counters Β· engine oil life (UDS DIDs)
TCM UDS reads:
- Current gear vs. commanded gear
- Transmission fluid temperature
- Torque converter slip %
- Shift solenoid status grid (color-coded)
- Line pressure
BCM UDS reads:
- Battery voltage under load Β· alternator duty cycle
- Door ajar bitmask with per-door ASCII diagram
- Lighting circuit health table
- HVAC blower actual vs. commanded speed
ABS and RCM UDS reads:
- Wheel speeds FL/FR/RL/RR
- Yaw rate and lateral acceleration
- Airbag squib continuity and seatbelt bitmask
PAM UDS reads:
- Eight ultrasonic sensor distances visualized as proximity gauges
- Backup camera status
- Object detection confidence
HVAC UDS reads:
- Driver/passenger cabin temps (dual-zone)
- Blend door actual vs. commanded %
- Evaporator temp Β· refrigerant pressure Β· AC compressor load
APIM UDS reads:
- GPS fix quality and satellite count
- Cellular RSSI and Bluetooth device count
- Software version string for all polled modules
In-session computed from live data:
- RPM histogram (idle / cruise / high-load bands)
- Speed distribution
- Estimated fuel consumption (PID
0x5E) - Brake and acceleration event counts
Cross-module status table:
- Last response time per module
- Consecutive timeout count
- Module voltage (where available)
- Software version
- New
panels/module tree insidefaraday-tui(one file per tab) - Per-panel polling intervals (250 ms engine PIDs β 5 s infotainment)
- Graceful degradation: timed-out modules show
[N/A], TUI never panics - Extended PID catalog in
faraday-core::protocol::j1979(PIDs0x06β0x62)
Navigation: 1β9 jump to tabs Β· β/β cycle Β· p pause Β· r reset Β· q quit
- Vehicle-specific: Currently supports only Ford Fusion 2017 SEL
- No firmware reprogramming: UDS Modes 34/36 are out of scope (high risk)
- CLI/TUI only: No GUI planned
- Experimental: Use at your own risk - always create snapshots before modifications
faraday-emu is a standalone process that creates a virtual serial port (PTY) and speaks the full ELM327/STN text protocol. It exercises the complete 5-layer stack β including VLinkerFs, baud rate configuration, and AT/STN command parsing β identical to a real adapter. No OBD-II adapter or vehicle connection is required.
# Terminal 1 β start the emulator (prints slave device path, creates symlink)
faraday-emu --link /tmp/faraday-dev
# Terminal 2 β connect as if it were real hardware
faraday --adapter /tmp/faraday-dev vin
faraday --adapter /tmp/faraday-dev read-dtc
faraday --adapter /tmp/faraday-dev live 0C,05,0D
faraday --adapter /tmp/faraday-dev read-did --module pcm F190
faraday --adapter /tmp/faraday-dev session --module pcm extendedOmit --link to use the raw /dev/pts/N path printed on stdout. The emulator removes the symlink automatically on Ctrl-C or SIGTERM.
Simulated values:
| Data | Value |
|---|---|
| VIN | 1FA6P8TH5H5123456 |
| Engine RPM | 800 rpm |
| Coolant temp | 65 Β°C |
| Stored / pending / permanent DTCs | None |
| Control module voltage | 14.26 V |
- Rust 1.70 or higher
- Cargo (included with Rust)
The project includes a Makefile for common development tasks.
Run make help to see available targets.
make helpCommon commands:
make build: Build the project (dev)make release: Build the project (release)make test: Run tests with all featuresmake fmt: Format code using rustfmtmake clippy: Run clippy lintermake doc: Build and open documentationmake clean: Clean build artifactsmake check: Check dependencies
If you prefer using cargo directly:
- Build:
cargo build --release - Test:
cargo test --all-features - Format:
cargo fmt - Lint:
cargo clippy -- -D warnings - Documentation:
cargo doc --no-deps
This project is licensed under either of: