configurate DATALOGGER

Discussion about software developed by Freematics, including Freematics Builder and Freematics Emulator GUI
Abico1594
Posts: 3
Joined: Thu May 17, 2018 8:32 am

configurate DATALOGGER

Post by Abico1594 »

Hi, i'm new in Freematics One + and I'd like some help to configurate datalogger, i need to read and save the next information:
- PID_SPEED
- PID_RPM
- PID_THROTTLE
- PID_COOLANT_TEMP
- PID_INTAKE_TEMP
- PID_BAROMETRIC
- PID_SHORT_TERM_FUEL_TRIM_1
- PID_LONG_TERM_FUEL_TRIM_1
- PID_INTAKE_MAP
- PID_FUEL_INJECTION_TIMING
- PID_ENGINE_FUEL_RATE

I tried to change the PID_POLLING_INFO obdData introducing by the next way
PID_POLLING_INFO obdData[]= {
{PID_SPEED, 1},
{PID_RPM, 1},
{PID_THROTTLE, 1},
{PID_COOLANT_TEMP, 3},
{PID_INTAKE_TEMP, 3},
{PID_BAROMETRIC, 3},
{PID_SHORT_TERM_FUEL_TRIM_1, 5},
{PID_LONG_TERM_FUEL_TRIM_1, 5},
{PID_INTAKE_MAP, 6},
{PID_FUEL_INJECTION_TIMING, 3},
{PID_ENGINE_FUEL_RATE, 3},
{0, 0},
};
But i can't get the last 4 PIDS, please help me how to get them.
Thank you
clochardm33
Posts: 3
Joined: Wed Jun 20, 2018 9:55 pm

Re: configurate DATALOGGER

Post by clochardm33 »

Yep, me too. Any help at all would be much appreciated.
If it anything to do with the declaration of
// bit map of supported PIDs
byte pidmap[4 * 4] = {0};
in FreematicsOBD.h
This seems to imply that there are a max of 16 entries (unless this is increased).
clochardm33
Posts: 3
Joined: Wed Jun 20, 2018 9:55 pm

Re: configurate DATALOGGER

Post by clochardm33 »

You too?
If I get anywhere I'll let you know.
aboaboit
Posts: 23
Joined: Mon Mar 26, 2018 4:55 am

Re: configurate DATALOGGER

Post by aboaboit »

clochardm33 wrote:

> If it anything to do with the declaration of
> // bit map of supported PIDs
> byte pidmap[4 * 4] = {0};
> in FreematicsOBD.h
> This seems to imply that there are a max of 16 entries (unless this is
> increased).

pidmap is a bitmap (see for example COBD::isValidPID) so the entries should be 16*8.
also, I would try to keep the PIDs sorted by increasing tier: from reading the code in loop() I'd say it expects that.
clochardm33
Posts: 3
Joined: Wed Jun 20, 2018 9:55 pm

Re: configurate DATALOGGER

Post by clochardm33 »

This is starting to make sense a bit now. As the code isn't commented it is all a bit of a muddle at first glance.
I think the short answer is that you are not getting the PIDs you want as your car doesn't support them (despite what you may think).

In the routine COBD::init there is the section after the line stage = 3;
This is where the pidmap[] array is populated. This is the bit map (as aboaboit says) of the PIDs that the car reports back as being valid.
The array contains the entries of responses of the PID address x0, x20, x40, x60. These are the car coming back giving a 1/0 for each of the addresses.
It is in https://en.wikipedia.org/wiki/OBD-II_PIDs
pidmap[] is then a map of which PIDs the car will give a response to (a 1) and which the car will not give a response to (a 0).
The line in the datalogger.ino
if (!obd.isValidPID(pid)) {
continue;
}
simply compares the address of the pid you request to that pid's location in the pidmap. If the map contains a 1 then the pid you are trying to read is valid and can be read from. If it contains a 0 then the pid is not valid, the continue; drops out of the loop and moves onto the next pid.

There is also another condition in the obd.isValidPID() function which means that any pid with an address above x7F is always returned false. This is because the pidmap[] only reads the addresses x0, x20, x40, x60, and x60 + 32 takes you to x80, which is not something that the pidmap config reads.

Therefore if the car comes back and says that the pid address is not one that it reports then you get nothing (regardless of the tier).
The tier is the relative frequency of polling, but (again as aboaboit says) this should be in numerical order.
aboaboit
Posts: 23
Joined: Mon Mar 26, 2018 4:55 am

Re: configurate DATALOGGER

Post by aboaboit »

Hmm, right now the isValid method returns true when the PID index is above 0x7F which makes no sense to me: there is no space to map supported PIDs above that number and also no transcoding of values in the library.
danish
Posts: 1
Joined: Wed Jun 05, 2019 7:41 pm
Contact:

Re: configurate DATALOGGER

Post by danish »

Great information.. :)
Urmila785
Posts: 1
Joined: Thu Jun 18, 2020 8:05 pm

Re: configurate DATALOGGER

Post by Urmila785 »

I'm looking for something like that
parkinson87
Posts: 1
Joined: Fri Jun 19, 2020 12:07 am

Re: configurate DATALOGGER

Post by parkinson87 »

I thought it was just me sticking with this thing.
Raj120p1
Posts: 2
Joined: Fri Aug 07, 2020 8:06 pm

Re: configurate DATALOGGER

Post by Raj120p1 »

Great information
Post Reply