Sam Hobbs ·
My car has been a real pain recently: it has a recurring error code that the garage can't seem to fix (apparently, it's a fault in the air conditioning, but the car doesn't even have air con!). Taking the car to the garage to get the code cleared means I lose the car for a day, which is getting annoying.
So, I decided to buy myself a USB connecter for the car's On Board Diagnostics (OBD) and see if I could get it working with Linux (specifically Kubuntu, but I doubt it matters). I was pleased to find that there was some decent Free Software available for Linux called Scantool that enabled me to read and clear the codes on my car.
Here's how to install and use the software, and some screenshots...
What is an OBD Connector and Where to get one
Since 2004, the EU has required all cars to have a compatible connector for On Board Diagnostics. In 2007, the regulations were updated and now require all cars to have an OBD-II connector within 0.61m of the steering wheel, which makes it easily accessible. My boring old 2004 Ford Fiesta has one behind a little flap under the steering wheel.
OBD connectors come in USB and bluetooth variants, and you can pay through the nose for a fancy one or go with a cheap chinese knock-off. I opted for a generic £6 USB model from Amazon, which took ages to arrive but worked fine.
Installing scantool
Installation for this one is really simple: it's in the Ubuntu Universe section. Install with these commands:
sudo apt-get update sudo apt-get install scantool
The software needs to access the OBD device, which is found at /dev/ttyUSB0
. This is owned by root with the group dialout
, so the proper way to run the scantool software is to add your user to the dialout group, e.g.:
sudo usermod -a -G dialout sam
When researching before trying the software out, I noticed someone recommending you run scantool with root so that it can read the device. While running it with sudo
would work, it violates the principle of least privilege: scantool doesn't need superuser privileges to run, it just needs to be able to read the OBD interface. Running it as root is lazy - don't do it!
Usage / Screenshots
To make the changes to your groups take effect, you need to either log out and back in, or you can use the newgrp
command, which will let you use the new group straight away by changing your group ID to the one you specify, in this case dialout:
newgrp dialout
Then check you are in the dialout group:
groups
(You should see dialout as one of the groups in the list).
Now turn the ignition on, and then launch scantool:
scantool
You should see the main menu:
If you select "read codes" now you will see the error codes along with explanations of what they mean (the codes are standard, but sometimes manufacturers have non-standard meanings, so you may get more than one explanation for each code):
If you know what the code means and you are sure you want to clear it, you can select clear. Obligatory warning: I am not a mechanic. If you're not sure what the codes mean, ask a mechanic, and don't clear it unless you're sure it's OK.
Back to the main menu, and choose sensor data to see realtime readouts from the sensors on the car (the car needs to be running for this to work):
The tests option isn't implemented in this build, but the software still does more than enough to be useful!
Comments
Terry · Permalink
Bluetooth Chip
One would assume this will work with the bluetooth version also?
Sam Hobbs · Permalink
I'm not sure, I didn't see
I'm not sure, I didn't see any option for Bluetooth pairing, but maybe if you paired it manually it would show up in the program.
I've connected android apps to a Bluetooth OBD reader and it worked fine.
alex cher · Permalink
Segmentation failed
Hi i'm install this soft on my rasp pi2 and when i going command "scantools" im see this:
Version: 1.21 for DOS
Initializing All Modules...
---------------------------------
Initializing Alegro... OK
Segmentation fault
PS: xserver is installed and all commponents from xserver
Jay R Fude · Permalink
Raspberry likely needs compiled
The scantool likely needs to be recompiled to run on the ARM chipset the raspberry uses.
ChiefH · Permalink
does not connect
My Bluetooth device pairs with my computer on a serial rather than a Bluetooth connection. I have followed the steps to change the dialout and my terminal says it is COM1 . . . opened /dev/ttuS0. The Scantool software will not connect and gives a notice. I am using Linux: Ubuntu 16.04.1LTS and a Bluetooth OBDII device that pairs just fine with my Android phone and Tourque, but I cannot get any applications for Linux to work with my computer(and I thought that Android was based on Linux, Ha!Ha!) .
Maybe something is missing in the above instructions???? Why does the OBDII BT device pair as a serial rather than a BT port like my audio devices pair? And when I have configured the ports for dialout and /dev/ttyS0 is now COM1
Sam Hobbs · Permalink
mine was USB not bluetooth
My OBD adapter was a USB device like in the photo, not bluetooth, so you may have to rummage around and find the device and see which group owns it and experiment a bit to get it working.
Sam
YLK · Permalink
P0420 DTC here also
Thanks for this very informative webpage. Just received my USB ELM327 device today.
Hooked it up, started the engine and ran scantool, which connected after a little struggle with configuration.
For baud rate, device specifications stated 9600 or 38400, not what scantool defaults to.
For the COM port, scantool's output to console was helpful.
For my P0420 DTC, I looked into Sensor Data but most everything was OFF on Page 1.
Why not turn everything ON? Or, can that be dangerous?
DM · Permalink
Useful tips. For developers,
Useful tips. For developers, an obd2 lib may be useful.
Martin · Permalink
Aha!
Thanks for your clear and helpful instructions. BTW, I can read your car's problem: it is called 'Landrover'... ;-)
Sam Hobbs · Permalink
It's actually a fiesta, I
It's actually a fiesta, I think the codes sometimes mean slightly more specific things for some manufacturers than others!
Martin · Permalink
Aha. LOL
Aha. LOL
gavin · Permalink
Not working
Hi, thank you for the clear instructions. Unfortunately when i run 'scantool' i get 'shutting down allegro due to signal #11'.
Any help would be greatly appreciated.
hans · Permalink
Will scantool work whit Volvo
Will scantool work whit Volvo v70
Tim Holt, Jr · Permalink
I can't see why not. If your
I can't see why not. If your looking for the OBDII plug on a V70, they're usually close to the shifter, just in front and to the left, under a little cover.
Benjamin Rittgers · Permalink
Reading the Man Page
I got a USB one like in the picture. I couldn't get it to work at all. I knew it was connected to /dev/ttyUSB0 but I could only choose com1 through com8. After reading the man page, it will connect to com1 first tries /dev/ttyUSB0 and then tries /dev/ttyS0. Com2 tries /dev/ttyUSB1 and then tries /dev/ttyS1. The device was connected to /dev/ttyUSB0, but it was not reading in the software. I needed to change the baud rate to 38400 in order to get it to work 115000 is too fast.
I had no error code, so couldn't read anything, but I could go see the stats on the other page. Thanks for the advice. I get a similar code when mine goes haywire.
Martin Jones · Permalink
Same here
Yea, I've tried this program a time or two. It seems to connect to /dev/ttyUSB0, but I have to pick which com port and which baud rate? So if somebody has an answer, I'd love to hear it.
Benjamin · Permalink
Yes. Choose com1 for usb0
Yes. Choose com1 for usb0 and com2 for usb1. Choose a baud rate that works with you car.
Anne · Permalink
awesome in use and highly
awesome in use and highly recommended to people.
Sam · Permalink
How to get this to connect
How to get this to connect over WIFI please?
Novince · Permalink
i did it '
i did not read all of your article before i gave acces and root privilage to the app, can i cancel it;s root privilagge, and how.
m03da · Permalink
yeah, just exit the program,
yeah, just exit the program, or perhaps do a killall scantool*
Wayne Mews · Permalink
electric auto
Will the scan tool read codes from Electric auto's eg Smart fortwo ED or EQ
Alan · Permalink
Ford Key Chip programming the ECU ...?
Greetings ...
Does this OBD2 tool have an option to Erase the existing chip stored on the ECU memory, (I lost my keys and have a new set arriving) and Program the New Chip and Keys into the ECU ...???
Thanks.
Add new comment