RTK Rover

Centimeter-accurate, standalone, USB- or Ethernet-based RTK receiver that leverages a robust, decentralized geospatial network

Aug 09, 2023

Project update 5 of 7

A Guide to RTKLIB, our Open Source Software Suite

by Hyfix Team

In this post, we’ll explore the capabilities of RTKLIB, learn how to use it on your PC or Raspberry Pi, guide you through installing RTKLIB tools on your Pi, configuring the LC29H for RTCM, and even logging your first GPS data file. Let’s dive in!

What is RTKLIB?

RTKLIB is an open-source software suite that allows you to achieve centimeter-level accuracy in your GPS positioning. RTKLIB can be harnessed on both your PC and the Raspberry Pi. Whether you prefer a desktop or the compact efficiency of a Pi, RTKLIB has you covered. RTKLIB consists of a portable program library and several APs (application programs) utilizing the library.

How to Use RTKLIB on Your PC

For those who prefer the comfort of a PC, RTKLIB extends its capabilities to that platform as well. To get started:

First, visit the official RTKLIB website: https://rtklib.com/

From here, you have two options:

  1. Clone the RTKLIB GitHub repository to access the source code and tools
  2. Download the pre-compiled binaries directly from the website for quick and easy installation.

How to use and install RTKLIB on your PI

Let’s walk through the installation process step by step:

  1. Update Package List: Open the terminal on your Raspberry Pi or SSH to your pi with a PC and run sudo apt update to update your package list and ensure you have the latest information about available software.
  2. Install Git: If you don't already have Git installed, you'll need it to clone the RTKLIB repository. Run sudo apt install git to install Git.
  3. Create a Directory: You'll need a dedicated directory for RTKLIB. Run these commands to create and navigate to the directory:
mkdir rtklib
cd rtklib
  1. Clone the RTKLIB Repository: Use Git to clone this RTKLIB repository (maintained by rtklibexplorer) by running git clone https://github.com/rtklibexplorer/RTKLIB.git.
  2. Compile the str2str Utility: Navigate to the directory containing the str2str utility source code and compile it:
cd RTKLIB/app/consapp/str2str/gcc 
  1. Copy the Executable for General Access Once compiled, copy the str2str executable to a location accessible by all users: sudo cp str2str /usr/local/bin/str2str.
  2. Compile the rtkrcv Utility: Go back to the RTKLIB directory and navigate to the rtkrcv source code directory: cd ../../rtkrcv/gcc.
  3. Compile the rtkrcv utility: Run make.
  4. Copy the Executable for General Access Similar to before, copy the rtkrcv executable to a location accessible by all users: sudo cp rtkrcv /usr/local/bin/rtkrcv.

RTKLIB is now installed on your Raspberry Pi! You can execute the str2str and rtkrcv utilities from any terminal window.

Using RTKLIB Applications from the Binaries:

These applications offer an array of functionalities, from data conversion and processing to real-time positioning and analysis. Navigate to the directory where the RTKLIB binaries are located on your PC. This could be the directory where you cloned the repository or the installation location of the pre-compiled binaries.

Within this directory, you’ll find various executable files for RTKLIB applications, each serving a distinct purpose. Examples include rtkconv for data conversion, rtkplot for real-time plotting, and rtkpost for post-processing.

Screenshot of STRSVR from PC
Screenshot of RTKPLOT from PC

Configuring the LC29H for RTCM

The LC29H module can achieve impressive accuracy when configured for Real-Time Kinematic (RTK) operation using RTCM correction data. Proper configuration involves enabling RTCM. We have developed a python script that can be used to enable RTCM.

How to Use the Script

  1. Clone script from our github repository
  2. Navigate to the location that the script was downloaded in
  3. Modify the script to utilize the port that is being used
  4. Run the script python lc29h_script.py

Sample screenshot:

  1. Navigate to the “PAIR_RTCM_SETOUTPUT_MODE” using the arrow keys, hit "space" then "enter".
  1. Enter "0"

RTCM will be enabled after you see the success message in the outputted response.

Logging Your First File

Here is an example of how to log your file for the first time using the Raspberrypi and rtklib.

Sample command: str2str -in serial://dev/ttyAMA0:115200 -out file://test.log

In this example, -in represents the data coming in from the com port and -out represents where the data will be output. In this case it is going to a file called test.log.

Example output:

Contents of generated test.log:

The information shown here may be different for you when using str2str in your environment.

Sign up to receive future updates for RTK Rover.

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects