obd2-bt.md 1.0 KB


title: Connect an OBD2 Adapter via Bluetooth categories: [cheatsheets] tags: [automotive]


Connect an OBD2 Adapter via Bluetooth

We are using bluetooth to connect a linux machine to an obd2 (ELM 327) adapter.

Instructions

  1. Install the necessary bluetooth dependencies (bluetoothctrl, bluez)

  2. Connect to the device using 'bluetoothctl'

    > bluetoothctl
    > help
    > scan on
    > devices
    Device <device-mac>
    > pair <device-mac>
    > trust <device-mac>
    > connect <device-mac>
    

if the connection is not working and no serial interface is available (e.g. /dev/rfcomm0), use the following command to create the serial interface:

rfcomm bind hci0 <mac-addr>

use /dev/rfcomm0 with pyobd:

import obd
connection = obd.OBD('/dev/rfcomm0')

Have fun!

Resources

https://theksmith.com/software/hack-vehicle-bus-cheap-easy-part-1/
http://pinoutguide.com/CarElectronics/volkswagen_obd2_pinout.shtml
https://www.autopi.io/blog/discover-hidden-functions-in-your-car-with-can-bus/