Rtk raspberry pi

Another Raspberry Pi RTKLIB project

After describing my simple Pi based data logger in my last post, I stumbled across this Raspberry Pi based GPS project on diydrones.com. It uses an M8T receiver and includes a touchscreen GUI to manage RTKLIB. It has downloadable files for 3D printing the case as well as an image file with all the code for the SD card (something I should probably provide with mine).

I haven’t looked at in great detail but it seems very intriguing and could be a good alternative to what I described in my last post if you are looking for something with greater capability.

Here’s a photo of the completed project.

Share this:

Like this:

5 thoughts on “Another Raspberry Pi RTKLIB project”

Here is a video of post processing with rgp.ign.fr data and one with CORS geodesy.noaa.gov, the results are not correct with CORS because the rover is in France and stations in USA. The epoch have to be adapted because hourly data are only available 3 days. If you use auto base mode you have to close RTKBASE to stop the base mode (else it will still run in background). Software will also crash if not enough stations are found.
I use the command line syntax for rnx2rtkp and CORS data from you site (https://rtklibexplorer.wordpress.com/2016/02/13/kinematic-solution-with-rnx2rtkp/) the rgp data and process are not the same, its
rnx2rtkp -k test1.conf -o out.pos ebay.obs zdv13480.15o zdv13480.15n zdv13480.15g
the .15n and .15g file are the nav data for GPS and Glonass

Thank’s for the report on the rapsberry touchscreen project, we have done a lot of updates since the first release, you can follow it and download sources and pre-installed raspberry pi disk images here :
and a Wiki here :

A video to present the interface in use :

This year update is the on board automatic post processing on RGP IGN data (France area only) and we wwill try to make it work for CORS station from NOAA server (USA) .
Actually you can do :
– Use rover presets of RTKLIB for single/sbas/dgps/rtk/ppp
– create your own rover presets on the interface
– Base mode with last position results in rover or manual input
– create presets for base mode
– Data logging , you have to choose output file in base mode
– Automatic post processing on RGP IGN server with rnx2rtkp a internet connexion is needed, the software looks the 1 to 6 nearest stations in the wanted radius and will download and process data, you can log, process data and go to base mode in the same process (beta on master branch, works only on RPI3 and desktop). if more than one station process is asked a average position of all station will be done

I’m looking for a 30mn data log from US to test and adapt the automatic post processing to the NOAA CORS server, if someone got one or know were I can find one

Hi Francklin. Thanks for the update. Looks like you’ve made some good progress!

I try to buld one like this but i want to use windows 10 iot.
Is it possible ? & what about using Demo 5 Ver ?

P.S. I have basic knowledge in windows but not in linux
P.S.2 where i can find the 3d-printer files ?

Hi Dimitri. I’m pretty sure you could build a similar logger with Windows 10 IOT but I don’t know how much translation work it would require. If you get the 2.4.3 version of RTKLIB working on IOT then the demo5 version should work too. I didn’t build one of these myself, just thought it might be interesting to other readers, so I don’t know the details about file locations, etc but I believe they are available.

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Use Git or checkout with SVN using the web URL.

Work fast with our official CLI. Learn more.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats


Failed to load latest commit information.


The files and instructions to get a rtklib RTK base station running on a Raspberry Pi

  • Raspberry Pi Model b (I’ve used a Pi3)
  • 8GB Micro SD card (I’ve used a Sandisk MAX ENDURANCE card)
  • U-blox GPS module that supports RXM-RAWX output (I’ve used a Neo-M8T)
  • 4g USB dongle (Huawei Unlocked E3372h)

Seeing as the Pi will most likely operate as a headless server, I’ve opted to setup everything from the get-go via SSH.

  • A knowledge of the Linux (Raspberry Pi OS is based on Debian) command line interface (CLI)
  • An SSH client PuTTY is a good one for Windows
  1. Download Raspberyy Pi OS Lite from the Raspberry Pi website
  2. Write the image to the SD card
  3. Enable the SSH server by adding an empty file called ssh (no extension) to the /boot (small) partition on the SD card
  4. Insert the SD card, connect the Pi to your router/switch and power the Pi up
  5. Connect to the Pi — the name of the computer will be raspberrypi with a username of pi and password of raspberry

Raspberry Pi configuration

Configure the following using sudo rasbpi-config

  1. Under System Options, connect to your Wireless LAN, change the password and change the Hostname to something other than raspberrypi .
  2. Under Performance Options, reduce the GPU Memory to the minimum (16MB) as it’ll be headless.
  3. Under Localisation Options, set your Timezone and Keyboard.
  4. If you plan on adding a display to the GPIO header, eable SPI and I2C under Interface Options.
  5. Finish and reboot

If you don’t want to use the user pi , then you should add yourself to all the groups that the pi user is a member of:

The GPSD server for Debian Buster is quite an old version which doesn’t fully support u-blox. So the Backports needs to be added to the package sources:

If apt-get update returns an error saying «The following signatures couldn’t be verified. «, then you need to install each of the keys referenced:

Update all packages, and then install all the required packages:

Install Node.js 14

Devices gpsd should collect to at boot time.

They need to be read/writeable, either by user gpsd or the group dialout.

localhost:4000 provides the multiplexed GNSS serial stream

localhost:4001 provides the corrected rover stream

Other options you want to pass to gpsd

Automatically hot add/remove USB GPS devices via gpsdctl

This is disabled so GPSD doesn’t take control of the GNSS serial device

Build and install RTKLIB

As of 21 April 2021 there’s a bug in RTKLIB where the rtkrcv doesn’t start if run with a telnet interface. This PR fixes the issue, so a patch needs to be applied.

Install pi-rtk package

The pi-rtk package install itself into /opt/pi-rtk , and will do the following:

  • Install systemd service files
    • pi-rtk-multiplex — Allows multiple applications to read from a single GNSS serial port
    • pi-rtk-base — Operates the system as an RTK base station that can provide data to an NTRIP Caster
    • pi-rtk-rover — Operates the system as an RTK rover
    • pi-rtk-http — A HTTP server that allows a user to view the status of the station
  • Install configuration files int /etc/pi-rtk
  • Install cronjobs for the ubx/RINEX pi-rtk-multiplex service

The Nodejs HTTP server needs to be built before installation



Use Git or checkout with SVN using the web URL.

Work fast with our official CLI. Learn more.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats


Failed to load latest commit information.


An easy to use and easy to install web frontend with bash scripts and services for a simple headless gnss base station.

Frontend’s main features are:

  • View the satellites signal levels
  • View the base location on a map
  • Start/stop various services (Sending data to a Ntrip caster, Ntrip caster, Rtcm server, Sending Rtcm stream on a radio link, Log raw data to files)
  • Edit the services settings
  • Download/delete raw data

  • Enclosure: GentleBOX JE-200 (waterproof, cable glands for antenna and ethernet cable)
  • SBC: Raspberry Pi 3 / Orange Pi Zero (512MB)
  • Gnss Receiver: U-Blox ZED-F9P (from Drotek)
  • Antenna: DA910 (Gps L1/L2, Glonass L1/L2, Beidou B1/B2/B3 and Galileo E1/E5b/E6) + sma (male) to TNC (male) outdoor cable.
  • Power: Trendnet TPE-115GI POE+ injector + Trendnet POE TPE-104GS Extractor/Splitter + DC Barrel to Micro Usb adapter

Other images are available in the ./images folder.

Ready to flash release:

A ready to flash image is available for Orange Pi Zero SBC : Armbian_RTKBase

If you use a Raspberry Pi, thanks to jancelin, you can download a ready to flash iso file here.

Connect your gnss receiver to your raspberry pi/orange pi/.

Open a terminal and:

Go grab a coffee, it’s gonna take a while. The script will install the needed software, and if you use a Usb-connected U-Blox ZED-F9P receiver, it’ll be detected and set to work as a base station. If you don’t use a F9P, you will have to configure your receiver manually (see step 7 in manual installation), and choose the correct port from the settings page.

Open a web browser to http://ip_of_your_sbc (the script will try to show you this ip address). Default password is admin . The settings page allows you to enter your own settings for the base coordinates, ntrip credentials and so on.

If you don’t already know your base precise coordinates, it’s time to read one of these tutorials:

The install.sh script can be used without the —all option to split the installation process into several different steps:

So, if you really want it, let’s go for a manual installation with some explanations:

Install dependencies with sudo ./install.sh —dependencies , or do it manually with:

Install RTKLIB with sudo ./install.sh —rtklib , or:

compile and install str2str:

Optionally, you can edit the CTARGET line in makefile in RTKLIB/app/str2str/gcc

For an Orange Pi Zero SBC, i use:

CTARGET = -mcpu=cortex-a7 -mfpu=neon-vfpv4 -funsafe-math-optimizations

Then you can compile and install str2str:

Compile/install rtkrcv and convbin the same way as str2str .

Get latest rtkbase release sudo ./install.sh —rtkbase-release , or:

If you prefer, you can clone this repository to get the latest code.

Install the rtkbase requirements:

Install the systemd services with sudo ./install.sh —unit-files , or do it manually with:

  • Edit them ( rtkbase/unit/ ) to replace with your username.
  • If you log the raw data inside the base station, you may want to compress these data and delete the too old archives. archive_and_clean.sh will do it for you. The default settings compress the previous day data and delete all archives older than 90 days. To automate these 2 tasks, enable the rtkbase_archive.timer . The default value runs the script every day at 04H00.
  • Copy these services to /etc/systemd/system/ then enable the web server, str2str_tcp and rtkbase_archive.timer:

Install and configure chrony and gpsd with sudo ./install.sh —gpsd-chrony , or:

Install chrony with sudo apt install chrony then add this parameter in the chrony conf file (/etc/chrony/chrony.conf):

refclock SHM 0 refid GPS precision 1e-1 offset 0.2 delay 0.2

Edit the chrony unit file. You should set After=gpsd.service

Install a gpsd release >= 3.2 or it won’t work with a F9P. Its conf file should contains:

Edit the gpsd unit file. You should have something like this in the «[Unit]» section:

  • Reload the services and enable them:

Connect your gnss receiver to raspberry pi/orange pi/. with usb or uart, and check which com port it uses (ttyS1, ttyAMA0, something else. ). If it’s a U-Blox usb receiver, you can use sudo ./install.sh —detect-usb-gnss . Write down the result, you may need it later.

If you didn’t have already configure your gnss receiver, you must set it to output raw data:

If it’s a U-Blox ZED-F9P (usb), you can use

If it’s a U-Blox ZED-F9P (uart), you can use this command (change the ttyS1 and 115200 value if needed)):

