Page 1 of 1

Logging extra OBD data fails

Posted: Thu Feb 09, 2017 4:30 pm
by siberian
I'm trying to log extra OBD data including preset parameters by editing datalogger.ino file.
Below is line 318-333 of original code.
For OBD data, values in the pids and pids2 are retrieved in the csv file.
Values in the pids are retrieved every time, while values of pids2 are retrieved once a while.

To retrieve other parameters, I tried switching a PID code in pids2[] with FUEL_LEVEL(in FreematicsONE.h).
But the logged data didn't have fuel level data.
I also tried with other PID code, but it also didn't work.

Am I missing something or is there any problem with the original code?
I read through functions logData and readPID and couldn't find any clues.

if (one.state & STATE_OBD_READY) {
byte pids[]= {0, PID_RPM, PID_SPEED, PID_THROTTLE, PID_ENGINE_LOAD};
byte pids2[] = {PID_COOLANT_TEMP, PID_INTAKE_TEMP, PID_DISTANCE};
int values[sizeof(pids)];
static byte index2 = 0;
pids[0] = pids2[index2 = (index2 + 1) % sizeof(pids2)];
// read multiple OBD-II PIDs
if (one.readPID(pids, sizeof(pids), values) == sizeof(pids)) {
one.dataTime = millis();
for (byte n = 0; n < sizeof(pids); n++) {
one.logData((uint16_t)pids[n] | 0x100, values[n]);
}
}
if (one.errors >= 10) {
one.reconnect();
}

Re: Logging extra OBD data fails

Posted: Thu Feb 09, 2017 7:09 pm
by siberian
I tried changing this line.
byte pids2[] = {PID_FUEL_LEVEL};
My datalogger(Freematics ONE) does not log Fuel Level Input data.
I think this should be answered.

Re: Logging extra OBD data fails

Posted: Thu Feb 09, 2017 11:21 pm
by protomor
I think your car doesn't have that PID so the logger can't log it.

Re: Logging extra OBD data fails

Posted: Fri Feb 10, 2017 1:20 am
by siberian
I'm new to this field so didn't know the fact.
Good to know that not all cars gives all values in obd2 pid list. :lol:
I really appreciate your help.

Re: Logging extra OBD data fails

Posted: Fri Feb 10, 2017 2:28 am
by protomor
Every manufacturer puts in their own PIDs and there are many different protocol types. Each protocol has its own issues and what it will and won't give you. The simplest way to find out what your car puts out is to just try the pid and see if something comes back; if anything.

Re: Logging extra OBD data fails

Posted: Mon Feb 20, 2017 9:25 pm
by onche
Hello, anyone know how to read PIDs that are not standardized, but we have the address ?
Like this guy have read the data for brake pedal and lot of useful stuff : https://x0r.fr/blog/39
I want to record these

Thank you !