Here are the instructions for setting up an Ardusimple GNSS base station with a Raspberry Pi (here we're using a Raspberry Pi Zero, which is inexpensive and consumes very little energy) to log raw satellite observations over serial (in UBX format, which we'll later convert to RINEX format for processing) for Precise Point Positioning.
This is useful to get a very precise stand-alone position, either for direct use, or to provide a base station with a good absolute reference. The basic idea is to run an ArduSimple for at least 2.5 hours (4 is better) and log all of the raw satellite data, then send it to Natural Resources Canada (or another PPP provider) for processing.
You will:
- Set up jumper cables for serial transmission between the ArduSimple and a Raspberry Pi (this can be done via USB, but that consumes a USB port which limits what else can be done with the Pi Zero, so we're using serial).
- Configure the ArduSimple to output raw satellite observations on its UART1 serial port at 460800 baud
- Configure a Raspberry Pi to read those observations and log them to a file on its SD card for retrieval and processing later.
Ok, let's get to it.
jumper cables are required to log the raw data from UART1. For this we need 5 Female-Female connectors.
The following pins should be connected:
Pi | ArduSimple |
---|---|
5V | 5V_IN |
5V | IOREF |
GROUND | GND |
TX | RX |
RX | TX |
Make really sure that these connections are correct! If these ones are connected wrong, then the GNSS receiver may get destroyed. Note that for GND at the GNSS receiver are two pins. You can use either one of them, but make sure you are not using the ‘empty’ pin on the top. Also, be sure to disconnect the power from both devices before hooking up serial cables.
You'll need U-Center for this. Instructions to set that up (on Linux) are here
- Before you start this configuration journey, make sure your ArduSimple is running the stock configuration. If you are not sure, you can use U-Center to configure it with the file in
/ublox_configurations/stock_ardusimple_base.txt
. Here's how you do that
You need to activate transmission of raw data over UART1 (serial over jumper cables) at the right baud rate for the script on the Pi to read and log it.
- Connect the ArduSimple to U-Center
- Open the Messages window. It may take a moment for the UBX options to appear.
- Navigate down to UBX-CFG-PRT (Ports) and select UART1 as Target. Check that the Protocol out contains only UBX (
0 - UBX
) and the Baudrate is set according for your needs (to match the Python logging script we use, select 460800). - Click on UBX-CFG-MSG (Messages)
- Select the message 02-15 RXM-RAWX and activate it on UART1.
- Select the message 02-13 RXM SFRBX and activate it on UART1.
- Click on send.
- After that, go to UBX-CFG-CFG (Configuration). Select all 4 devices on the right (BBR, FLASH, I2C-EEPROM, SPI-FLASH) and click on send.
- Flash a Pi SD card with the latest Raspberry Pi OS Lite from here (I use Balena Etcher for this).
- Add empty
ssh
file and appropriatewpa_supplicant.conf
like this with wifi info to boot partition on that SD card. Put it in the Pi and start it up. - SSH into the parent pi
ssh pi@raspberrypi.local
with passwordraspberry
. - Change the default password
passwd
, update, upgradesudo apt update && sudo apt upgrade -y
and install Gitsudo apt install git -y
. - Disable the default serial console to free up UART serial line (which we'll need to read the data streaming in from the ArduSimple)
sudo sed -i 's/console=serial0,115200 //g' /boot/cmdline.txt
If you are having trouble setting up the Pi, here is a detailed walk-through of the steps up until this point.
- Clone this repo
git clone https://github.com/localdevices/RTK_GNSS
- Copy the logger script into the home folder
cp RTK_GNSS/provisioning/simple_python_logger/log_ubx.py /home/pi
- Copy the service file so that Systemd will start logging on startup
sudo cp RTK_GNSS/provisioning/simple_python_logger/gnss_base_logger.service /etc/systemd/system/
- Enable the service
sudo systemctl enable gnss_base_logger.service
This section gives a quick description on how to convert the logged .ubx files of base and rover to RINEX files. It does not cover how to convert it to daily files.
For the conversion we use the command line tool convbin from the RTKLIB toolkit. This covers the installation procedure. Navigate to the convbin folder, set an alias or put a link for it into your bin folder. For one ubx file that you want to convert, use the following command line code:
convbin -os -od -f 5 -v 3.03 YOUR_UBX_FILE_PATH
This will convert the logged data one-to-one into RINEX. No splicing, no trimming or splitting is performed. It will output you a .obs file. For further processing, the supplied python scripts can be used, or manually with gfzrnx.