Skip to content
brendanwhitfield edited this page Nov 26, 2014 · 11 revisions

Welcome to python-OBD

Installation

Run the following command to download/install the latest release from pypi:

$ pip install obd

Connecting

After installing the library, simply import 'obd', and create a new OBD connection object. By default, python-OBD will scan for Bluetooth and USB serial ports (in that order), and will pick the first connection it finds. The port can also be specified manually by passing a connection string to the OBD constructor. You can also use the scanSerial helper retrieve a list of connected ports::

import obd

connection = obd.OBD() # create connection object

# OR

connection = obd.OBD("/dev/ttyUSB0") # create connection with USB 0

# OR

ports = obd.scanSerial()       # return list of valid USB or RF ports
print ports                    # ['/dev/ttyUSB0', '/dev/ttyUSB1']
connection = obd.OBD(ports[0]) # connect to the first port in the list

Docs have been moved to python-obd.readthedocs.org

Clone this wiki locally