RTK Corrections unavailable when using RTK Express

Workbench

  • What development board or microcontroller are you using? ESP32

  • What version of hardware or breakout board are you using? ESP32

  • How is the breakout board wired to your microcontroller? I2C

  • How is everything being powered? MicroUSB

  • Are there any additional details that may help us help you?

Steps to reproduce


#include <SparkFun_u-blox_GNSS_v3.h> 

UBX_NAV_STATUS_data_t checkRTKstatus;

Serial.println(checkRTKstatus.fixStat.bits.diffCorr);

Expected behavior

Since I have connected the RTK Express to the GPS and powered it on, I should be receiving the RTK Corrections. But when I check the value of diffCorr variable (https://github.com/sparkfun/SparkFun_u- … 9C9-L189C9), I always get 0.

Actual behavior

The value of diffCorr should be 1 when RTK Corrections are available.

Since I have connected the RTK Express to the GPS and powered it on, I should be receiving the RTK Corrections.

The GNSS satellites do not provide RTK corrections. RTK Correction are obtained from a terrestrial source (usually), using an NTRIP client or other. SW Maps has a built in NTRIP Client that works well with the RTK Express: https://docs.sparkfun.com/SparkFun_RTK_ … e/#sw-maps

You will need to locate a base station within ~20km of your location for the RTK Express to obtain an RTK Fix. You can also setup your own base station, or use a correction service such as Skylark or OneNav. See the Quickstart guide here: https://docs.sparkfun.com/SparkFun_RTK_ … ash-course

Hi Divyansh,

Adding a link to your original question on GitHub: https://github.com/sparkfun/SparkFun_u- … /issues/39

Are you still having difficulty with the Holybro radio connection? Did you try correcting the connections between the radio and the ZED-F9P board like I suggested?

Best wishes,

Paul

Thank you for your response Paul and sparky.

Yes Paul, I am still unable to get the RTK corrections. I have modified the connections according to your suggestions.

divyanshbhutia99:
Workbench

  • What development board or microcontroller are you using? ESP32

  • What version of hardware or breakout board are you using? ESP32

  • How is the breakout board wired to your microcontroller? I2C

  • How is everything being powered? MicroUSB

  • Are there any additional details that may help us help you?

Steps to reproduce


#include <SparkFun_u-blox_GNSS_v3.h> 

UBX_NAV_STATUS_data_t checkRTKstatus;

Serial.println(checkRTKstatus.fixStat.bits.diffCorr);

Expected behavior

Since I have connected the RTK Express to the GPS and powered it on, I should be receiving the RTK Corrections. But when I check the value of diffCorr variable (https://github.com/sparkfun/SparkFun_u- … 9C9-L189C9), I always get 0.

Actual behavior

The value of diffCorr should be 1 when RTK Corrections are available.

Update:

Some more clarification on the setup -

RTK Express is in base station mode connected via radio to the F9PGPS. Rover is an F9PGPS on ESP32.

Hi Divyansh,

Please check each of the following steps:

Has the Express completed its survey-in? Is it outputting RTCM messages?

Has the Express port been configured correctly? Are the RTCM messages being output?

Has the radio been connected correctly to the Express?

Has the baud rate been set correctly (the Express and radio baud rates need to match)?

Has the radio been connected correctly to the ZED-F9P UART pins?

Is the radio powered correctly?

Is the radio outputting RTCM messages?

Does the radio baud rate match the ZED-F9P UART?

Is the ZED-F9P UART configured for RTCM-input? (The default is “yes” but please check.)

Do both the Express and ZED-F9P antennas have a clear view of the sky?

All of these need to be correct for the ZED to achieve RTK float / fixed…

I hope this helps,

Paul

Thank you for your response Paul.

I ran this example (https://github.com/sparkfun/SparkFun_u- … CM1005.ino). The 1st time I ran it, I got an output saying “No RTCM 1005 data is available.”

When I ran it again, I got the following output.

Welcome to minicom 2.7.1

OPTIONS: I18n

Compiled on Dec 23 2019, 02:06:26.

Port /dev/ttyUSB0, 15:25:12

Press CTRL-A Z for help on special keys

SparkFun u-blox GNSS Example

Survey started.

This will run until 60s have passed and better than 5.00m accuracy is achieved.

Base survey complete. Configuring RTCM.

RTCM messages were configured successfully

available

No RTCM 1005 data

Latest RTCM 1005: Latest RTCM 1005:

ARP ECEF-X: 903707.6442 Y: -5725762.2957 Z: 2651770.1888 available but is stale

ARP ECEF-X: 903707.6442 Y: -5725762.2957 Z: 2651770.1888 available but is stale

ARP ECEF-X: 903707.6442 Y: -5725762.2957 Z: 2651770.1888

ARP ECEF-X: 903707.6442 Y: -5725762.2957 Z: 2651770.1888

Also, just wanted to confirm this, to do survey in, I have to switch it on and change the mode to base (using setup button) and place it under open sky right? Once I see the number of satellites and other info, the survey in is done?

Hi Divyansh,

Example24 configures the ZED-F9P as a base. It performs a survey-in and then checks that the ZED-F9P is producing the RTCM 1005 message. RTCM 1005 contains the base antenna location. When the Antenna Reference Point (ARP) Earth Centered Earth Fixed (ECEF) XYZ coordinates are displayed, you know the survey-in has been successful.

Internally, the Express is doing the exact same thing. Press the SETUP button until Base is highlighted. The survey-in will start and the checkered flag icon will flash, Mean (metres) will decrease and Time (seconds) will increase. You can tell if the survey-in is complete when the checkered flag icon stops flashing and the word Xmitting (transmitting) appears on the display.

For RTK to work, you need a Base and a Rover with the Base sending RTCM corrections to the Rover. By running Example24, you have made the ZED-F9P board a Base. The battery-backed memory means it will remember that it is a Base. To make it a Rover again, you need to reset its memory with Basics/Example11_ResetModule.

I hope this helps,

Paul

That helps a lot Paul, thank you!

I am using the F9PGPS breakout board in the rover mode. Could you please tell me how to properly setup the ZED F9P as a rover and how to init the radio in code?

Hi Divyansh,

Please have another read through this tutorial: https://learn.sparkfun.com/tutorials/se … over-setup

If you reset the ZED-F9P breakout with Basics/Example11_ResetModule, it will return to being a Rover.

The Holybro radios default to 57600 baud. You can set the ZED-F9P UART1 and/or UART2 ports to 57600 baud using u-center - as shown in the tutorial. Or you can do it through the Arduino library with:

myGNSS.setSerialRate(57600, COM_PORT_UART1); // Change to COM_PORT_UART2 if needed

This will set UART1 to 57600 baud and will save the setting in battery-backed RAM. If you also want to set it in flash memory, you can use:

myGNSS.setSerialRate(57600, COM_PORT_UART1, VAL_LAYER_ALL); // Change to COM_PORT_UART2 if needed

I hope this helps,

Paul

Thank you Paul, I will check this out!

Hey Paul,

Thank you so much for assisting me. I appreciate your support!

I have reset the F9PGPS using the example you mentioned and changed the baud rate to 57600. When I check the value of myGNSS.getFixType(), I get 3. And the value of diffCorr is still 0 (https://github.com/sparkfun/SparkFun_u- … cts.h#L186). And is diffCorr value the only way to check if RTK Corrections have been applied?

According to (https://github.com/sparkfun/SparkFun_u- … e.ino#L228), a fix type of 3 means 3D fix (longitude, latitude and altitude I guess?) but when I check the longitude and latitude coordinates and map them to an address, it points to a wrong location (it points to a different location in my neighbourhood).

Also, how do I initialize the radio in the code?

Hi Divyansh,

You should not need to change the radio settings. It defaults to 57600 baud. If you have connected the radio TX pin correctly to the ZED-F9P UART1 RX pin, changed the ZED UART1 baud rate, and provided power, then it should work.

Without RTK the position accuracy should be approximately 1m. If the error is larger than that, please check that the antenna has a clear view of the whole sky. Good signal reception is critical for RTK.

I hope this helps,

Paul

Thank you Paul!

Hey Paul,

When I check the value of myGNSS.getCarrierSolutionType(), I get “2” which means High precision RTK fix. But on the other hand the value of diffCorr and diffSoln in UBX_NAV_STATUS_data_t struct is still 0. Do you have any suggestions on what I could be missing?

Hi Divyansh,

Please check you have enabled the NAV_STATUS message and are reading it correctly with the library.

There is no dedicated example for NAV_STATUS. But you can adapt (e.g.) the NAV_PVT Callback example:

https://github.com/sparkfun/SparkFun_u- … AV_PVT.ino

Please try the following code:

Best wishes,

Paul

#include <Wire.h> //Needed for I2C to GPS

#include <SparkFun_u-blox_GNSS_v3.h> //http://librarymanager/All#SparkFun_u-blox_GNSS_v3
SFE_UBLOX_GNSS myGNSS;

// Callback: printPVTdata will be called when new NAV PVT data arrives
void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
{
    Serial.println();

    Serial.print(F("Time: ")); // Print the time
    uint8_t hms = ubxDataStruct->hour; // Print the hours
    if (hms < 10) Serial.print(F("0")); // Print a leading zero if required
    Serial.print(hms);
    Serial.print(F(":"));
    hms = ubxDataStruct->min; // Print the minutes
    if (hms < 10) Serial.print(F("0")); // Print a leading zero if required
    Serial.print(hms);
    Serial.print(F(":"));
    hms = ubxDataStruct->sec; // Print the seconds
    if (hms < 10) Serial.print(F("0")); // Print a leading zero if required
    Serial.print(hms);
    Serial.print(F("."));
    unsigned long millisecs = ubxDataStruct->iTOW % 1000; // Print the milliseconds
    if (millisecs < 100) Serial.print(F("0")); // Print the trailing zeros correctly
    if (millisecs < 10) Serial.print(F("0"));
    Serial.print(millisecs);

    long latitude = ubxDataStruct->lat; // Print the latitude
    Serial.print(F(" Lat: "));
    Serial.print(latitude);

    long longitude = ubxDataStruct->lon; // Print the longitude
    Serial.print(F(" Long: "));
    Serial.print(longitude);
    Serial.print(F(" (degrees * 10^-7)"));

    long altitude = ubxDataStruct->hMSL; // Print the height above mean sea level
    Serial.print(F(" Height above MSL: "));
    Serial.print(altitude);
    Serial.print(F(" (mm)"));

    uint8_t carrSoln = ubxDataStruct->flags.bits.carrSoln; // Print the carrier phase range solution
    Serial.print(F(" carrSoln: "));
    Serial.println(carrSoln);
}

// Callback: printSTATUSdata will be called when new NAV STATUS data arrives
void printSTATUSdata(UBX_NAV_STATUS_data_t *ubxDataStruct)
{
    Serial.println();

    Serial.print(F("diffSoln: "));
    Serial.print(ubxDataStruct->flags.bits.diffSoln;

    Serial.print(F(" diffCorr: "));
    Serial.println(ubxDataStruct->fixStat.bits.diffCorr;
}

void setup()
{
  Serial.begin(115200);
  while (!Serial); //Wait for user to open terminal
  Serial.println("SparkFun u-blox Example");

  Wire.begin();

  //myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial

  if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port
  {
    Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing."));
    while (1);
  }

  myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
  myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR

  myGNSS.setNavigationFrequency(1); //Produce one solutions per second

  myGNSS.setAutoPVTcallbackPtr(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata

  myGNSS.setAutoNAVSTATUScallbackPtr(&printSTATUSdata); // Enable automatic NAV STATUS messages with callback to printSTATUSdata
}

void loop()
{
  myGNSS.checkUblox(); // Check for the arrival of new data and process it.
  myGNSS.checkCallbacks(); // Check if any callbacks are waiting to be processed.

  Serial.print(".");
  delay(50);
}

Thank you Paul, I will check this.