Skip to content

Commit 3a1d357

Browse files
authored
Merge pull request #161 from sparkfun/release_candidate
v2.2.17
2 parents 6f98c6c + 634152f commit 3a1d357

File tree

9 files changed

+458
-9
lines changed

9 files changed

+458
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/*
2+
NEO-D9C QZSS-L6 receiver example
3+
By: SparkFun Electronics / Paul Clark
4+
Date: September 23rd, 2022
5+
License: MIT. See license file for more information but you can
6+
basically do whatever you want with this code.
7+
8+
This example shows how to display a summary of the NEO-D9C's UBX-RXM-QZSSL6 data.
9+
It also enables UBX-RXM-QZSSL6 message output on both UART1 and UART2 at 38400 baud
10+
so you can feed the corrections directly to (e.g.) a ZED-F9P.
11+
12+
We believe the NEO-D9C's I2C address should be 0x43 (like the NEO-D9S). But, reported by users in Japan,
13+
the initial NEO-D9C's use address 0x42 - which is the same as the ZED-F9P.
14+
15+
If you have one of the initial NEO-D9C's, the address 0x42 should work for you.
16+
If you have a newer or upgraded NEO-D9C, then you may need to change to 0x43. See line 100.
17+
18+
Also, again reported by users in Japan, the initial NEO-D9C's do not support UBX-CFG-PRT.
19+
The library uses UBX-CFG-PRT inside .begin (.isConnected) to check if the module is connected.
20+
This then fails with the initial NEO-D9C's.
21+
The work-around is to set the .begin assumeSuccess parameter to true.
22+
With newer NEO-D9C's this work-around may not be necessary. Again see line 100.
23+
24+
Feel like supporting open source hardware?
25+
Buy a board from SparkFun!
26+
ZED-F9P RTK2: https://www.sparkfun.com/products/16481
27+
NEO-D9S L-Band Correction Data Receiver: https://www.sparkfun.com/products/19390
28+
29+
Hardware Connections:
30+
Use a Qwiic cable to connect the NEO-D9C QZSS-L6 corection data receiver to your board
31+
If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
32+
Open the serial monitor at 115200 baud to see the output
33+
*/
34+
35+
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS
36+
SFE_UBLOX_GNSS myQZSS; // NEO-D9C
37+
38+
#define OK(ok) (ok ? F(" -> OK") : F(" -> ERROR!")) // Convert uint8_t into OK/ERROR
39+
40+
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
41+
42+
// Callback: printRXMQZSSL6 will be called when new QZSS-L6 data arrives
43+
// See u-blox_structs.h for the full definition of UBX_RXM_QZSSL6_message_data_t
44+
// _____ You can use any name you like for the callback. Use the same name when you call setRXMQZSSL6messageCallbackPtr
45+
// / _____ This _must_ be UBX_RXM_QZSSL6_message_data_t
46+
// | / _____ You can use any name you like for the struct
47+
// | | /
48+
// | | |
49+
void printRXMQZSSL6(UBX_RXM_QZSSL6_message_data_t *qzssL6Data)
50+
{
51+
Serial.println(F("New QZSS-L6 data received:"));
52+
53+
Serial.print(F("Message version: "));
54+
Serial.println(qzssL6Data->payload[0]);
55+
56+
Serial.print(F("Satellite Identifier: "));
57+
Serial.println(qzssL6Data->payload[1]);
58+
59+
Serial.print(F("Carrier / Noise: "));
60+
double cno = (0.00390625 * ((double)qzssL6Data->payload[2])) + ((double)qzssL6Data->payload[3]);
61+
Serial.println(cno, 1);
62+
63+
Serial.print(F("Bit Errors Corrected: "));
64+
Serial.println(qzssL6Data->payload[9]);
65+
66+
uint16_t chInfo = (((uint16_t)qzssL6Data->payload[11]) << 8) | qzssL6Data->payload[10];
67+
uint16_t errStatus = ((chInfo >> 12) & 0x3);
68+
Serial.print(F("Receiver Channel: "));
69+
Serial.println((chInfo >> 8) & 0x3);
70+
Serial.print(F("Message Name: L6"));
71+
Serial.println(((chInfo >> 10) & 0x1) == 0 ? F("D") : F("E"));
72+
Serial.print(F("Error Status: "));
73+
if (errStatus == 1)
74+
Serial.println("error-free");
75+
else if (errStatus == 2)
76+
Serial.println("erroneous");
77+
else
78+
Serial.println("unknown");
79+
Serial.print(F("Channel Name: "));
80+
Serial.println(((chInfo >> 14) & 0x3) == 0 ? F("A") : F("B"));
81+
82+
Serial.println();
83+
}
84+
85+
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
86+
87+
void setup()
88+
{
89+
Serial.begin(115200);
90+
Serial.println(F("NEO-D9C Example"));
91+
92+
Wire.begin(); //Start I2C
93+
94+
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
95+
// Begin and configure the NEO-D9C QZSS-L6 receiver
96+
97+
//myQZSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial
98+
99+
// For the initial NEO-D9C's: connect using address 0x42; set the assumeSuccess parameter to true
100+
while (myQZSS.begin(Wire, 0x42, 1100, true) == false)
101+
// For newer NEO-D9C's: use address 0x43; leave assumeSuccess set to false (default)
102+
//while (myQZSS.begin(Wire, 0x43) == false)
103+
{
104+
Serial.println(F("u-blox NEO-D9C not detected at selected I2C address. Please check wiring and I2C address."));
105+
delay(2000);
106+
}
107+
Serial.println(F("u-blox NEO-D9C connected"));
108+
109+
uint8_t ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_I2C, 1); // Output QZSS-L6 message on the I2C port
110+
111+
Serial.print(F("QZSS-L6: I2C configuration "));
112+
Serial.println(OK(ok));
113+
114+
if (ok) ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_UART1, 1); // Output QZSS-L6 message on UART1
115+
if (ok) ok = myQZSS.setVal32(UBLOX_CFG_UART1_BAUDRATE, 38400); // Match UART1 baudrate with ZED
116+
117+
Serial.print(F("QZSS-L6: UART1 configuration "));
118+
Serial.println(OK(ok));
119+
120+
if (ok) ok = myQZSS.setVal(UBLOX_CFG_UART2OUTPROT_UBX, 1); // Enable UBX output on UART2
121+
if (ok) ok = myQZSS.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_QZSSL6_UART2, 1); // Output QZSS-L6 message on UART2
122+
if (ok) ok = myQZSS.setVal32(UBLOX_CFG_UART2_BAUDRATE, 38400); // Match UART2 baudrate with ZED
123+
124+
Serial.print(F("QZSS-L6: UART2 configuration "));
125+
Serial.println(OK(ok));
126+
127+
myQZSS.setRXMQZSSL6messageCallbackPtr(&printRXMQZSSL6); // Call printRXMQZSSL6 when new QZSS-L6 data arrives
128+
}
129+
130+
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
131+
132+
void loop()
133+
{
134+
myQZSS.checkUblox(); // Check for the arrival of new QZSS-L6 data and process it.
135+
myQZSS.checkCallbacks(); // Check if any QZSS-L6 callbacks are waiting to be processed.
136+
}

