Real-time solutions with RTKLIB and NTRIP using a cell phone as data link

As I mentioned in an earlier post, I’ve recently acquired access to some low cost dual frequency receivers, specifically a Tersus Precis BX306 and a pair of Swift Piksi Multis.  I have been playing with them over the past few weeks and plan to share my experiences with them over a series of posts.

Both receivers provide internal RTK solutions as well as raw measurements that can be processed with RTKLIB.  I’m interested in how the RTKLIB solutions compare to the internal solutions as well as how both of these compare to solutions derived from single frequency data collected simultaneously with the dual frequency data.

The first issue I ran into with this experiment, however, is that both receivers will only provide an RTK solution for real-time data, neither have the capability to post-process previously collected data.  This meant that I needed a way to provide a real-time stream of dual frequency base station data to the receivers.  I wanted to be able to  do this while driving a car around the local area so I needed more range than a low cost set of radios would give.

Fortunately, I have fairly good cell phone coverage in this area so I was able to rely on my cell phone for the data link.  In this post I will explain how I did that, both for an external CORS reference station and for my own base station.  In both cases I used  NTRIP server/caster/clients to do this.  NTRIP is a protocol for streaming of DGPS or RTK correction data via the internet using TCP/IP.  The NTRIP server sends out the data to an NTRIP caster and the NTRIP client receives it. For more details, there is a good description here.

Using this setup I was able to run real-time solutions with RTKLIB as well as with the intenal RTK engines in the Swift and Tersus receivers.  Here’s a diagram from the RTKLIB manual showing the setup I used for running a real-time RTKLIB solution using RTKNAVI.  When I ran a Swift or Tersus solution, the configuration was similar, but the NTRIP caster streamed the base station data to STRSVR instead of RTKNAVI, and STRSVR then streamed it to the receiver where it was combined with the raw receiver observations to create an internal RTK solution.  Also missing in this diagram is the cell phone which should be in between the internet and the rover PC.

ntrip.rtklib

The amount of free base station reference data that is available online on a real-time basis is a fair bit more limited that what is available after the fact for post-processing.  Fortunately I was able to find a CORS reference station about 17 km away that is available real-time through the UNAVCO NTRIP caster.  The service is free if the data is used for educational purposes and appropriately attributed.   Most of their stations are on the west coast of the U.S. but they do have some scattered across the rest of the country as you can see in this map from their site.  There are other networks available in other parts of the world that can be found by searching online.

unavco_map

To access the UNAVCO data I had to request access through email but the process was very simple and within a couple hours of my request I was all setup with an account and password.

Once I had my account set up, I used RTKLIB on my laptop computer to collect the data from the internet and stream it to the rover receiver over a serial port.  If I were doing this experiment within range of a wireless router then I could leave the computer connected to the wireless.  In this case though, I wanted to roam outside the range of my home wireless.  To do this, I enabled a hot spot on my cell phone and logged into that with my computer.

I was able to access the raw observation data stream from the UNAVCO NTRIP caster directly using the NTRIP client option in RTKLIB.  If I had wanted to generate a real-time RTKLIB solution, I would have configured the input streams of RTKNAVI but in this case I want to stream the raw data directly to the receiver so it can use the observation data for it’s internal solution.  I did this using the STRSVR app in RTKLIB.  I specifed the “NTRIP Client” option as input type and then entered the information from my UNAVCO account into the “Ntrip Client Options” as shown below.

ntrip_client

In this case I wanted the data from station P041 in RTCM3 format so I had to specify the Mountpoint as “P041_RTCM3”.  For other networks, the mountpoint details may be a little different.  Most NTRIP casters use Port 2101, and that was the case for this one.  For the STRSVR output type, I specified “Serial” and then configured the serial port options for whichever rover receiver I was using.  Before doing the configuration, I had connected the receiver to the laptop using a USB cable.

I then had to configure the receiver to tell it to get its base station data from the COM port and specify that it is in RTCM3 format.  The details for doing this on the two receivers are a little different but fairly straightforward in both cases.  You may also need to specify the exact base station location manually or the receiver may be able to get it from the data stream depending on the receiver and NTRIP stream details.

And that’s it.  With this configuration, either receiver was able to fairly quickly lock to a fixed RTK solution and continue to receive base data as long as I stayed in range of cell reception.  Any lag in the base station observations appeared to be less than a second.

