Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

v1.8.7 Release candidate #137

Merged
merged 27 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8895c9b
Change Ublox to u-blox
nseidle Oct 23, 2020
6efce21
Change default setVal to RAM+BBR+Flash. Expanding key set.
nseidle Oct 23, 2020
55bb4a2
Move keys to separate file
nseidle Oct 23, 2020
79679f8
Add getVal8/16/32. Add a bunch of keys.
nseidle Oct 23, 2020
583f528
Add getVal8/16/32 support for group/id/size combos.
nseidle Oct 23, 2020
0fb2fcf
Update Example1_GetSetPortSettings.ino
nseidle Oct 23, 2020
872520b
Update library.properties
nseidle Oct 23, 2020
8638c35
Add support for TMOD3 fixed position.
nseidle Oct 23, 2020
7114584
Merge pull request #133 from sparkfun/UBloxTextChange
PaulZC Oct 26, 2020
30bff51
Merge branch 'release_candidate' into Expand-getVal-setVal
PaulZC Oct 26, 2020
32f8583
Change function call vars to be more clear. Fix example with correct …
nseidle Oct 26, 2020
d4975d4
Resort and rename get/setVal examples in one chunk.
nseidle Oct 26, 2020
03a91e5
Remove duplicate define
nseidle Oct 26, 2020
5102d9f
Add MSGOUT keys. Update examples to use defined keys.
nseidle Oct 26, 2020
6239fc2
Adding header guard
nseidle Oct 26, 2020
50086e4
Merge pull request #135 from sparkfun/setStaticPosition
nseidle Oct 26, 2020
8be456c
Merge pull request #134 from sparkfun/Expand-getVal-setVal
nseidle Oct 26, 2020
5e5dcce
Update library.properties
nseidle Oct 26, 2020
5672e91
Merge pull request #136 from sparkfun/increaseLibVersion
nseidle Oct 26, 2020
9f72926
autoHPPOSLLH functions added - work in progress
PaulZC Oct 27, 2020
9bc3a2d
autoHPPOSLLH - almost ready
PaulZC Oct 27, 2020
1075c2e
Removing two incorrect inversions. These were preventing OVERWRITTEN …
PaulZC Oct 27, 2020
47c83da
Adding autoHPPOSLLH. Tested on the ZED-F9P.
PaulZC Oct 27, 2020
722afc4
Merge pull request #139 from sparkfun/autoHPPOSLLH
PaulZC Oct 27, 2020
f3af4a4
Fix typo. Convert keys to const uint32_ts.
Oct 27, 2020
3b30b92
Update Example11_autoHPPOSLLH.ino
PaulZC Oct 27, 2020
8b27b3e
Merge pull request #140 from sparkfun/autoHPPOSLLH
PaulZC Oct 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions examples/ZED-F9P/Example11_autoHPPOSLLH/Example11_autoHPPOSLLH.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
Configuring the GPS to automatically send HPPOSLLH position reports over I2C
By: Paul Clark
Date: October 27th 2020

Based on an earlier example:
By: Nathan Seidle and Thorsten von Eicken
SparkFun Electronics
Date: January 3rd, 2019
License: MIT. See license file for more information but you can
basically do whatever you want with this code.

This example shows how to configure the U-Blox GPS the send navigation reports automatically
and retrieving the latest one via getHPPOSLLH. This eliminates the blocking in getHPPOSLLH while the GPS
produces a fresh navigation solution at the expense of returning a slighly old solution.

This can be used over serial or over I2C, this example shows the I2C use. With serial the GPS
simply outputs the UBX_NAV_HPPOSLLH packet. With I2C it queues it into its internal I2C buffer (4KB in
size?) where it can be retrieved in the next I2C poll.

Feel like supporting open source hardware?
Buy a board from SparkFun!
ZED-F9P RTK2: https://www.sparkfun.com/products/15136
NEO-M8P RTK: https://www.sparkfun.com/products/15005

Hardware Connections:
Plug a Qwiic cable into the GPS and a BlackBoard
If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
Open the serial monitor at 115200 baud to see the output
*/

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

#include <SparkFun_Ublox_Arduino_Library.h> //http://librarymanager/All#SparkFun_Ublox_GPS
SFE_UBLOX_GPS myGPS;

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

Wire.begin();

//myGPS.enableDebugging(); // Uncomment this line to enable lots of helpful debug messages

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

// Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate
//myGPS.factoryDefault(); delay(5000);

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

myGPS.setNavigationFrequency(1); //Produce one solution per second