examples/NEO-M8P-2/Example1_EnableRTCM/Example1_EnableRTCM.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void setup()
4646
Serial.println(F("Press any key to send commands to enable RTCM 3.x"));
4747
while(Serial.available() == 0) ; //Wait for user to press a key
4848

49-
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
49+
myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); // Ensure RTCM3 is enabled
5050
myGNSS.saveConfiguration(); //Save the current settings to flash and BBR
5151

5252
bool response = true;

examples/NEO-M8P-2/Example2_StartRTCMBase/Example2_StartRTCMBase.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void setup()
4646
while (1);
4747
}
4848

49-
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
49+
myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); // Ensure RTCM3 is enabled
5050
myGNSS.saveConfiguration(); //Save the current settings to flash and BBR
5151

5252
while (Serial.available()) Serial.read(); //Clear any latent chars in serial buffer

examples/NEO-M8P-2/Example3_BaseWithLCD/Example3_BaseWithLCD.ino

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ void setup()
6767
lcd.setCursor(0, 1);
6868
lcd.print("GNSS Detected");
6969

70+
myGNSS.setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); // Ensure RTCM3 is enabled
71+
myGNSS.saveConfiguration(); //Save the current settings to flash and BBR
72+
7073
//Check if Survey is in Progress before initiating one
7174
// From v2.0, the data from getSurveyStatus (UBX-NAV-SVIN) is returned in UBX_NAV_SVIN_t packetUBXNAVSVIN
7275
// Please see u-blox_structs.h for the full definition of UBX_NAV_SVIN_t

examples/ZED-F9P/Example16_NTRIPClient_WithGGA/Example16_NTRIPClient_WithGGA.ino

+2-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ void setup()
7878

7979
while (myGNSS.begin() == false) //Connect to the Ublox module using Wire port
8080
{
81-
Serial.println(F("u-blox GPS not detected at default I2C address. Please check wiring. Freezing."));
81+
Serial.println(F("u-blox GPS not detected at default I2C address. Please check wiring."));
8282
delay(2000);
83-
//while (1);
8483
}
8584
Serial.println(F("u-blox module connected"));
8685

@@ -400,4 +399,4 @@ void SFE_UBLOX_GNSS::processNMEA(char incoming)
400399
ggaSentenceStarted = false;
401400
}
402401
}
403-
}
402+
}

0 commit comments

Comments
 (0)