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 (2.4.2.11) 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.   For the Neo-M8N receiver 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 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.

strsvr

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:

strsvr_run

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

Advertisements

21 thoughts on “Collecting raw Ublox data with RTKLIB”

  1. Thank you for the posts. I try to acquire more SBAS data from M8N, but I still only have two SBAS satellite by using your configuration (m8n_rover_5hz). By using other receiver, I could obtain more than 3 SBAS satellite. Could you show how to obtain all SBAS data around me ?

    Like

  2. Hi, thank you very much for all your work! I’m looking for a command in order to get the raw measurement rate at 30s (1 measurement every 30 seconds) in order to get smaller files during long duration measurements. Do you know how to do this? I couldn’t find…

    Like

  3. Hi I had the same problem of Pujja. I have two receivers with the latest firmware version. I can not use RTKLIB. Any suggestion?
    How can I configure the M8N modules with the new firmware?

    Like

    1. Hi Dart. The raw measurement outputs of the M8N are scrambled in the latest u-blox firmware and not readable by RTKLIB. You will need to flash them with the older firmware which is available on the u-blox site. I have not done this myself but believe it should be possible.

      Like

      1. By entering the codes.
        To enable RXM-RAW

        B5 62 09 01 10 00 dc 0f 00 00 00 00 00 00 23 cc 21 00 00 00 02 10 27 0 e
        To enable RXM-SFRB

        B5 62 09 01 10 00 08 11 00 00 00 00 00 00 0fcc 21 00 00 00 02 11 42 4d
        In impout * cmd and correctly locate the port in rtknavi I do not get anything, it is only static green

        Like

    1. !HEX B5 62 09 01 10 00 C8 16 00 00 00 00 00 00 97 69 21 00 00 00 02 10 2B 22
      !HEX B5 62 09 01 10 00 0C 19 00 00 00 00 00 00 83 69 21 00 00 00 02 11 5F F0
      !HEX B5 62 06 01 08 00 02 10 00 01 01 01 00 00 24 2F
      !HEX B5 62 06 01 08 00 02 11 00 01 01 01 00 00 25 36
      !UBX CFG-MSG 240 0 0 0 0 1 # NMEA GGA
      !UBX CFG-MSG 240 1 0 0 0 0 # NMEA GLL
      !UBX CFG-MSG 240 2 0 0 0 0 # NMEA GSA
      !UBX CFG-MSG 240 3 0 0 0 0 # NMEA GSV
      !UBX CFG-MSG 240 4 0 0 0 1 # NMEA RMC
      !UBX CFG-MSG 240 5 0 0 0 0 # NMEA VTG
      !UBX CFG-MSG 240 8 0 0 0 0 # NMEA ZDA

      Like

  4. 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 pujjaozone@gmail.com or else I’m pleased to contact you too
    thanks

    Like

    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.

      Like

      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?

        thanks

        Like

        1. 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.

          Like

          1. 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?
            thanks

            Like

  5. 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?

    Regards,
    Ben

    Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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