Pages: [1]
Author Topic: VW CAN info via OBD port  (Read 8373 times)
bretskee
Newbie
*

Karma: +1/-0
Offline Offline

Posts: 1


« on: December 31, 2011, 10:14:28 PM »

Hi,
I am new to this forum and am seeking some help.
I have a VW R32 DSG '09 model. I have read a lot of information about OBD but require some parameters not offered by OBD or are at least VW proprietary. One in particular is current DSG gear. I am using a small micro and programming in C# and interfacing to a Sparkfun OBD/Can UART card. The objective is to embed this micro and a small screen into the car to provide additional information about performance and the like. To do this I need to discover the VW protocol variant and the required CAN gateway queries to get the desired data.
I also have a VAG cable and software and have verified that the parameters I seek are in fact available via the OBD port in the car. Further, I have made a Y-chord so that I can capture the VAG conversation with the car using my Sparkfun card. The Sparkfun card uses an ELM clone STN1110. I began by setting the protocol and switching headers on. I then set the card to listen to all messages. This was done by issuing the following AT commands to the UART card:
ATPP 2D SV 01
ATPP 2D ON
ATZ
ATSP B
ATH1
ATD1
ATMA
The included file contains the captured session.
The resulting capture is in three sections. The first is where the VAG software is started and it performs some initial queries. The next section is where I set VAG to display the relevant data (in this case current gear) and the last section is where I take VAG back to the home screen, it cleans up and terminates the session.
So, from what I have read, setting headers on displays the headers but not the checksum. Further, the initialization sequence with the CAN gateway is taken care of (I think). As you can see, I have identified the data request and response sequences and I can make sense of most of it. I have seen bytes changing in response to gearbox lever movements but in the captured file, it is in park. I am sure once I get this running, the actual bytes for each gear position will be relatively simple. Other parameters will be simple later also.
I then have the following questions:
1.   Am I correct that if VAG can do this, it is possible to emulate via my own micro + ELM equivalent
2.   Since the captured file is RAW data if you like, and I am emulating this protocol via an embedded micro and a STN1110, I am unsure what parts are handled by the STN1110 (ELM327) and which have to be specifically handled by my application? For example, do I need to generate ACK/NAKS with the correct sequencing, packet counters, payload lengths etc ?
3.   Most of the captured data conforms to some sort of query and response order. There are however some sections where it does not seem to conform to at least the part of the protocol I understand. This is colour coded with a legend at the bottom. Can anyone help me with what these do?
4.   When I set the protocol, is all of the CAN initialization taken care of? Is the session kept alive for me?
5.   Can someone help me with ECU addressing and setting the headers correctly?
6.   I have also attached a document written by Andreas Sjoberg as a University report to the Vaxjo University written in Swedish. I apologize that I can’t recall the actual source, but I found it in my travels using many google searches. My captured data matches exactly that described in the report. I have translated much of the document but I am still missing the actual implementation using the ELM interface.
I know a lot of this information is probably embedded in many of the documents and data sheets, and perhaps even, I am a little dim, but I am very confused by a lot I have read as to what exactly is the protocol and where VW have strayed and is proprietary. I am hoping someone has solved some or all of this. I am of course going to contribute all of my finding back to the forum as there must be others wanting the same sort of detail.
I have been searching and reading for a long time and have probably been over or under descriptive. Please ask me for more details if I have been unclear. I also hope this is on-topic enough for this forum.
Thanks in advance and apologies for the very long story.
Logged
Tony@NefMoto
Administrator
Hero Member
*****

Karma: +132/-4
Offline Offline

Posts: 1389


2001.5 Audi S4 Stage 3


« Reply #1 on: January 03, 2012, 05:14:42 PM »

1) The KWP 1281 and KWP 2000 protocols provide access to different information in the ECU. The protocols run on top of the physical communication layer which is either K-Line or CAN. Your micro should be able to do what you want.

2) The ELM chip should handle all the details of the protocol for you. the ELM docs cover most of this info. You should just have to worry about sending and receiving messages and what addresses and data you put in the messages.

3)

4) The ELM chip should handle connecting over K-Line or CAN and keeping the session alive automatically. You only have to worry about the protocol and not how the ELM is implementing it.

5) The headers and addresses are different depending on if you use KWP 2000 or KWP 1281.
Logged

Remember you have to log in if you want to see the file attachments!
Info or questions, please add to the wiki: http://www.nefariousmotorsports.com/wiki
Follow NefMoto developments on Twitter: http://twitter.com/nefmoto
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.013 seconds with 17 queries. (Pretty URLs adds 0s, 0q)