10
10
11
11
This is a proof of concept to show how the UBX-RXM-PMP corrections control the accuracy.
12
12
13
+ If you are using the SparkFun Combo Board (SPX-20167), the correction data is transferred from the NEO to the ZED via UART2.
14
+ You don't need to push it over I2C. Doing so just gives the ZED twice as many correction messages.
15
+ Uncomment the "#define noPush" below to disable the I2C push.
16
+
13
17
You will need a Thingstream PointPerfect account to be able to access the SPARTN Credentials (L-Band or L-Band + IP Dynamic Keys).
14
18
Copy and paste the Current Key and Next Key into secrets.h.
15
19
16
20
Feel like supporting open source hardware?
17
21
Buy a board from SparkFun!
18
22
ZED-F9P RTK2: https://www.sparkfun.com/products/16481
19
- NEO-D9S: Coming soon!
23
+ NEO-D9S: https://www.sparkfun.com/products/19390
24
+ Combo Board: https://www.sparkfun.com/products/20167
20
25
21
26
Hardware Connections:
22
27
Use Qwiic cables to connect the NEO-D9S and ZED-F9x GNSS to your board
23
28
If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
24
29
Open the serial monitor at 115200 baud to see the output
25
30
*/
26
31
32
+ // #define noPush // Uncomment this line to disable pushing the correction data over I2C. Useful for the combo board which uses UART2 instead.
33
+
27
34
#include " secrets.h" // <- Copy and paste the Current Key and Next Key into secrets.h
28
35
29
36
#include < SparkFun_u-blox_GNSS_Arduino_Library.h> // http://librarymanager/All#SparkFun_u-blox_GNSS
@@ -41,21 +48,31 @@ const uint32_t myLBandFreq = 1556290000; // Uncomment this line to use the US SP
41
48
// See u-blox_structs.h for the full definition of UBX_RXM_PMP_message_data_t
42
49
// _____ You can use any name you like for the callback. Use the same name when you call setRXMPMPmessageCallbackPtr
43
50
// / _____ This _must_ be UBX_RXM_PMP_message_data_t
44
- // | / _____ You can use any name you like for the struct
45
- // | | /
46
- // | | |
51
+ // | / _____ You can use any name you like for the struct
52
+ // | | /
53
+ // | | |
47
54
void pushRXMPMP (UBX_RXM_PMP_message_data_t *pmpData)
48
55
{
49
56
// Extract the raw message payload length
50
57
uint16_t payloadLen = ((uint16_t )pmpData->lengthMSB << 8 ) | (uint16_t )pmpData->lengthLSB ;
51
58
Serial.print (F (" New RXM-PMP data received. Message payload length is " ));
52
59
Serial.print (payloadLen);
60
+
61
+ #ifndef noPush
62
+
53
63
Serial.println (F (" Bytes. Pushing it to the GNSS..." ));
54
64
55
65
// Push the PMP data to the GNSS
56
66
// The payload length could be variable, so we need to push the header and payload, then checksum
57
67
myGNSS.pushRawData (&pmpData->sync1 , (size_t )payloadLen + 6 ); // Push the sync chars, class, ID, length and payload
58
68
myGNSS.pushRawData (&pmpData->checksumA , (size_t )2 ); // Push the checksum bytes
69
+
70
+ #else
71
+
72
+ Serial.println (F (" Bytes." ));
73
+
74
+ #endif
75
+
59
76
}
60
77
61
78
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -202,7 +219,12 @@ void setup()
202
219
Serial.println (F (" u-blox GNSS module connected" ));
203
220
204
221
uint8_t ok = myGNSS.setI2COutput (COM_TYPE_UBX); // Turn off NMEA noise
222
+
205
223
if (ok) ok = myGNSS.setPortInput (COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_SPARTN); // Be sure SPARTN input is enabled
224
+
225
+ if (ok) ok = myGNSS.setPortInput (COM_PORT_UART1, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_SPARTN); // Be sure SPARTN input is enabled
226
+
227
+ if (ok) ok = myGNSS.setPortInput (COM_PORT_UART2, COM_TYPE_UBX | COM_TYPE_RTCM3 | COM_TYPE_SPARTN); // Be sure SPARTN input is enabled
206
228
207
229
if (ok) ok = myGNSS.setDGNSSConfiguration (SFE_UBLOX_DGNSS_MODE_FIXED); // Set the differential mode - ambiguities are fixed whenever possible
208
230
@@ -250,10 +272,10 @@ void setup()
250
272
if (ok) ok = myLBand.setVal16 (UBLOX_CFG_PMP_DESCRAMBLER_INIT, 26969 ); // Default 23560
251
273
if (ok) ok = myLBand.setVal8 (UBLOX_CFG_PMP_USE_PRESCRAMBLING, 0 ); // Default 0
252
274
if (ok) ok = myLBand.setVal64 (UBLOX_CFG_PMP_UNIQUE_WORD, 16238547128276412563ull );
253
- if (ok) ok = myLBand.setVal (UBLOX_CFG_MSGOUT_UBX_RXM_PMP_I2C, 1 ); // Ensure UBX-RXM-PMP is enabled on the I2C port
254
- if (ok) ok = myLBand.setVal (UBLOX_CFG_MSGOUT_UBX_RXM_PMP_UART1, 1 ); // Output UBX-RXM-PMP on UART1
255
- if (ok) ok = myLBand.setVal (UBLOX_CFG_UART2OUTPROT_UBX, 1 ); // Enable UBX output on UART2
256
- if (ok) ok = myLBand.setVal (UBLOX_CFG_MSGOUT_UBX_RXM_PMP_UART2, 1 ); // Output UBX-RXM-PMP on UART2
275
+ if (ok) ok = myLBand.setVal8 (UBLOX_CFG_MSGOUT_UBX_RXM_PMP_I2C, 1 ); // Ensure UBX-RXM-PMP is enabled on the I2C port
276
+ if (ok) ok = myLBand.setVal8 (UBLOX_CFG_MSGOUT_UBX_RXM_PMP_UART1, 1 ); // Output UBX-RXM-PMP on UART1
277
+ if (ok) ok = myLBand.setVal8 (UBLOX_CFG_UART2OUTPROT_UBX, 1 ); // Enable UBX output on UART2
278
+ if (ok) ok = myLBand.setVal8 (UBLOX_CFG_MSGOUT_UBX_RXM_PMP_UART2, 1 ); // Output UBX-RXM-PMP on UART2
257
279
if (ok) ok = myLBand.setVal32 (UBLOX_CFG_UART1_BAUDRATE, 38400 ); // match baudrate with ZED default
258
280
if (ok) ok = myLBand.setVal32 (UBLOX_CFG_UART2_BAUDRATE, 38400 ); // match baudrate with ZED default
259
281
0 commit comments