BerryGPS setup Guide for Raspberry Pi

BerryGPS-IMU v2 Plate has been designed to fit perfectly with the Raspberry Pi Zero. It is also compatible with all other versions Raspberry Pi, including the Pi 3B+.

BerryGPS-IMU v2 uses the M20048 from Antenova, which is a high quality GPS module which is able to track 22 satellites. The BerryGPS-IMU v2 is a GPS module which also includes the sensors that can be found on the BerryIMU v2 Plate.

BerryGPS-IMU v2 is also fitted with a barometric sensor (BMP280) which can be used to calculate altitude. A temperature sensor is also included.

Sensors included are;

GPS

Accelerometer

Gyroscope

Magnetometer (Compass)

Barometric/Altitude

Temperature

GPS Module M20048

Low current consumption, <200uA when using Periodic mode.

Antenova M20048 ( MT3337-E chip) GPS module

3.3v supply

NMEA 0183

UART 4800/9600/38400/115200 bps

Channels – 210 PRN / 66 Acquisition / 22 Tracking

Max update rate 5 Hz

Horizontal position accuracy <2.5m CEP

Acquisition sensitivity -148dBm

Tracking sensitivity -165dBm

Hot start <1s

Warm start <25s

Cold start <35s

Orbit prediction

1PPS Sync

Fix LED

PPS LED

Internal antenna

Connector for external antenna

SuperCap to help store ephemeris data.

IMU:

An inertial measurement unit, or IMU, measures and reports on velocity, orientation and gravitational forces, using a combination of an accelerometer, gyroscope and a magnetometer.

Global Positioning System (GPS) satellites broadcast microwave signals to enable GPS receivers on or near the Earth’s surface to determine location and time and derive velocity. The GPS system itself is operated by the U.S. Department of Defense (DoD) for use by both the military and the general public.

The Global Positioning System (GPS), originally Navstar GPS, is a satellite-based radionavigation system owned by the United States government and operated by the United States Air Force. It is a global navigation satellite system that provides geolocation and time information to a GPS receiver anywhere on or near the Earth where there is an unobstructed line of sight to four or more GPS satellites. Obstacles such as mountains and buildings block the relatively weak GPS signals.

BerryGPS-IMU uses the serial port on the Raspberry Pi. By default, the serial port is already assigned to the console. This can be confirmed by using;

Minicom

Here are some useful commands while using Minicom
Exit – Ctrl+A and then q
Help, – Ctrl+A and then z
Settings, – Ctrl+A and then o

Screen

Shell

1

2

pi@raspberrypi~$sudo apt-getinstall screen

pi@raspberrypi~$screen/dev/serial09600

Below is two examples of what you would see.
The first image is when you GPS has been up and running for awhile and has a fix. If your GPS has a fix, you would also see the green fix LED flash.

The second image is when your GPS is trying to obtain a fix. As you can see, most of the NMEA data is empty. On first power up, it can take your GPS module awhile to get a fix. It could be longer than 10 minutes in some situations, it all depends on interference and if your GPS has clear access to the sky.

A summary of the default NMEA sentences that BerryGPS will output;

$GPVTG

Vector track and Speed over the Ground

$GPGGA

GGA – essential fix data which provide 3D location and accuracy data.

$GPGLL

GLL – Geographic Latitude and Longitude

$GPGSA

GSA – details on the nature of the fix. It includes the numbers of the satellites

Viewing Meaningful GPS Data

There are number of freely available tools which we can used to view meaningful information from BerryGPS, like longitude, latitude and ground speed.

First, we will install GPSD. gpsd is a daemon that receives data from a GPS receiver, and provides the data back to multiple applications such gpsmon and cgps.

Install, gpsd, gpsmon and cgps;

Shell

1

pi@raspberrypi~$sudo apt-getinstall gpsd-clients gpsd-y

If you need to stop gpsd, you can use

Shell

1

pi@raspberrypi~$sudo killall gpsd

Be default, gpsd is configured to stat at boot and run in the background. If you are fine with this, you will need to edit the config file so that gpsd uses the correct serial device.

Shell

1

2

3

4

5

6

7

pi@raspberrypi~$sudo nano/etc/default/gpsd

Look for

DEVICES=””

andchange it to

DEVICES=”/dev/serial0″

Reboot once youhave updated the above file.

If you want to manually run gpsd, you will need to disable it from starting at boot;

Shell

1

2

pi@raspberrypi~$sudo systemctl stop gpsd.socket

pi@raspberrypi~$sudo systemctl disable gpsd.socket

To force it to autostart again at boot;

Shell

1

2

pi@raspberrypi~$sudo systemctl enable gpsd.socket

pi@raspberrypi~$sudo systemctl start gpsd.socket

If you have disabled gpsd from automatically started at boot, you will need to start if before running gpsmon or cgps

Shell

1

pi@raspberrypi~$sudo gpsd/dev/serial0-F/var/run/gpsd.sock

You can now use gpsmon or cgps to view GPS data.

Shell

1

pi@raspberrypi~$gpsmon

Shell

1

pi@raspberrypi~$cgps

When gpsd is running, you will not be able to see the raw NMEA data on /dev/serial0 as the serial device will show as busy.
You can use gpspipe to view this data while gpsd is running.

Shell

1

pi@raspberrypi~$gpspipe-r

Other Tools

gpsprof performs accuracy, latency, and time drift profiling on a GPS. It emits to standard output a GNUPLOT scatter graph.
The command below will take 100 samples from BerryGPS and display them in a graph.

This Keyestudio KS0216 Raspberry Pi GPS Plate (shield) features high performance and low power consumption. It utilizes the NEO-6M Module developed by U-blox. The GPS Module is connected through the 2*20 ... Read more

Need LEGO Parts, Manual, …

Isaac Asimov's "Three Laws of Robotics":

A robot may not injure a human being or, through inaction, allow a human being to come to harm. A robot must obey orders given it by human beings except where such orders would conflict with the First Law. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.