[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] OBD data, suitable for GPSd inclusion?

From: Derek LaHousse
Subject: [gpsd-dev] OBD data, suitable for GPSd inclusion?
Date: Mon, 25 Jun 2012 08:28:42 -0400

Hello, GPSd developers.

I'd like your opinion on whether gpsd should support OBD data from
automobiles, or if it would be okay to create an obdd in gpsd's image.

Cars (in the US at least) made in the last decade have an OBDII port,
where a technician can read error codes and clear them.  It also allows
a device to ask for the speed, pedal positions, air temperature, etc.
See for more.  The interface
to the car is (sometimes) an Elm327-compatible device which converts the
variety of OBD protocols to a serial connection.

I connect the Elm327 to the car OBDII and to my computer's serial port.
My computer asks the serial port "01 0D".  Some short time later, it
receives "41 0D 20".  This exchange was me asking for my vehicle speed,
and the car responding "You asked for mode 01 (41), for speed (0D), and
the response is 32 km/h (20)."

This interaction has a few important characteristics.
- It's a serial connection, only one program can connect to it at a time
- It's polled, and can be provided more than 1 Hz.
- The more a program asks for, the less frequently it gets any
individual datum.
- It's ASCII-coded hex values which must be looked up for their meaning

Since it's from a serial device, this prompted me to think of a muxing
program, like the early gpsd.  However, the set of data is really a far
cry from TPV.  Because it's a polled connection, would a mux have to
plan when it asks?  Should a client subscribe at some rate, and let the
muxer handle the scheduling?

Current examples of obd consuming programs are "obdgpslogger" or
"scantool".  In obdgpslogger's case, it connects to the Elm327 serial
and to gpsd, and logs speed, throttle position, airflow, and engine RPM
along with the position from gpsd.  I believe it uses the timing from
gpsd to do the obd requests.  I'm unfamiliar with scantool at the

I would like to write an obdd server, where clients might use a libobd
to subscribe to data streams.  I expect there is much reuse possible of
gpsd code.  I ask for your comments and suggestions.

Derek LaHousse

reply via email to

[Prev in Thread] Current Thread [Next in Thread]