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

**URL:** <https://community.sparkfun.com/t/how-can-i-collect-raw-gnss-data-and-prepare-it-for-ppp-processing-e-g-csrs-ppp/67195>\
**Category:** GPS/GNSS\
**Created:** [October 25, 2025, 5:18am UTC](https://community.sparkfun.com/t/how-can-i-collect-raw-gnss-data-and-prepare-it-for-ppp-processing-e-g-csrs-ppp/67195 "2025-10-25T05:18:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve.talent](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@steve.talent](https://community.sparkfun.com/u/steve.talent)\
**Post date:** [October 25, 2025, 5:18am UTC](https://community.sparkfun.com/t/how-can-i-collect-raw-gnss-data-and-prepare-it-for-ppp-processing-e-g-csrs-ppp/67195/1 "2025-10-25T05:18:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PaulZC](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/paulzc/32/67_2.png) [@PaulZC](https://community.sparkfun.com/u/PaulZC)\
**Post date:** [October 25, 2025, 7:46am UTC](https://community.sparkfun.com/t/how-can-i-collect-raw-gnss-data-and-prepare-it-for-ppp-processing-e-g-csrs-ppp/67195/2 "2025-10-25T07:46:48Z")

</div>

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:

```auto
    "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

---

<div class="post-metadata">

**Author:** ![semuadmin](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/semuadmin/32/7096_2.png) [@semuadmin](https://community.sparkfun.com/u/semuadmin)\
**Post date:** [October 25, 2025, 8:51am UTC](https://community.sparkfun.com/t/how-can-i-collect-raw-gnss-data-and-prepare-it-for-ppp-processing-e-g-csrs-ppp/67195/3 "2025-10-25T08:51:49Z")

</div>

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:

 ![Screenshot 2025-10-25 at 09.58.44](https://canada1.discourse-cdn.com/sparkfun/original/2X/9/9d85c033f8e9f9e736e376677f8eba5a2694c6a1.png)

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

 ![Screenshot 2025-10-25 at 18.08.11](https://canada1.discourse-cdn.com/sparkfun/original/2X/a/ab60d7b0922dc5ae7ee2c9a310f3e970b9add10a.png)

The pyubx2 library has [dedicated helper methods](https://github.com/semuconsulting/pyubx2?tab=readme-ov-file#configinterface) to facilitate this. In addition, PyGPSClient has a [built-in helper method](https://github.com/semuconsulting/PyGPSClient?tab=readme-ov-file#userdefined) 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](https://github.com/semuconsulting/PyGPSClient/blob/master/examples/presets.py) which incorporates these helper methods:

```python
"""
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:

> **[IS-GPS-200N.pdf](https://www.gps.gov/sites/default/files/2025-07/IS-GPS-200N.pdf)**
>
> 3.18 MB

(specifically section 20.3.2 Message Structure)

> **[u-blox Portal](https://portal.u-blox.com/s/question/0D52p00008HKD1kCAH/why-are-the-sfrbx-messages-words-32-bits-but-in-isgps200h-the-words-are-specified-as-being-30-bits-long)**

(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)).

---

<div class="post-metadata">

**Author:** ![Eric\_S](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@Eric\_S](https://community.sparkfun.com/u/Eric_S)\
**Post date:** [October 25, 2025, 10:56am UTC](https://community.sparkfun.com/t/how-can-i-collect-raw-gnss-data-and-prepare-it-for-ppp-processing-e-g-csrs-ppp/67195/4 "2025-10-25T10:56:43Z")

</div>

You may have a look at [RTKBase](https://github.com/Stefal/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](https://github.com/Stefal/rtkbase/issues/461). It’s including RAW data logging and conversion to prepare a file for CSRS-PPP treatment.

---

<div class="post-metadata">

**Author:** ![rftop](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/rftop/32/6121_2.png) [@rftop](https://community.sparkfun.com/u/rftop)\
**Post date:** [October 25, 2025, 11:57pm UTC](https://community.sparkfun.com/t/how-can-i-collect-raw-gnss-data-and-prepare-it-for-ppp-processing-e-g-csrs-ppp/67195/5 "2025-10-25T23:57:26Z")

</div>

> [@steve.talent](#):
>
> I would like to do as much of this as possible on the Raspberry Pi.

convbin command-line tool from the RTKLIB suite.

---

<div class="post-metadata">

**Author:** ![steve.talent](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@steve.talent](https://community.sparkfun.com/u/steve.talent)\
**Post date:** [October 26, 2025, 1:52am UTC](https://community.sparkfun.com/t/how-can-i-collect-raw-gnss-data-and-prepare-it-for-ppp-processing-e-g-csrs-ppp/67195/6 "2025-10-26T01:52:53Z")

</div>

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.
