can anyone help me out with a OBDII request Mode 09 04 Calibration ID Up to 16 ASCII chars. Data bytes not used will be reported as null bytes (0x00). Several CALID can be outputed (16 bytes each)
im requesting the data but am trying to figure out why its not the same as the scan tool (efi live) im using to verify if its correct.
i was trying this sample from the apps section i just changed the message to my request.
void readVIN() {
Serial.println("Reading VIN");
// Send request to read VIN
CANMessage message;
message.id = OBD_CAN_BROADCAST_ID;
message.len = 8; // just always use 8
message.data[0] = 0x02; // 0 = single-frame format, 2 = num data bytes
message.data[1] = 0x09;
message.data[2] = 0x04;
carloop.can().transmit(message);
OBDMessage obd;
unsigned long start = millis();
unsigned long timeout = 200; // ms
while(millis() - start < timeout) {
if (carloop.can().receive(message)) {
if (message.id == 0x7E8) {
Serial.println("Got reply from ECU");
// Add the data to our OBD message
bool needsFlowControl = obd.addMessageData(message);
if (needsFlowControl) {
// Sending flow control
CANMessage flowControl = obd.flowControlMessage();
carloop.can().transmit(flowControl);
Serial.println("Sent flow control");
}
// Use the data when the message is complete
if (obd.complete()) {
String vin = "";
// VIN is 17 character and can be left-padded with zeros
for (int i = obd.size() - 17; i < obd.size(); i++) {
vin += String((char)obd.data()[i]);
}
Serial.println("VIN: " + vin);
if (Particle.connected()) {
Particle.publish("vin/result", vin, PRIVATE);
}
obd.clear();
Serial.println("Done");
return;
}
}
}
}
the problem im having is the data im gettig back with this code is not the same as in efi live. i can see the request if i sniff the tool and the response im just figureing out why the code snippet is messing up the response. it just comes back as squares and random stuff lol
It looks like in your code that you are taking the raw data coming back and adding it to your string as if it was ASCII data.
When it comes back as squares and random stuff, it convinces me that the raw data is not ASCII, but something else that will need to be converted.
One way to get started is to convert the raw data to HEX characters and send that to your string. That way we can see the data in bytes. If you provide an example of that, along with an example of what your scan tool is providing, then we should be able to sort it out by comparing them.
according to wiki mode 09 04 is Calibration ID comes Up to 16 ASCII chars. Data bytes not used will be reported as null bytes (0x00). Several CALID can be outputed (16 bytes each) Mode 09 04
7E0 [8] 02 09 04 00 00 00 00 00_
but when i use the carloop and the OBDII vin request sample app 09 04 im getting this data back
313236333730333500000000
on another tool EFI live im able to verify the calibration ID “12646438”
ive tried a few things but lost a bit, going to try and make own “request” handler and see if that is whats messing me up. anyone with some info welcome to comment.
I took the calibration ID “12646438” and converted it to hex using this ASCII table
I got: 31 32 36 34 36 34 33 38
This row of data matches the first part:
Look into it more and see if there is a certain way that the Calibration ID data should be interpreted…
I think things are getting closer to solving it.
yea that number is similar im able to refence EFI live to determine what it is, and none of numbers are the actual “calibration ID” ive gotten “Slave Calibration” and a few others listed from requesting 02 09 04
which got me to belive 02 09 06 should be the Calibration ID. but still cant get the correct data. even my elm327 can get the info lol im overlooking something i know it.