[obdgpslogger] P-Codes

Gary Briggs chunky at icculus.org
Mon Feb 21 21:45:11 EST 2011

On Mon, Feb 21, 2011 at 10:30:47PM -0400, Herring Cove wrote:
> Hi,
> I have been learning slowly about obdgpslogger and enjoying what it does.
> I need to read the p-codes from my OBD port. I was wondering if this is
> already setup with obdgpslogger and I have just missed it. Any info can
> help. Thanks to anyone who can help,

By "p-codes", do you mean trouble codes? [since they may have a prefix
of "P"]

There's a buncha code in there to do it, but I never really did much
with it. For example, in main.c, there's a block commented out that
would get called if you run with "-p" :

        unsigned int retvals[50];
        int vals_returned;
                retvals, sizeof(retvals)/sizeof(retvals[0]), &vals_returned);

        int q = 0;
        int c = retvals[0];
        for(q=1;q<1+2*c && q+1<vals_returned;q+=2) {
            printf("Error: %s\n", obderrconvert(retvals[q], retvals[q+1]));


I've no idea if that works; I must have commented out for a good reason.
Not sure, though.

Alternatively, you can always connect to your car and manually get the
trouble codes out by typing "03" at the prompt and hitting enter, then
manually decoding them. It takes only a minute or two, and detailed
instructions on how to do it are in the ELM327 documentation.

Gary (-;

More information about the obdgpslogger mailing list