gmenounos / kw1281test

VW KW1281 Protocol Test Tool
MIT License
111 stars 14 forks source link

System.TimeoutException #66

Closed roder closed 3 months ago

roder commented 3 months ago

Hello @gmenounos -

I'm receiving the following from my ECU:

C:\Users\[REDACTED]\Documents\Autos\TDI\kw1281test_0.93.0-beta_Win10> .\kw1281test.exe com4 9600 1 ReadIdent
KW1281Test: Yesterday's diagnostics...Today.

Version 0.93.0-beta (https://github.com/gmenounos/kw1281test/releases)
Args: com4 9600 1 ReadIdent
OSVersion: Microsoft Windows NT 10.0.19045.0
.NET Version: 8.0.0
Culture: en-US
Opening serial port com4
Sending wakeup message
Reading sync byte
Keyword Lsb $01
Keyword Msb $8A
Protocol is KW 1281 (8N1)
Caught: System.TimeoutException The operation has timed out.
Unhandled exception: System.TimeoutException: The operation has timed out.
   at System.IO.Ports.SerialStream.ReadByte(Int32)
   at System.IO.Ports.SerialStream.ReadByte()
   at System.IO.Ports.SerialPort.ReadByte()
   at BitFab.KW1281Test.Interface.GenericInterface.ReadByte() in /Users/gmenounos/src/kw1281test/Interface/GenericInterface.cs:line 34
   at BitFab.KW1281Test.KwpCommon.ReadByte() in /Users/gmenounos/src/kw1281test/KwpCommon.cs:line 130
   at BitFab.KW1281Test.KW1281Dialog.ReadAndAckByte() in /Users/gmenounos/src/kw1281test/KW1281Dialog.cs:line 442
   at BitFab.KW1281Test.KW1281Dialog.ReceiveBlock() in /Users/gmenounos/src/kw1281test/KW1281Dialog.cs:line 384
   at BitFab.KW1281Test.KW1281Dialog.ReceiveBlocks() in /Users/gmenounos/src/kw1281test/KW1281Dialog.cs:line 351
   at BitFab.KW1281Test.KW1281Dialog.Connect() in /Users/gmenounos/src/kw1281test/KW1281Dialog.cs:line 91
   at BitFab.KW1281Test.Tester.Kwp1281Wakeup(Boolean ) in /Users/gmenounos/src/kw1281test/Tester.cs:line 39
   at BitFab.KW1281Test.Program.Run(String[]) in /Users/gmenounos/src/kw1281test/Program.cs:line 288

This occurs with any ECU command. I have successfully used the VAG KKL cable on another ECU, and I have successfully used a ross-tech cable and VCDS on this ECU. I am bench testing this ECU, so no other controllers are available.

Can you advise on best practices to troubleshoot this timeout?

Thanks, Matt

PS: FYI, I'm a programmer by trade, but new to ECUs and the EDC15.

gmenounos commented 3 months ago

What's the part number of the ECU? Which VCDS cable?

roder commented 3 months ago

IMG_20240321_151720_544_1

roder commented 3 months ago

Thanks for your super fast response BTW!

roder commented 3 months ago

@gmenounos part number is 038 906 012 FD

roder commented 3 months ago

@gmenounos the ross-tech cable is:

Kii-USB Hc165365 rev A

gmenounos commented 3 months ago

Make sure you have "Boot in Intelligent Mode" UNchecked in the VCDS settings. If it's checked and you uncheck it, you'll need to unplug the cable from the PC and plug it back in again for the setting to take effect.

And, you're successfully able to connect to this ECU on the bench with VCDS? And then you try kw1281test and it always gives the timeout?

roder commented 3 months ago

I followed this procedure from the bench:

  1. Connected to ECU via ross-tech with VCDS, confirmed successful reads from controller 1.
  2. Unchecked "Boot in Intelligent Mode" in VCDS Options dialog, Applied and Saved config.
  3. Disconnected power from ECU and disconnected Ross-Tech cable from laptop and ECU.
  4. Reconnected Ross-Tech cable, tried .\kw1281test.exe com4 9600 1 ReadIdent on all four com ports (com1, com2, etc) - System.IO.FileNotFoundException on all 4 com ports.
  5. Disconnected power from ECU and disconnected Ross-Tech cable from laptop and ECU.
  6. Connected VAG KKL cable and executed .\kw1281test.exe com4 9600 1 ReadIdent.

Result:

 C:\Users\Matt Heitzenroder\Documents\Autos\TDI\kw1281test_0.93.0-beta_Win10> .\kw1281test.exe com4 9600 1 ReadIdent
KW1281Test: Yesterday's diagnostics...Today.

Version 0.93.0-beta (https://github.com/gmenounos/kw1281test/releases)
Args: com4 9600 1 ReadIdent
OSVersion: Microsoft Windows NT 10.0.19045.0
.NET Version: 8.0.0
Culture: en-US
Opening serial port com4
Sending wakeup message
Reading sync byte
Keyword Lsb $01
Keyword Msb $8A
Protocol is KW 1281 (8N1)
Caught: System.TimeoutException The operation has timed out.
Unhandled exception: System.TimeoutException: The operation has timed out.
   at System.IO.Ports.SerialStream.ReadByte(Int32)
   at System.IO.Ports.SerialStream.ReadByte()
   at System.IO.Ports.SerialPort.ReadByte()
   at BitFab.KW1281Test.Interface.GenericInterface.ReadByte() in /Users/gmenounos/src/kw1281test/Interface/GenericInterface.cs:line 34
   at BitFab.KW1281Test.KwpCommon.ReadByte() in /Users/gmenounos/src/kw1281test/KwpCommon.cs:line 130
   at BitFab.KW1281Test.KW1281Dialog.ReadAndAckByte() in /Users/gmenounos/src/kw1281test/KW1281Dialog.cs:line 442
   at BitFab.KW1281Test.KW1281Dialog.ReceiveBlock() in /Users/gmenounos/src/kw1281test/KW1281Dialog.cs:line 384
   at BitFab.KW1281Test.KW1281Dialog.ReceiveBlocks() in /Users/gmenounos/src/kw1281test/KW1281Dialog.cs:line 351
   at BitFab.KW1281Test.KW1281Dialog.Connect() in /Users/gmenounos/src/kw1281test/KW1281Dialog.cs:line 91
   at BitFab.KW1281Test.Tester.Kwp1281Wakeup(Boolean ) in /Users/gmenounos/src/kw1281test/Tester.cs:line 39
   at BitFab.KW1281Test.Program.Run(String[]) in /Users/gmenounos/src/kw1281test/Program.cs:line 288
   at BitFab.KW1281Test.Program.Main(String[]) in /Users/gmenounos/src/kw1281test/Program.cs:line 31

Yes, I'm getting a consistent timeout from kw1281test everytime and yes, I'm able to successfully read the identity (VIN, etc) with VCDS on the bench.

gmenounos commented 3 months ago

Thanks for the detailed report. The reason kw1281test isn't working with your VCDS cable is that you need to install the RossTech Virtual COM Port (VCP) drivers in order for the VCDS cable to appear as a COM port. Instructions are here: https://sites.google.com/site/imnuts/home/install-setup-ross-tech-vcp-drivers I'm not optimistic that that will magically fix your issue, but it's something you can try while I try to figure out what the problem is.

gmenounos commented 3 months ago

Try this new release: https://github.com/gmenounos/kw1281test/releases/tag/v0.94-beta I added some additional logging.

roder commented 3 months ago

@gmenounos your support is amazing! 🙏 🙇

TL;DR - Its working!

The long story...

I followed the steps to use the Ross-Tech KII-USB cable in the document that you gave me. When I reached this section:

Now that VCP has been enabled, you should have a new option in Device Manager. Odds are, your computer didn't come with a serial (COM) or parallel (LPT) port, so Ports (COM & LPT) should be new for you. If it isn't, this will be a little more difficult, but not much. Expand the listing. If more than one item is listed, you'll need to find the correct item. Right click on one, or the only one, and select properties. If you have more than one, the manufacturer listed should be Ross-Tech. If it is, you selected the right one.

I did not have the Ports (COM & LPT) in the device manager, but there was another section called Other Devices which had a USB Com Device with no drivers identified. However, I noticed in the Ross-Tech Drivers, there was another driver file called ftdiport.inf, so I followed the same steps to manually load that driver for the new, unknown USB COM device (which was identified as a Ross-Tech Device).

Once I loaded the ftdiport.inf, I ran the following successfully with the Ross-Tech KII-USB cable:

C:\Users\Matt Heitzenroder\Documents\Autos\TDI\kw1281test_0.93.0-beta_Win10> .\kw1281test.exe com5 9600 1 ReadIdent
KW1281Test: Yesterday's diagnostics...Today.

Version 0.93.0-beta (https://github.com/gmenounos/kw1281test/releases)
Args: com5 9600 1 ReadIdent
OSVersion: Microsoft Windows NT 10.0.19045.0
.NET Version: 8.0.0
Culture: en-US
Opening serial port com5
Sending wakeup message
Reading sync byte
Keyword Lsb $01
Keyword Msb $8A
Protocol is KW 1281 (8N1)
ECU: 038906012FD 1,9l R4 EDC G000SG  4102
Software Coding 00002, Workshop Code: 94774
Sending ReadIdent block
Ident: 3VWRP29M02M024932     VWZ7Z0A3840049
Sending EndCommunication block

Thank you so much again, for the amazing and fast support. The outcome was better than expected - now I have one cable to rule them all!

I can code, but I haven't ever written any .NET. I'm quick to learn new languages though, so If there's any way I can support your project, I'd love too. Want help with documentation or fixing bugs (or anything else)?

PS: If there isn't anything else, feel free to close this issue.