That worked great for using an existing external reference as base station.  However, I also wanted to run another real-time experiment where I used one Swift receiver as base and the other as rover.   To do this, I needed to set up an NTRIP server to stream the data to  a caster on the internet as well as an NTRIP client to receive it.

I started by connecting the second Swift receiver to an old laptop with a USB cable and then downloading RTKLIB, the Swift console app,  and the right USB drivers.  The base station antenna is on top of my roof and the laptop is in the house so I was able to connect the laptop to the internet using my home wireless.

For the NTRIP caster, I found it convenient to use RTK2GO which is a community caster available for anyone to use at no cost.  To send the data to the caster, I used the “NTRIP Server” as the STRSVR output type and configured it as shown below.

strsvr_server

Again, the port is 2101.  You can choose any name for the mountpoint.  If that name is already in use, then rtk2go will assign a suffix to it, so it is best to choose a name that is unlikely to already be in use.  The password at the current time is BETATEST but that may change from time to time so it’s worth verifying it is still correct.

For the STRSVR input, I selected “Serial” and specified the correct COM port for the base station receiver.  In this case the raw observations are in Swift binary format which RTKLIB does not support so it sends them unaltered.  If they were in a format that RTKLIB did support, then they could be converted to RTCM3 to reduce bandwidth and make them more easily usable by someone else not using a Swift receiver as rover.  You can specify the conversion to RTCM3 using the “Conv” menu on the STRSVR output.

Start STRSVR and your base station observations are now accessible to anyone in the world through RTK2GO.com!

On the rover side, the NTRIP client is set up as I previously described using STRSVR except you want to use the same caster/mountpint/password as you just did on the base station.  In this case the user-id is left blank.  Again, set the STRSVR output to “Serial” to send it to the receiver.   Then set up the receiver to get it’s base station data from the serial port and, in this case, specify that it is in the Swift Binary Protocol (sbp).  Start the receiver and it should fairly quickly get a fix.  If you are seeing baseline data but not a solution, then most likely you have not specified the base station location to the rover.

I was now able to drive around almost anywhere and get continuous real-time RTK solutions using either my own base station or the CORS reference station as base.  In the next post I will discuss some of the data I collected and analyzed.

 

 

 

 

