Top Banner
When the Rubber Hits the Road: Making Your Computer Talk to Your Car Gary “Chunky Ks” Briggs <[email protected]>
15

When the Rubber Hits the Road: Make Your Computer Talk to Your Car

Jul 07, 2015

Download

Automotive

LAAOS

Gary Briggs discusses the what's and hows of his Open Source Automotive hit, OBDLogger
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

When the Rubber Hits the Road:Making Your Computer Talk to Your Car

Gary “Chunky Ks” Briggs<[email protected]>

Page 2: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

Slides Overview

Me

OBDGPSLogger

ELM327 and OBDII

OBDSim

Demo

Page 3: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

MeGrew up & Studied in England

Offered job in LA doing random Linux stuff

Which ended up being print drivers for 6 years

Now I work at a research nonprofit in Santa Monica

Mostly simulation and modeling

Really, this slide is so I havesomewhere to put this pic --->

Page 4: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

OBDGPSLogger Genesis

Late 2009, I bought a car with an OBDII port

That's mighty tempting

Idealist requirements:

Linux, OSX. Windows maybe

Log data

No GUI. RasberryPi, SheevaPlug...

Log GPS as well as OBDII

Make pretty pictures

Page 5: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

OBDGPSLogger Now

http://icculus.org/obdgpslogger

“It does exactly what it says on the tin. It logs OBDII and GPS data on Linux, OSX and others”

Mostly C, bits of C++

Open Source

Logs to SQLite

Hokey GUI

Page 6: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

OBDGPSLogger in Google Earth

Page 7: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

OBDGPSLogger, Still...

Reads only Mode $01 PIDs

Magically just works

Except I haven't patched in support for current gpsd

Google Earth output

There's a live version, too

Simple analysis stuff

Works with my bike...

Page 8: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

ELM327 and OBDII

Originally invented at Elm Electronics, http://elmelectronics.com/obdic.html#ELM327

Most of the high-quality manufacturers implement their own chip firmware

The ELM327 datasheet taught me most of what I know

Page 9: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

ELM327 and OBDII, AT commands

Standard text-based serial protocol

I use PuTTY on Windows, screen(1) on Linux

ELM327 commands might look suspiciously familiar to older members of the audience

ATZ for reset

ATE0/1 to turn echo on or off

Scantool.net have an additional “ST” command set

Page 10: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

ELM327 and OBDII, Getting Data

In short:

> 01 0D

41 0D 1F

>

“Show me mode $01, PID $0D” [vehicle speed]

41 => 0x40 | 0x01

0x40 = success, 0x01 = requested mode

0D => requested PID

Page 11: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

OBDSim Genesis

Got bored of walking out to car with my laptop

Went looking for ELM327 & OBDII simulator

Idealist requirements:

Command-line

OBDGPSLogger log playback

Actually honors ELM327 commands

Multiple ECUs

Multi protocol support

Page 12: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

OBDSim Now

http://icculus.org/obdgpslogger/obdsim.html

Pluggable data generators

Works with all OBDII tools I've tried

In the same source as OBDGPSLogger

Has way more users than OBDGPSLogger

Native Windows [MSYS] using com0com

Page 13: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

OBDSim Supported AT commands

ATAT{0,1,2} – Adaptive timing

ATD{0,1} – Display data bytes

ATL{0,1} – Linefeed

ATH{0,1} – Headers

ATS{0,1} – Space separators

ATE{0,1} – Command echo

ATSP[A]{0-9,A-C} – Set protocol

ATST{n} – Set timeout

@1, @2, @3 – Device identifier stuff

Cvdddd – Calibrate battery voltage

RV – Request battery voltage

ATD – Reset defaults

ATDP – Describe protocol

ATDPN – Describe protocol by number

ATI – Request device version id

ATZ – Reset device

ATWS – Warm start reset

EXIT – Exit OBDSim

Page 14: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

OBDSim Demo

Launch on Linux, use “-c” to attach screen(1):

obdsim -c

ATZ, total reset

ATE{0,1}, ATS{0,1}, ATL{0,1}

As a developer, you'll turn them all off

For keyboard experimenting, turn them all on

ATI, @1, @2 for identifying device

Couple simple data requests [010D vss, 010C rpm]

ATH1, ATSP7 [CAN 29-bit 500], ATSP1 [J1850]

Page 15: When the Rubber Hits the Road: Make Your Computer Talk to Your Car

That's all, Folks