// The acid test: all four of these combinations should work seamlessly :-)

//myGPS.setAutoPVT(false); // Library will poll each reading
//myGPS.setAutoHPPOSLLH(false); // Library will poll each reading

//myGPS.setAutoPVT(true); // Tell the GPS to "send" each solution automatically
//myGPS.setAutoHPPOSLLH(false); // Library will poll each reading

//myGPS.setAutoPVT(false); // Library will poll each reading
//myGPS.setAutoHPPOSLLH(true); // Tell the GPS to "send" each hi res solution automatically

myGPS.setAutoPVT(true); // Tell the GPS to "send" each solution automatically
myGPS.setAutoHPPOSLLH(true); // Tell the GPS to "send" each hi res solution automatically
}

void loop()
{
// Calling getHPPOSLLH returns true if there actually is a fresh navigation solution available.
// Calling getPVT returns true if there actually is a fresh navigation solution available.
if ((myGPS.getHPPOSLLH()) || (myGPS.getPVT()))
{
Serial.println();

long highResLatitude = myGPS.getHighResLatitude();
Serial.print(F("Hi Res Lat: "));
Serial.print(highResLatitude);

int highResLatitudeHp = myGPS.getHighResLatitudeHp();
Serial.print(F(" "));
Serial.print(highResLatitudeHp);

long highResLongitude = myGPS.getHighResLongitude();
Serial.print(F(" Hi Res Long: "));
Serial.print(highResLongitude);

int highResLongitudeHp = myGPS.getHighResLongitudeHp();
Serial.print(F(" "));
Serial.print(highResLongitudeHp);

unsigned long horizAccuracy = myGPS.getHorizontalAccuracy();
Serial.print(F(" Horiz accuracy: "));
Serial.print(horizAccuracy);

long latitude = myGPS.getLatitude();
Serial.print(F(" Lat: "));
Serial.print(latitude);

long longitude = myGPS.getLongitude();
Serial.print(F(" Long: "));
Serial.println(longitude);
}
else
{
Serial.print(".");
delay(50);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
Set the static position of the receiver.
By: SparkFun Electronics / Nathan Seidle
Date: September 26th, 2020
License: MIT. See license file for more information but you can
basically do whatever you want with this code.

This example shows how to set the static position of a receiver
using an Earth-Centered, Earth-Fixed (ECEF) location. This is the
output from a long (24 hour+) survey-in. Setting the static position
immediately causes the receiver to begin outputting RTCM data (if
enabled), perfect for setting up your own RTCM NTRIP caster or CORS.

Feel like supporting open source hardware?
Buy a board from SparkFun!
ZED-F9P RTK2: https://www.sparkfun.com/products/15136
NEO-M8P RTK: https://www.sparkfun.com/products/15005

Hardware Connections:
Plug a Qwiic cable into the GPS and a BlackBoard
If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
Open the serial monitor at 115200 baud to see the output
*/

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

#include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_Ublox_GPS
SFE_UBLOX_GPS myGPS;

void setup()
{
Serial.begin(115200); // You may need to increase this for high navigation rates!
while (!Serial)
; //Wait for user to open terminal
Serial.println(F("SparkFun u-blox Example"));

Wire.begin();

//myGPS.enableDebugging(); // Uncomment this line to enable debug messages

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

myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)

//-1280208.308,-4716803.847,4086665.811 is SparkFun HQ so...

//Units are cm so 1234 = 12.34m
//myGPS.setStaticPosition(-128020831, -471680385, 408666581);

//Units are cm with a high precision extension so -1234.5678 should be called: (-123456, -78)
myGPS.setStaticPosition(-128020830, -80, -471680384, -70, 408666581, 10); //With high precision 0.1mm parts

//We can also set via lat/long
//40.09029751,-105.18507900,1560.238
//myGPS.setStaticPosition(400902975, -1051850790, 156024, true); //True at end enables lat/long input
//myGPS.setStaticPosition(400902975, 10, -1051850790, 0, 156023, 80, true);

//Now let's use getVals to read back the data
//long ecefX = myGPS.getVal32(0x40030003);
//Serial.print("ecefX: ");
//Serial.println(ecefX);

Serial.println(F("Done!"));
}

void loop()
{
}
22 changes: 12 additions & 10 deletions examples/ZED-F9P/Example6_GetVal/Example6_GetVal.ino
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
Send UBX binary commands to enable RTCM sentences on Ublox ZED-F9P module
Get a device's I2C address using advanced getVal method
By: Nathan Seidle
SparkFun Electronics
Date: January 9th, 2019
License: MIT. See license file for more information but you can
basically do whatever you want with this code.

Ublox changed how to configure their modules in 2019. As of version 23 of the UBX protocol the
u-blox changed how to configure their modules in 2019. As of version 23 of the UBX protocol the
UBX-CFG commands are deprecated; they still work, they just recommend using VALSET, VALGET, and VALDEL
commands instead. This example shows how to use this new command structure.

Expand All @@ -32,27 +32,29 @@ long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to Ublox m
void setup()
{
Serial.begin(115200);
while (!Serial); //Wait for user to open terminal
Serial.println("Ublox getVal example");
while (!Serial)
; //Wait for user to open terminal
Serial.println("u-blox getVal example");

Wire.begin();
Wire.setClock(400000); //Increase I2C clock speed to 400kHz

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

myGPS.enableDebugging(); //Enable debug messages over Serial (default)
//myGPS.enableDebugging(SerialUSB); //Enable debug messages over Serial USB

uint8_t currentI2Caddress = myGPS.getVal8(0x20510001);
uint8_t currentI2Caddress = myGPS.getVal8(UBLOX_CFG_I2C_ADDRESS);
Serial.print("Current I2C address (should be 0x42): 0x");
Serial.println(currentI2Caddress >> 1, HEX); //Ublox module returns a shifted 8-bit address. Make it 7-bit unshifted.

while(1);

while (1)
;
}

void loop()
Expand Down Expand Up @@ -83,4 +85,4 @@ void loop()

Serial.println();
}
}
}
31 changes: 16 additions & 15 deletions examples/ZED-F9P/Example7_SetVal/Example7_SetVal.ino
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
Send UBX binary commands to enable RTCM sentences on Ublox ZED-F9P module
Send UBX binary commands to enable RTCM sentences on u-blox ZED-F9P module
By: Nathan Seidle
SparkFun Electronics
Date: January 9th, 2019
License: MIT. See license file for more information but you can
basically do whatever you want with this code.

