Getting ODB2 (OBD-II) car scanner working in Linux
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Getting ODB2 (OBD-II) car scanner working in Linux
I have a cheap USB ODB2 scanner that I got off ebay straight from Hong Kong. I'd like to use it get get the check engine light codes from my car. It has no brand or any other info, so I'm not sure what kind of chip it has. Do nghost and other Linux OBD2 software usually have the drivers for most OBD2 scanners included, or do you need to get them separate? If they're separate, how would I go about finding the drivers for my scanner?
Your most promising option is to find out if your USB device can be used as a character device. There may be drivers linux drivers under the usbserial category, the most common being ftdi, but sometimes the generic one works as well.
Note that you may have to edit source code to deal with the fact that you are using a usb-serial device rather than a true serial device (read the mailinglist/forums).
I am looking at buying some OBD2/EOBD software and would like to run in on my Linux Acer notebook. Have tried ScanTool.net.1.23 on windows and it worked well. Would like to know how you got on with the software interface you bought.
Two things that might be useful:
First, google for "obdgpslogger". That's my pet project for about the last year, and it does OBDII Linux stuff.
Second, to get the trouble codes out is easy by hand. Your device is probably an ftdi device, so linux will probably magically recognise it out of the box, and create /dev/ttyUSB0 or similar.
You can open that with your favorite serial terminal [I like screen: "screen /dev/ttyUSB0"]. If all goes well, you can type "03" and hit enter, and see the trouble codes in Hex. They're easy to decode; google for "elm electronics", go to their products, datasheets, and download the one for ELM327. Instructions on decoding trouble codes is on page 26.
My apologies for telling you to google stuff and this post being a bit terse; this is my first post to these forums. The first time I wrote up a big thing but the forum ate it because it contained urls, here's hoping this one's briefer.
Hopefully that's helpful. One thing to add is that the ubuntu 9.10 FTDI driver can be buggy; if you run into problems with garbage on your console and you know you have the right baudrate, it might be that. I wrote a userland ftdi<->pty proxy that neatly sidesteps the problem; if you download obdgpslogger and have libftdi-dev installed when you build it, you'll get "obdftdipty" built as part of it. Run that, and you'll be given a pty to use instead of /dev/ttyUSB{something}. The rest of the instructions are the same.
Gary (-;
Last edited by chunkyks; 01-01-2010 at 11:09 PM.
Reason: clarifications
Thanks for this help, appologies for not getting back to you earlier Christmas and mechanical tasks on another vehicle got in the way. I will try what you suggest and let you know how I get on. It might be a while before I get to this job, usual problem when you fix something you skip onto the next task. I appreciate your efforts.
Best regards
Dave
Quote:
Originally Posted by chunkyks
Two things that might be useful:
First, google for "obdgpslogger". That's my pet project for about the last year, and it does OBDII Linux stuff.
Second, to get the trouble codes out is easy by hand. Your device is probably an ftdi device, so linux will probably magically recognise it out of the box, and create /dev/ttyUSB0 or similar.
You can open that with your favorite serial terminal [I like screen: "screen /dev/ttyUSB0"]. If all goes well, you can type "03" and hit enter, and see the trouble codes in Hex. They're easy to decode; google for "elm electronics", go to their products, datasheets, and download the one for ELM327. Instructions on decoding trouble codes is on page 26.
My apologies for telling you to google stuff and this post being a bit terse; this is my first post to these forums. The first time I wrote up a big thing but the forum ate it because it contained urls, here's hoping this one's briefer.
Hopefully that's helpful. One thing to add is that the ubuntu 9.10 FTDI driver can be buggy; if you run into problems with garbage on your console and you know you have the right baudrate, it might be that. I wrote a userland ftdi<->pty proxy that neatly sidesteps the problem; if you download obdgpslogger and have libftdi-dev installed when you build it, you'll get "obdftdipty" built as part of it. Run that, and you'll be given a pty to use instead of /dev/ttyUSB{something}. The rest of the instructions are the same.
Codes are really of little use to a service tech. A more complete scan tool would find reasons instead of "hard" codes. Sure you can guess but if you want simple go to autozone and ask them to tell you the codes.
Better still take it to the dealer and get it scanned and request the report.
Two things that might be useful:
First, google for "obdgpslogger". That's my pet project for about the last year, and it does OBDII Linux stuff.
Second, to get the trouble codes out is easy by hand. Your device is probably an ftdi device, so linux will probably magically recognise it out of the box, and create /dev/ttyUSB0 or similar.
You can open that with your favorite serial terminal [I like screen: "screen /dev/ttyUSB0"]. If all goes well, you can type "03" and hit enter, and see the trouble codes in Hex. They're easy to decode; google for "elm electronics", go to their products, datasheets, and download the one for ELM327. Instructions on decoding trouble codes is on page 26.
My apologies for telling you to google stuff and this post being a bit terse; this is my first post to these forums. The first time I wrote up a big thing but the forum ate it because it contained urls, here's hoping this one's briefer.
Hopefully that's helpful. One thing to add is that the ubuntu 9.10 FTDI driver can be buggy; if you run into problems with garbage on your console and you know you have the right baudrate, it might be that. I wrote a userland ftdi<->pty proxy that neatly sidesteps the problem; if you download obdgpslogger and have libftdi-dev installed when you build it, you'll get "obdftdipty" built as part of it. Run that, and you'll be given a pty to use instead of /dev/ttyUSB{something}. The rest of the instructions are the same.
Gary (-;
chunkyks;
Were you able to get the raw data? I am working on a project and am currently trying to just simply get the OBD2 raw data with no interface and am failing in able to do so. Could point me to some good sources or aid in this in any way?
What do you mean by "no interface" You need an ODB2 tool or hardware of some sort to convert the signals into something compatible with a computer.
Sorry, what I mean is I have a hardware interface but on the computer side of this all I have is a linux box but want to get the raw data from my serial console.
I would expect the output to be a binary format. I have no experience using this utility and no idea what distribution/desktop you are running but this is something that could be useful: http://sourceforge.net/projects/serlook/
If the output is ASCII data then minicom would work too.
I would expect the output to be a binary format. I have no experience using this utility and no idea what distribution/desktop you are running but this is something that could be useful: http://sourceforge.net/projects/serlook/
If the output is ASCII data then minicom would work too.
Sorry, I am using Ubuntu 10.4 and the device is the AutoTap OBDII Streamer. I tried minicom but did not seem to see anything or be able to input any commands.
The device you have isn't ASCII to communicate with, you won't have much luck with minicom [or screen, which is a much better serial terminal than minicom for normal human usage].
The protocol description for your device is here: http://www.bb-elec.com/bb-elec/liter...onse_V1_17.pdf. Very simple serial protocol, a proof of concept to "just see if I can communicate with it" would be twenty lines of C.
It would be easy to write an obdsim plugin if you wanted to communicate with "real" OBDII software, but be warned that there aren't many parameters that it has that are also in base OBDII spec; this is clearly a device intended to make managing fleets easier, rather than a device for consumers to play around with their cars.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.