Dealing with car troubles can be frustrating, especially when error codes pop up and garages struggle to pinpoint the issue. Like many car owners, I recently faced a recurring error code that seemed nonsensical – an air conditioning fault in a car without AC! Tired of costly garage visits just to clear codes, I explored a DIY solution: using Linux and an OBD2 connector. I discovered Scantool, a fantastic free software for Linux, that allows you to read and clear these codes yourself. This guide will walk you through installing and using Scantool on Linux to take control of your car’s diagnostics.
Understanding OBD2 Connectors and Getting Started
Since 2004 in Europe, and even earlier in other regions like the USA, On-Board Diagnostics (OBD) has become a standard feature in vehicles. OBD-II, the current standard, became mandatory in the USA in 1996 and gained traction globally afterwards. Regulations in 2007 further standardized OBD-II, mandating easily accessible connectors within 0.61 meters (approximately 2 feet) of the steering wheel. Even my older 2004 Ford Fiesta has an OBD-II port discreetly located behind a small panel beneath the steering wheel.
OBD2 connectors come in various forms, primarily USB and Bluetooth. Prices range from budget-friendly generic models to more expensive, brand-name scanners. For my experiment, I opted for an affordable generic USB OBD2 adapter from Amazon, costing around £6. While delivery took a bit longer, this inexpensive option proved to be perfectly functional for basic diagnostics. These budget adapters often utilize the ELM327 chip, a common interface for OBD-II communication.
Installing Scantool on Linux (Ubuntu/Debian)
Setting up Scantool on a Debian-based Linux distribution like Ubuntu is straightforward thanks to its availability in the standard repositories. Open your terminal and execute the following commands:
sudo apt-get update
sudo apt-get install scantool
These commands first update your package lists to ensure you have the latest information and then install the Scantool software.
After installation, Scantool needs permission to access your OBD-II adapter. The system typically assigns the OBD device, when connected via USB, to /dev/ttyUSB0
. This device file is usually owned by the root
user and the dialout
group. To grant Scantool access without running it as root (which is not recommended for security reasons), add your user to the dialout
group. Replace sam
with your actual username in the command below:
sudo usermod -a -G dialout sam
It’s important to avoid running Scantool with sudo
or as the root user directly. This practice, while technically functional, violates the principle of least privilege. Scantool only requires access to the OBD interface, not full system administrator rights. Running applications with unnecessary elevated privileges increases potential security risks.
Using Scantool to Read and Clear Diagnostic Codes
For the group changes to take effect, you’ll need to log out and log back into your Linux session. Alternatively, the newgrp
command provides a quicker way to apply the group change to your current session. Use the following command:
newgrp dialout
Verify that you are now part of the dialout
group by running:
groups
The output should list dialout
among your groups.
Now, with your OBD2 adapter plugged into your car and connected to your Linux machine, and with your car’s ignition turned to the “ON” position (engine not necessarily running), launch Scantool by simply typing scantool
in the terminal:
scantool
This will open the Scantool main menu in your terminal:
Select “read codes” from the menu to retrieve any stored diagnostic trouble codes (DTCs) from your car’s computer. Scantool will display the codes along with descriptions. It’s worth noting that while OBD-II codes are standardized, manufacturers sometimes have specific interpretations. Scantool may provide multiple potential explanations for each code to account for this.
If you understand the meaning of the codes and are confident in clearing them (e.g., after addressing a minor issue), you can select the “clear” option in Scantool.
Important Disclaimer: I am not a professional mechanic. Incorrectly interpreting or clearing codes can have unintended consequences. If you are unsure about the meaning of any diagnostic codes, consult a qualified mechanic before clearing them. Clearing codes without addressing the underlying issue will only temporarily hide the problem and could lead to more serious issues down the line.
Returning to the main menu, the “sensor data” option provides real-time data from your car’s sensors. This feature is particularly useful for monitoring engine parameters while the car is running.
While the “tests” option might not be fully implemented in this version of Scantool, the software offers sufficient functionality for basic OBD-II diagnostics, allowing you to read and clear codes and monitor sensor data effectively.
By using Linux and free software like Scantool, you can gain valuable insights into your car’s health and potentially save money by diagnosing and addressing minor issues yourself. This setup provides a powerful, open-source alternative to proprietary diagnostic tools, putting you in control of your car’s diagnostics.