25 thoughts on “Real-time solutions with RTKLIB and NTRIP using a cell phone as data link”

  1. Hello Dear expert,
    I have 2 cors station both are TRIMBLE NETR9 within 10km. My task to compare baseline between them in RTK solution with fixed value. ​

    On my own server which is running RTKLIB, receiving A, B cors as ntrip server. then on RTKNAVI connected rover as B, base as A. But i cant see any fixed coordinate on screen.Only visible satellite’s graphs section showing columnbar.

    There is any way to do my task using RTKLIB?

    Like

    1. Hi Sumiya. With two CORS stations within 10 km, acquiring a fix with RTKLIB should be very straightforward. If you are not acquiring a fix, it is almost certainly a configuration issue. The most common problem is not properly specifying the base location. If that is not the issue, I would suggest setting the debug trace level option to two, running the solution, and then taking a look at the debug trace file for clues as to why you were not able to acquire a fix.

      Liked by 1 person

  2. Hello! My name is Max. I have a question about how to use RTKLIB as NTRIP-Client with opportunity to transform to local coordinate system. According to the manual, RTKLIB supports “datum transformation”, however there is no information how exactly to use and how to work with “datum.c” file. Could you please help me to solve this problem?
    Thank you!

    Like

    1. Hi Max. RTKLIB does have a configuration parameter to specify the solution datum but this parameter is not used anywhere in the code and the manual specifies that the current version of RTKLIB supports only the WGS84 datum. There is some unconnected code in datum.c to transform between local datums in Japan, you might be able to leverage off of this if you are up for custom modification of the code but I think this would be a non-trivial task.

      Like

  3. Hi, great blog. Quick question, when you use STRSVR to send corrections using Ntrip for internal processing on the receivers themselves, how do you log the solution? Once the serial connection is being used to send the corrections to the receiver it’s not possible to also connect with RTKNAVI to the same serial connection to record the corrected output.

    Like

    1. Hi Mconnigle. RTKLIB has a nice feature which will stream the data coming the other direction on a serial port to a TCP port. You can then start a second instance of STRSVR to log the incoming data to a file. This gets around the problem you are having where you cannot connect two applications to the same serial port. To enable this feature, check the “Output Received Stream to TCP Port” box in the “Serial Options” menu and specify a TCP Port number. For the input type for the second instance of STRSVR, specify “TCP Client” with the “Server Address” set to “localhost” and the same port number you used above.

      Like

  4. Thanks alot for this , but Can you make a post for rtklib strsvr. As using caster options as output, and how I can set my own system , and receive the data with clint throw internet

    Like

    1. Hi Theboel. If the NTRIP observations are in RTCM format, I don’t know of any way to convert these to UBX format. If the NTRIP data is coming from your own receiver, then you can send it in UBX format.

      Like

  5. I have a base on ublox m8p and a rover neo m8n, I can not get a Fix solution. I climbed the whole Internet but I did not understand for the rover, I also need a receiver with a ublox m8P or will the m8N work too

    Like

  6. Hi rtkexplorer! I just tried connecting to a NY NTRIP server using rtkNavi (demo5 b29a) and just could not get a connection. As a double check I did the same in the official release version of rtkNavi and it worked without a problem with the same credentials. Not sure what the problem is. Any help would be appreciated.

    Thanks
    Mike

    Like

    1. Hi Mike. I have been successfully connecting to NTRIP servers with the demo5 b29a version of RTKNAVI so I’m not sure what is going on in your case. If you are comfortable emailing me your connection info, I can see if I can duplicate the problem here.

      Liked by 1 person

      1. Hi Mike. I was able to successfully connect with the demo5 b29a version of RTKNAVI that I just downloaded from my website using the credentials you sent me. I’m not sure why it isn’t working for you.

        Update for others who might have a similar issue: Mike found that his firewall was blocking RTKNAVI’s access to the internet

        Liked by 1 person

        1. Sorry for the delay in updating this post. The block was caused by the Norton Firewall as opposed to the router. So if you run into a problem check your anti-virus (if it has an option for allowing internet access to programs).

          Like

          1. Realize this is resolved now, but the line “…connecting to a NY NTRIP server…” caught my eye and wanted to put in that the NY State’s CORS network is one of the slower ones to connect when a virtual site is being used. I have seen it take >15 seconds to reply with data when the initial connection is made. RTKLIB, by contrast, will time out and reconnect in 10 (default values). You can get into a loop. We make some timing adjustments to cope with this in our own SW for the SNIP Caster. So the trick to know would be to use longer time out value if a VRS is used.

            Like

  7. hi, i had problem fixing a point, i used ‘single option’ (a receiver) and NTRIP client was used as stream type, my ID, password, mountpoint, ntripcaster address were inserted to both Input, Output and Log, then i clicked on start. note: i am using a receiver. pls is there any step missing?

    Like

  8. Hi rtklibexplorer! Thank you for maintaining such an informative blog! You gave us a lot of insights in RTK technology! I have been trying on a project using LTE network as the data link to stream with public NTRIP as well. The RTCM3.2 MSM4/5 format works well for GPS but doesn’t operate normally for Beidou satellites. By using the newest demo5 rtknavi, both GPS and Beidou SNR are displayed on screen and showed in obs data. I can also see RTCM1074, 1124 and other messages in the RTCM3 data. However, only GPS are counted in valid satellites while Beidou don’t. I am sure elevation mask and snr mask are not hiding them. I used to use my own antennas with skyTraq format for base and rover and they worked fine with GPS+Beidou but got no luck with public NTRIP RTCM format. I wonder if I did anything wrong in the configurations or did I missed any specifications of RTKLIB.

    Like

    1. Hi Kevin. In order to use the Beidou satellites you will need to enable them, both in the conversion from binary data in RTKCONV and in the solution, either in RTKPOST, RNX2RTKP, or RTKNAVI. Assuming you have enabled them, then I don’t know why they wouldn’t be processed. I don’t see the Beidou satellites from here, so have not worked with them myself. I’d be happy to take a look at some data that includes Beidou if you could send me some. You can send it to me at rtklibexplorer@gmail.com.

      Liked by 1 person

Leave a reply to rtklibexplorer Cancel reply

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