TinyGPS library has issues

The TinyGPS library that is frequently referenced on the Arduino forums have issues. The library needs some updating.

I've posted an issue on github, but it library isn't being updated

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 OK
35
$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,E
53
$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,4
37
$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,,0
6B
$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,0
71
$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,V
19
$GNVTG,113.84,T,,M,2.75,N,5.09,K,E*24

1 Like

The TinyGPSPlus library has support for the GNSS sentences.

#define _GPRMCterm   "GPRMC"
#define _GPGGAterm   "GPGGA"
#define _GNRMCterm   "GNRMC"
#define _GNGGAterm   "GNGGA"

Would be nice if support for all systems were added, with possibly an option to ignore specific systems if you desired.

Agreed. TinyGPS and TinyGPS++ have the issue

From the Arduino libraries page

TinyGPS

Sensors
A compact Arduino NMEA (GPS) parsing library
Author: Mikal Hart
Maintainer: Mikal Hart

Read the documentation

The documentation is for an older version,

Whereas the tinyGPS version from MikeHart

also has the problem,

But this version from MikeHart is being updated and works

The library version that installs with the IDE is an older version.

That library is ancient and very unlikely to be updated not sure why people use it.

If you think it should be updated, then please do volunteer, your efforts would be appreciated.

Otherwise just use TinyGPS++.

So contact Arduino and have them update it.

Contributed libraries are generally maintained by the content creator. I have posted note elsewhere to Arduino, but if it takes a while to correct - we'd still have other using out of date versions.

I have sent comment to arduino.cc that's not an instant fix either. But individuals that are struggling might search for issues with Tinygps and they'd see the problem.

I'm not sure there is an updated version of TInyGPS, the github site is on version 13 from August 13, 2013.

TInyGPSPlus is up to verison 1.0.3a, from a little over a year ago, while the library manager still shows version 1.0.3. According to github, the only difference in the versions is a correction for the value of _GPS_VERSION, which was incorrectly left at 1.0.2

The Arduino Library reference page takes you to the old TinyGPS version which does not support the GN sentences for GPS receivers. Many of the chipsets now on the market will send GNRMC instead of GPRMC. The TinyGPSPlus version has the code changes to allow for the newer receivers.

The Arduino Library reference page for TinyGPS should be depreciated and the newer library promoted.

I'm not entirely sure how the "manage library" versions gets out of synch, but I helped a friend install TinyGPS an (oops) on a fresh Arduino IDE install on Linux and it did bring the old library.

Since TinyGPS is no longer being updated for newer chipsets - that library version should be marked as being deprecated - with a reference pushing new individuals to TinyGPS. If a library reference is marked as "obsolete", I would have immediately spotted the "oops"!

The primary reason for possibly using the TinyGPS instead of TinyGPSPlus was that the code size was slightly smaller - easier to fit into the Uno's. But most of the newer Arduino Chipsets and boards supported under the Arduino IDE now have much larger program memory and ram available.

This helps explain part of the confusion and why I've both contacted Arduino and have posted the comments in the forum.

" * ThermistorLibrary: This library allows you to read the thermistors very easily.

  • TinyDHT sensor library: Arduino library for Using DHT11, DHT22, etc Temp & Humidity Sensors with the ATtiny85 such as Adafruit Trinket and Arduino Gemma
  • TinyGPS: A compact Arduino NMEA (GPS) parsing library
  • TinyMPU6050: Tiny implementation for MPU6050 focusing on performance and accuracy
  • tinySHT2x: Arduino library for the SHT20, SHT21 and SHT25 temperature and humidity sensor. Optimized for AVR tiny.
  • TLC5947: Arduino library for TLC5947 24 channel 12 bit PWM.
  • TLE493D: This library provides an Interface for Infineon's TLE493D

Note the absence of TinyGPS++ or TinyGPSPlus on the reference page

You can spot that section I posted above at:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.