How can I collect raw GNSS data and prepare it for PPP processing, e.g., CSRS-PPP

I am using a GNSS Flex pHAT - ZED-X20P, and I want to collect several hours of binary RAWX and SFRBX messages from a stationary antenna so I can prepare and submit RINEX Data to CSRS-PPP (Canadian Spatial Reference System – Precise Point Positioning).

I would like to do as much of this as possible on the Raspberry Pi.

I have been trying to do this with PyGPSClient, ubxtool, and other available software on the Pi. I have searched for a solution, but have not found any that actually work. I have not been able to see/capture the necessary UBX-RXM-RAWX and UBX-RXM-SFRBX messages.

I may try to do this with u-center 2, but I would really like to find a solution where I don’t need to take a laptop out in the field.

Hi Steve (@steve.talent ),

PyGPSClient should work well here. Are you enabling the RAWX and SFRBX messages correctly? On the X20P, you will need to use the Configuration Interface (CFG-VALSET) to do this. UBX-CFG-MSG is largely deprecated and probably won’t work. To enable RAWX, you need to send a UBX-CFG-VALSET message which enables CFG-MSGOUT-UBX_RXM_RAWX on the desired port. If you are using UART1, you need to set CFG-MSGOUT-UBX_RXM_RAWX_UART1 (0x209102a5) to a value of 1. For SFRBX, you need to set CFG-MSGOUT-UBX_RXM_SFRBX_UART1 (0x20910232) to 1.

If you are using “presets”, it will look something like the following:

    "ubxpresets_l": [
        "Enable RAWX and SFRBX on UART1 in RAM layer, CFG, CFG-VALSET, 00010000a502912001, 1, CFG, CFG-VALSET, 000100003202912001, 1",
        "Disable RAWX and SFRBX on UART1, CFG, CFG-VALSET, 00010000a502912000, 1, CFG, CFG-VALSET, 000100003202912000, 1"
    ],

(It’s confusing because the key bytes need to be in little-endian (reverse) order.)

I hope this helps,
Paul

1 Like

Hi all,

Just to build on Paul’s advice - the X20P and other new generation UBX GNSS modules no longer support legacy UBX CFG commands (with some exceptions). You need to use the newer configuration database commands CFG-VALSET, CFG-VALGET and CFG-VALDEL.

Here’s a screen shot of the relevant panel in PyGPSClient:

… and here are the enabled UBX RXM-RAWX and RXM-SFRBX messages appearing in the PyGPSClient console:

The pyubx2 library has dedicated helper methods to facilitate this. In addition, PyGPSClient has a built-in helper method which can convert binary UBX messages to preset strings suitable for incorporation into the ubxpresets_l section of your .json configuration file.

NB: Just be careful with the configuration key names - pyubx2 uses underscores throughout, so use "CFG_MSGOUT_UBX_RXM_RAWX_UART1" rather than “CFG-MSGOUT-UBX_RXM_RAWX_UART1”

Here’s a sample python script which incorporates these helper methods:

"""
Illustration of how to create UBX configuration database
messages and convert them to a UBX preset entry which can
be inserted into the ubxpresets_l section of a .json config
file.

Created on 21 Feb 2024
@author: semuadmin
"""

from pyubx2 import SET_LAYER_RAM, TXN_NONE, UBXMessage
from pygpsclient import ubx2preset

layers = SET_LAYER_RAM  # volatile RAM
transaction = TXN_NONE
cfgdata = [("CFG_MSGOUT_UBX_RXM_RAWX_UART1", 1), ("CFG_MSGOUT_UBX_RXM_SFRBX_UART1", 1)]

msg = UBXMessage.config_set(layers, transaction, cfgdata)
print(msg)
preset = ubx2preset(msg, "Enable RAWX and SFRBX messages on UART1")
print(preset)

If you’re minded to try to deconstruct the contents of the individual RXM-SFRBX messages, be aware that this is not for the faint-hearted, but the following references may help:

(specifically section 20.3.2 Message Structure)

(note that the 30-bit NAV words are padded to 32-bits in RXM-SFRBX for ease of processing, but the specific padding treatment depends on the signal ID (L1, L2, L5, L6)).

2 Likes

You may have a look at RTKBase. It’s to establish a RTK base using a rasp or an orange-pi with several GNSS chips like the ublox F9P. X20 is not supported but see this issue. It’s including RAW data logging and conversion to prepare a file for CSRS-PPP treatment.

1 Like

convbin command-line tool from the RTKLIB suite.

1 Like

Thanks, everyone, for all the helpful replies. I just finished a 6+ hour data collection and submitted the corresponding RINEX files to CSRS-PPP. Additional thanks to @semuadmin for a clear description of relevant PyGPSClient features.