TinyGPS++ library issue

So I have been working with using Mikal Hart’s TinyGPS++ library (which I’ve had great success with in the past on other MCUs) on a Boron.
I have successfully adapted the original Device Example file to use the Serial1 pins to receive serial messages from a GPS module (Beitian BN-220), and then passing that info to the library to parse what I need (lat, lon), then on to Log.info() in a format that it will accept [which was a huge pain as I wrangled with every type of type conversion (sprintf, etc.) I could think of… until I found in the docs that “%ld” simply works. Thank you!] for debugging. However I am still not getting valid data.
So to test I hooked the module up to an FTDI serial cable and in a serial terminal I could see I was getting valid NEMA sentences i.e.
“$GNRMC,001609.00,A,4153.95928,N, etc.”
However looking at the BasicExample file provided with the library I noted that the hard coded example strings were
“$GPRMC,045103.000,A,3014.1984,N, etc.”
and I couldn’t help noticing that one sentence begins $GPS___ and the other $GPN__
So could the problem be as simple as my module sends sentences in the new nomenclature (e.g. we now say Global Navigation vs Global Positioning) that the library doesn’t accept and can’t/doesn’t parse?
If so I suppose I could dig down into the .cpp file to see if I could correct it, but I’m a bit out of my league there. So…
I am curious then if anyone else has 1) had similar problems? And 2) if anyone has solved this and would be willing to share their code?

There are a couple of options:

  1. Use the AssetTrackerRK library. It has some stuff you don’t need, but the linker will just remove the unnecessary stuff.

  2. Grab the TinyGPS++ out of the library. It should be usable with minimal or no changes standalone.

  3. Search for GNRMC in my C++ file and apply the same change to your code. It’s really just a couple line change. You probably also need the GNGGA change.


@rickkas7 thanks for the quick response.
In case it’s helpful to anyone else, per your advice I did the following:
From the AssetTrackerRK library I copied the TinyGPS++.h and .ccp files to a new sketch with my own .h & .cpp tabs [curious side note: the web IDE would not allow me to use ++ (plus signs) in the name, so I had to name mine TinyGPSplus.h ]
I then took my code*, a modified version of Mikal’s Device_Demo, which uses Serial1 and Log.info() for the Boron, and after after wrangling some string casting I was able to get accurate latitude and longitude valeas printed to the serial port.
Thank you!
*anyone interested in seeing my code is welcome to PM me at rdrink@saic.edu

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