logged data

Inquiry and support for Freematics products
Post Reply
Hexadecimal
Posts: 3
Joined: Fri Mar 08, 2019 2:36 am

logged data

Post by Hexadecimal »

Im assuming the following code in datalogger.ino,

PID_POLLING_INFO obdData[]= {
{PID_SPEED, 1},
{PID_RPM, 1},
{PID_THROTTLE, 1},
{PID_ENGINE_LOAD, 1},
{PID_FUEL_PRESSURE, 2},
{PID_TIMING_ADVANCE, 2},
{PID_COOLANT_TEMP, 3},
{PID_INTAKE_TEMP, 3},
};

is what controls what is output to DATA\n.CSV

0,23135
10D,0
10C,0
111,100
104,0
10E,5
20,28,14,-107
24,1570

If true how do I convert this data into actual decimal equivalents?
The PID formula for rpm is ((A*256)+B)/4.
aboaboit
Posts: 23
Joined: Mon Mar 26, 2018 4:55 am

Re: logged data

Post by aboaboit »

Hi.

if you check in libraries/FreematicsPlus/utility/OBD.h you will see the defintions for those symbols, for example PID_RPM corresponds to 0x0C.
Now, the sketch handles real PIDs and "fake" PIDs in a slightly different way: real PIDs are logged with a leading "1" (I suppose this is a mnemonic referring to OBD mode 1) whichi gives you 3 digit codes while the rest are fakes (meaning, non OBD)

So you have:
0: this is a millisecond-resolution timestamp, counting from the boot of ESP32
1xx: a real mode 1 PID (those defined in obddata)
24: the battery voltage

In other words, the value you're looking for is
10C,0
(that is, engine off)

The conversions between the raw values and those returned by the ECU is either handled internally in the interface chips (STM32 and its protocol-specific companion) or in libraries/FreematicsPlus/FreematicsOBD.cpp .

Long story, short: turn the engine on and you should see reasonable values in all lines with 10C. At least this is the case for me.

HTH.
Post Reply