Skip to content

Commit c766852

Browse files
authored
Merge pull request #701 from sparkfun/pcUpdates
pcUpdates
2 parents 09b0c3f + d685ba7 commit c766852

26 files changed

+1091
-768
lines changed

.github/workflows/compile-rtk-everywhere.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ jobs:
8989
"SparkFun u-blox GNSS v3"@3.1.8
9090
"SparkFun Qwiic OLED Arduino Library"@1.0.13
9191
92-
"SparkFun Extensible Message Parser"@1.0.2
92+
"SparkFun Extensible Message Parser"@1.0.4
9393
"SparkFun BQ40Z50 Battery Manager Arduino Library"@1.0.0
9494
"ArduinoMqttClient"@0.1.8
9595
"SparkFun u-blox PointPerfect Library"@1.11.4
9696
"SparkFun IM19 IMU Arduino Library"@1.0.1
97-
"SparkFun UM980 Triband RTK GNSS Arduino Library"@1.0.4
97+
"SparkFun UM980 Triband RTK GNSS Arduino Library"@1.0.5
9898
"SparkFun LG290P Quadband RTK GNSS Arduino Library"@1.0.8
9999
"SparkFun I2C Expander Arduino Library"@1.0.1
100100

.github/workflows/non-release-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ jobs:
8888
"SparkFun u-blox GNSS v3"@3.1.8
8989
"SparkFun Qwiic OLED Arduino Library"@1.0.13
9090
91-
"SparkFun Extensible Message Parser"@1.0.2
91+
"SparkFun Extensible Message Parser"@1.0.4
9292
"SparkFun BQ40Z50 Battery Manager Arduino Library"@1.0.0
9393
"ArduinoMqttClient"@0.1.8
9494
"SparkFun u-blox PointPerfect Library"@1.11.4
9595
"SparkFun IM19 IMU Arduino Library"@1.0.1
96-
"SparkFun UM980 Triband RTK GNSS Arduino Library"@1.0.4
97-
"SparkFun LG290P Quadband RTK GNSS Arduino Library"@1.0.7
96+
"SparkFun UM980 Triband RTK GNSS Arduino Library"@1.0.5
97+
"SparkFun LG290P Quadband RTK GNSS Arduino Library"@1.0.8
9898
"SparkFun I2C Expander Arduino Library"@1.0.1
9999

100100
- name: Patch libmbedtls

Firmware/RTK_Everywhere/AP-Config/index.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@
20162016
<label for="maxLogTime" class="box-margin40 col-sm-3 col-7 col-form-label">Max Logging
20172017
Time (min):
20182018
<span class="tt" data-bs-placement="right"
2019-
title="Once the max log time is achieved, logging will cease. This is useful for limiting long term, overnight, static surveys to a certain length of time. Default: 1440 minutes. Limits: 1 to 2880 minutes.">
2019+
title="Once the max log time is achieved, logging will cease. This is useful for limiting long term, overnight, static surveys to a certain length of time. Default: 1440 minutes. Limits: 0 to 1,051,200 minutes. 0 = no limit.">
20202020
<span class="icon-info-circle text-primary ms-2"></span>
20212021
</span>
20222022
</label>
@@ -2027,15 +2027,23 @@
20272027
<div class="form-group row">
20282028
<label for="maxLogLength" class="box-margin40 col-sm-3 col-7 col-form-label">Max Log
20292029
File Length (min):<span class="tt" data-bs-placement="right"
2030-
title="Once this length of time is achieved, a new log will be created. This is useful for creating multiple logs over a long survey. Default: 1440 minutes. Limits: 1 to 2880 minutes.">
2030+
title="Once this length of time is achieved, a new log will be created. This is useful for creating multiple logs over a long survey. Default: 1440 minutes. Limits: 0 to 2880 minutes. 0 = no limit.">
20312031
<span class="icon-info-circle text-primary ms-2"></span>
20322032
</span>
20332033
</label>
2034-
20352034
<input type="number" class="form-control box-small" id="maxLogLength">
20362035
<p id="maxLogLengthError" class="inlineError"></p>
20372036
</div>
20382037

2038+
<div class="form-check mt-1 box-margin20">
2039+
<label class="form-check-label" for="alignedLogFiles">Aligned Log Files</label>
2040+
<input class="form-check-input" type="checkbox" value="" id="alignedLogFiles" unchecked>
2041+
<span class="tt" data-bs-placement="right"
2042+
title="If enabled, log files will be aligned to the Max Log File Length. Only possible if the Max Log Length is an integral fraction of 24 hours.">
2043+
<span class="icon-info-circle text-primary ms-2"></span>
2044+
</span>
2045+
</div>
2046+
20392047
<div id="logFile" class="row">
20402048
<div class="mb-2">
20412049
<label for="logFile" class="form-group box-margin20">Log file name: <span
@@ -2069,7 +2077,7 @@
20692077
<label for="ARPLoggingInterval" class="box-margin40 col-sm-3 col-7 col-form-label">ARP
20702078
Logging Interval (s):
20712079
<span class="tt" data-bs-placement="right"
2072-
title="If ARP logging is enabled, the Antenna Reference Position will be logged at intervals of this many seconds.">
2080+
title="If ARP logging is enabled, the Antenna Reference Position will be logged at intervals of this many seconds. Min: 1. Max 600. Default: 10.">
20732081
<span class="icon-info-circle text-primary ms-2"></span>
20742082
</span>
20752083
</label>

Firmware/RTK_Everywhere/AP-Config/src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,8 +1004,8 @@ function validateFields() {
10041004

10051005
//System Config
10061006
if (ge("enableLogging").checked == true) {
1007-
checkElementValue("maxLogTime", 1, 1051200, "Must be 1 to 1,051,200", "collapseSystemConfig");
1008-
checkElementValue("maxLogLength", 1, 1051200, "Must be 1 to 1,051,200", "collapseSystemConfig");
1007+
checkElementValue("maxLogTime", 0, 1051200, "Must be 0 to 1,051,200", "collapseSystemConfig");
1008+
checkElementValue("maxLogLength", 0, 2880, "Must be 0 to 2880", "collapseSystemConfig");
10091009
}
10101010
else {
10111011
clearElement("maxLogTime", 60 * 24);

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -843,10 +843,10 @@ void beginSD()
843843

844844
gotSemaphore = false;
845845

846-
while (settings.enableSD == true)
846+
while (settings.enableSD == true) // Note: settings.enableSD is never set to false
847847
{
848848
// Setup SD card access semaphore
849-
if (sdCardSemaphore == nullptr)
849+
if (sdCardSemaphore == NULL)
850850
sdCardSemaphore = xSemaphoreCreateMutex();
851851
else if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_shortWait_ms) != pdPASS)
852852
{
@@ -862,7 +862,7 @@ void beginSD()
862862
break; // Give up on loop
863863

864864
// If an SD card is present, allow SdFat to take over
865-
log_d("SD card detected");
865+
systemPrintf("SD card detected @ %s\r\n", getTimeStamp());
866866

867867
// Allocate the data structure that manages the microSD card
868868
if (!sd)
@@ -930,7 +930,7 @@ void beginSD()
930930
sdCardSize = 0;
931931
outOfSDSpace = true;
932932

933-
systemPrintln("microSD: Online");
933+
systemPrintf("microSD: Online @ %s\r\n", getTimeStamp());
934934
online.microSD = true;
935935
break;
936936
}
@@ -951,7 +951,7 @@ void endSD(bool alreadyHaveSemaphore, bool releaseSemaphore)
951951
sd->end();
952952

953953
online.microSD = false;
954-
systemPrintln("microSD: Offline");
954+
systemPrintf("microSD: Offline @ %s\r\n", getTimeStamp());
955955
}
956956

