MODGPS hanging

25 Apr 2011

Hello all + Andy,

I am attempting to use the MODGPS library but its hanging somewhere, not sure where yet.

Has anyone tested this lib at NMEA output rates higher than 1Hz?

I checked the output using MODSERIAL and see the NMEA sentences just fine so the problem must be after. I used the example code provided with MODGPS so the code is pretty basic.

I will keep looking but if anyone has any thoughts?

Thanks, Serge

25 Apr 2011

Hi Serge,

I use the Sparkfun Venus GPS with SMA Connector module to test MODGPS and haven't seen anything like you are describing (except when using the 1PPS which I found I had to buffer with a transistor, otherwise it caused an odd hanging behaviour).

  • What module are you using?
  • What baud rate?
  • What NMEA sentence frequency?
  • Does it hang "instantly" or after a period of operation?

Can you paste some examples of NMEA sentences (note, you might want to use MODSERIAL to capture the sentences).

I can't really "debug" it any further without really being able to replicate the problem you are seeing and that means more information.

25 Apr 2011

Hi Andy,

I have the same module funnily enough, I have configured only GGA and RMC sentences at a rate of 2Hz. UART speed of 57600

The hanging seems to be random in time but generally I do not even get to the print of the first Lat Lon statements of the example code.

If I comment out the following I don't get the hanging

if (_base != NULL) attach(this, &GPS::rx_irq);

So seems to be in here somewhere.

Thanks, Serge

25 Apr 2011

Hi Serge,

Been thinking on this while away. MODGPS came from a simple need I had and, on second thoughts, it's probably only going to handle 1Hz@9600 (or less) without the possibility of buffer corruption. 1Hz@9600 meets most modules as that's been pretty much the standard for GPS modules for some time (some use 4800buad also). However, many modern GPS units are now managing higher performanaces and update rates beyond 1HZ are now starting to become quite common in a moderately priced module.

To that end, the "inards" of MODGPS really need to be totally refactored to cope with this. I'll have a think and probably come up a totally new module that is more "all encompassing". In fact, I really should layout a proper design goal and I'll set that at being able to handle upto 10Hz@115200 for RMC, GGA and VTG sentences.

I'll send you my email address via a private message and perhaps you could assist in testing it out as I dev it?

25 Apr 2011

Hi Andy,

OK no problem, I have added you to my Skype contacts so if you turn on Skype I should appear. Would it make any sense leveraging MODSERIAL for the new version?

Thanks, Serge

02 May 2011

Hello Andy! After reading your post, I quote "To that end, the "inards" of MODGPS really need to be totally refactored to cope with this. I'll have a think and probably come up a totally new module that is more "all encompassing". In fact, I really should layout a proper design goal and I'll set that at being able to handle upto 10Hz@115200 for RMC, GGA and VTG sentences." I have the "66 Channel LS20031 GPS 10Hz Receiver" from sparkfun. And at 10hz RMC,GGA and VTG packets is exactly what i tried to do at 115200 baud. It usually works if i only use the RMC or GGA at 10 hz. I am now experimenting with GGA at 5hz, and RMC and VTG at 2 hz. The phenomena i encounter (in all cases) are that my code sometimes starts running and sometimes it doesn't start at all, well at least, it does not go past the RTC sync it hangs somewhere in the process of getting the gps time. I try to sync my mbed RTC with the GPS clock, when that is done i use an gga.attach in which i save all values in my own variables and then print them to my terminal (for now).

$PMTK251,115200*1F (baud) $PMTK220,100*2F (10 hz / 100ms) $PMTK314,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29 (RMC,VTG,GGA 10hz) $PMTK314,0,5,5,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29 (RMC,VTG 2 hz, GGA 10hz)

(without signal)

$GPVTG,0.00,TM,0.00,N,0.00,K,N*32

$GPGGA,165010.146,0,0,MM*48

$GPGGA,165010.246,0,0,MM*4B

$GPGGA,165010.346,0,0,MM*4A

$GPGGA,165010.446,0,0,MM*4D

$GPGGA,165010.546,0,0,MM*4C

$GPRMC,165010.546,V,0.00,0.00,020511,N*4E

$GPVTG,0.00,TM,0.00,N,0.00,K,N*32

I also notice some incidental strange values, 48.8 lat, 488 lon. 443 kts and track of 16000 degrees. The one thing that would be nice to have is easy access to the HDOP (maybe also the VDOP and LDOP) values.

Would MODSERIAL help anything? The mbed has no problem outputting the data directly though.. Thanks!

02 May 2011

Hello Joost,

I don't think this will work for you either above 9600, I know Andy has been working on a new version but not sure where he is with his development efforts. In the mean time you might have more luck using the TinyGPS library (which also exposes HDOP)

Regards, Serge

02 May 2011

Thanks man! Will check it out.