Logging extra OBD data fails

Discussion about software developed by Freematics, including Freematics Builder and Freematics Emulator GUI
Post Reply
siberian
Posts: 5
Joined: Wed Feb 08, 2017 6:48 pm

Logging extra OBD data fails

Post 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();
}
siberian
Posts: 5
Joined: Wed Feb 08, 2017 6:48 pm

Re: Logging extra OBD data fails

Post 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.
protomor
Posts: 99
Joined: Wed Oct 14, 2015 9:17 am

Re: Logging extra OBD data fails

Post by protomor »

I think your car doesn't have that PID so the logger can't log it.
siberian
Posts: 5
Joined: Wed Feb 08, 2017 6:48 pm

Re: Logging extra OBD data fails

Post 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.
protomor
Posts: 99
Joined: Wed Oct 14, 2015 9:17 am

Re: Logging extra OBD data fails

Post 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.
onche
Posts: 20
Joined: Thu Sep 24, 2015 7:00 am

Re: Logging extra OBD data fails

Post 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 !
Post Reply