Ruby, OBDLink SX and other OBD II Adapters

ScanTool released the OBDLink SX as a simple wired
connector from your laptop to the OBD II port found on cars
after about 1996. However, the support for OS X and Linux is
missing and ScanTool does not offer a software development kit
for this product. This page is about an experiment to connect
my Mac, via the OBDLink SX, to a 1998 Ford Escort Wagon.

Ford's Motorcraft Technical Resources Home Page has
overviews available and subscriptions for on-line
access to more detailed data. Their link to manual vendor,
Helm Inc.,
is one source for the DVD I used in lieu of a subscription.
The DVD only works on Windows and the user interface could
use improvements -- but that is another topic.

Ruby is included with OS X and probably is also already
on your Linux distribution.

This first experiment is just a wrapper around
the ELM AT and OBD commands. I gave names to some of the commands.
Since my car is too old for CAN "stuffing" I added a small facility
to ask for more than 1 PID at a time. Ruby is quite convenient for
this sort of string processing application. minirap.rb
is just the essentials of communicating with the OBDLink SX with
Ruby.

The original rap.rb was a
command line tool. Adding GUI gauges did not seem interesting at the time.
However, for observing the rate of change of oxygen sensors a picture may
well be worth a thousand words. The more recent version of
rap.rb also serves the file
http://localhost:8090/oxygensensor.html
(or alternatively: http://localhost:8090/rap)
which is a Javascript, HTML5 canvas program that gets
the data from rap.rb in JSON format.