Utility for reading data from a vehicle over OBD-II
Find a file
Nicholas Orlowsky c1cea1e488
Serialport Support
- allow communication to elm327 device via a serialport
- allow creation of elm327 device without requiring unwrap()
- added some extra documentation
- expose reset() functionality of device
- serial_comm and ftdi_comm abstractions added
2025-05-23 20:40:30 -04:00
docs Add ELM327 datasheet 2023-05-20 00:27:26 -04:00
examples/basic Serialport Support 2025-05-23 20:40:30 -04:00
src Serialport Support 2025-05-23 20:40:30 -04:00
.gitignore Switch to a library and move main to an example 2023-05-14 23:41:18 -04:00
Cargo.toml Serialport Support 2025-05-23 20:40:30 -04:00
LICENSE Add GPL License 2025-05-09 00:40:50 -04:00
README.md Serialport Support 2025-05-23 20:40:30 -04:00

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, FTDIDevice}, Obd2};

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

alternatively, you could use a serial port provided by your operating system such as /dev/ttyUSB0 on unix-like systems

let mut device = Obd2::new(Elm327::new(SerialPort::new("/dev/ttyUSB0")?)?)?;

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