If you need to use a config tool from another computer (like U-center), you can use socat :

Change the ttyS1 and 115200 value if needed. Then you can use a network connection in U-center with the base station ip address and the port n°128.

Now you can start the services with sudo ./install.sh —start-services , or:

Everything should be ready, now you can open a web browser to your base station ip address.

RTKBase use several RTKLIB str2str instances started with run_cast.sh as systemd services. run_cast.sh gets its settings from settings.conf

  • str2str_tcp.service is the main instance. It is connected to the gnss receiver and broadcast the raw data on TCP for all the others services.
  • str2str_ntrip.service get the data from the main instance, convert the data to rtcm and stream them to a Ntrip caster.
  • str2str_local_ntrip_caster.service get the data from the main instance, convert the data to rtcm, and act as a local Ntrip caster.
  • str2str_rtcm_svr.service get the data from the main instance, convert the data to rtcm and stream them to clients
  • str2str_rtcm_serial.service get the data from the main instance, convert the data to rtcm and stream them to a serial port (radio link, or other peripherals)
  • str2str_file.service get the data from the main instance, and log the data to files.

The web GUI is available when the rtkbase_web service is running.

Aerial images: The default map background is OpenStreetMap, but you can switch to a worldwide aerial layer if you have a Maptiler key. To enable this layer, create a free account on Maptiler, create a key and add it to settings.conf inside the [general] section: maptiler_key=your_key

