You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the issue is that not all GPS receivers respond with the RMC data by preceding with GP. The same is true for the GCA data.
Thus using a defined term which includes the full GPRMC results in no valid sentences being found.
The first two characters after the $ sentence start, may be:
BD BDS - Chinese GPS system
GP GPS - Original USA GPS
GL GLOSNASS - Russian GPS system
GA Galileo - European GPS
GN GNSS (Global Navigation Satellite System)
The data following the identifiers are still in the NMEA 0183 format
The defines are found by using this TinyGPS code snippet.
int TinyGPS::gpsstrcmp(const char *str1, const char *str2)
{
while (*str1 && *str1 == *str2)
++str1, ++str2;
return *str1;
}
TinyGPSPlus uses a different method for the string compare (strcmp term, _GPRMC). Not sure if makes much difference for the final solution which and how it is solved.
One suggestion is that the GPS sentences have a format something like:
"${BD,GP,GL,GA,GN} {RMC, GGA, GSV,GSA,VTG},raw data
After the sentence start "$" is seen, it might be of use to look for the satellite system identifier one of (BD,GP,GL,GA,GN), if not seen, it's not likely to be a valid sentence, simply skip until sentence start "$" is seen again.
Once you've seen the satellite identifier and skipped to the next term in the sentence, that would be data format identifier (RMC, GGA, GSV,GSA,VTG) which you could then do a string compare before decoding.
If you identify the satellite, that might allow for library user to provide a mask of the satellite systems that they are willing to use... and if and AND results in no matches - ignore the sentence.
It could also be useful to set a bit map to describe which satellite systems were used to compile the data for the output from TinyGPS.
In the defines for TinyGPS we see:
#define _GPRMC_TERM "GPRMC"
#define _GPGGA_TERM "GPGGA"
the issue is that not all GPS receivers respond with the RMC data by preceding with GP. The same is true for the GCA data.
Thus using a defined term which includes the full GPRMC results in no valid sentences being found.
The first two characters after the $ sentence start, may be:
BD BDS - Chinese GPS system
GP GPS - Original USA GPS
GL GLOSNASS - Russian GPS system
GA Galileo - European GPS
GN GNSS (Global Navigation Satellite System)
The data following the identifiers are still in the NMEA 0183 format
The defines are found by using this TinyGPS code snippet.
int TinyGPS::gpsstrcmp(const char *str1, const char *str2)
{
while (*str1 && *str1 == *str2)
++str1, ++str2;
return *str1;
}
If the original defines are change to
#define _GPRMC_TERM "RMC"
#define _GPGGA_TERM "GGA
the TinyGPS software would then work with more receivers.
An alternative might be to include two new defines:
#define _GNRMC_TERM "GNRMC"
#define _GNGGA_TERM "GNGGA"
and then look for those strings and take action -- it's more cumbersome...
Sample data from the GPS receiver:
$GNZDA,201846.000,10,08,2023,00,004B
$GPTXT,01,01,01,ANTENNA OK35
$GNGGA,201847.990,4743.25572,N,12211.02802,W,6,08,2.4,77.8,M,-21.2,M,,4F
$GNGLL,4743.25572,N,12211.02802,W,201847.990,A,E53
$GNGSA,A,3,10,18,23,27,32,,,,,,,,5.7,2.4,5.2,13F
$GNGSA,A,3,27,33,41,,,,,,,,,,5.7,2.4,5.2,437
$GPGSV,3,1,11,02,09,305,,08,38,295,,10,80,315,29,15,11,045,,067
$GPGSV,3,2,11,18,30,121,26,21,17,305,,23,53,063,35,24,21,076,,06B
$GPGSV,3,3,11,27,49,244,30,32,38,189,41,194,06,291,,063
$BDGSV,2,1,05,14,25,055,,27,65,274,32,28,48,170,,33,53,056,31,071
$BDGSV,2,2,05,41,71,227,32,044
$GNRMC,201847.990,A,4743.25572,N,12211.02802,W,2.75,113.84,100823,,,E,V19
$GNVTG,113.84,T,,M,2.75,N,5.09,K,E*24
The text was updated successfully, but these errors were encountered: