speeding up data update rate of GPS NEO6MV2 via NMEAGPS and NEOGPS

Hello Forum,
I’ve been trying to find a way to configure a NEO6MV2 (Arduino Compatible GPS Receiver Module | Jaycar Electronics) to increase the default cadence of data update from 1 Hz to … as high as possible to still give a reasonably accurate (<10m) measurement.

There’s a lot of configurable items, so to be clear; I want to be able to obtain GPS data faster than once a second - ideally perhaps, around 0.25 Hz. (the default is 1 Hz). - Not modify the TIMEPULSE nor the baud rate.

I’ve examined available documentation including /Dev’s library at NeoGPS/Extending.md at master · SlashDevin/NeoGPS · GitHub, and spent too long searching various fora, but if anyone can point me to some documentation might have missed, or has a solution on-hand, please let me know!.

Many thanks.

Module documentation is at
https://www.jaycar.com.au/medias/sys_master/images/9183387811870/XC3712-dataSheetMain.pdf I’m using NMEAGPS library, and my test scripts are pretty basic per below, I’m using an arduino UNO, but i dont think the board matters a great deal.

#include <NMEAGPS.h>
#include <NeoSWSerial.h>

NeoSWSerial gpsPort(8, 7);
NMEAGPS GPS;


void setup()
{
  Serial.begin(115200);

  gpsPort.begin(9600);
  GPS.send_P( &gpsPort, F("PMTK220,1000") );   // 1 Hz update rate
}



void loop() {

  if (GPS.available( gpsPort )) {

    gps_fix fix = GPS.read();

    if (fix.valid.location) {
          <do stuff>
        }
    }
}

I should also point out that the UNO pin 7 is connected to the top of a series resistor voltage divider(P7 → 4k7 => 10k =G) , and the GPS RX pin picks off at the junction of the resistors (at 3.3V) as at https://forum.arduino.cc/index.php?topic=434405.0. The TX pin from the GPS is connected directly to pin 8 in the arduino.

Have you managed to find a data sheet that describes the NEO6MV2 in any useful detail?

The "official" NEO-6 data sheet does not mention that particular derivative, and I'm wondering if the NEO6MV2 is a stripped down, cheaper version of the NEO6M.

I don't have the NEO6MV2, so if you can find out the ROM/FLASH version number and post that, I and probably others would be interested.

Thanks for your help Jremington.

I’d noticed the documentation didnt mention a NEO6MV2 specifically, though I think section 8.2 in the ublox documentation (per your link) outlines that the “V” indicates “variant” number.
Im not sure if it’s reasonable to assume the firmware in V2 is the same as what you have.
I just noticed now that the documentation shows in section 1.3 that it might not be possible to have an update rate faster than 1Hz for the NEO6M anyhow.

As we appear to have a lack of other information, while I try to find out something a little more detailed, I’m posting an image of the front of the board, that might contain data useful for your question.

Many thanks again.

At this point, without having specific details about the firmware, the "advice" from various retailers is that the firmware of the GY-NEO6MV2 is the same as GY-NEO6M - though I'm not sure they really know much about it.

The documentation provides only two rom/flash alternatives, I think it's safe to assume the version of the NEO6MV2 is the same as NEO6M, as shown on page 2: i.e. version ROM7.03

Connect the GPS to a standard USB serial adapter and configure it with the PC application that UBLOX provide for the purpose, U-CENTER.

UCENTER has a display of the output from the GPS so you will be able to see the rate at which it sends the sentences.

I dont see how altering the sentance rate impacts on accuracy.

Agreed, download the latest version of UCENTER and explore the GPS module setup possibilities. '

For a fast update rate you MUST limit the sentence types output over serial, since you stated:

Not modify the TIMEPULSE nor the baud rate.

Many thanks folks.

Since I dont use a PC, that solution is a little problematic. I'd thought it was possible to configure a ublox device via some packet protocol command- after all, the ucenter software must be doing something like that anyhow.

I'd tried a few alternatives, since I'm not 100% certain of the formats:

adressing via the gps serial:

void setup()
{
  Serial.begin(115200);
  gpsPort.begin(9600);

GPS.send_P( &gpsPort, F("PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0") );
GPS.send_P( &gpsPort, F("PMTK220,200")); 
}

or alternatively with checksums, and different syntax.. (both this format, and the format above appear in various online literature). e.g:

void setup()
{
  Serial.begin(115200);
  gpsPort.begin(9600);

gpsPort.println( F("$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28") );
gpsPort.println( F("$PMTK220,200*2C")); 
}

Though I think I just don't understand the expected syntax, and I must not be interpreting properly (what I think is) the available documentation: https://cdn-shop.adafruit.com/datasheets/PMTK_A11.pdf
Have I misunderstood these protocol commands and the roles they play in the operations of the GPS?

srnet, thanks for your reply: i was assuming the operation of the GPS module. my reasoning is b based on the fact that shorter integration periods yield larger error margins, though if the GPS doesnt spend much time taking data anyhow, then increasing the data rate won't really affect the measurement.

Anyhow, as I dont have easy access to a PC, can someone comment on the utility (and perhaps, my implementation) of the packet commands for increasing data update rate?
thanks again.

Given the lack of clarity of the published documentation, I would not even attempt to solve this problem using the UBLOX protocol. Surely you can borrow someone’s PC running Windows.

However, if your attempts are not working at all, consider that the Arduino may not be sending the and characters, in the correct order to denote the end of the line. Better to use Serial.write() and format the message completely and accurately.

emuller:
Since I dont use a PC, that solution is a little problematic. I'd thought it was possible to configure a ublox device via some packet protocol command- after all, the ucenter software must be doing something like that anyhow.

You will struggle to understand the commands from the manual, but what happened when you tried the commands in your post, did the refresh rate change ?

What operating system are you running the Arduino IDE on ?

Thanks Srnet,
As you might be guessing, the refresh rates did not change when I'd tried the PMTK commands - despite trying a few formats and different write commands.
Unfortunately, the NeoSWSerial library does not have a Write member (according to my IDE, though I dont know how to determine the modules in the library), so I couldnt find a way to implement jremington's gpsPort.Write suggestion.

I'm using OSX10.12.5 - a little out of date I guess, but perhaps not too bad compared to the age of the libraries.

I'm trying to write a char buffer with sprint now, in case it will write the LF, CR characters better.

I'm trying to write a char buffer with sprint now, in case it will write the LF, CR characters better.

That should work, as long as there is an equivalent to Serial.print() in the software serial package (as opposed to .println() ).

But there are other software serial packages. I use AltSoftSerial.

Assuming the NEO-6MV2 has the same config packet anatomies as the normal NEO-6M, it is really easy to change the refresh rate…as long as you have the right packet :wink:

Lucky for you, I know how to change the refresh rate to 10Hz:

// <<---------------------------------------------------------------------------//CFG-RATE packets:
	byte updateFreq[FREQ_LEN] = {
	  0xB5, // sync char 1
	  0x62, // sync char 2
	  0x06, // class
	  0x08, // id
	  0x06, // length
	  0x00, // length
	  0x64, // payload
	  0x00, // payload
	  0x01, // payload
	  0x00, // payload
	  0x01, // payload
	  0x00, // payload
	  0x7A, // CK_A
	  0x12, // CK_B
	};
	// <<---------------------------------------------------------------------------//CFG-RATE packets

Just use a for loop to cycle through the entire packet array using Serial.write(packet[index]) like so:

//send the packet specified to the receiver.
void neo6mGPS::writeConfigPacket(byte packet[], byte len)
{
	for (byte i = 0; i < len; i++)
	{
		Serial.write(packet[i]);
	}

	return;
}

Lastly, if you want to see more config packet anatomies, check out the header file in my custom NEO-6M library: link

Okay,
Thanks guys for your help - though nothing really seems to be working - the data refresh rate stays at ~1 Hz.

I think I’d like to check if I really am transmitting info to the GPS module - I was looking for a way to ping the module through the Tx pin - just as a way to check I can actually talk to it, though I’ve not found anything. does anyone know if this is possible?

A quick rundown on what I’Ve tried…

#include <NMEAGPS.h>
#include <NeoSWSerial.h>

NeoSWSerial gpsPort(8, 7);
NMEAGPS GPS;

#define FREQ_LEN    14
  byte updateFreq[FREQ_LEN] = {
    0xB5, // sync char 1
    0x62, // sync char 2
    0x06, // class
    0x08, // id
    0x06, // length
    0x00, // length
    0x64, // payload
    0x00, // payload
    0x01, // payload
    0x00, // payload
    0x01, // payload
    0x00, // payload
    0x7A, // CK_A
    0x12, // CK_B
  };


void setup()
{
  Serial.begin(115200);
  Serial.println( F("GPS heading each waypoint!") ); // F macro saves RAM

  gpsPort.begin(9600);

  for (byte i = 0; i < FREQ_LEN; i++)
  {
    gpsPort.write(updateFreq[i]);
  }


}


void loop() {

  if (GPS.available( gpsPort )) {
    Serial.println("GPS found");

    gps_fix fix = GPS.read();
    Serial.println("\tGPS data read");

    if (fix.valid.location) {      
        Serial.println("\t\tvalid GPS data found");

    }
  }
}

and also:

#include <NMEAGPS.h>
#include <NeoSWSerial.h>

NeoSWSerial gpsPort(8, 7);
NMEAGPS GPS;
#define PMTK_SET_NMEA_UPDATE_5HZ  "$PMTK220,200*2C" //set the update rate from once a second
#define PMTK_API_SET_FIX_CTL_5HZ  "$PMTK300,200,0,0,0,0*2F\n" //set the position fix update rate
char buffer [24]; // must be large enough for the whole string plus nul


void setup()
{
  Serial.begin(115200);
  gpsPort.begin(9600);
  gpsPort.print(sprintf (buffer, "%s", PMTK_API_SET_FIX_CTL_5HZ)); 
  gpsPort.print(sprintf (buffer, "%s", PMTK_SET_NMEA_UPDATE_5HZ)); 

}


void loop() {

  // Process GPS characters

  if (GPS.available( gpsPort )) {
    Serial.println("GPS found");
    gps_fix fix = GPS.read();
    Serial.println("\tGPS data read");
    if (fix.valid.location) {
        Serial.println("\t\tvalid GPS data found");
    }
  }
}

As well as various modifications on the actual structure of the string sent as PMTK.

So - Perhaps I can’t talk to the GPS at all?
As I suggest above, perhaps I’m not even able to send anything to the GPS? Does anyone know how I might be able to send a ping to the GPS, and check I’m getting some expected return signal?

…my guess/hope is that I’ve still not formulated the packet string properly …

Thanks for all your help so far…

As well as various modifications on the actual structure of the string sent as PMTK.

Why are you sending PMTK (Mediatek format) messages to a UBLOX GPS ?

ah.. because that'S what came up when i googled for configuring a GPS data cycle cadence.
You've implicitly suggested a more tedious reality: GPS manufacturers use different protocols.

Thats simultaneously good news - since it probably explains why I was getting no result with PTMK, but now I have to go learn about NMEA and /or UBX protocols too.. ugh..

thanks again, and any pointers from here are greatly appreciated, i'm wading through some documentation again now (which is slightly less bewildering).

I just looked in NeoGPS, and it appears to have all the UBLOX protocol commands you need to set the data rate, disable certain sentences, etc. (assuming they work with the NEO-6MV2).

Try it.

Thanks, It works :slight_smile: Check the ubloxRate example and follow the prerequisites 1-4 and act on some other compile messages.