configurate DATALOGGER

Discussion about Data2KML and other open-source telematics utilities developed by us
Abico1594
Posts: 3
Joined: Thu May 17, 2018 8:32 am

configurate DATALOGGER

Postby Abico1594 » Thu Jun 07, 2018 7:19 am

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

Postby clochardm33 » Wed Jun 20, 2018 9:58 pm

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

Postby clochardm33 » Thu Jun 21, 2018 6:55 pm

You too?
If I get anywhere I'll let you know.

aboaboit
Posts: 8
Joined: Mon Mar 26, 2018 4:55 am

Re: configurate DATALOGGER

Postby aboaboit » Thu Jun 28, 2018 6:20 am

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

Postby clochardm33 » Tue Jul 31, 2018 1:25 am

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.


Return to “Freematics Software”

Who is online

Users browsing this forum: No registered users and 2 guests