957957
// Free the caches for the microSD card
@@ -1699,7 +1699,7 @@ void tpISR()
16991699
{
17001700
if (online.rtc) // Only sync if the RTC has been set via PVT first
17011701
{
1702-
if (timTpUpdated) // Only sync if timTpUpdated is true
1702+
if (timTpUpdated) // Only sync if timTpUpdated is true - set by storeTIMTPdata on ZED platforms only
17031703
{
17041704
if (millisNow - lastRTCSync >
17051705
syncRTCInterval) // Only sync if it is more than syncRTCInterval since the last sync

Firmware/RTK_Everywhere/Buttons.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void buttonRead()
119119
gpioChanged = false;
120120

121121
// Get all the pins in one read
122-
uint8_t currentState = io.getInputRegister() & 0b00111111; // Ignore unconnected GPIO6/7
122+
uint8_t currentState = io.getInputRegister() & 0b00011111; // Mask the five buttons. Ignore SD detect
123123

124124
if (currentState != gpioExpander_previousState)
125125
{

Firmware/RTK_Everywhere/ESPNOW.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ void espNowOnDataReceived(const esp_now_recv_info *mac, const uint8_t *incomingD
161161
{
162162
// Pass RTCM bytes (presumably) from ESP NOW out ESP32-UART to GNSS
163163
gnss->pushRawData((uint8_t *)incomingData, len);
164+
sempParseNextBytes(rtcmParse, (uint8_t *)incomingData, len); // Parse the data for RTCM1005/1006
164165

165166
if ((settings.debugEspNow == true || settings.debugCorrections == true) && !inMainMenu)
166167
systemPrintf("ESPNOW received %d RTCM bytes, pushed to GNSS, RSSI: %d\r\n", len, espNowRSSI);

Firmware/RTK_Everywhere/GNSS.ino

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,29 +72,52 @@ bool GNSS::supportsAntennaShortOpen()
7272
}
7373

7474
// Periodically push GGA sentence over NTRIP Client, to Caster, if enabled
75-
void pushGPGGA(char *ggaData)
75+
// We must not push to the Caster while we are reading data from the Caster
76+
// See #695
77+
// pushGPGGA is called by processUart1Message from gnssReadTask
78+
// ntripClient->read is called by ntripClientUpdate and ntripClientResponse from networkUpdate from loop
79+
// We need to make sure processUart1Message doesn't gatecrash
80+
// If ggaData is provided, store it. If ggaData is nullptr, try to push it
81+
static void pushGPGGA(char *ggaData)
7682
{
77-
#ifdef COMPILE_NETWORK
78-
// Wait until the client has been created
79-
if (ntripClient != nullptr)
83+
static char storedGPGGA[100];
84+
85+
static SemaphoreHandle_t reentrant = xSemaphoreCreateMutex(); // Create the mutex
86+
87+
if (xSemaphoreTake(reentrant, 10 / portTICK_PERIOD_MS) == pdPASS)
8088
{
81-
// Provide the caster with our current position as needed
82-
if (ntripClient->connected() && settings.ntripClient_TransmitGGA == true)
89+
if (ggaData)
8390
{
84-
if (millis() - lastGGAPush > NTRIPCLIENT_MS_BETWEEN_GGA)
85-
{
86-
lastGGAPush = millis();
91+
snprintf(storedGPGGA, sizeof(storedGPGGA), "%s", ggaData);
92+
xSemaphoreGive(reentrant);
93+
return;
94+
}
8795

88-
if (settings.debugNtripClientRtcm || PERIODIC_DISPLAY(PD_NTRIP_CLIENT_GGA))
96+
#ifdef COMPILE_NETWORK
97+
// Wait until the client has been created
98+
if (ntripClient != nullptr)
99+
{
100+
// Provide the caster with our current position as needed
101+
if (ntripClient->connected() && settings.ntripClient_TransmitGGA == true)
102+
{
103+
if (millis() - lastGGAPush > NTRIPCLIENT_MS_BETWEEN_GGA)
89104
{
90-
PERIODIC_CLEAR(PD_NTRIP_CLIENT_GGA);
91-
systemPrintf("NTRIP Client pushing GGA to server: %s", (const char *)ggaData);
92-
}
105+
lastGGAPush = millis();
93106

94-
// Push our current GGA sentence to caster
95-
ntripClient->print((const char *)ggaData);
107+
if ((settings.debugNtripClientRtcm || PERIODIC_DISPLAY(PD_NTRIP_CLIENT_GGA)) && !inMainMenu)
108+
{
109+
PERIODIC_CLEAR(PD_NTRIP_CLIENT_GGA);
110+
systemPrintf("NTRIP Client pushing GGA to server: %s", (const char *)storedGPGGA);
111+
}
112+
113+
// Push our current GGA sentence to caster
114+
if (strlen(storedGPGGA) > 0)
115+
ntripClient->write((const uint8_t *)storedGPGGA, strlen(storedGPGGA));
116+
}
96117
}
97118
}
98-
}
99119
#endif // COMPILE_NETWORK
120+
121+
xSemaphoreGive(reentrant);
122+
}
100123
}

Firmware/RTK_Everywhere/GNSS_ZED.ino

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,6 @@ bool GNSS_ZED::configureGNSS()
542542
_zed->setAutoPVTcallbackPtr(&storePVTdata, VAL_LAYER_ALL); // Enable automatic NAV PVT messages with callback to storePVTdata
543543
response &= _zed->setAutoHPPOSLLHcallbackPtr(
544544
&storeHPdata, VAL_LAYER_ALL); // Enable automatic NAV HPPOSLLH messages with callback to storeHPdata
545-
_zed->setRTCM1005InputcallbackPtr(
546-
&storeRTCM1005data); // Configure a callback for RTCM 1005 - parsed from pushRawData
547-
_zed->setRTCM1006InputcallbackPtr(
548-
&storeRTCM1006data); // Configure a callback for RTCM 1006 - parsed from pushRawData
549545

550546
if (present.timePulseInterrupt)
551547
response &= _zed->setAutoTIMTPcallbackPtr(
@@ -2598,30 +2594,6 @@ void GNSS_ZED::storeMONCOMMSdataRadio(UBX_MON_COMMS_data_t *ubxDataStruct)
25982594
}
25992595
}
26002596

2601-
//----------------------------------------
2602-
// Callback to save ARPECEF*
2603-
//----------------------------------------
2604-
void storeRTCM1005data(RTCM_1005_data_t *rtcmData1005)
2605-
{
2606-
ARPECEFX = rtcmData1005->AntennaReferencePointECEFX;
2607-
ARPECEFY = rtcmData1005->AntennaReferencePointECEFY;
2608-
ARPECEFZ = rtcmData1005->AntennaReferencePointECEFZ;
2609-
ARPECEFH = 0;
2610-
newARPAvailable = true;
2611-
}
2612-
2613-
//----------------------------------------
2614-
// Callback to save ARPECEF*
2615-
//----------------------------------------
2616-
void storeRTCM1006data(RTCM_1006_data_t *rtcmData1006)
2617-
{
2618-
ARPECEFX = rtcmData1006->AntennaReferencePointECEFX;
2619-
ARPECEFY = rtcmData1006->AntennaReferencePointECEFY;
2620-
ARPECEFZ = rtcmData1006->AntennaReferencePointECEFZ;
2621-
ARPECEFH = rtcmData1006->AntennaHeight;
2622-
newARPAvailable = true;
2623-
}
2624-
26252597
//----------------------------------------
26262598
void storeTIMTPdata(UBX_TIM_TP_data_t *ubxDataStruct)
26272599
{

Firmware/RTK_Everywhere/LoRa.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ void updateLora()
175175
// Pass RTCM bytes (presumably) from LoRa out ESP32-UART to GNSS
176176
gnss->pushRawData(rtcmData, rtcmCount); // Push RTCM to GNSS module
177177

178+
// Parse the data for RTCM1005/1006
179+
sempParseNextBytes(rtcmParse, rtcmData, rtcmCount);
180+
178181
if (((settings.debugCorrections == true) || (settings.debugLora == true)) && !inMainMenu)
179182
{
180183
systemFlush(); // Complete prints
@@ -254,6 +257,9 @@ void updateLora()
254257
// Pass RTCM bytes (presumably) from LoRa out ESP32-UART to GNSS
255258
gnss->pushRawData(rtcmData, rtcmCount); // Push RTCM to GNSS module
256259

260+
// Parse the data for RTCM1005/1006
261+
sempParseNextBytes(rtcmParse, rtcmData, rtcmCount);
262+
257263
if (((settings.debugCorrections == true) || (settings.debugLora == true)) && !inMainMenu)
258264
{
259265
systemFlush(); // Complete prints

0 commit comments

Comments
 (0)