From 97e9198c1db782a6408c40b9c336ef48bae61be6 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 23 Sep 2022 09:33:15 +0100 Subject: [PATCH 1/7] Create Example32_NEO-D9C.ino --- .../Example32_NEO-D9C/Example32_NEO-D9C.ino | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 examples/Example32_NEO-D9C/Example32_NEO-D9C.ino diff --git a/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino b/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino new file mode 100644 index 0000000..be7da61 --- /dev/null +++ b/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino @@ -0,0 +1,117 @@ +/* + NEO-D9C QZSS-L6 receiver example + By: SparkFun Electronics / Paul Clark + Date: September 23rd, 2022 + License: MIT. See license file for more information but you can + basically do whatever you want with this code. + + This example shows how to display a summary of the NEO-D9C's UBX-RXM-QZSSL6 data. + It also enables UBX-RXM-QZSSL6 message output on both UART1 and UART2 at 38400 baud + so you can feed the corrections directly to (e.g.) a ZED-F9P. + + It is not clear if the NEO-D9C's default I2C address is 0x43 or 0x42. It may depend + on what firmware version is installed. If the NEO-D9C is not detected at 0x43, please + try 0x42. (Please note: the ZED-F9P's default address is also 0x42) + + Feel like supporting open source hardware? + Buy a board from SparkFun! + ZED-F9P RTK2: https://www.sparkfun.com/products/16481 + NEO-D9S L-Band Correction Data Receiver: https://www.sparkfun.com/products/19390 + + Hardware Connections: + Use a Qwiic cable to connect the NEO-D9C QZSS-L6 corection data receiver to your board + 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 //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myQZSS; // NEO-D9C + +#define OK(ok) (ok ? F(" -> OK") : F(" -> ERROR!")) // Convert uint8_t into OK/ERROR + +//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +// Callback: printRXMQZSSL6 will be called when new QZSS-L6 data arrives +// See u-blox_structs.h for the full definition of UBX_RXM_QZSSL6_message_data_t +// _____ You can use any name you like for the callback. Use the same name when you call setRXMPMPcallbackPtr +// / _____ This _must_ be UBX_RXM_QZSSL6_message_data_t +// | / _____ You can use any name you like for the struct +// | | / +// | | | +void printRXMQZSSL6(UBX_RXM_QZSSL6_message_data_t *qzssL6Data) +{ + Serial.println(F("New QZSS-L6 data received:")); + + Serial.print(F("Message version: ")); + Serial.println(qzssL6Data->payload[0]); + + Serial.print(F("Satellite Identifier: ")); + Serial.println(qzssL6Data->payload[1]); + + Serial.print(F("Carrier / Noise: ")); + double cno = (0.00390625 * ((double)qzssL6Data->payload[2])) + ((double)qzssL6Data->payload[3]); + Serial.println(cno, 1); + + Serial.print(F("Bit Errors Corrected: ")); + Serial.println(qzssL6Data->payload[9]); + + uint16_t chInfo = (((uint16_t)qzssL6Data->payload[11]) << 8) | qzssL6Data->payload[10]; + uint16_t errStatus = ((chInfo >> 12) & 0x3); + Serial.print(F("Receiver Channel: ")); + Serial.println((chInfo >> 8) & 0x3); + Serial.print(F("Message Name: L6")); + Serial.println(((chInfo >> 10) & 0x1) == 0 ? F("D") : F("E")); + Serial.print(F("Error Status: ")); + if (errStatus == 1) + Serial.println("error-free"); + else if (errStatus == 2) + Serial.println("erroneous"); + else + Serial.println("unknown"); + Serial.print(F("Channel Name: ")); + Serial.println(((chInfo >> 14) & 0x3) == 0 ? F("A") : F("B")); + + Serial.println(); +} + +//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +void setup() +{ + Serial.begin(115200); + Serial.println(F("NEO-D9C Example")); + + Wire.begin(); //Start I2C + + //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + // Begin and configure the NEO-D9C QZSS-L6 receiver + + //myQZSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial + + while (myQZSS.begin(Wire, 0x43) == false) //Connect to the u-blox NEO-D9C using Wire port. If 0x43 does not work, try 0x42 + { + Serial.println(F("u-blox NEO-D9C not detected at selected I2C address. Please check wiring and I2C address.")); + delay(2000); + } + Serial.println(F("u-blox NEO-D9C connected")); + + uint8_t ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_I2C, 1); // Output QZSS-L6 message on the I2C port + if (ok) ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_UART1, 1); // Output QZSS-L6 message on UART1 + if (ok) ok = myQZSS.setVal32(UBLOX_CFG_UART1_BAUDRATE, 38400); // Match UART1 baudrate with ZED + if (ok) ok = myQZSS.setVal(UBLOX_CFG_UART2OUTPROT_UBX, 1); // Enable UBX output on UART2 + if (ok) ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_UART2, 1); // Output QZSS-L6 message on UART2 + if (ok) ok = myQZSS.setVal32(UBLOX_CFG_UART2_BAUDRATE, 38400); // Match UART2 baudrate with ZED + + Serial.print(F("QZSS-L6: configuration ")); + Serial.println(OK(ok)); + + myQZSS.setRXMQZSSL6messageCallbackPtr(&printRXMQZSSL6); // Call printRXMQZSSL6 when new QZSS-L6 data arrives +} + +//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +void loop() +{ + myQZSS.checkUblox(); // Check for the arrival of new QZSS-L6 data and process it. + myQZSS.checkCallbacks(); // Check if any QZSS-L6 callbacks are waiting to be processed. +} From 1932e35fdca3134387f3d945df1722c63719b016 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 23 Sep 2022 09:58:40 +0100 Subject: [PATCH 2/7] Update Example32_NEO-D9C.ino --- examples/Example32_NEO-D9C/Example32_NEO-D9C.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino b/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino index be7da61..c6a4bbc 100644 --- a/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino +++ b/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino @@ -33,7 +33,7 @@ SFE_UBLOX_GNSS myQZSS; // NEO-D9C // Callback: printRXMQZSSL6 will be called when new QZSS-L6 data arrives // See u-blox_structs.h for the full definition of UBX_RXM_QZSSL6_message_data_t -// _____ You can use any name you like for the callback. Use the same name when you call setRXMPMPcallbackPtr +// _____ You can use any name you like for the callback. Use the same name when you call setRXMQZSSL6messageCallbackPtr // / _____ This _must_ be UBX_RXM_QZSSL6_message_data_t // | / _____ You can use any name you like for the struct // | | / From 389b6d8977c9f63feaee327ef88f0d59861df75c Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 23 Sep 2022 19:21:51 +0100 Subject: [PATCH 3/7] Add NEO-D9C + ZED-F9x Example22 --- .../Example32_NEO-D9C/Example32_NEO-D9C.ino | 29 +- ...mple22_QZSSL6_Corrections_with_NEO-D9C.ino | 312 ++++++++++++++++++ 2 files changed, 336 insertions(+), 5 deletions(-) create mode 100644 examples/ZED-F9P/Example22_QZSSL6_Corrections_with_NEO-D9C/Example22_QZSSL6_Corrections_with_NEO-D9C.ino diff --git a/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino b/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino index c6a4bbc..4d67387 100644 --- a/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino +++ b/examples/Example32_NEO-D9C/Example32_NEO-D9C.ino @@ -9,10 +9,18 @@ It also enables UBX-RXM-QZSSL6 message output on both UART1 and UART2 at 38400 baud so you can feed the corrections directly to (e.g.) a ZED-F9P. - It is not clear if the NEO-D9C's default I2C address is 0x43 or 0x42. It may depend - on what firmware version is installed. If the NEO-D9C is not detected at 0x43, please - try 0x42. (Please note: the ZED-F9P's default address is also 0x42) + We believe the NEO-D9C's I2C address should be 0x43 (like the NEO-D9S). But, reported by users in Japan, + the initial NEO-D9C's use address 0x42 - which is the same as the ZED-F9P. + If you have one of the initial NEO-D9C's, the address 0x42 should work for you. + If you have a newer or upgraded NEO-D9C, then you may need to change to 0x43. See line 100. + + Also, again reported by users in Japan, the initial NEO-D9C's do not support UBX-CFG-PRT. + The library uses UBX-CFG-PRT inside .begin (.isConnected) to check if the module is connected. + This then fails with the initial NEO-D9C's. + The work-around is to set the .begin assumeSuccess parameter to true. + With newer NEO-D9C's this work-around may not be necessary. Again see line 100. + Feel like supporting open source hardware? Buy a board from SparkFun! ZED-F9P RTK2: https://www.sparkfun.com/products/16481 @@ -88,7 +96,10 @@ void setup() //myQZSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial - while (myQZSS.begin(Wire, 0x43) == false) //Connect to the u-blox NEO-D9C using Wire port. If 0x43 does not work, try 0x42 + // For the initial NEO-D9C's: connect using address 0x42; set the assumeSuccess parameter to true + while (myQZSS.begin(Wire, 0x42, 1100, true) == false) + // For newer NEO-D9C's: use address 0x43; leave assumeSuccess set to false (default) + //while (myQZSS.begin(Wire, 0x43) == false) { Serial.println(F("u-blox NEO-D9C not detected at selected I2C address. Please check wiring and I2C address.")); delay(2000); @@ -96,13 +107,21 @@ void setup() Serial.println(F("u-blox NEO-D9C connected")); uint8_t ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_I2C, 1); // Output QZSS-L6 message on the I2C port + + Serial.print(F("QZSS-L6: I2C configuration ")); + Serial.println(OK(ok)); + if (ok) ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_UART1, 1); // Output QZSS-L6 message on UART1 if (ok) ok = myQZSS.setVal32(UBLOX_CFG_UART1_BAUDRATE, 38400); // Match UART1 baudrate with ZED + + Serial.print(F("QZSS-L6: UART1 configuration ")); + Serial.println(OK(ok)); + if (ok) ok = myQZSS.setVal(UBLOX_CFG_UART2OUTPROT_UBX, 1); // Enable UBX output on UART2 if (ok) ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_UART2, 1); // Output QZSS-L6 message on UART2 if (ok) ok = myQZSS.setVal32(UBLOX_CFG_UART2_BAUDRATE, 38400); // Match UART2 baudrate with ZED - Serial.print(F("QZSS-L6: configuration ")); + Serial.print(F("QZSS-L6: UART2 configuration ")); Serial.println(OK(ok)); myQZSS.setRXMQZSSL6messageCallbackPtr(&printRXMQZSSL6); // Call printRXMQZSSL6 when new QZSS-L6 data arrives diff --git a/examples/ZED-F9P/Example22_QZSSL6_Corrections_with_NEO-D9C/Example22_QZSSL6_Corrections_with_NEO-D9C.ino b/examples/ZED-F9P/Example22_QZSSL6_Corrections_with_NEO-D9C/Example22_QZSSL6_Corrections_with_NEO-D9C.ino new file mode 100644 index 0000000..f290022 --- /dev/null +++ b/examples/ZED-F9P/Example22_QZSSL6_Corrections_with_NEO-D9C/Example22_QZSSL6_Corrections_with_NEO-D9C.ino @@ -0,0 +1,312 @@ +/* + Use the NEO-D9C QZSS-L6 receiver to provide corrections to a ZED-F9x via UART + By: SparkFun Electronics / Paul Clark + Based on original code by: u-blox AG / Michael Ammann + Date: September 23rd, 2022 + 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 a NEO-D9C QZSS-L6 receiver and have it send coorection data to a ZED-F9x via Serial (UART). + + We believe the NEO-D9C's I2C address should be 0x43 (like the NEO-D9S). But, reported by users in Japan, + the initial NEO-D9C's use address 0x42 - which is the same as the ZED-F9P.... + + As a work-around, this example expects the ZED-F9P to be connected via UART1 Serial (Teensy Serial1) to avoid a collision + on the I2C bus. + + (Yes, OK, it is straight-forward to change the NEO-D9C's I2C address. But, with this example, you do not need to do that.) + + Also, again reported by users in Japan, the initial NEO-D9C's do not support UBX-CFG-PRT. + The library uses UBX-CFG-PRT inside .begin (.isConnected) to check if the module is connected. + This then fails with the initial NEO-D9C's. + The work-around is to set the .begin assumeSuccess parameter to true. + With newer NEO-D9C's this work-around may not be necessary. See line 272. + + Connections: e.g. for Teensy 4.0, Geosense D9CX1 NEO-D9C and SparkFun ZED-F9P: + + Teensy 5V (Vin) -> ZED-F9P 5V -> D9CX1 V5V (JP1 Pin 2) + Teensy GND -> ZED-F9P GND -> D9CX1 GND (JP1 Pin 1) + Teensy SDA1 (17) -> D9CX1 SDA (JP1 Pin 5) + Teensy SCL1 (16) -> D9CX1 SCL (JP1 Pin 6) + Teensy Serial1 TX1 (1) -> ZED-F9P UART1 RX1 + Teensy Serial1 RX1 (0) -> ZED-F9P UART1 TX1 + D9CX1 UART1 TX1 (JP1 Pin 3) -> ZED-F9P UART2 RX2 + D9CX1 UART1 RX1 (JP1 Pin 4) -> ZED-F9P UART2 TX2 + + The Teensy communicates with the NEO-D9C (D9CX1) via I2C on address 0x42 + The Teensy communicates with the ZED-F9P via UART (Serial1 on Teensy, UART1 on ZED) to avoid the I2C address collision + The NEO-D9C corrections (UBX-RXM-QZSSL6) are sent from NEO UART1 to ZED UART2 + + Feel like supporting open source hardware? + Buy a board from SparkFun! + ZED-F9P RTK2: https://www.sparkfun.com/products/16481 + NEO-D9S L-Band Correction Data Receiver: https://www.sparkfun.com/products/19390 + + Hardware Connections: + Use Qwiic cables to connect the NEO-D9S and ZED-F9x GNSS to your board + 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 //http://librarymanager/All#SparkFun_u-blox_GNSS +SFE_UBLOX_GNSS myGNSS; // ZED-F9x +SFE_UBLOX_GNSS myQZSS; // NEO-D9C + +#define OK(ok) (ok ? F(" -> OK") : F(" -> ERROR!")) // Convert uint8_t into OK/ERROR + +//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +// Callback: printRXMQZSSL6 will be called when new QZSS-L6 data arrives +// See u-blox_structs.h for the full definition of UBX_RXM_QZSSL6_message_data_t +// _____ You can use any name you like for the callback. Use the same name when you call setRXMQZSSL6messageCallbackPtr +// / _____ This _must_ be UBX_RXM_QZSSL6_message_data_t +// | / _____ You can use any name you like for the struct +// | | / +// | | | +void printRXMQZSSL6(UBX_RXM_QZSSL6_message_data_t *qzssL6Data) +{ + Serial.println(F("New QZSS-L6 data received:")); + + Serial.print(F("Message version: ")); + Serial.println(qzssL6Data->payload[0]); + + Serial.print(F("Satellite Identifier: ")); + Serial.println(qzssL6Data->payload[1]); + + Serial.print(F("Carrier / Noise: ")); + double cno = (0.00390625 * ((double)qzssL6Data->payload[2])) + ((double)qzssL6Data->payload[3]); + Serial.println(cno, 1); + + Serial.print(F("Bit Errors Corrected: ")); + Serial.println(qzssL6Data->payload[9]); + + uint16_t chInfo = (((uint16_t)qzssL6Data->payload[11]) << 8) | qzssL6Data->payload[10]; + uint16_t errStatus = ((chInfo >> 12) & 0x3); + Serial.print(F("Receiver Channel: ")); + Serial.println((chInfo >> 8) & 0x3); + Serial.print(F("Message Name: L6")); + Serial.println(((chInfo >> 10) & 0x1) == 0 ? F("D") : F("E")); + Serial.print(F("Error Status: ")); + if (errStatus == 1) + Serial.println("error-free"); + else if (errStatus == 2) + Serial.println("erroneous"); + else + Serial.println("unknown"); + Serial.print(F("Channel Name: ")); + Serial.println(((chInfo >> 14) & 0x3) == 0 ? F("A") : F("B")); + + Serial.println(); +} + +//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +// Callback: printPVTdata will be called when new NAV PVT data arrives +// See u-blox_structs.h for the full definition of UBX_NAV_PVT_data_t +// _____ You can use any name you like for the callback. Use the same name when you call setAutoPVTcallbackPtr +// / _____ This _must_ be UBX_NAV_PVT_data_t +// | / _____ You can use any name you like for the struct +// | | / +// | | | +void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct) +{ + double latitude = ubxDataStruct->lat; // Print the latitude + Serial.print(F("Lat: ")); + Serial.print(latitude / 10000000.0, 7); + + double longitude = ubxDataStruct->lon; // Print the longitude + Serial.print(F(" Long: ")); + Serial.print(longitude / 10000000.0, 7); + + double altitude = ubxDataStruct->hMSL; // Print the height above mean sea level + Serial.print(F(" Height: ")); + Serial.print(altitude / 1000.0, 3); + + uint8_t fixType = ubxDataStruct->fixType; // Print the fix type + Serial.print(F(" Fix: ")); + Serial.print(fixType); + if (fixType == 0) + Serial.print(F(" (None)")); + else if (fixType == 1) + Serial.print(F(" (Dead Reckoning)")); + else if (fixType == 2) + Serial.print(F(" (2D)")); + else if (fixType == 3) + Serial.print(F(" (3D)")); + else if (fixType == 3) + Serial.print(F(" (GNSS + Dead Reckoning)")); + else if (fixType == 5) + Serial.print(F(" (Time Only)")); + else + Serial.print(F(" (UNKNOWN)")); + + uint8_t carrSoln = ubxDataStruct->flags.bits.carrSoln; // Print the carrier solution + Serial.print(F(" Carrier Solution: ")); + Serial.print(carrSoln); + if (carrSoln == 0) + Serial.print(F(" (None)")); + else if (carrSoln == 1) + Serial.print(F(" (Floating)")); + else if (carrSoln == 2) + Serial.print(F(" (Fixed)")); + else + Serial.print(F(" (UNKNOWN)")); + + uint32_t hAcc = ubxDataStruct->hAcc; // Print the horizontal accuracy estimate + Serial.print(F(" Horizontal Accuracy Estimate: ")); + Serial.print(hAcc); + Serial.print(F(" (mm)")); + + Serial.println(); +} + +//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +// Callback: printRXMCOR will be called when new RXM COR data arrives +// See u-blox_structs.h for the full definition of UBX_RXM_COR_data_t +// _____ You can use any name you like for the callback. Use the same name when you call setRXMCORcallbackPtr +// / _____ This _must_ be UBX_RXM_COR_data_t +// | / _____ You can use any name you like for the struct +// | | / +// | | | +void printRXMCOR(UBX_RXM_COR_data_t *ubxDataStruct) +{ + Serial.print(F("UBX-RXM-COR: ebno: ")); + Serial.print(ubxDataStruct->ebno); + + Serial.print(F(" protocol: ")); + if (ubxDataStruct->statusInfo.bits.protocol == 1) + Serial.print(F("RTCM3")); + else if (ubxDataStruct->statusInfo.bits.protocol == 2) + Serial.print(F("SPARTN")); + else if (ubxDataStruct->statusInfo.bits.protocol == 29) + Serial.print(F("PMP (SPARTN)")); + else if (ubxDataStruct->statusInfo.bits.protocol == 30) + Serial.print(F("QZSSL6")); + else + Serial.print(F("Unknown")); + + Serial.print(F(" errStatus: ")); + if (ubxDataStruct->statusInfo.bits.errStatus == 1) + Serial.print(F("Error-free")); + else if (ubxDataStruct->statusInfo.bits.errStatus == 2) + Serial.print(F("Erroneous")); + else + Serial.print(F("Unknown")); + + Serial.print(F(" msgUsed: ")); + if (ubxDataStruct->statusInfo.bits.msgUsed == 1) + Serial.print(F("Not used")); + else if (ubxDataStruct->statusInfo.bits.msgUsed == 2) + Serial.print(F("Used")); + else + Serial.print(F("Unknown")); + + Serial.print(F(" msgEncrypted: ")); + if (ubxDataStruct->statusInfo.bits.msgEncrypted == 1) + Serial.print(F("Not encrypted")); + else if (ubxDataStruct->statusInfo.bits.msgEncrypted == 2) + Serial.print(F("Encrypted")); + else + Serial.print(F("Unknown")); + + Serial.print(F(" msgDecrypted: ")); + if (ubxDataStruct->statusInfo.bits.msgDecrypted == 1) + Serial.print(F("Not decrypted")); + else if (ubxDataStruct->statusInfo.bits.msgDecrypted == 2) + Serial.print(F("Successfully decrypted")); + else + Serial.print(F("Unknown")); + + Serial.println(); +} + +//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +void setup() +{ + Serial.begin(115200); + Serial.println(F("NEO-D9C Corrections")); + + //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + // Begin and configure the ZED-F9x + + Serial1.begin(38400); // The ZED-F9P is connected via Serial1 to UART1 + + //myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial + + while (myGNSS.begin(Serial1) == false) //Connect to the u-blox module using Serial1 and UART1 + { + Serial.println(F("u-blox GNSS module not detected. Please check wiring.")); + delay(2000); + } + Serial.println(F("u-blox GNSS module connected")); + + uint8_t ok = myGNSS.setUART1Output(COM_TYPE_UBX); //Turn off NMEA noise + + if (ok) ok = myGNSS.setPortInput(COM_PORT_UART2, COM_TYPE_UBX | COM_TYPE_RTCM3 | COM_TYPE_SPARTN); //Be sure SPARTN input is enabled on UART2 + + if (ok) ok = myGNSS.setDGNSSConfiguration(SFE_UBLOX_DGNSS_MODE_FIXED); // Set the differential mode - ambiguities are fixed whenever possible + + if (ok) ok = myGNSS.setNavigationFrequency(1); //Set output in Hz. + + if (ok) ok = myGNSS.setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_COR_UART1, 1); // Enable UBX-RXM-COR messages on UART2 + + //if (ok) ok = myGNSS.saveConfiguration(VAL_CFG_SUBSEC_IOPORT | VAL_CFG_SUBSEC_MSGCONF); //Optional: Save the ioPort and message settings to NVM + + Serial.print(F("GNSS: configuration ")); + Serial.println(OK(ok)); + + myGNSS.setAutoPVTcallbackPtr(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata so we can watch the carrier solution go to fixed + + myGNSS.setRXMCORcallbackPtr(&printRXMCOR); // Print the contents of UBX-RXM-COR messages so we can check if the QZSS-L6 data is being decrypted successfully + + //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + // Begin and configure the NEO-D9C QZSS-L6 receiver + + Wire.begin(); //Start I2C + + //myQZSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial + + // For the initial NEO-D9C's: connect using address 0x42; set the assumeSuccess parameter to true + while (myQZSS.begin(Wire, 0x42, 1100, true) == false) + // For newer NEO-D9C's: use address 0x43; leave assumeSuccess set to false (default) + //while (myQZSS.begin(Wire, 0x43) == false) + { + Serial.println(F("u-blox NEO-D9C not detected at selected I2C address. Please check wiring and I2C address.")); + delay(2000); + } + Serial.println(F("u-blox NEO-D9C connected")); + + ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_I2C, 1); // Output QZSS-L6 message on the I2C port + + Serial.print(F("QZSS-L6: I2C configuration ")); + Serial.println(OK(ok)); + + if (ok) ok = myQZSS.setVal(UBLOX_CFG_UART1OUTPROT_UBX, 1); // Enable UBX output on UART1 + if (ok) ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_UART1, 1); // Output QZSS-L6 message on UART1 + if (ok) ok = myQZSS.setVal32(UBLOX_CFG_UART1_BAUDRATE, 38400); // Match UART1 baudrate with ZED + + Serial.print(F("QZSS-L6: UART1 configuration ")); + Serial.println(OK(ok)); + + if (ok) ok = myQZSS.setVal(UBLOX_CFG_UART2OUTPROT_UBX, 1); // Enable UBX output on UART2 + if (ok) ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_UART2, 1); // Output QZSS-L6 message on UART2 + if (ok) ok = myQZSS.setVal32(UBLOX_CFG_UART2_BAUDRATE, 38400); // Match UART2 baudrate with ZED + + Serial.print(F("QZSS-L6: UART2 configuration ")); + Serial.println(OK(ok)); + + myQZSS.setRXMQZSSL6messageCallbackPtr(&printRXMQZSSL6); // Call printRXMQZSSL6 when new QZSS-L6 data arrives +} + +//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +void loop() +{ + myGNSS.checkUblox(); // Check for the arrival of new GNSS data and process it. + myGNSS.checkCallbacks(); // Check if any GNSS callbacks are waiting to be processed. + + myQZSS.checkUblox(); // Check for the arrival of new QZSS-L6 data and process it. + myQZSS.checkCallbacks(); // Check if any LBand callbacks are waiting to be processed. +} From 4fc374a5c9664eb7a922910cf63944c0064da1b8 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 23 Sep 2022 19:27:55 +0100 Subject: [PATCH 4/7] Update Example22_QZSSL6_Corrections_with_NEO-D9C.ino --- .../Example22_QZSSL6_Corrections_with_NEO-D9C.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ZED-F9P/Example22_QZSSL6_Corrections_with_NEO-D9C/Example22_QZSSL6_Corrections_with_NEO-D9C.ino b/examples/ZED-F9P/Example22_QZSSL6_Corrections_with_NEO-D9C/Example22_QZSSL6_Corrections_with_NEO-D9C.ino index f290022..0a8fd26 100644 --- a/examples/ZED-F9P/Example22_QZSSL6_Corrections_with_NEO-D9C/Example22_QZSSL6_Corrections_with_NEO-D9C.ino +++ b/examples/ZED-F9P/Example22_QZSSL6_Corrections_with_NEO-D9C/Example22_QZSSL6_Corrections_with_NEO-D9C.ino @@ -250,7 +250,7 @@ void setup() if (ok) ok = myGNSS.setNavigationFrequency(1); //Set output in Hz. - if (ok) ok = myGNSS.setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_COR_UART1, 1); // Enable UBX-RXM-COR messages on UART2 + if (ok) ok = myGNSS.setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_COR_UART1, 1); // Enable UBX-RXM-COR messages on UART1 //if (ok) ok = myGNSS.saveConfiguration(VAL_CFG_SUBSEC_IOPORT | VAL_CFG_SUBSEC_MSGCONF); //Optional: Save the ioPort and message settings to NVM From d17a5f9f0363c3d9702e6bd81ddb3d2472d74a0a Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 17 Oct 2022 09:34:16 +0100 Subject: [PATCH 5/7] Ensure COM_TYPE_RTCM3 is enabled in RTCM examples --- .../NEO-M8P-2/Example1_EnableRTCM/Example1_EnableRTCM.ino | 2 +- .../Example2_StartRTCMBase/Example2_StartRTCMBase.ino | 2 +- .../NEO-M8P-2/Example3_BaseWithLCD/Example3_BaseWithLCD.ino | 3 +++ .../Example16_NTRIPClient_WithGGA.ino | 5 ++--- .../ZED-F9P/Example4_BaseWithLCD/Example4_BaseWithLCD.ino | 3 +-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/NEO-M8P-2/Example1_EnableRTCM/Example1_EnableRTCM.ino b/examples/NEO-M8P-2/Example1_EnableRTCM/Example1_EnableRTCM.ino index 83bb8cc..2e48386 100644 --- a/examples/NEO-M8P-2/Example1_EnableRTCM/Example1_EnableRTCM.ino +++ b/examples/NEO-M8P-2/Example1_EnableRTCM/Example1_EnableRTCM.ino @@ -46,7 +46,7 @@ void setup() Serial.println(F("Press any key to send commands to enable RTCM 3.x")); while(Serial.available() == 0) ; //Wait for user to press a key - myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); // Ensure RTCM3 is enabled myGNSS.saveConfiguration(); //Save the current settings to flash and BBR bool response = true; diff --git a/examples/NEO-M8P-2/Example2_StartRTCMBase/Example2_StartRTCMBase.ino b/examples/NEO-M8P-2/Example2_StartRTCMBase/Example2_StartRTCMBase.ino index f375ade..a3ea14d 100644 --- a/examples/NEO-M8P-2/Example2_StartRTCMBase/Example2_StartRTCMBase.ino +++ b/examples/NEO-M8P-2/Example2_StartRTCMBase/Example2_StartRTCMBase.ino @@ -46,7 +46,7 @@ void setup() while (1); } - myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); // Ensure RTCM3 is enabled myGNSS.saveConfiguration(); //Save the current settings to flash and BBR while (Serial.available()) Serial.read(); //Clear any latent chars in serial buffer diff --git a/examples/NEO-M8P-2/Example3_BaseWithLCD/Example3_BaseWithLCD.ino b/examples/NEO-M8P-2/Example3_BaseWithLCD/Example3_BaseWithLCD.ino index e945a32..15ab70f 100644 --- a/examples/NEO-M8P-2/Example3_BaseWithLCD/Example3_BaseWithLCD.ino +++ b/examples/NEO-M8P-2/Example3_BaseWithLCD/Example3_BaseWithLCD.ino @@ -67,6 +67,9 @@ void setup() lcd.setCursor(0, 1); lcd.print("GNSS Detected"); + myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); // Ensure RTCM3 is enabled + myGNSS.saveConfiguration(); //Save the current settings to flash and BBR + //Check if Survey is in Progress before initiating one // From v2.0, the data from getSurveyStatus (UBX-NAV-SVIN) is returned in UBX_NAV_SVIN_t packetUBXNAVSVIN // Please see u-blox_structs.h for the full definition of UBX_NAV_SVIN_t diff --git a/examples/ZED-F9P/Example16_NTRIPClient_WithGGA/Example16_NTRIPClient_WithGGA.ino b/examples/ZED-F9P/Example16_NTRIPClient_WithGGA/Example16_NTRIPClient_WithGGA.ino index b2506eb..f75ade9 100644 --- a/examples/ZED-F9P/Example16_NTRIPClient_WithGGA/Example16_NTRIPClient_WithGGA.ino +++ b/examples/ZED-F9P/Example16_NTRIPClient_WithGGA/Example16_NTRIPClient_WithGGA.ino @@ -78,9 +78,8 @@ void setup() while (myGNSS.begin() == false) //Connect to the Ublox module using Wire port { - Serial.println(F("u-blox GPS not detected at default I2C address. Please check wiring. Freezing.")); + Serial.println(F("u-blox GPS not detected at default I2C address. Please check wiring.")); delay(2000); - //while (1); } Serial.println(F("u-blox module connected")); @@ -400,4 +399,4 @@ void SFE_UBLOX_GNSS::processNMEA(char incoming) ggaSentenceStarted = false; } } -} \ No newline at end of file +} diff --git a/examples/ZED-F9P/Example4_BaseWithLCD/Example4_BaseWithLCD.ino b/examples/ZED-F9P/Example4_BaseWithLCD/Example4_BaseWithLCD.ino index 14a78a1..c8d62ef 100644 --- a/examples/ZED-F9P/Example4_BaseWithLCD/Example4_BaseWithLCD.ino +++ b/examples/ZED-F9P/Example4_BaseWithLCD/Example4_BaseWithLCD.ino @@ -69,8 +69,7 @@ void setup() lcd.setCursor(0, 1); lcd.print("GNSS Detected"); - //myGNSS.setI2COutput(COM_TYPE_RTCM3); //Set the I2C port to output RTCM3 sentences (turn off NMEA noise) - myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX sentences (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); // Ensure RTCM3 is enabled myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR bool response = true; From 848adcb68d190b3dc222d8bf5ca9afaa97b1a4dd Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 17 Oct 2022 09:36:23 +0100 Subject: [PATCH 6/7] Update Example3_StartRTCMBase.ino --- .../ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino b/examples/ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino index 8dc4bc4..405e025 100644 --- a/examples/ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino +++ b/examples/ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino @@ -54,7 +54,7 @@ void setup() // Uncomment the next line if you want to reset your module back to the default settings with 1Hz navigation rate //myGNSS.factoryDefault(); delay(5000); - myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise) + myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); // Ensure RTCM3 is enabled myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save the communications port settings to flash and BBR while (Serial.available()) Serial.read(); //Clear any latent chars in serial buffer From 634152facad8f58d96ffe0aec2108417d54fba8d Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 17 Oct 2022 09:44:22 +0100 Subject: [PATCH 7/7] v2.2.17 --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index efd70b1..bad7a40 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun u-blox GNSS Arduino Library -version=2.2.16 +version=2.2.17 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=Library for I2C, Serial and SPI Communication with u-blox GNSS modules