0

I have a Raspberry Pi 3 with Adafruit's Ultimate GPS Pi Hat. I was able to successfully install gpsd and chrony. I am now getting NMEA and PPS thumbs up But I have a weird issue.

The Ultimate GPS module is spitting out more NMEA messages that I want: I want only GPGGA and GPRMC....but it is also replying with GPGSA, GPGSV, and GPZDA.

So Adafruit has some Python code/libraries that allows you to interface with the GPS module and 'talk' to it. (https://github.com/adafruit/Adafruit_GPS). Using this code I was able to send the following packet using the PMTK command packet (https://cdn-shop.adafruit.com/datasheets/PMTK_A11.pdf)

$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28

I then opened up Putty and using a 9600 serial connection to /dev/ttyAMA0 I see indeed that only GPGGA and GPRMC are being processed out:

enter image description here BUT...as soon as I reopen gpsmon/gpsd, all the NMEA message streams are reactivated'...what the heck ??

If I don't open gpsd/gpsmon...indeed only GPGGA and GPRMC are active.

Has anyone come across this issue before ?

[enter image description here

Tom
  • 1
  • 1
  • Well, you don't need to use puTTY to read the longwinded, difficult to ciper, text messages. You may like to read my answer to the following question for tips to selectively read only the data you want. (https://raspberrypi.stackexchange.com/questions/98840/is-my-gps-module-fried/98919#98919 ). Instead of using puTTY, you can use python to extract the data. – tlfong01 Jul 01 '19 at 01:37
  • Please don't post pictures of text. Instead paste the text direct into the question. – Ingo Jul 01 '19 at 09:07

1 Answers1

0

gpsd re-enables most sentence types when it detects that it is talking to the GPS chip that the Adafruit Ultimate GPS Hat uses (MTK3339).

The relevant code in gpsd reacts when it sees a sentence from the GPS Hat starting $PMTK705,, which identifies this GPS hardware. gpsd then sends a few configuration strings, including one for PMTK314:

// Set NMEA sentences.
(void)nmea_send(session, "$PMTK314,0,1,0,1,1,5,1,1,0,0,0,0,0,0,0,0,0,1,0");

There's no way in gpsd to disable this behaviour except a sledgehammer workaround, which is to invoke gpsd with the -b option to prevent it from writing to the device at all. On Raspbian, editing /etc/default/gpsd will do:

# Other options you want to pass to gpsd
GPSD_OPTIONS="-b -n"

Needless to say, disabling gpsd from writing to the device might have undesired consequences.

futzle
  • 1
  • 1
  • What possible reason could gpsd have to write to your GPS receiver? Other than to reconfigure it. Just use the `-b` option and you're done. – Dougie May 19 '21 at 08:13