Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GnssMonitor: picking up GN* messages #78

Closed
HG-Dev opened this issue Aug 31, 2020 · 19 comments · Fixed by #79
Closed

GnssMonitor: picking up GN* messages #78

HG-Dev opened this issue Aug 31, 2020 · 19 comments · Fixed by #79

Comments

@HG-Dev
Copy link

HG-Dev commented Aug 31, 2020

I've been trying to figure out why GnssMonitor.OnMessageReceived has been interpreting exactly one real GGA message before going silent, and I think it might be the m_supportGNMessages flag.

Here's an idea of what my log looks like:

(OnMessageReceived) Gga receieved (right after else if (message is Gga gga))
(OnLocationUpdate) {lat, lon, alt, satellites}
(NmeaMessageReceived end) Gga message should have been processed
///
(NmeaMessageReceived end) Gga message should have been processed
(The message contained "GGA" but wasn't picked up by OnMessageReceived? Weird)
///
(NmeaMessageReceived end) Gga message should have been processed
///
(NmeaMessageReceived end) Gga message should have been processed
///
(NmeaMessageReceived end) Gga message should have been processed
///
Ignoring message in favor of Gsv (the m_supportGNMessages return)
(NmeaMessageReceived end) Gga message should have been processed
///
Ignoring message in favor of Gsv
(NmeaMessageReceived end) Gga message should have been processed

Assuming my device (a Bad Elf GPS Pro+) supports GN* messages, where are they interpreted?

@dotMorten
Copy link
Owner

GN is the combined message. Once it's detected that the device uses GN that is what is used for GGA.

@HG-Dev
Copy link
Author

HG-Dev commented Aug 31, 2020

Is this delivered in one string, or compiled over time? I've confirmed that OnLocationUpdate only works if this GN* flag is ignored.

@dotMorten
Copy link
Owner

I'm not really following what your issue is. Could you perhaps share a sample NMEA log from your device?

@HG-Dev
Copy link
Author

HG-Dev commented Aug 31, 2020

Okay. I'll be sure to identify where LocationChanged (whoops, not "OnLocationChanged") is firing.

@HG-Dev
Copy link
Author

HG-Dev commented Aug 31, 2020

badelf_nmea.log
As noted, LocationChanged is called only once. PropertyChanged is called so long as the given message is not GGA or RMC. I don't see any other areas updating coordinates, though...

@dotMorten
Copy link
Owner

Is the location actually changing?

@dotMorten dotMorten reopened this Aug 31, 2020
@HG-Dev
Copy link
Author

HG-Dev commented Aug 31, 2020

No. Once the first Gga message is parsed for coordinates, the coordinates (GnssMonitor.Latitude / GnssMonitor.Longitude) never change again, and so LocationChanged is never called again.

@dotMorten
Copy link
Owner

If your location isn't changing it makes sense that the location changed event doesn't fire then, right?
Anyway I'll take a look at the log a bit later

@HG-Dev
Copy link
Author

HG-Dev commented Aug 31, 2020

Sure, if I was standing stock still with fantastic precision on the part of my GPS receiver. For this log, I walked in a big circle.

@dotMorten
Copy link
Owner

Ok you just said the location wasn't changing. Sounds like we misunderstood each other 😂

@dotMorten
Copy link
Owner

Looking at the log, your bad elf is weird ;-) It supports GN messages, but it only uses it for GSA, and everything else is GP for location.
Did you configure your device to report messages like this, or is that just how the bad elf receiver works?

@dotMorten
Copy link
Owner

@HG-Dev I'm also seeing in the log you shared that almost all the messages have invalid checksums, and thus fail to parse

@HG-Dev
Copy link
Author

HG-Dev commented Sep 1, 2020

Yeah-- I still don't quite understand what GN messages are, but even I can tell they're not in there. EDIT: Okay, now I understand what GN messages are. Very scant indeed. The website specifies that it should have "GGA, GSA, GSV, RMC - Talker ID's GP,GL,GN." I guess I'll contact the maker to confirm what's going on.

The Bad Elf device has only two settings for NMEA, "Default (all NMEA sentences)" and "Simplified NMEA (GGA / RMC only)." I wouldn't worry about the checksums; the text between $ and * all check out with this website.

@dotMorten
Copy link
Owner

GP*** : GPS Satellites
GL*** : GLONASS Satellites
etc.
GN***: Combination of all satellites (and usually the one you want to use).

Never fully understood why we need location updates for each constellation, but it makes things tricky because we have to detect that this is a multi-band receiver, and we want to prefer the GN messages over the individual measurements, since this gives the most satellites for the solution fix.

@dotMorten
Copy link
Owner

It looks like I should probably detect if there's a GN version for each message type instead. I'll submit a fix for that. Thanks for testing this out and providing the feedback

@HG-Dev
Copy link
Author

HG-Dev commented Sep 1, 2020

Very illuminating, thanks! Glad to help.

@dotMorten
Copy link
Owner

dotMorten commented Sep 1, 2020

You're welcome. It seems rather odd that you're getting GPGGA messages but not GNGGA. Found this on the @BadElf website and it makes no sense to me:
image
Basically you only get GGA from the GPS system, but no GGA from GLONASS, or a combined one of them (I'm assuming Bad Elf probably uses GPGGA as the combined value but using the wrong identifier - otherwise there's really no point in having GLONASS support)

@HG-Dev
Copy link
Author

HG-Dev commented Sep 2, 2020

Followup: You're right, GPGGA is the combined value. In their support's words, "the Pro+ is built on a dual-frequency GNSS engine from Mediatek, it defaults to the talker identifier for for GPS (GP) for many of the messages regardless of whether the GLONASS signal is contributing to the solution."

@dotMorten
Copy link
Owner

Thanks for the follow-up. That's definitely against the NMEA spec but I can see why. Older NMEA libraries would likely only pass GP*** messages (including some older versions of this library).
Anyway the latest fix I made should address this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants