Put a GPS NEO-6M in Power Save Mode

Hello,
I’m creating a beehive tracker for my beehives with a GPS NEO-6M.
In the NEO-6 datasheet, it’s written :

1.14.3Power Save ModePower Save Mode (PSM) allows a reduction in system power consumption by selectively switching parts of thereceiver on and off.

But I don’t know how what is le message to send at le GPS and how to send.
Do you have an idea ?
Thanks!

The Protocol Specification datasheet for a particular Ublox GPS contains lists all the configuration commands.

Or you can use the Windows U-Center program that will show you the commands and allow you to try them out.

Ok. In the u-blox 6 Receiver Description Including Protocol Specification, there are some explaination

Power modes are selected using the message CFG-RXM on page 18
and in the page 142 the description of the message.

So, how can I send the message with neogps or tinyGPSplus library for example ?

Its worth studying the examples provided with a particular GPS library.

Whilst TinyGPS provides no functionality to configure a GPS, I seem to recall NeoGPS did have an example of programming a Ublox GPS, so take a look.

In the neoGPS library examples, I think ubloxRate.ino is the good example to do a save power mode.
The dataSheet in page 142 give the message structure for the power management CFG-RXM configuration :

Header | ID | Length (Bytes) | Payload | Checksum
0xB5 0x62 | 0x06 0x11 | 2 | see below | CK_A CK_B

Payload contents :

Byte Offset | NumberFormat | Scaling | Name | Unit | Description
0 | U1| - | reserved1 | - | Always set to 8
1 | U1| - | lpMode | - | Low Power Mode
low Power Mode :
0: Max. performance mode
1: Power Save Mode (>= FW 6.00 only)
2-3: reserved
4: Eco mode
5-255: reserved

In the example, ubloxRate.ino, the function sendUBX is

void sendUBX( const unsigned char *progmemBytes, size_t len )
{
gpsPort.write( 0xB5 ); // SYNC1
gpsPort.write( 0x62 ); // SYNC2

uint8_t a = 0, b = 0;
while (len-- > 0) {
uint8_t c = pgm_read_byte( progmemBytes++ );
a += c;
b += a;
gpsPort.write( c );
}

gpsPort.write( a ); // CHECKSUM A
gpsPort.write( b ); // CHECKSUM B

} // sendUBX

So 2 first bytes (0xB5 0x62) are written in the sendUBX function and also the 2 CHECKSUMS.
I need help to write the const unsigned char * to pass to the sendUBX function to put the GPS in Power Save Mode or Eco mode.

Perhaps study the .ino file you mentioned a bit more.

Presumably if there is a function defined in that sketch (that you want to use) then elsewhere in the same sketch is examples of how to use the function.

Post the sketch here if you need more help.

With the code below, I don't have consumption difference with or without sendUBX(ubxPSM, sizeof(ubxPSM)); : around 70mA with an arduino nano and a ublox GPS neo-6M :

#include <NMEAGPS.h>
#include <GPSport.h>
//Power save modes
const unsigned char ubxPSM[] PROGMEM =
  { 0x06,0x11,0x02,0x08,0x01 }; //Power Save Mode
const unsigned char ubxEM[] PROGMEM =
  { 0x06,0x11,0x02,0x08,0x04 }; //Eco Mode
const unsigned char ubxMPM[] PROGMEM =
  { 0x06,0x11,0x02,0x08,0x00 }; //Max Performance Mode

NMEAGPS  gps; // This parses the GPS characters
gps_fix  fix; // This holds on to the latest values

void sendUBX( const unsigned char *progmemBytes, size_t len )
{
  gpsPort.write( 0xB5 ); // SYNC1
  gpsPort.write( 0x62 ); // SYNC2

  uint8_t a = 0, b = 0;
  while (len-- > 0) {
    uint8_t c = pgm_read_byte( progmemBytes++ );
    a += c;
    b += a;
    gpsPort.write( c );
  }

  gpsPort.write( a ); // CHECKSUM A
  gpsPort.write( b ); // CHECKSUM B

} // sendUBX
 
void setup()
{
  DEBUG_PORT.begin(9600);
  while (!DEBUG_PORT)
    ;
  gpsPort.begin(9600);
  sendUBX(ubxPSM, sizeof(ubxPSM)); //turn GPS in Power Save Mode
}

void loop()
{
  delay(2000);
}

Do you know what is the problem ?

There might be no change in power consumption until the GPS has a good fix anyway.

Then there is the issue of fake Ublox GPSs, plenty of them out there, of which one of the symptoms is that they dont accept some configuration commands correctly.

In the datasheet, it is written

1: Power Save Mode (>= FW 6.00 only)

Do you know how to determine the FW version ?

There is a command listed in the datasheet to poll it.

Normally displayed at power on too.

Nothing displayed at power on and I don't see the command in the datasheet... :frowning_face:

Hi, I have the same problem - did you solve this?

Probably a good idea to start your own thread.

Then people dont need to read all of this thread to work out what the problem was.