#obd2

obd2

Utility for reading data from a vehicle over OBD-II

4 releases

0.2.0-pre3 May 21, 2023
0.2.0-pre2 May 16, 2023
0.2.0-pre1 May 15, 2023
0.1.0 May 15, 2023

#935 in Hardware support

Download history 1/week @ 2023-11-10 5/week @ 2023-11-17 4/week @ 2023-11-24 9/week @ 2023-12-01 5/week @ 2023-12-08 5/week @ 2023-12-15 9/week @ 2023-12-22 4/week @ 2024-01-05 4/week @ 2024-01-26 6/week @ 2024-02-02 7/week @ 2024-02-09 146/week @ 2024-02-16

163 downloads per month

MIT/Apache

340KB
699 lines

obd2

This library provides a user-friendly interface to automatically configure an ELM327 OBD-II to UART interface through an FTDI UART to USB interface (the entire setup is easily available online as an OBD-II to USB interface), and then send commands and receive data from a vehicle.

Usage

use obd2::{commands::Obd2DataRetrieval, device::Elm327, Obd2};

fn main() -> Result<(), obd2::Error> {
    let mut device = Obd2::<Elm327>::default();
    println!("VIN: {}", device.get_vin()?);
    Ok(())
}

See the docs for more: https://docs.rs/obd2/


lib.rs:

Crate for communicating with OBD-II (on-board diagnostics) interfaces on cars

Currently only the ELM327 is supported (many cheap USB to OBD-II devices you can buy online are compatible with the ELM327). The high-level data retrieval functions can be found in commands::Obd2DataRetrieval.

Usage

use obd2::{commands::Obd2DataRetrieval, device::Elm327, Obd2};

fn main() -> Result<(), obd2::Error> {
    let mut device = Obd2::<Elm327>::default();
    println!("VIN: {}", device.get_vin()?);
    Ok(())
}

Dependencies

~3.5–5.5MB
~92K SLoC