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
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?
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.
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?
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 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?
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
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).
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.
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?
#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);
}