Skip to content

Commit

Permalink
Merge pull request #47 from sparkfun/release_candidate
Browse files Browse the repository at this point in the history
v3.1.1
  • Loading branch information
PaulZC authored Jan 3, 2024
2 parents 746ad2b + 3ab265c commit b7bb3db
Show file tree
Hide file tree
Showing 16 changed files with 397 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compile-sketch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Branch name
run: echo running on branch ${GITHUB_REF##*/}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
Serial.print(F(" (2D)"));
else if (fixType == 3)
Serial.print(F(" (3D)"));
else if (fixType == 3)
else if (fixType == 4)
Serial.print(F(" (GNSS + Dead Reckoning)"));
else if (fixType == 5)
Serial.print(F(" (Time Only)"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
Serial.print(F(" (2D)"));
else if (fixType == 3)
Serial.print(F(" (3D)"));
else if (fixType == 3)
else if (fixType == 4)
Serial.print(F(" (GNSS + Dead Reckoning)"));
else if (fixType == 5)
Serial.print(F(" (Time Only)"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
Serial.print(F(" (2D)"));
else if (fixType == 3)
Serial.print(F(" (3D)"));
else if (fixType == 3)
else if (fixType == 4)
Serial.print(F(" (GNSS + Dead Reckoning)"));
else if (fixType == 5)
Serial.print(F(" (Time Only)"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
Serial.print(F(" (2D)"));
else if (fixType == 3)
Serial.print(F(" (3D)"));
else if (fixType == 3)
else if (fixType == 4)
Serial.print(F(" (GNSS + Dead Reckoning)"));
else if (fixType == 5)
Serial.print(F(" (Time Only)"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
Serial.print(F(" (2D)"));
else if (fixType == 3)
Serial.print(F(" (3D)"));
else if (fixType == 3)
else if (fixType == 4)
Serial.print(F(" (GNSS + Dead Reckoning)"));
else if (fixType == 5)
Serial.print(F(" (Time Only)"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
Serial.print(F(" (2D)"));
else if (fixType == 3)
Serial.print(F(" (3D)"));
else if (fixType == 3)
else if (fixType == 4)
Serial.print(F(" (GNSS + Dead Reckoning)"));
else if (fixType == 5)
Serial.print(F(" (Time Only)"));
Expand Down
79 changes: 61 additions & 18 deletions examples/NEO-F10N/Example1_RAWX/Example1_RAWX.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Configuring the NEO-F10N GNSS to send RXM RAWX reports over I2C and display them using a callback
Configuring the NEO-F10N GNSS to send RXM RAWX reports over Serial and display them using a callback
By: Paul Clark
SparkFun Electronics
Date: November 24th, 2023
Expand All @@ -8,20 +8,29 @@
This example shows how to configure the u-blox NEO-F10N GNSS to send RXM RAWX reports automatically
and access the data via a callback. It also demonstrates how to mark the L5 signals as healthy.
Note: the NEO-F10N only supports UART1. It does not support I2C, SPI or built-in USB.
To run this example on the SparkFun NEO-F10N breakout, you need to open the USB-TX and USB-RX jumpers
to isolate the on-board CH340 USB interface chip. See Hardware Connections below.
Note: the engineering sample of the NEO-F10N-00B supports RXM-RAWX. Production firmware may not.
Feel like supporting open source hardware?
Buy a board from SparkFun!
NEO-F10N: https://www.sparkfun.com/products/24114
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 USB-TX and USB-RX jumpers to isolate the on-board CH340 USB interface chip.
Solder header pins (9-way) to the board so you can access the UART1 TX and RX connections.
Use jumper wires to connect:
* TX to Serial1 RX on your Arduino board.
* RX to Serial1 TX on your Arduino board.
* GND to GND
* 5V to 5V (or 3V3 to 3V3)
Open the serial monitor at 115200 baud to see the output
*/

#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;
SFE_UBLOX_GNSS_SERIAL myGNSS;

// Callback: newRAWX will be called when new RXM RAWX data arrives
// See u-blox_structs.h for the full definition of UBX_RXMRAWX_data_t
Expand Down Expand Up @@ -209,9 +218,9 @@ void newRAWX(UBX_RXM_RAWX_data_t *ubxDataStruct)
else if (ubxDataStruct->blocks[block].svId < 100) sprintf(&SV[14], "%d ", ubxDataStruct->blocks[block].svId); // Align the svId
else sprintf(&SV[14], "%d ", ubxDataStruct->blocks[block].svId); // Align the svId

if (ubxDataStruct->blocks[block].cno < 10) sprintf(&SV[18], " %d ", ubxDataStruct->blocks[block].cno); // Align the svId
else if (ubxDataStruct->blocks[block].cno < 100) sprintf(&SV[18], " %d ", ubxDataStruct->blocks[block].cno); // Align the svId
else sprintf(&SV[18], "%d ", ubxDataStruct->blocks[block].cno); // Align the svId
if (ubxDataStruct->blocks[block].cno < 10) sprintf(&SV[18], " %d ", ubxDataStruct->blocks[block].cno); // Align the cno
else if (ubxDataStruct->blocks[block].cno < 100) sprintf(&SV[18], " %d ", ubxDataStruct->blocks[block].cno); // Align the cno
else sprintf(&SV[18], "%d ", ubxDataStruct->blocks[block].cno); // Align the cno

// Print cno as a bar chart
uint8_t cno;
Expand All @@ -231,25 +240,50 @@ void setup()
while (!Serial); //Wait for user to open terminal
Serial.println("SparkFun u-blox Example");

Wire.begin();
Serial1.begin(38400); // The NEO-F10N defaults to 38400 baud

//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
while (myGNSS.begin(Serial1) == false) //Connect to the u-blox module using Serial1 (UART)
{
Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing."));
while (1);
Serial.println(F("u-blox GNSS not detected. Please check wiring. Retrying..."));
delay(1000);
}

myGNSS.setGPSL5HealthOverride(true); // Mark L5 signals as healthy - store in RAM and BBR
if (myGNSS.getModuleInfo())
{
Serial.print(F("FWVER: "));
Serial.print(myGNSS.getFirmwareVersionHigh()); // Returns uint8_t
Serial.print(F("."));
Serial.println(myGNSS.getFirmwareVersionLow()); // Returns uint8_t

Serial.print(F("Firmware: "));
Serial.println(myGNSS.getFirmwareType()); // Returns HPG, SPG, SPGL1L5 etc. as (const char *)

myGNSS.setLNAMode(SFE_UBLOX_LNA_MODE_NORMAL); // Set the LNA gain to normal (full). Other options: LOWGAIN, BYPASS
Serial.print(F("PROTVER: "));
Serial.print(myGNSS.getProtocolVersionHigh()); // Returns uint8_t
Serial.print(F("."));
Serial.println(myGNSS.getProtocolVersionLow()); // Returns uint8_t

Serial.print(F("MOD: "));
Serial.println(myGNSS.getModuleName()); // Returns ZED-F9P, MAX-M10S etc. as (const char *)
}
else
Serial.println(F("Error: could not read module info!"));

myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
myGNSS.setUART1Output(COM_TYPE_UBX); //Set the UART1 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.setMeasurementRate(5000); //Produce one solution every five seconds (RAWX produces a _lot_ of data!)

myGNSS.setVal8(UBLOX_CFG_SIGNAL_GPS_L5_ENA, 1); // Make sure the GPS L5 band is enabled (needed on the NEO-F9P)

myGNSS.setGPSL5HealthOverride(true); // Mark L5 signals as healthy - store in RAM and BBR

myGNSS.setLNAMode(SFE_UBLOX_LNA_MODE_NORMAL); // Set the LNA gain to normal (full). Other options: LOWGAIN, BYPASS

myGNSS.softwareResetGNSSOnly(); // Restart the GNSS to apply the L5 health override

myGNSS.setAutoRXMRAWXcallbackPtr(&newRAWX); // Enable automatic RXM RAWX messages with callback to newRAWX
}

Expand All @@ -258,6 +292,15 @@ 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);
printDot();
}

void printDot() // Print a dot every 200ms - without using delay
{
static unsigned long lastPrint = millis();
if (millis() > (lastPrint + 200))
{
Serial.print(".");
lastPrint = millis();
}
}
Loading

0 comments on commit b7bb3db

Please sign in to comment.