Pages: [1]
Author Topic: CAN Vehicle Information Display - Should I sniff the CAN bus or request values?  (Read 2036 times)
jrelder
Jr. Member
**

Karma: +0/-0
Offline Offline

Posts: 36



I am currently in the process of creating a display for my vehicle information. I am wondering what is the best way to extract this information from the CAN bus. I see two options:

1. Receive all CAN data on the line and then filter for the required values
or
2. Every x ms request the required values from the sensors on the CAN bus

Which would be the best method and why?

Thanks in advance!
« Last Edit: March 05, 2017, 08:32:03 AM by jrelder » Logged
seishuku
Full Member
***

Karma: +12/-0
Offline Offline

Posts: 125



When I did my display for my old mk6 Jetta TDI, I just requested it the same way VCDS does it. You get exactly what you want, when you want it.
Besides that, you can't find soot load just floating around on the power train bus (not that I know of anyway), so I had to get that from the correct measuring block.
Logged
jrelder
Jr. Member
**

Karma: +0/-0
Offline Offline

Posts: 36



Thanks, that's really helpful and that was the option I preferred.

I was trying to figure out exactly how others did it for a while now but I could only find explanations for people who had hacked OBD USB/Bluetooth devices. No explanation of how the data is retrieved at the CAN level.

One last question, I assumed you can only request one value at a time, hence if I need 4 sensor values I have to send 4 request messages?

The only issue with this if so, is that the values will update sequentially and not simultaneously, although I expect the time difference between each value update will be miniscule and the update period for each will be equal anyway.
Logged
seishuku
Full Member
***

Karma: +12/-0
Offline Offline

Posts: 125



That's how I ended up doing it in the end, one request for each item... It does slow down refresh a bit, but still real time enough for me.

In the VW TP2.0 protocol, there is a facility for assembling multiple request to batch it in one transaction, but I never had a chance to get it to work.
Logged
nubcake
Sr. Member
****

Karma: +28/-0
Offline Offline

Posts: 339



That's how I ended up doing it in the end, one request for each item... It does slow down refresh a bit, but still real time enough for me.

In the VW TP2.0 protocol, there is a facility for assembling multiple request to batch it in one transaction, but I never had a chance to get it to work.

You can define your own DDLI with all the values you need (there are some limits, though).
Tried it with MED9 - and without auth and any ECU patches - the F0 DDLI can contain up to 20 single-byte values. Or, to be precise, the last item can contain 20 sequential bytes as well.
So, up to 39 bytes without any additional tricks.
Logged
jameswalker
Jr. Member
**

Karma: +3/-0
Offline Offline

Posts: 39



So, did you manage to successfully request anything? If so, do you know what messages do what? (even better, is there a document here on this site detailing it at all?)

I am currently doing similar, but by sniffing the bus directly.
Logged
nubcake
Sr. Member
****

Karma: +28/-0
Offline Offline

Posts: 339



So, did you manage to successfully request anything? If so, do you know what messages do what? (even better, is there a document here on this site detailing it at all?)

I am currently doing similar, but by sniffing the bus directly.

http://www.orlaus.dk/mercantec/UdvidetHardwareSoftware/Can/OBD2/VW%20Transport%20Protocol%202.0%20(TP%202.0)%20for%20CAN%20bus%20_%20jazdw.pdf
http://nefariousmotorsports.com/forum/index.php?topic=9182
Check Basano's and seishuku's posts.
There's enough info on here to build a working memory logger (or whatever you're trying to achieve) for the MED9, although it's a bit scattered.

EDIT: if you're talking about CAN packet contents - check FR.
« Last Edit: March 16, 2017, 09:45:23 AM by nubcake » Logged
jameswalker
Jr. Member
**

Karma: +3/-0
Offline Offline

Posts: 39



Perfect thanks.

I located all the parameters I was after, there is still 1 which I cannot find. That is real time AFR (or, raw actual lambda value). Not user requested target lambda.

I am guessing, that it is not actually sent out over the CAN bus?? And that the only way to grab it is to request is? Could anyone clarify this?
Logged
jrelder
Jr. Member
**

Karma: +0/-0
Offline Offline

Posts: 36



So, did you manage to successfully request anything? If so, do you know what messages do what? (even better, is there a document here on this site detailing it at all?)

I am currently doing similar, but by sniffing the bus directly.

Hi,

Sorry for the late reply from myself. I actually didn't in the end as it turns out my car uses K-Line KW1281 instead of CAN to communicate, despite having a CAN bus. So I am now creating software for the K-Line. As for the values, I found everything I needed when I was looking at the CAN bus on the Wikipedia page for the OBD2 protocol. It tells you how to request values and which values are at which PID. It also tells you how to convert them into their meaningful decimal values.

Hope this might help you
Logged
Pages: [1]
  Print  
 
Jump to:  

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