ELMduino icon indicating copy to clipboard operation
ELMduino copied to clipboard

Standard PID Request

Open interardu opened this issue 1 year ago • 2 comments

Hi. I'm guess I'm asking for you to do my homework for me....

I am trying to get Lambda data.

I have been following this https://github.com/PowerBroker2/ELMduino/issues/84 but the format has changed for the latest version? I am using the latest version of Elmduino according to the "Manage Libraries" in Arduino IDE.

This is the code I am using

if (DATArequest == 0){
float templambdaRATIO = myELM327.processPID(1, 36, 4, 1, (2.0 / 65536.0),0);
DATArequest = 1;
  if (myELM327.nb_rx_state == ELM_SUCCESS)
  {
    lambdaRATIO = templambdaRATIO;
 Serial.print(lambdaRATIO);
    DATArequest = 0;
  }
  else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
   SENSORnum++;
DATArequest = 0;
}

with debug enabled it returns "no data"

I can pull the data like coolant temp and rpm no problem.

The solution you gave in the issue linked above was to go from

2, 2.0/65536);

to

>> (((myELM327.numPayChars / 2) - 2) * 8)) * (2.0 / 65536.0)

I don't know what I need to do with the new format.....

interardu avatar Feb 13 '25 13:02 interardu

@interardu "No Data" response means that the request/response is OK, but the ECU has no data for that PID. Your previous example queried for OXYGEN_SENSOR_1_C which is PID 0x34, but your new code is querying for PID 0x36 (OXYGEN_SENSOR_3_C). Is that your intent?

jimwhitelaw avatar Feb 28 '25 16:02 jimwhitelaw

Oh! That is probably the problem. Ive been using an Uno until now but I think there might be memory issues, it doesnt work consistently. Ive got a Pro mega today. Ill get that up and running over the next few days. Thank you for taking the time to help me, I appreciate it. Not sure why I put 36. Ill try 34 and see if it works and let you know.

interardu avatar Mar 02 '25 12:03 interardu