|
From: | Thomas Giglia |
Subject: | Re: How do you access UBX MON-HW messages in a gpsd client |
Date: | Wed, 20 Mar 2024 14:37:29 +0000 |
Solved the problem. There were old gpsd libs in /lib/aarch64-linux-gnu/. Had to delete those libs and links and then create new links to the current libs.
Data values are making sense now.
Thomas
From: gpsd-users-bounces+tgiglia=hotmail.com@nongnu.org on behalf of Gary E. Miller Sent: Tuesday, March 19, 2024 3:43 PM To: gpsd-users@nongnu.org Subject: Re: How do you access UBX MON-HW messages in a gpsd client Yo Thomas!
On Tue, 19 Mar 2024 19:21:21 +0000 Thomas Giglia <tgiglia@hotmail.com> wrote: > I built/installed the source changes from the weekend. > When I tested it a couple of issues came up. Cool. > 1. The satellites_used and satellites_visible don't get updated in my > client. (they did with the old code) Without a copy of your client, no way for me to know what it does wrong. You did, of course, rebuild your client for the new header files? I'm still waiting for your build.log. A some point I give up and stop asking. > 2. The Latitude and Longitude > have the wrong values now. (they did with the old code). In your code? Or in cgps or xgps? > 3. The "jam" > field that was added to gps_fix_t is populated - allthough the value > is not what I would expect. it bounces around 1,071,980,216 when no > jamming signal is present, and jumps up to over 2,000,000,00 when I > introduce a jamming signal. If you ran, as I suggest, with "-nND 5", you will see what the values should be. > 4. To make matter worse (for me). The > debug output from the gpsd server shows that it has the correct > latitude and logitude. Its in the JSON/TPV output. In addition > utilities like cgps or gpsmon have the right values. Seems like its > just my client code that gets the wrong values (however the same code > worked before). Do I recall correctly that you are using the SHM method to read gps_data_t? > I extracted what I am doing into a small program to test and show > what I am doing: Oh, my. Did you look at the gpsd client examples? They show many of the things you are doing wrong. > void showGPSData(struct gps_data_t *data) > "<<data->online.tv_sec<<"."<<data->online.tv_nsec<<endl; You are supposed to check that feilds are valid, before using them. >From gps.h: * All double values use NAN to indicate data not available. * WARNING: Check all floats and doubles with isfinite() before using them! * isnan() is not sufficient. > for (;;) { > struct gps_data_t* newdata; > > if (!gps_rec.waiting(50000000)) > continue; > > if ((newdata = gps_rec.read()) == NULL) { > cerr << "Read error.\n"; > return 1; > } else { > showGPSData(newdata); > } > } Yeah, you really need to read the examples. https://gpsd.io/gpsd-client-example-code.html > If someone can give me a idea of why my code doesn't display the > correct lat,lon, and satellite information it would be much > appreciated. The examples directly address your issues. > Also one other question: How do we access the JSON in a client > program? Just open the stream, and ask for JSON with the ?WATCH command. gegps is a good example of doing that in Python. 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 |
[Prev in Thread] | Current Thread | [Next in Thread] |