-
-
Notifications
You must be signed in to change notification settings - Fork 23
Home
kw1281test is a command-line utility created by user @gmenounos at the TDIclub.com message board. Versions are available for Windows, Mac, and Linux. With this tool and a generic OBD2 scan tool (KKL), users can read and make modifications to various electronic control systems on numerous vehicles from VWAG (roughly translated as "Volkswagen Auto Group") for vehicles manufactured from approximately 1998 to 2010, depending on market and models.
This tool can send the most common KW1281 commands. Support for KW2000 is currently limited to DumpEeprom
and DumpEdc15Eeprom
.
The interface cable needs to be a “dumb” serial—>KKL or USB—>KKL cable. Legacy cables from Ross-Tech (makers of VCDS) can most likely be used but will require the installation of Virtual COM Port drivers. See https://www.ross-tech.com/vag-com/usb/virtual-com-port.php for details on how to do that.
The cheap blue KKL cables (Example: https://www.amazon.com/gp/product/B00K6498D0) usually use a CH340 chip. kw1281test only supports CH340 cables on Windows. Sometimes a small white driver CD is included with the cable but it's better to download the drivers. Here are installation instructions and download links for the CH340 drivers: https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all
For Mac and Linux users, you will need a KKL cable with an FTDI controller chip. While less common than the CH340 cables, there are cheap examples available (e.g., https://www.amazon.com/dp/B0BFDYC4SK). FTDI drivers and instructions can be found here: https://ftdichip.com/drivers/d2xx-drivers/
A USB—>serial adapter can be used with a (very) old serial KKL cable on more modern computers, but the adapter cable needs to have an FTDI controller chip, (as opposed to e.g., PL2303 chip).
Here are some common module addresses:
- 1 - Engine (ECU) - ? baud
- 9 - Central Electric - ? baud
- 15 - Airbag - 9600 baud
- 17 - Instruments (instrument cluster - speedometer, tachometer et al.) - 10400 baud (usually), 9600 baud (sometimes)
- 19 - CAN Gateway - ? baud
- 35 - Central Locking - ? baud
- 37 - Navigation - ? baud
- 46 - Comfort Module (CCM) - door locking, window operation - 9600 baud
- 56 - Radio (stereo head unit) - 9600 baud
In Device Manager, look under PORTS and take note of which COM port is being used by your KKL cable.
- Click the Apple menu top left of display,
- hold down OPTION
- ABOUT THIS MAC will turn to SYSTEM INFORMATION - click that.
- Under HARDWARE,
- click USB,
- then find your cable in the DEVICE TREE (top window, right-hand side).
- Take note of serial number of your cable (eight-character number - e.g., A12JCDR4)
Like on a Mac, you will have to take note of your serial number of your cable. Instructions to locate your serial number on linux are here:
Find FTDI cable serial number on Linux
To use kw1281test on Mac, you will need an FTDI cable and you will need to know it's serial number. You'll also need to be running macOS 10.4 or higher.
Download and install the FTDI drivers for your platform. Make sure to pay attention to your system architecture (x64 or ARM). Choose x64 if you're on an Intel-based Mac; choose ARM for Macs with Apple silicon (M1, M2, etc.).
Once downloaded, unzip the drivers to your Desktop. This should create a folder called release
.
The installation process works roughly as follows, but you may need to change the driver version number in steps 4 and 5:
- Open a Terminal window
- If the
/usr/local/lib
directory does not exist, create it:sudo mkdir /usr/local/lib
- If the
/usr/local/include
directory does not exist, create it:sudo mkdir /usr/local/include
- Copy the dylib file to
/usr/local/lib
:sudo cp ~/Desktop/release/build/libftd2xx.1.4.24.dylib /usr/local/lib/libftd2xx.1.4.24.dylib
- Make a symbolic link:
sudo ln -sf /usr/local/lib/libftd2xx.1.4.24.dylib /usr/local/lib/libftd2xx.dylib
- Copy the D2XX include file:
sudo cp ~/Desktop/release/ftd2xx.h /usr/local/include/ftd2xx.h
- Copy the WinTypes include file:
sudo cp ~/Desktop/release/WinTypes.h /usr/local/include/WinTypes.h
- Delete the
release
folder from your desktop
Only cables with an FTDI chip are supported on Linux. This is due to the fact that, in order to initiate communication with an ECU, we first need to send the ECU address at a low baud rate of 5 bps, then process its response at the selected baud rate. On Linux, we have not yet found a way to do this through the standard serial API, which is why we need to use a vendor-specific driver.
Ubuntu 22.04 (the same probably goes for other modern distributions) has drivers on board to access the FTDI device as a serial port (/dev/ttyUSB0
for the first USB-to-serial adapter on Ubuntu, YMMV if you already have some other USB-to-serial adapter on your system and/or your distribution has a different naming convention). However, for the reasons described above, we need the vendor-specific driver.
Download the FTDI driver for your processor architecture and follow the instructions in the archive to install it. Basically, the procedure is:
sudo cp libftd2xx.* /usr/local/lib
sudo chmod 0755 /usr/local/lib/libftd2xx.so.1.4.27
-
sudo ln -sf /usr/local/lib/libftd2xx.so.1.4.27 /usr/local/lib/libftd2xx.so
Ifkw1281test
then complains aboutlibftd2xx.so
not being found, try this:sudo ln -sf /usr/local/lib/libftd2xx.so.1.4.27 /usr/lib/libftd2xx.so
(TODO prevent the kernel from loading the ftdi_sio
module – as long as it is loaded, libftd2xx
and thus kw1281test
will not be able to access the interface.)
When you run kw1281test
, you will need to provide the serial number of your FTDI chip instead of a port number. Here’s how to find out the serial number:
- Run
lsusb | grep FT
and look up the USB ID of your device. - Run
lsusb -v -d 0403:xxxx | grep iSerial
(replacing the USB ID of your device as reported in the previous step).
If your kernel has a serial port driver for your device and loads it automatically, this will prevent libftd2xx
and kw1281test
from accessing the device. There are several ways to work around this, each with its own drawbacks; refer to the README that came with the driver for details.
A simple workaround is to run the following each time you plug in the cable. You will need to do this every time you unplug the cable and plug it back in, and you will not be able to use other USB-to-serial adapters during that time.
sudo rmmod ftdi_sio
sudo rmmod usbserial
KW1281Test PORT BAUD ADDRESS COMMAND [args]
KW1281Test SERIAL BAUD ADDRESS COMMAND [args]
(where SERIAL = serial number of cable, as determined from SYSTEM INFORMATION as described above)
kw1281test SERIAL BAUD ADDRESS COMMAND [args]
(where SERIAL = serial number of cable, as determined from lsusb
as described above)
PORT = COM1|COM2|etc.
BAUD = 10400|9600|etc.
ADDRESS = The controller address, e.g. 1 (ECU), 17 (cluster), 46 (CCM), 56 (radio)
COMMAND
- see the Commands summary page
KW1281Test COM4 10400 17 ReadIdent
./kw1281test 12345678 10400 17 ReadIdent
KW1281Test COM4 10400 17 GetSKC
./kw1281test 12345678 10400 17 GetSKC
KW1281Test COM4 10400 17 AdaptationSave 21 2 01111
./kw1281test 12345678 10400 17 AdaptationSave 21 2 01111