Receiver options: str2str accept some receiver dependent options. If you use a U-Blox, the -TADJ=1 parameter is recommended as a workaround to non-rounded second values in Rtcm and Ntrip outputs. You can enter this parameter inside the settings forms. More information here and here.

If you want to install RTKBase from the dev branch, you can do it with these commands:

A gnss receiver with a timepulse output is a very accurate stratum 0 clock thus, your gnss base station could act as a stratum 1 ntp peer for your local network and/or the ntp pool. There are a few steps to do this:

Connect the timepulse output + GND to some GPIO inputs on your SBC.

Configure this input as PPS in your operating system.

Raspberry Pi example:

  • Inside /boot/config.txt, add dtoverlay=pps-gpio,gpiopin=18 on a new line. ’18’ is the input used for timepulse.
  • Inside /etc/modules, add pps-gpio on a new line, if it is not already present.

Orange Pi Zero example, inside /boot/armbianEnv.txt:

  • Add pps-gpio to the overlays line.
  • One a new line, add param_pps_pin=PA19 DEVICE line in /etc/defaut/gpsd and uncomment #DEVICES=»tcp:\\ \dev\pps0

chrony: inside /etc/chrony/chrony.conf uncomment the refclock pps line and add noselect to the ‘refclock SHM 0`. You should have something like this:

  • reboot your sbc and check the result of chronyc sources -v You should read something like this, notice the ‘*’ before ‘PPS’:

RTKBase is licensed under AGPL 3 (see LICENSE file).

RTKBase uses some parts of other software:


Software for your own GNSS base station for RTK localization