BerryGPS-IMU FAQ

Can I reset the GPS module from the command line?

This can be done with a cold reboot. Use;

echo -e -n "\xb5\x62\x06\x04\x04\x00\xff\xff\x02\x00\x0e\x61" > /dev/serial0

How do I tell the accuracy of my position?

The HDOP value can be used to determine the accuracy of the GPS position.  Lower is better.

The HDOP can be seen when using gpsmon. The image below has HDOP highlighted;gpsmon HDOP
The HDOP can also be found in the GSA sentence.  Below it is shown as 1.3;

$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39

A HDOP value of 1 or below would give you an accuracy of about 2.5m.

See here for more information.

 

How do I change the update rate?

The NMEA sentence update rate can be increased to 10Hz(10 times a second). The default is 1Hz (Once a second).

When increasing the update rate, you will also need to increase the baud rate.

To change the baud rate to 115200;

echo -e -n "\xB5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xD0\x08\x00\x00\x00\xC2\x01\x00\x07\x00\x03\x00\x00\x00\x00\x00\xC0\x7E" > /dev/serial0

 

If you need to update the speed on the Raspberry Pi serial port, you can use;

stty -F /dev/serial0 115200

 

To increase update rate to 2Hz;

echo -e -n "\B5\x62\x06\x08\x06\x00\xF4\x01\x01\x00\x01\x00\x0B\x77" > /dev/serial0

 

To increase update rate to 5Hz;

echo -e "\xB5\x62\x06\x08\x06\x00\xC8\x00\x01\x00\x01\x00\xDE\x6A > /dev/serial0

 

To increase update rate to 10Hz;

echo -e "\B5\x62\x06\x08\x06\x00\x64\x00\x01\x00\x01\x00\x7A\x12" > /dev/serial0

 

 

In uCenter, the setting can be found under UBX -> CFG -> RATE
uCenter update rate

The UBX protocol is documented here.

I am seeing the message "More than 100 frame errors, UART RX was disabled", what do I need to do to fix it?

If you see this message in the output from the GPS;

More than 100 frame errors, UART RX was disabled

This is the GPS telling you that it is receiving data on the serial port, but it doesn’t recognize it.

The cause is most likely due to echo being enabled on the Raspberry Pi serial port.

Echo can be disabled with;

pi@raspberrypi ~ $ /usr/bin/stty -F /dev/serial0 -echo

 

How can I put the GPS module to sleep via the command line?

The GPS module can be put to sleep by sending a UBX command to the GPS module.

To put it to sleep;

echo -e -n "\xB5\x62\x06\x57\x08\x00\x01\x00\x00\x00\x50\x4F\x54\x53\xAC\x85" > /dev/serial0

To wake it up;

echo -e -n "\xB5\x62\x06\x57\x08\x00\x01\x00\x00\x00\x20\x4E\x55\x52\x7B\xC3" > /dev/serial0

The UBX protocol is documented here.

How do I enable the ZDA NMEA sentence?

The ZDA sentence is a good sentence to use to get the date and time.

It can be enabled by sending a UBX command to the GPS module;

echo -e -n "\xB5\x62\x06\x01\x08\x00\xF0\x08\x00\x01\x00\x00\x00\x00\x08\x60" > /dev/serial0

Below is where it can be found in uCenter.UBX->CFG->MSGuCenter ZDA


ZDA Format
$GPZDA,hhmmss.ss,dd,mm,yyyy,xx,yy*CC
$GPZDA,201530.00,04,07,2002,00,00*60

where:
hhmmss HrMinSec(UTC)
dd,mm,yyy Day,Month,Year
xx local zone hours -13..13
yy local zone minutes 0..59
*CC checksum

 

The UBX protocol is documented here.

How do I change the baud rate on the GPS module?

The baud rate can be changed by sending a UBX command to the

GPS module.
To change the baud rate to 115200;

echo -e -n "\xB5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xD0\x08\x00\x00\x00\xC2\x01\x00\x07\x00\x03\x00\x00\x00\x00\x00\xC0\x7E" > /dev/serial0

If you need to update the speed on the Raspberry Pi serial port, you can use;

stty -F /dev/serial0 115200

 

To change back to 9600;

echo -e -n "\xB5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xD0\x08\x00\x00\x80\x25\x00\x00\x07\x00\x03\x00\x00\x00\x00\x00\xA2\xB5" > /dev/serial0

The other baud rates are;
19200;

echo -e -n "\xB5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xD0\x08\x00\x00\x00\x4B\x00\x00\x07\x00\x03\x00\x00\x00\x00\x00\x48\x57" > /dev/serial0

38400;

echo -e -n "\xB5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xD0\x08\x00\x00\x00\x96\x00\x00\x07\x00\x03\x00\x00\x00\x00\x00\x93\x90" > /dev/serial0

57600;

echo -e -n "\xB5\x62\x06\x00\x14\x00\x01\x00\x00\x00\xD0\x08\x00\x00\x00\xE1\x00\x00\x07\x00\x03\x00\x00\x00\x00\x00\xDE\xC9" > /dev/serial0

Below is where this can be set using uCenter. UBX -> CFG -> PRT
uCenter baudRate

 

The UBX protocol is documented here.

Blip, blop, bloop...