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
more on custom PIDs - splitting response #38
Comments
While bit masking/shifting the output of |
I opted not to use class variables Changes implemented in 2.3.0. |
Hi @PowerBroker2, sorry for re-opening this. |
No worries! Some standard PIDs return a single byte - in this case, the LSB of the response is the Because there is no set byte for the byte responseByte_0;
byte responseByte_1;
byte responseByte_2;
byte responseByte_3;
byte responseByte_4;
byte responseByte_5;
byte responseByte_6;
byte responseByte_7; Where For your application, if you get a valid response from Does that help? |
Thank you for reply, but again I'm sorry for not understanding (I'm not a programmer, just using the lib to do small work for me) So far I used only A and A+B values. Only recently found a value that need to be split into separate calculations on A and B Maybe it's an option to zero out more significant bytes and just filling A or A+B on query ? |
Any non-valid bytes are already zeroed out, so it's fully backwards compatible with previous sketches. The difference is now you have more flexibility when calculating complex PID responses. For your case: myELM327.findResponse();
byte B = myELM327.responseByte_0;
byte A = myELM327.responseByte_1;
// do things with A and B |
Hi, I found some examples/sniff and description on the net, but it looks like for a query (PID 220100), the response can be 6x 8bytes or even 9x 8bytes long or maybe I just misunderstand something. (Source) pid 220100 @ 2019-03-23T10:50:56.868873 Is there a way to parse and check a specific "responseByte_X"? |
I'm curious, what is the Once you do get the car, use one of the test sketches to manually query the vehicle for this custom PID. Then, record the exact response and post it here. |
I think Header / Module ID. (end of this page) |
Just found this example with more info. Another crazy example about VESS - CAN mod explained ATcommands (init, protocol 6) for OBD adapter ( screenshot from OBD2 Simulator, found on the net) : |
Here is the response, using your demo sketch:
|
This is all a little confusing - all I need is the query and the exact response. Most likely, however, you will have to send and parse this particular PID response yourself since the output of the library's parser is 64bit max. You can still find utility in the library for setting up the ELM327 and polling less eccentric PIDs |
I combined 2 demo sketches, but basically I just sent the "220101" thru Arduino Serial Monitor (using this OBD adapter + this ESP32 TTGO board).
and the exact response was this (where 03E = 62 bytes length and 620101 = 40h + PID):
Today I will try this:
|
So here is the results for queryPID(34, 257) =>PID 22 0101 at every 2 seconds
Modified payloadLen = 200 in elmduino.h (line 300)
From here the car was turned ON ( 7F2212 was sent 3 times for each query, I don't know what is this)
Strange: sometimes 7F2212 appears later in the packet, between frame 0: and frame 1:
|
Is this a snipet of your code? Should I had: To set the Header first? Thanks |
@herode10 It's from the demo code, but yes you should set the Header first, using this command, otherwise more ECUs will respond with the same message. |
Wow! Impressive work! Thanks for the response. |
This is continuation of issue 4
some custom PIDs return values and suggested calculation for result is divided in two parts A and B (all examples for Torque app)
see example of calculations suggested -> here
if A256+B makes all sense as it's simply conversion of longer response to decimal (I guess)
such a calculation :
(A33.55/255+B*0.13/255)-12
is impossible to get with current findResponse()
Would it be possible to return A and B separately so calculation could be done on them ?
currently the most complex query & response for me is
Distance Since Last DPF Regeneration Dist. DPF 223039 A*256+B 0 65535 km 7E0
myELM327.queryPID(34, 12345) //0x22 and 0x3039 => 34 and 12345
The text was updated successfully, but these errors were encountered: