Converting raw receiver data to standard text format using CONVBIN

At this point, we have collected raw receiver output data in a Ublox binary format file. We need to convert this to RINEX format before RTKLIB will process it. RINEX (Receiver Independent Exchange Format) is a standard text data format supported by many receivers and post‐processing analysis software.

This can be done with RTKCONV, the GUI conversion program in RTKLIB, but I prefer to use CONVBIN, the CUI version.  To avoid having to remember the exact command format, I automate the call with a simple matlab wrapper. To convert binary data from a file named “testdata.ubx” the format of the command to CONVBIN will look like this:

convbin -od -os -oi -ot -f 1 -ts 2015/12/14 17:25:00 -te 2015/12/14 18:25:00 testdata.ubx

The command line options are all well documented in the RTKLIB user manual and there are many I am not using but here’s a brief explanation of the options I am using:

-od: include doppler frequency data in observation output file

-os: include SNR data in observation output file

-oi: include iono correction in nav output file header

-ot: include time correction in nav output file header

-f 1: one frequency (L1 only)

-ts: start time

-te: end time

I leave off the start time and end time options when I choose to process the complete file.

The output of this command will be a set of text files. The .obs file contains the observation data which in this case is the pseudorange, carrier phase, doppler, and SNR from each satellite for each epoch. The start of this file should look something like this:

obsfile

The top section is the file header, followed by a timedate stamp and list of satellites for the first epoch. After that is a list of pseudorange, carrier phase, doppler, and SNR numbers for five satellites from the first epoch, each row being one satellite. See here for a complete description for the RINEX observation file data format.

There will also be a .nav file containing navigation data for the GPS satellites, a .gnav file for GLONASS navigation data, a .hnav file for geosynchronous satellite navigation data and a .sbs file containing SBAS correction data. All of these files are in text format and we will need most, if not all of them, as inputs to generate position data.

The data is now in a standard format that can be processed by RTKLIB to determine position.

Advertisements

30 thoughts on “Converting raw receiver data to standard text format using CONVBIN”

  1. Hi SIr,
    1st thak’s for the vlogs that U made … it did help
    But while i was puisuiting this one i had a littel proble that i hope U help me with.
    i’m working with the RTKLIB Windows executables that U linked http://rtkexplorer.com/downloads/rtklib-code/
    after i generate the Ublox proprietary binary data using the STRSVR program (strsvr.exe), i wanted to convert it to .OBS file

    BUT when i used the cmd i get this :

    C:\Users\Me\Desktop\demo5_b29d>.\convbin.exe -od -os -oi -ot -f 1 -ts 2018/09/14 14:56:14 -te 2018/09/14 14:57:28 .\convbin_outputFile.ubx
    input file : .\convbin_outputFile.ubx (u-blox)
    ->rinex obs : .\convbin_outputFile.obs
    ->rinex nav : .\convbin_outputFile.nav
    ->rinex gnav: .\convbin_outputFile.gnav
    ->rinex hnav: .\convbin_outputFile.hnav
    ->rinex qnav: .\convbin_outputFile.qnav
    ->rinex lnav: .\convbin_outputFile.lnav
    ->rinex cnav: .\convbin_outputFile.cnav
    ->rinex inav: .\convbin_outputFile.inav
    ->sbas log : .\convbin_outputFile.sbs

    :

    C:\Users\Me\Desktop\demo5_b29d>

    when i checked the directory … i found none of the files that should be createn.


    Any help !!!

    Like

  2. Hi,
    I am trying to convert a .ubx file that i have created to Rinex format for further processing (using RTKLib 2.4.2). The following command line option

    convbin -od -os -oi -ot -f 1 Test.ubx

    did not seem to work however the GUI version did and created the relevant files however i would prefer to use the command line version. I am using a neo m8n device and have followed the previous posts to correctly setup the GPS and create the .ubx file. The top part of the created .OBS file indicates that the Rinex version is 3.11 – is this the incorrect version to use to have the command line version work.

    Also, i am using a NEO-m8n GPS device which requires the undocumented commands to make it output the raw GPS data. Is there a way to have these undocumented command settings made permanent in the GPS device so that it can be used with a microcontroller (arduino) to capture the raw data to an SD card (remote animal tracking application) for later processing with RTK lib or can these commands be sent over the serial port to the arduino.

    Any help is much appreciated.

    Cheers.

    Like

      1. The older firmware M8N receivers can be configured to permanently output raw data.
        Once the correct commands are activated you just need to save the current configuration.

        One way to do it:

        1)Use the initialization strings in RTKNAVI to turn on the raw data messages:

        !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

        2) Exit RTKNAVI – Make sure NO shutdown commands are enabled

        3) Start u-center and save the configuration under UBX-CFG-CFG

        That’s all there is to it though I would turn off all unnecessary output first and maybe
        set an optimal baud rate.

        Like

        1. Thanks JB for the correction! For some reason, I was under the impression this wouldn’t work, but apparently I was wrong. To avoid confusion, I have deleted my original response.

          Like

          1. Hi, and thanks for the replies, much appreciated – i just have a couple of questions;

            1) The initialization strings mentioned by JB that need to be entered in RTKNAVI have already been entered in STRSVR do they also have to be entered in RTKNAVI and if so how/where is this done in RTKNAVI – the only place i could see was in the command option of the input stream for the rover – is this correct?

            2) When i use RTKCONV it creates the *.obs file but only one *.nav file (the others are selected but grayed out) and the *.sbs file however the *.sbs file only has “No Text” written in it.

            Any help is much appreciated.

            Cheers.

            Like

          2. Hi Richard. (1) The command strings only need to be entered in one place for each receiver. The command option of the input stream is the correct place to enter these commands in either app. (2) If you have RTKCONV set up to generate RINEX 3 files through the options menu then it will create only one .nav file which will contain navigation data for all constellations. If you choose a RINEX 2 format, then RTKCONV will generate a different nav file for each constellation. If the .sbs file has only “No Text” in it, then most likely your receiver is not logging SBAS correction data to the raw file.

            Like

          3. Hi,
            I have continued experimenting with using micro-controllers to log raw data from a NEO M8n GPS receiver for remote data tracking applications with reasonable success. However if possible could i get an explanation of the output from the ubx conversion using convbin – specifically the last 3 entries of the last line from the conversion. The following are two outputs; 1 from a python program running on a PC and the other is from a micro-controller, running an embedded python program:

            convbin.exe -od -os -oi -ot -f 1 GPSBinTestPy.ubx
            input file : GPSBinTestPy.ubx (u-blox)
            ->rinex obs : GPSBinTestPy.obs
            ->rinex nav : GPSBinTestPy.nav
            ->rinex gnav: GPSBinTestPy.gnav
            ->rinex hnav: GPSBinTestPy.hnav
            ->rinex qnav: GPSBinTestPy.qnav
            ->rinex lnav: GPSBinTestPy.lnav
            ->sbas log : GPSBinTestPy.sbs

            2018/08/06 03:41:46-08/06 03:54:32: O=443 N=4 Q=2

            In the above conversion the ubx file was about 1.2Mb and the resultant .OBS file was 87Kb.

            convbin.exe -od -os -oi -ot -f 1 GPSBinTest.ubx
            input file : GPSBinTest.ubx (u-blox)
            ->rinex obs : GPSBinTest.obs
            ->rinex nav : GPSBinTest.nav
            ->rinex gnav: GPSBinTest.gnav
            ->rinex hnav: GPSBinTest.hnav
            ->rinex qnav: GPSBinTest.qnav
            ->rinex lnav: GPSBinTest.lnav
            ->sbas log : GPSBinTest.sbs

            2018/08/06 02:36:54-08/06 03:01:54: O=10 N=2 Q=5 E=816

            In the above conversion assume the E=816 relates to some form of error? In this conversion the ubx file was about 2Mb but the resultant .OBS file was only 3.3kb. Which seems way to small?

            Any help with this is much appreciated.

            Cheers.

            Like

          4. Hi Richard. The last 3 items on the last line are the number of entries to each file (O=obs, N=nav, Q=qnav), except the last which is as you guessed, number of errors. To get more info about the errors, you could use the “-trace 2” option on the command line. Unfortunately, the trace option is not enabled in the convbin executable, so you will either have to rebuild the code with preprocessor option “TRACE” set or use RTKCONV which does have the trace option enabled. With RTKCONV you can set the debug level to 2 from the “Options” menu. The trace file will be in the data folder with CONVBIN or the executable folder with RTKCONV.

            Like

          5. Hi,
            And thanks for the reply.

            Is there a definitive way to determine if the created files (from convbin etc) are actually valid observation files. For example if files that have been created using convbin are created with no errors does this mean that the created files are definitely valid. Conversely if the conversion by convbin only creates a couple of errors, are the created files still useable?

            Any help is much appreciated.

            Cheers.

            Like

          6. Hi Richard. A few errors when translating raw binary files are not unusual and should not affect the solution other than you may have a few missing samples. The best way I know of to check the validity of the observation file is to use RTKPLOT to plot it and look for missing data.

            Like

  3. Hi all,

    I am trying to convert some *.ubx files into rinex with RTKLIB v2.4.2 p10 and I have noticed some strange things. The antenna is connected with an ublox receiver and a commercial one with a splitter, so I have the “same” measurements in both receivers. Comparing both rinex files, I see there are some differences in the pseudoranges (I know the noise is different, but this does not explain the difference). An other strange thing is that I cannot load the rinex file from ublox in a commercial GNSS software (Leica Geo Office, Topcon tolls etc.)

    Like

    1. Hi Nikos. The pseudorange measurements are not just a measurement of distance to the satellite but also include a significant offset due to errors in the receiver clock. Your two receivers will have different clock errors and hence different pseudorange measurements.

      RTKLIB can generate different versions of RINEX files. Is it possible that your GNSS software is expecting a different version than you are generating with RTKLIB? The RINEX version number is in the file header so you can look at the version number of a file that the software does accept.

      Like

      1. Hello,

        I am trying to convert base station’s data from .ubx to RINEX. But, I only could receive .obs files, the .nav files were not included. Nonetheless, when I converted observation station’s data from .ubx to RINEX, I could receive both .obs and .nav.

        I am wondering if you can tell me how to get .nav files from base station’s data.

        Thanks in advance,

        Kien

        Like

        1. Hi Nguyen. The navigation messages are often not enabled in the base station to reduce bandwidth needed to transmit the base station data over a data link. I suspect this is what is happening in your case. The navigation data is identical between base and rover so there is no need for two copies. If you do want the the navigation data from the base instead of the rover you will need to enable the navigation messages in the base receiver.

          Like

  4. Hi Tim. First, as many have said, thank you for all the work you are putting into maintaining this site. Great for beginners and advanced users alike. Now, to the problem at hand. Let me say I haven’t clue what I am doing but am trying to follow along your examples in this and the previous post using an M8N. I am able to run strsvr and collect data (about 500k). So far so good. I then used your command line slightly modified:

    convbin -od -os -oi -ot -f 1 -ts 2017/10/17 19:24:00 -te 2017/10/17 19:25:30 rtkTest3.ubx

    Starts out looking ok but at the end I get a E=1 (which I assume is an error) and no files are created.
    input file : rtkTest3.ubx (u-blox)
    ->rinex obs : .\rtkTest3.obs
    ->rinex nav : .\rtkTest3.nav
    ->rinex gnav: .\rtkTest3.gnav
    ->rinex hnav: .\rtkTest3.hnav
    ->rinex qnav: .\rtkTest3.qnav
    ->rinex lnav: .\rtkTest3.lnav
    ->sbas log : .\rtkTest3.sbs
    E=1

    I did try rtkconv as well with the same results and playing around with different settings since I have galielo, glonas, gps selected.

    Any help for a newbie would be appreciated.

    Thanks
    Mike

    Like

    1. Ok I may not have v2.01, I may have updated:
      Software Version: EXT CORE 3.01 (107900)
      ROM BASE: 2.01
      FWVER =SPG3.01
      Anybody have v2.01?

      Like

      1. Downgraded to 2.01 and everything looks ok with config at 2.01. Now when I create the file no messages but no conversion files are created. What in the world am I doing wrong.

        Ok. Was using 2.4.2 with this new file. When I use rtkconv from your demo5 it works but it only created a obs file – only ran it for about 2 seconds of data just as a test. Maybe now need more data.

        Like

  5. First, thanks for your wonderful blog and its wealth of useful information. I am seeing similar problems to Syed. If I capture raw UBX from my LEA-6T for 1 day from 2017-10-03 15:00, my converted RINEX file with convbin/RTKCONV contains datetimes spanning 2017-09-30 to 2017-10-21 (!) mixed together. This cause the post-processing services (I’m using NRC’s PPP service which is happy with L1-only data) to throw it back with ‘Error : An out-of-order data block was found in your RINEX file. Ensure time tags of observations are in proper increasing order.’

    Like

      1. Hi Tim. I got your file and it looks like you had both RXMRAW and TRKD5 messages enabled when you collected this data. This will give you a double set of observations and cause all sorts of problems. Disabling the TRKD5 messages in your receiver configuration will fix the problem. I verified that if I modified the RTKLIB ublox.c file to ignore the TRKD5 messages, then the resulting Rinex file looked good.

        Like

  6. Hi, I have a question about RTKCONV tool from RTKLIB. When i convert RTCM3 file to RINEX 2.11 using this tool, the output RINEX observation file is not be able to be processed by softwares like NRCAN PPP, GLAB, GAPS, AUSPOS 2.2 etc. The error message which i receive are following

    AUSPOS has detected an error in the data you have submitted for processing. Please check you data is in the correct RINEX format required for processing an AUSPOS job.
    CSRS-PPP online was unable to process your submitted RINEX file. Most likely causes are bad data, bad satellite identification or time tag problems.

    But when i use another RINEX file from receivers which generate RINEX files by themselves, these softwares are working totally fine.

    Please let me know your view about resolving this issue?
    Thanks and best regards,

    Like

    1. Hi Syed. I have not tried converting RTCM3 files to RINEX 2.11 for online PPP processing, but I have converted raw binary files from both Swift and Tersus receivers to RINEX 2.11 using RTKCONV and have not had a problem submitting these to any of the online PPP processing tools. Are you submitting dual freq observation files or single freq? I have found that some of the online PPP tools will reject files if they don’t have any L2 observations. Also, do your RINEX files have valid approximate base positions in the header. I have seen this cause problems if it is missing, although not specifically for online PPP processing.

      Like

      1. Thanks for your message, The Rinex files are dual frequency KINEMATIC file. My RINEX files do not have base positions and are set to 0. Today, i changed it to approx x,y,z values and post processed it using NRCAN PPP online, still i got an error message saying.

        “Error : CSRS-PPP online was unable to process your submitted RINEX file. Most likely causes are bad data, bad satellite identification or time tag problems.”

        I am not sure why the there is such error. Please guide me about this

        Like

  7. Hi,

    I’m doing an experiment for gps tracking of an animal using a base and a rover. I want to use the data for rtklib post-processing. I understand I need carrier phase, psuedorange and raw data. I’m using the C94-M8P which has a NEO-M8P GPS module on it. I am not making use of the RTK functionality, I just want to log the data and do post processing. I was just wondering if you could assist me or at least guide me in the right direction on how to do this. I’m logging the data from the base and rover to an SD card. I need to know what messages to send to the SD card. When configuring the devices in u-center, what messages must I send? Will the UBX-RAW messages contain all the information I need for the rover? Also I know that I need a RINEX log file for the rover, and RINEX and NAV files from the base. I assume for rinex I just need carrier phase, psuedorange and raw data, but what is the navigation file comprised of?

    I hope this was clear!

    Like

    1. Hi James. I have not used the M8P and so am not certain on the answer. With the M8T you want to enable the RXM-RAWX and RXM-SFRBX messages but the u-blox documentation suggests these may only be available for the timing modules. I see comments on the u-blox board though that suggest the M8P may support these commands. If that is not true, then you will probably need to enable the RTCM3 messages for raw measurements and navigation data. There is some discussion of this on the u-blox forum that may help. Either way you will need both raw measurements and navigation data. The navigation data includes the necessary orbital information for the satellites.

      Like

    2. Hi James,

      I may be able to help you. Currently i am working for a GPS company where we use M8P and RTK lib. Personally i am quite interested in animal tracking applications, so i could give you support for this. UBlox receiver will contain all the information which will be then converted to RINEX format using RTK LIB.
      RINEX NAvigation file comprises of all the satellites that are visible to the receiver for example constellation type, clock parameters etc. In short RINEX Navigation files allows a receiver with info about correct positions of all satellites and time tag information. Even if you do not have Navigation file, another solution is available which is PPP.

      As i am very interested in animal tracking applications, i can help you with further if you are interested. Let me know.

      Like

  8. Hi Sir,
    I repeated your experiment with this article.
    But some problem have occured.
    Thank you

    qyh@qyh-ThinkPad-T450:~/uav/rtklib-dx/RTKLIB-b27$ convbin -od -os -oi -ot -f 1 COM5_170617_120649.ubx
    input file : COM5_170617_120649.ubx (u-blox)
    ->rinex obs : COM5_170617_120649.obs
    ->rinex nav : COM5_170617_120649.nav
    ->rinex gnav: COM5_170617_120649.gnav
    ->rinex hnav: COM5_170617_120649.hnav
    ->rinex qnav: COM5_170617_120649.qnav
    ->rinex lnav: COM5_170617_120649.lnav
    ->sbas log : COM5_170617_120649.sbs

    Segmentation fault (core dumped)

    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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.