Collecting raw Ublox data with RTKLIB

At this point, we have verified that the GPS hardware and the link to the PC are working properly, and are ready to start using RTKLIB to collect the raw GPS data.

Start by downloading RTKLIB from Github.  Choose either the main branch ( which is the stable branch or 2.4.3 which is a beta branch (currently at revision b8).  Recent check-ins have all been made on the beta branch, but most or all of the recent work appears to be unrelated to Ublox receivers or the  kinematic mode normally used for low cost receivers, so the functionality of the code should be nearly identical regardless of which branch you choose.  I am using 2.4.3 because I think it may be easier to merge in any future changes.  The repository includes all the executables, so there is no need to build any code before running it.

There are actually two sets of executables built from the same codebase, a GUI set, and a CUI set.  I am using a combination of the two.  For collecting the raw data, and plotting the results, I use the GUI versions (STRSVR and RTKPLOT) for convenience.  For converting the raw data to RTCM and processing the data, I use the CUI versions (CONVBIN and RTKPOST).  This is for two reasons.  First, because making any changes to the GUI versions requires  an Embarcadero/Borland VCL compiler to re-build the code and this compiler is not available for free.  The CUI versions can be rebuilt with the Microsoft Visual C++ compiler, which is free and one I am also much more familiar with.  The second reason I use the CUIs is because I have found it easier to keep track of all the input and output files for each run when using the CUIs.  I use simple Matlab wrappers to call the CUIs which save all the configuration, input, and output information to a separate folder.  Python wrappers would probably work just as well and it is available for free, but I already have Matlab and again am more familiar with it.

Once RTKLIB is downloaded, and the GPS receiver is connected to your PC via USB, start the STRSVR program (strsvr.exe).  It can be found in the rtklib\bin folder.  Set the Input Stream to “Serial” and use the “Opt” button to set the port and baudrate to match your GPS receiver.  If you’ve been communicating to the receiver with U-center or any other application, make sure you have disconnected them from the com ports to avoid any conflicts.

Next we need to configure the receiver to output the raw GPS signals, pseudorange, carrier phase, doppler, and SNR.   This requires us to use the normally undocumented commands TRK-MEAS and TRK-SFRBX.  First select the “Cmd” button for the input stream and copy the following commands into the “Commands at startup” window.

!UBX CFG-GNSS 0 32 32 1 0 10 32 0 1
!UBX CFG-GNSS 0 32 32 1 6 8 16 0 1
!UBX CFG-MSG 3 15 0 1 0 1 0 0
!UBX CFG-MSG 3 16 0 1 0 1 0 0
!UBX CFG-MSG 1 32 0 1 0 1 0 0

Make sure the “Commands at startup” box is selected, then click the “Save” button to save.  STRSVR will send these RTCM commands to the receiver at startup.  The third and fourth commands in this list enable the TRK-MEAS and TRK-SFRBX commands to the USB and UART ports.  See pages 9-13 of this document for an explanation of exactly what these numbers do.  The first and second commands are documented commands to configure how many channels the receiver should allocate to GPS and GLONASS.  Details are explained in the M8 Receiver Description under the CFG-GNSS command.  We could have configured these with the Ublox eval software in the last post, but I thought it was easier to do it all in one place, and also more consistent with other references.


Next, set Output (1) to “File” and use the “Opt” button to select a file name to save the data to.  I use a “.ubx” extension for this raw binary data.  Finally, click on “Start” to start collecting receiver data.  If everything is working properly, it should look something like this:


In the next post we will use RTKLIB to convert this Ublox proprietary binary data to a more friendly text version.

7 thoughts on “Collecting raw Ublox data with RTKLIB”

  1. Can I know some further details about this post, because I have tried this several times to get data but I unable to connect to RTK library! Could please send me a reply with or else I’m pleased to contact you too


    1. Hi Puji. I understand … RTKLIB can be quite unforgiving when first getting started. I encourage you to start simple, try to duplicate exactly what I did, or what someone else did, using their code, configuration, and data. Once you have got that working then you can work up one step at a time to your own configuration.


      1. Hi,
        Do you have any idea to active UBX 03-10 TRK-MEAS and TRK-SFRBX messages both UART and USB at startup? and what is configuration code to activate that! I have tried several times but I couldn’t able to do?



      2. Hi Pujja,

        I’m not sure I understand your question. If you are trying to activate UART and USB output at the same time, I don’t believe that is possible, but I could be wrong.

        If you are trying to use the commmands in this post on an M8N receiver and they are not working, it may be possible that your receiver has the most recent firmware, which I have heard no longer supports the raw data commands.


      3. Hey,
        I think you are correct I have latest firmware and I can’t configure to UBX TRK-SFRBX and UBX TRK-MEAS. but when I debug the receiver from U-center and disconnect from u center (without unplugging the module), and reconnect to RTKLib gives results. So main thing is to activate those message protocols manually using a command. Do you have any idea to activate that two types or do you have any idea to build up the code?


  2. Hi

    Thanks for your very useful post. i am also using two UBLOX GPS NEO M8T receivers. i am really new to this and trying to use RTKLIB. for some reason i am not able to do the RTKnavi. Could you please help me out?



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s