gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change from 3.23 to 3.24 - program doesn't work?


From: Mike Tubby
Subject: Re: Change from 3.23 to 3.24 - program doesn't work?
Date: Wed, 22 Jun 2022 15:57:00 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0



On 21/06/2022 19:11, Gary E. Miller wrote:
Yo Mike!

Care to share with everyone?


Hi Gary,

Its a work project, so I would have to remove some code to protect the innocent.

I am tidying up and the code and productionising it and have just re-introduced the API version check which fails, thus:

    22-06-2022 13:48:22 GMT [Info] GPSD version: 3.22 API version: 3.14  App built against API version: 11.0
    22-06-2022 13:48:22 GMT [Notice] GPSD API mis-match ... exiting!

the code that generates this error is in my reader:

    /* check the GPSD version and API info here */
    if (gpsd_data.set & VERSION_SET) {

        xlog(XLOG_INFO, "GPSD version: %s API version: %d.%d  App built against API version: %d.%d\n",
            gpsd_data.version.release, gpsd_data.version.proto_major, gpsd_data.version.proto_minor, GPSD_API_MAJOR_VERSION, GPSD_API_MINOR_VERSION);

        if (gpsd_data.version.proto_major != GPSD_API_MAJOR_VERSION || gpsd_data.version.proto_minor != GPSD_API_MINOR_VERSION)
            terminate(3, "GPSD API mis-match ... exiting!\n");

    } else {
        /* process the rest of the data */
        process_gpsd_data(&gpsd_data);
    }



I am slightly confused ... is there:

    a) just an API version to check; or
    b) an API version *and* a protocol version to ckeck?

the header file /usr/include/gps.h contains this definition for the version information:

struct version_t {
    char release[64];                   /* external version */
    char rev[64];                       /* internal revision ID */
    int proto_major, proto_minor;       /* API major and minor versions */
    char remote[GPS_PATH_MAX];          /* could be from a remote device */
};


which appears to use "API version" interchangeably with "proto version" ?

I am testing on a Debian system with GPSD version 3.22, variables:

    version.release    contains "3.22" which is okay
    version.proto_major    contains int(3)
    version.proto_minor    contains int(14)

yet the comments say the API major/minor numbers int(11) and int(0) should be there - if they are the API versions?


If we have both a "protocol version" and an "API version" to deal with then version_t appears to need extending:

struct version_t {
    char release[64];                   /* external version */
    char rev[64];                       /* internal revision ID */
    int proto_major, proto_minor;       /* Protocol major and minor versions */
    int api_major, api_minor;           /* API major and minor versions */
    char remote[GPS_PATH_MAX];          /* could be from a remote device */
};

and the origin of the 3.14 needs exporting in /usr/include/gps.h



Can you advise further?


Mike



On Tue, 21 Jun 2022 18:28:37 +0100
Mike Tubby <mike@tubby.org> wrote:

David,

I have emailed you off list with an example from one of my projects 
which works with GPSD 3.15 through 3.24 which you may find helpful.

Mike

On 20/06/2022 19:25, David Taylor wrote:
On 20/06/2022 18:39, Gary E. Miller wrote:  
Yo David!

On Mon, 20 Jun 2022 11:22:39 +0100
David Taylor <gm8arv@yahoo.co.uk> wrote:
 
On 20/06/2022 07:41, Gary E. Miller wrote:  
Yo David!

I can't see how that ever worked.  Your program does not check
if the receiver JSON has the data you are trying to read.

Take a look at example.c for ideas on what is missing.  
Gary,

I could not find "example.c" for gpsd.  
It is in the git repo, in the tar ball, in the libgps man page, ion
the web page,  etc.

Since you don't know how to grep or search:

https://gpsd.io/gpsd-client-example-code.html


 
I did find gpssnmp.c and a compiled version, which appears to be a
tidied up version of the software I submitted some time back, for
which, thanks!  
Yeah, bot used by many.
 
On running the compiled version, though, I get a "connection
failed" error.

     pi@RasPi-22:~/gpsd/gpsd-3.24.1~dev/clients $ gpssnmp -g
.1.3.6.1.2.1.25.1.33 gpssnmp: ERROR: connection failed  
Hmm, I see that.  I'll look at it.

WHile we are talking SNMP, I have been asked where those OIDs came
from?

RGDS
GARY  
Gary,

I didn't find example.c in the GIT download.  I've used "find..." 
before, but when I saw lib... I thought "that can't be the right 
file"...  Thanks for the example URL.

Thanks for checking out gpssnmp.c.  The only peculiar thing about
this RPi is that ipV6 is disabled, but it was disabled on the
previous 3.23 install.

The OIDs are invented by me.  If you can find better - more
official - ones let's swap.

Cheers,
David  




RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem@rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]