Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIDS #51

Open
ClusterModzCo opened this issue Dec 12, 2023 · 8 comments
Open

PIDS #51

ClusterModzCo opened this issue Dec 12, 2023 · 8 comments
Labels

Comments

@ClusterModzCo
Copy link

Hey there ive been trying to get the pid call to work with no luck. im currectly connected but when calling ny other address then the 3that are in the example i get nothing displaying. like nothing at all the whole line is blan. is there a trick im missing or do i need to some how add to the library in order to read the pid i request? if so mind hinting off how to do so please

@iwanders
Copy link
Owner

Not all ECU's support all PID's, you can query your ECU to determine what PIDs it supports. See the supportedPID example.

@ClusterModzCo
Copy link
Author

ClusterModzCo commented Dec 12, 2023

ok i got the supported pid example up and running but yet im still having trouble understanding. i was able to connect initally but right after is spit out data all it wants to do is loop now and no success? also the data display is 0x1 0x2 0x3 so on follows by a 1 or a 0. im assuming this states whats avalible? after the first connection it loops and will not connect agian unless i turn off the ecu and turn it back on, when cycled the data output is the same and previous connection. im working on a 04 allroad me7.1.1 if that helps

@ClusterModzCo
Copy link
Author

ClusterModzCo commented Dec 12, 2023

ok i got the supported pid example up and running but yet im still having trouble understanding. i was able to connect initally but right after is spit out data all it wants to do is loop now and no success? also the data display is 0x1 0x2 0x3 so on follows by a 1 or a 0. im assuming this states whats avalible? after the first connection it loops and will not connect agian unless i turn off the ecu and turn it back on, when cycled the data output is the same and previous connection. im working on a 04 allroad me7.1.1 if that helps

init_success:1
PID 0x0  -> 0xBF9FB110
0x1: 1
0x2: 0
0x3: 1
0x4: 1
0x5: 1
0x6: 1
0x7: 1
0x8: 1
0x9: 1
0xA: 0
0xB: 0
0xC: 1
0xD: 1
0xE: 1
0xF: 1
0x10: 1
0x11: 1
0x12: 0
0x13: 1
0x14: 1
0x15: 0
0x16: 0
0x17: 0
0x18: 1
0x19: 0
0x1A: 0
0x1B: 0
0x1C: 1
0x1D: 0
0x1E: 0
0x1F: 0
0x20: 0
Looping
init_success:0

Edit by Ivor; put the output in triple backticks (```) to get monospace formatting.

@iwanders
Copy link
Owner

iwanders commented Dec 12, 2023

also the data display is 0x1 0x2 0x3 so on follows by a 1 or a 0. im assuming this states whats available?

Yep, the 0 denotes not available, the 1 denotes available. This section on PID 01 on wikipedia is most helpful, it describes how to interpret the response to PID 00 (the 0xBF9FB110 you got).

So now you can look in the show current data section of wikipedia to see what data you can retrieve, and how to interpret it. For example, your car reports 0x10: 1, so PID 0x10 (first column in the table) shows that you can retrieve the mass air flow rate. The other columns describe how to interpret that data.

@ClusterModzCo
Copy link
Author

ClusterModzCo commented Dec 12, 2023 via email

@iwanders
Copy link
Owner

That show current data section on wikipedia is basically the PID description table, if you look there of 0x20, you'll see that PID 0x20 has the description PIDs supported [$21 - $40], given that PID 0x00 states that 0x20 is not supported, there's no PID's available on your ECU beyond the first block of 0x00-0x20.

@ClusterModzCo
Copy link
Author

ClusterModzCo commented Dec 13, 2023 via email

@iwanders
Copy link
Owner

When calling display.println(getCurrentPID(0x10, 2)); (address, byte length) no matter available or not the return value displayed is 1 is there a way to call the actual PID that I'm not understanding?

Yes... please consider looking at examples a bit. The getCurrentPID method returns a boolean whether the value could be retrieved. Then you can use the read functions to obtain response from the internal buffer.

Getting a PID is always a two step procedure, first you request it from the ECU, then you read the value from the buffer. Like the example clearly shows:

res = obd.getCurrentPID(0x11, 1);
if (res){
Serial.print("Result 0x11 (throttle): ");
Serial.println(obd.readUint8());
}

ECU though it is canbus

This library cannot do anything with a CAN bus, you'll need something else than this library for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants