Skip to content
mvglasow edited this page Mar 17, 2023 · 16 revisions

KW1281Test Wiki Contribution

KW1281Test Wiki Contribution

Introduction

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.

OBDII Cable

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

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).

Vehicle Controllers (electronic modules):

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

OBDII Cable Identification (?)

Windows:

In Device Manager, look under PORTS and take note of which COM port is being used by your KKL cable.

Mac:

  • 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)

Linux (ARM):

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

Installation

Windows:

Mac:

Linux:

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 If kw1281test then complains about libftd2xx.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

Usage

Windows:

KW1281Test PORT BAUD ADDRESS COMMAND [args]

Mac:

KW1281Test SERIAL BAUD ADDRESS COMMAND [args]

(where SERIAL = serial number of cable, as determined from SYSTEM INFORMATION as described above)

Linux:

kw1281test SERIAL BAUD ADDRESS COMMAND [args]

(where SERIAL = serial number of cable, as determined from lsusb as described above)

Parameters:

PORT = COM1|COM2|etc.
BAUD = 10400|9600|etc.
ADDRESS = The controller address, e.g. 1 (ECU), 17 (cluster), 46 (CCM), 56 (radio)
COMMAND =
    ActuatorTest
    AdaptationRead CHANNEL [LOGIN]
        CHANNEL = Channel number (0-99)
        LOGIN = Optional login (0-65535)
    AdaptationSave CHANNEL VALUE [LOGIN]
        CHANNEL = Channel number (0-99)
        VALUE = Channel value (0-65535)
        LOGIN = Optional login (0-65535)
    AdaptationTest CHANNEL VALUE [LOGIN]
        CHANNEL = Channel number (0-99)
        VALUE = Channel value (0-65535)
        LOGIN = Optional login (0-65535)
    BasicSetting GROUP
        GROUP = Group number (0-255)
        (Group 0: Raw controller data)
    ClarionVWPremium4SafeCode
    ClearFaultCodes
    DelcoVWPremium5SafeCode
    DumpEdc15Eeprom [FILENAME]
        FILENAME = Optional filename
    DumpEeprom START LENGTH [FILENAME]
        START = Start address in decimal (e.g. 0) or hex (e.g. $0)
        LENGTH = Number of bytes in decimal (e.g. 2048) or hex (e.g. $800)
        FILENAME = Optional filename
    DumpMarelliMem START LENGTH [FILENAME]
        START = Start address in decimal (e.g. 3072) or hex (e.g. $C00)
        LENGTH = Number of bytes in decimal (e.g. 1024) or hex (e.g. $400)
        FILENAME = Optional filename
    DumpMem START LENGTH [FILENAME]
        START = Start address in decimal (e.g. 8192) or hex (e.g. $2000)
        LENGTH = Number of bytes in decimal (e.g. 65536) or hex (e.g. $10000)
        FILENAME = Optional filename
    DumpRB8Eeprom START LENGTH [FILENAME]
        START = Start address in decimal (e.g. 66560) or hex (e.g. $10400)
        LENGTH = Number of bytes in decimal (e.g. 1024) or hex (e.g. $400)
        FILENAME = Optional filename
    GetSKC
    GroupRead GROUP
        GROUP = Group number (0-255)
        (Group 0: Raw controller data)
    LoadEeprom START FILENAME
        START = Start address in decimal (e.g. 0) or hex (e.g. $0)
        FILENAME = Name of file containing binary data to load into EEPROM
    MapEeprom
    ReadFaultCodes
    ReadIdent
    ReadEeprom ADDRESS
        ADDRESS = Address in decimal (e.g. 4361) or hex (e.g. $1109)
    ReadSoftwareVersion
    Reset
    SetSoftwareCoding CODING WORKSHOP
        CODING = Software coding in decimal (e.g. 4361) or hex (e.g. $1109)
        WORKSHOP = Workshop code in decimal (e.g. 4361) or hex (e.g. $1109)
    WriteEeprom ADDRESS VALUE
        ADDRESS = Address in decimal (e.g. 4361) or hex (e.g. $1109)
        VALUE = Value in decimal (e.g. 138) or hex (e.g. $8A)

Examples:

Identify manufacturer / model of instrument cluster in your car: ### Windows with COM4:###

KW1281Test COM4 10400 17 ReadIdent

### Mac with cable serial # ### A12JCDR4### :###

KW1281Test A12JCDR4 10400 17 ReadIdent