Skip to content

Commit ed8602c

Browse files
authored
Merge pull request #270 from sparkfun/Resolve_#267
Resolve #267
2 parents 3f68aeb + cf0eb4f commit ed8602c

File tree

9 files changed

+1815
-1775
lines changed

9 files changed

+1815
-1775
lines changed

Firmware/RTK_Everywhere/GNSS.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Connect to ZED module and identify particulars
1+
// Connect to GNSS and identify particulars
22
void gnssBegin()
33
{
44
if (present.gnss_zedf9p)

Firmware/RTK_Everywhere/MQTT_Client.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void mqttClientReceiveMessage(int messageSize)
305305

306306
if (mqttCount > 0)
307307
{
308-
// Correction data from PP can go direct to ZED module
308+
// Correction data from PP can go direct to GNSS
309309
if (present.gnss_zedf9p)
310310
{
311311
// Only push SPARTN if the priority says we can
@@ -316,7 +316,7 @@ void mqttClientReceiveMessage(int messageSize)
316316
if (isHighestRegisteredCorrectionsSource(CORR_IP))
317317
{
318318
if (((settings.debugMqttClientData == true) || (settings.debugCorrections == true)) && !inMainMenu)
319-
systemPrintf("Pushing %d bytes from %s topic to ZED\r\n", mqttCount, topic);
319+
systemPrintf("Pushing %d bytes from %s topic to GNSS\r\n", mqttCount, topic);
320320

321321
updateZEDCorrectionsSource(0); // Set SOURCE to 0 (IP) if needed
322322

@@ -326,7 +326,7 @@ void mqttClientReceiveMessage(int messageSize)
326326
else
327327
{
328328
if (((settings.debugMqttClientData == true) || (settings.debugCorrections == true)) && !inMainMenu)
329-
systemPrintf("NOT pushing %d bytes from %s topic to ZED due to priority\r\n", mqttCount, topic);
329+
systemPrintf("NOT pushing %d bytes from %s topic to GNSS due to priority\r\n", mqttCount, topic);
330330
}
331331
}
332332
// Always push KEYS and MGA to the ZED

Firmware/RTK_Everywhere/NtripClient.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,15 +836,15 @@ void ntripClientUpdate()
836836
if ((settings.debugNtripClientRtcm || PERIODIC_DISPLAY(PD_NTRIP_CLIENT_DATA)) && (!inMainMenu))
837837
{
838838
PERIODIC_CLEAR(PD_NTRIP_CLIENT_DATA);
839-
systemPrintf("NTRIP Client received %d RTCM bytes, pushed to ZED\r\n", rtcmCount);
839+
systemPrintf("NTRIP Client received %d RTCM bytes, pushed to GNSS\r\n", rtcmCount);
840840
}
841841
}
842842
else
843843
{
844844
if ((settings.debugNtripClientRtcm || PERIODIC_DISPLAY(PD_NTRIP_CLIENT_DATA)) && (!inMainMenu))
845845
{
846846
PERIODIC_CLEAR(PD_NTRIP_CLIENT_DATA);
847-
systemPrintf("NTRIP Client received %d RTCM bytes, NOT pushed to ZED due to priority\r\n", rtcmCount);
847+
systemPrintf("NTRIP Client received %d RTCM bytes, NOT pushed to GNSS due to priority\r\n", rtcmCount);
848848
}
849849
}
850850
}

Firmware/RTK_Everywhere/PointPerfectLibrary.ino

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ void updatePplTask(void *e)
3333
{
3434
if (rtcmLength > 0)
3535
{
36-
updateCorrectionsLastSeen(CORR_LBAND);
37-
if (isHighestRegisteredCorrectionsSource(CORR_LBAND))
36+
updateCorrectionsLastSeen(pplCorrectionsSource);
37+
if (isHighestRegisteredCorrectionsSource(pplCorrectionsSource))
3838
{
3939
// Set ZED SOURCE to 1 (L-Band) if needed
4040
// Note: this is almost certainly redundant. It would only be used if we
@@ -318,17 +318,18 @@ bool sendGnssToPpl(uint8_t *buffer, int numDataBytes)
318318
return false;
319319
}
320320

321-
// Send Spartn packets from PointPerfect (either IP or L-Band) to PPL
321+
// Send Spartn packets from PointPerfect to PPL
322322
bool sendSpartnToPpl(uint8_t *buffer, int numDataBytes)
323323
{
324324
if (online.ppl == true)
325325
{
326+
pplCorrectionsSource = CORR_IP;
326327

327328
ePPL_ReturnStatus result = PPL_SendSpartn(buffer, numDataBytes);
328329
if (result != ePPL_Success)
329330
{
330331
if (settings.debugCorrections == true)
331-
systemPrintf("ERROR processRXMPMP PPL_SendSpartn: %s\r\n", PPLReturnStatusToStr(result));
332+
systemPrintf("ERROR PPL_SendSpartn: %s\r\n", PPLReturnStatusToStr(result));
332333
return false;
333334
}
334335
lastMqttToPpl = millis();
@@ -342,6 +343,31 @@ bool sendSpartnToPpl(uint8_t *buffer, int numDataBytes)
342343
return false;
343344
}
344345

346+
// Send raw L-Band Spartn packets from mosaic X5 to PPL
347+
bool sendAuxSpartnToPpl(uint8_t *buffer, int numDataBytes)
348+
{
349+
if (online.ppl == true)
350+
{
351+
pplCorrectionsSource = CORR_LBAND;
352+
353+
ePPL_ReturnStatus result = PPL_SendAuxSpartn(buffer, numDataBytes);
354+
if (result != ePPL_Success)
355+
{
356+
if (settings.debugCorrections == true)
357+
systemPrintf("ERROR PPL_SendAuxSpartn: %s\r\n", PPLReturnStatusToStr(result));
358+
return false;
359+
}
360+
lastMqttToPpl = millis();
361+
return true;
362+
}
363+
else
364+
{
365+
pplLBandCorrections = true; // Notify updatePPL() that L-Band is online
366+
}
367+
368+
return false;
369+
}
370+
345371
// Print human-readable PPL status
346372
const char *PPLReturnStatusToStr(ePPL_ReturnStatus status)
347373
{

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ uint8_t *pplRtcmBuffer;
636636
bool pplAttemptedStart = false;
637637
bool pplGnssOutput = false;
638638
bool pplMqttCorrections = false;
639+
bool pplLBandCorrections = false; // Raw L-Band - e.g. from mosaic X5
639640
unsigned long pplKeyExpirationMs = 0; // Milliseconds until the current PPL key expires
640641

641642
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -692,7 +693,7 @@ uint32_t triggerTowMsR; // Global copy - Time Of Week of rising edge (ms)
692693
uint32_t triggerTowSubMsR; // Global copy - Millisecond fraction of Time Of Week of rising edge in nanoseconds
693694
uint32_t triggerAccEst; // Global copy - Accuracy estimate in nanoseconds
694695

695-
bool firstPowerOn = true; // After boot, apply new settings to ZED if the user switches between base or rover
696+
bool firstPowerOn = true; // After boot, apply new settings to GNSS if the user switches between base or rover
696697
unsigned long splashStart; // Controls how long the splash is displayed for. Currently min of 2s.
697698
bool restartBase; // If the user modifies any NTRIP Server settings, we need to restart the base
698699
bool restartRover; // If the user modifies any NTRIP Client or PointPerfect settings, we need to restart the rover
@@ -723,6 +724,10 @@ uint16_t failedParserMessages_UBX;
723724
uint16_t failedParserMessages_RTCM;
724725
uint16_t failedParserMessages_NMEA;
725726

727+
// Corrections Priorities Support
728+
std::vector<registeredCorrectionsSource> registeredCorrectionsSources; // vector (linked list) of registered corrections sources for this device
729+
correctionsSource pplCorrectionsSource = CORR_NUM; // Record which source is feeding the PPL
730+
726731
// configureViaEthernet:
727732
// Set to true if configureViaEthernet.txt exists in LittleFS.
728733
// Causes setup and loop to skip any code which would cause SPI or interrupts to be initialized.

Firmware/RTK_Everywhere/Tasks.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void btReadTask(void *e)
137137
systemPrintln("btReadTask running");
138138
}
139139

140-
// Receive RTCM corrections or UBX config messages over bluetooth and pass them along to ZED
140+
// Receive RTCM corrections or UBX config messages over bluetooth and pass them along to GNSS
141141
rxBytes = 0;
142142
if (bluetoothGetState() == BT_CONNECTED)
143143
{

0 commit comments

Comments
 (0)