u-Center only runs on Windows. It can connect over the network to a Raspberry Pi. This will require us to redirect the serial interface on the Raspberry Pi to a network port using ser2net.
Do an upt-get update and then install ser2net;
pi@raspberrypi ~ $ sudo apt-get install ser2net
Edit the ser2net config file and add the serial port redirect to a network port. We will use network port 6000
And add this line at the bottom;
6000:raw:600:/dev/serial0:9600 NONE 1STOPBIT 8DATABITS XONXOFF LOCAL -RTSCTS
This is a breakdown of the syntax for the line above;
TCP port : connection type : timeout : serial port : serial port speed : serial options
you can now start ser2net using;
And you can use the below command to check if it is running by seeing if the port is open and assigned to the ser2net process;
If it is running, you should see something similar to the output below;
Windows PC Setup and Connecting to the GPS module
You can download u-Center from here.
Once installed, open u-Center. You will get the default view as shown below. No data will be shown as we are not connected to a GPS.
The next step, is to create a new network connection and connect to the GPS which is connected to our Raspberry Pi. You can create a new connection under the Receiver and then Network connection menus.
Below I will list of the more useful windows/tools within u-Center.
You can also click on the images below for a larger version.
This window will show you the longitude, latitude, altitude and fix mode. It will also show the HDOP, which is the Horizontal Dilution of Precision. Lower is better, anything below 1.0 means you have a good signal.
This window will show you where the satellites are as well as what time.
Sky view is an excellent tool for analyzing the performance of antennas as well as the conditions of the satellite observation environment.
This map shows the average of all previously measured positions.
Satellite Signal History
This window shows the satellite signal strength over time.
The text console is were the raw NME sentences can be viewed.
Making Configuration changes to the GPS Module
U-Center allows you to make configuration changes to the GPS module on the BerryGPS-IMU and BerryGPS-GSM.
Some examples of what can be configured;
- Disable or enable specific NMEA sentences
- Change output update rate
- Modify power mode
You make changes from the Configuration View window. It can be found under the View menu;
At the bottom of the window, you see a Send button, this is how you apply changes.
There is also a Poll button which is used to poll the device for the current config. The number at the top right is how long it as been since the config has been sent or the device has been polled.
Example Change – Increase update rate
Here is how you would change the update rate, by default it is 1Hz (once a second). This is how you would change it to 5Hz (five times a second)
Find RATE(rates) in the left pain. Then on the right hand side you can see the Measured Period is 1000ms. This is how fast the GPS module prints out NMEA sentence. Change the Measured Period value to 200, which is 5Hz. Now click the send button. The GPS update rate should be instant.
Example Change – Remove GxGSV sentence
The GxGSV sentence contains detailed satellite information. If you are only interested in Longitude and Latitude, you can disable to sentence from being display as you would not need it.
Select MSG (Messages) from the left pane. On the right, in the drop down, find the NMEA GxGSV as shown below and untick the checkbox for UART1. Hit send. The change will be instant.
Making Changes without u-Center
The instruction above only work if u-Center is connected to the GPS module. When you hit the Send button, u-Center will send the change to the GPS module using the UBX protocol which is a string of HEX data.
It is possible to make changes manually without u-Center by sending the HEX data via the Raspberry Pi terminal.
The first thing to do is find out what the HEX string is for a specific change. We will do the change again to remove the GxGSV sentences, but this time manually.
Open Messages View from the view menu and in the left pain navigate to UBX->CFG->MSG (Messages). On the right, in the drop down, find the NMEA GxGSV as shown below and untick the checkbox for UART1.
If the window isn’t showing the HEX code, you need to click on the button highlighted below with the red arrow.
This HEX code is the UBX protocol. It is documented here.
Select the code, as I have below and copy it to the clipboard.
You can send this to the GPS unit using an echo command which is redirect to the serial0 interface on the Raspberry Pi.
-e enable interpretation of backslash escapes
-n do not output the trailing newline
\x means a HEX value
UBX Code Structure
The below information describes the frames structure used for the UBX protocol.
- Every Frame starts with a 2-byte Preamble consisting of two synchronization characters: 0xB5 0x62.
- A 1-byte Message Class field follows. A Class is a group of messages that are related to each other.
- A 1-byte Message ID field defines the message that is to follow.
- A 2-byte Length field follows. The length is defined as being
that of the payload only. It does not include the Preamble, Message Class, Message ID, Length, or CRC fields. The number format of the length field is a Little-Endian unsigned 16-bit integer.
- The Payload field contains a variable number of bytes.
- The two 1-byte CK_A and CK_B fields hold a 16-bit checksum.