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

Enable GNRMC and GNGGA sentences in TinyGPS #75

Open
K7MDL2 opened this issue Aug 31, 2020 · 0 comments
Open

Enable GNRMC and GNGGA sentences in TinyGPS #75

K7MDL2 opened this issue Aug 31, 2020 · 0 comments

Comments

@K7MDL2
Copy link

K7MDL2 commented Aug 31, 2020

Modern GPS can receive data from a number of GPS satellite systems now. Made a minor code change to TinyGPS.cpp to allow both the US GPS system GPRMC and GPGGA messages and the combined satellite services format GNRMC and GNGGA sentences which supply the same data from any available satellite source.

This came about plugging a BN-880 u-bloc Neo8/8 GPS with onboard HMC5883L compass into the project. The default message set is GNXX. Used U-Center program form u-blox to configure the message output to just GNRMC and GNGGA sentences to reduce CPU parsing overhead. This model GPS has onboard flash to store config changes.

Add 2 new sentences (GNXXX)
#define _GPRMC_TERM "GPRMC"
#define _GPGGA_TERM "GPGGA"
#define _GNRMC_TERM "GNRMC" // support other systems
#define _GNGGA_TERM "GNGGA" // support other systems

Match on either and convert to the standard sentence type. Here is the slightly revised part.

// the first term determines the sentence type
if (_term_number == 0)
{
if (!gpsstrcmp(_term, _GPRMC_TERM) || !gpsstrcmp(_term, _GNRMC_TERM)) // support other systems with GNXXX and convert to standard sentence type
_sentence_type = _GPS_SENTENCE_GPRMC;
else if (!gpsstrcmp(_term, _GPGGA_TERM) || !gpsstrcmp(_term, _GNRMC_TERM)) // support other systems with GNXXX and convert to standard sentence type
_sentence_type = _GPS_SENTENCE_GPGGA;
else
_sentence_type = _GPS_SENTENCE_OTHER;
return false;
}

I still have yet to make the 5883L compass work.

  • Mike
    K7MDL
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

No branches or pull requests

1 participant