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();
}
Logging extra OBD data fails
Re: Logging extra OBD data fails
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.
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
I think your car doesn't have that PID so the logger can't log it.
Re: Logging extra OBD data fails
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.
I really appreciate your help.
Good to know that not all cars gives all values in obd2 pid list.
I really appreciate your help.
Re: Logging extra OBD data fails
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
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 !
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 !