Ublox changed how to configure their modules in 2019. As of version 23 of the UBX protocol the
u-blox changed how to configure their modules in 2019. As of version 23 of the UBX protocol the
UBX-CFG commands are deprecated; they still work, they just recommend using VALSET, VALGET, and VALDEL
commands instead. This example shows how to use this new command structure.

Expand All @@ -27,49 +27,50 @@
#include "SparkFun_Ublox_Arduino_Library.h" //http://librarymanager/All#SparkFun_Ublox_GPS
SFE_UBLOX_GPS myGPS;

long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to Ublox module.
long lastTime = 0; //Simple local timer. Limits amount if I2C traffic to u-blox module.

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

Wire.begin();
Wire.setClock(400000); //Increase I2C clock speed to 400kHz

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

myGPS.enableDebugging(); //Enable debug messages over Serial (default)
//myGPS.enableDebugging(SerialUSB); //Enable debug messages over Serial USB

bool setValueSuccess;

//These key values are hard coded. You can obtain them from the ZED-F9P interface description doc
//These key values are hard coded and defined in u-blox_config_keys.h.
//You can obtain them from the ZED-F9P interface description doc
//or from u-center's Messages->CFG->VALSET window. Keys must be 32-bit.
//setValueSuccess = myGPS.setVal(0x10930006, 0); //Enable high precision NMEA
setValueSuccess = myGPS.setVal(0x30210001, 100); //Set measurement rate to 100ms (10Hz update rate)
//setValueSuccess = myGPS.setVal(0x30210001, 1000); //Set measurement rate to 1000ms (1Hz update rate)
//setValueSuccess = myGPS.setVal(UBLOX_CFG_NMEA_HIGHPREC, 0); //Enable high precision NMEA
setValueSuccess = myGPS.setVal(UBLOX_CFG_RATE_MEAS, 100); //Set measurement rate to 100ms (10Hz update rate)
//setValueSuccess = myGPS.setVal(UBLOX_CFG_RATE_MEAS, 1000); //Set measurement rate to 1000ms (1Hz update rate)

//Below is the original way we enabled the RTCM message on the I2C port. After that, we show how to do the same
//but with setVal().
//Original: myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second
//setValueSuccess = myGPS.setVal(0x209102bd, 1); //Set output rate of msg 1005 over the I2C port to once per second

if(setValueSuccess == true)
if (setValueSuccess == true)
{
Serial.println("Value was successfully set");
}
else
Serial.println("Value set failed");

}

void loop()
{

}
Loading