In order to rule out an incorrect baud rate, I retried the operation with a different baud rate (9600 instead of 10400), which resulted in the code tripping on the sync bit – which indicates the baud rate should have been correct.
In both cases, the actual and expected values differ by 0x80. This looks to me as if 7o1 input has been interpreted as 8n1 (as far as I know, bit order is from least to most significant, parity byte last, thus 0x80 would be the parity bit).
The received byte appears to be the complement of the ECU address (received | address == 0x7F, expected | address == 0xFF).
According to https://www.blafusel.de/obd/vag_kw2000.html (section Initialisierung), communication from the two keyword bytes up to the inverted ECU address uses seven data bits, odd parity. Once the inverted controller address has been transmitted, communication switches to 8 data bits, no parity.
So for the inverted controller address, after determining its 8-bit complement, we would need to calculate the parity of the complement, and if it is even, flip the most significant bit.
This would also mean the issue would currently affect only half of all addresses. Since the RNS-E listens on two addresses (0x37 for navigation, 0x56 for radio) with identical behavior, I tried 0x37 as well. This time the connection proceeds four lines further into Tester.cs, before aborting because the protocol is not recognized.
Steps to reproduce
Connect to an ECU which communicates using KWP2000 over K-line and perform a
ReadIdent
. ECUs I have tried (all of them in a 2005 Audi A4, type 8E/B7):0x56
, Radio/navigation RNS-E, part no. 8E0035192C0x77
, Telephone (part no. should be one of 8P0862335*)Expected result
Connection is successful and the ECU responds with its identification data (at least dealer part no., identification string).
Actual result:
Software environment
kwp1281test 0.80-beta, Ubuntu 22.04, libftd2xx.so.1.4.27
Additional information
In order to rule out an incorrect baud rate, I retried the operation with a different baud rate (9600 instead of 10400), which resulted in the code tripping on the sync bit – which indicates the baud rate should have been correct.
In both cases, the actual and expected values differ by
0x80
. This looks to me as if 7o1 input has been interpreted as 8n1 (as far as I know, bit order is from least to most significant, parity byte last, thus0x80
would be the parity bit).The received byte appears to be the complement of the ECU address (
received | address == 0x7F
,expected | address == 0xFF
).According to https://www.blafusel.de/obd/vag_kw2000.html (section Initialisierung), communication from the two keyword bytes up to the inverted ECU address uses seven data bits, odd parity. Once the inverted controller address has been transmitted, communication switches to 8 data bits, no parity.
So for the inverted controller address, after determining its 8-bit complement, we would need to calculate the parity of the complement, and if it is even, flip the most significant bit.
This would also mean the issue would currently affect only half of all addresses. Since the RNS-E listens on two addresses (
0x37
for navigation,0x56
for radio) with identical behavior, I tried0x37
as well. This time the connection proceeds four lines further intoTester.cs
, before aborting because the protocol is not recognized.