2

I am having trouble parsing NMEA sentences coming from a GY-NEO6MV2 board (https://www.cytron.io/p-gps-neo6mv2), using the TinyGPS (https://github.com/mikalhart/TinyGPS) library. The GPS board itself is connected to an Arduino Pro Mini 3v3 8MHz (ATmega328).

First of all, to start debugging I want to disable all NMEA sentences other than GGA and RMC (which are the only ones I need for this project).

According to the manual, this can be done by sending PUBX commands through the SoftwareSerial (no need for binary UBX).

I am doing this in the following way:

    #include <SoftwareSerial.h>
    #include <TinyGPS.h>

    // GPS SoftwareSerial
    // Shares pins with (MISO 12/ MOSI 11) used for SPI
     
    #define GPS_RX_PIN 12
    #define GPS_TX_PIN 11
     
    TinyGPS gps;
    SoftwareSerial GPSSerial(GPS_RX_PIN, GPS_TX_PIN);
     
    void setup()  
    {
      Serial.begin(115200);
      GPSSerial.begin(9600);
     
          GPSSerial.print("$PUBX,40,GLL,0,0,0,0*5C\r\n");
          GPSSerial.print("$PUBX,40,ZDA,0,0,0,0*44\r\n");
          GPSSerial.print("$PUBX,40,VTG,0,0,0,0*5E\r\n");
          GPSSerial.print("$PUBX,40,GSV,0,0,0,0*59\r\n");
          GPSSerial.print("$PUBX,40,GSA,0,0,0,0*4E\r\n");
    }
     
    void loop()
    {
    // ...
    }

However, the GPS board will not respond to these commands and keep sending all the NMEA sentences.

FWIW, this is the original code I'm building my project on - https://github.com/billygr/arduino-aprs-tracker/blob/master/arduino-aprs-tracker.ino

Any thoughts would be appreciated.

3 Answers 3

3

I've tried your code sending those PUBX commands to a ublox module and they work successfully for me.

There are a lot of fakes about on the internet using AT6558 chips repackaged as ublox. Check the GPTXT messages that are output when the GPS module is powered up to see if its really a ublox module or a fake one like this:

$GPTXT,01,01,02,MA=CASIC*27
$GPTXT,01,01,02,HW=ATGM332D,0080113573899*18
$GPTXT,01,01,02,IC=AT6558-5N-31-0C500000,J7M911C-B2-008827*50
$GPTXT,01,01,02,SW=URANUS4,V4.3.0.5*18
0

You have not enough Zeros in your command!

$PUBX,40,GLL,0,0,0,0,0,05C (CR)(LF) $PUBX,40,GSA,0,0,0,0,0,04E (CR)(LF) $PUBX,40,GGA,0,0,0,0,0,05A (CR)(LF) $PUBX,40,GSV,0,0,0,0,0,059 (CR)(LF) $PUBX,40,RMC,0,0,0,0,0,047 (CR)(LF) $PUBX,40,VTG,0,0,0,0,0,05E (CR)(LF) $PUBX,40,GRS,0,0,0,0,0,05D (CR)(LF) $PUBX,40,GST,0,0,0,0,0,05B (CR)(LF)

0

To enable all the messages in a NEO-6M, please use these:

  gpsSerial.print("$PUBX,40,GGA,0,1,0,0,0,05B\r\n");
  gpsSerial.print("$PUBX,40,GLL,0,1,0,0,0,05D\r\n");
  gpsSerial.print("$PUBX,40,GSA,0,1,0,0,0,04F\r\n");
  gpsSerial.print("$PUBX,40,GSV,0,1,0,0,0,058\r\n");
  gpsSerial.print("$PUBX,40,RMC,0,1,0,0,0,046\r\n");
  gpsSerial.print("$PUBX,40,VTG,0,1,0,0,0,05F\r\n");
  gpsSerial.print("$PUBX,40,ZDA,0,1,0,0,0,045\r\n");

Info from laroo, tested and seems to work.

New contributor
Freaky is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.