Skip to content

Commit 480e516

Browse files
committed
Merge branch 'release_candidate' into MFi
2 parents 3c3d6ca + 00d3d64 commit 480e516

37 files changed

+2321
-912
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: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,17 @@
16371637
<span class="icon-info-circle text-primary ms-2"></span>
16381638
</span>
16391639
</div>
1640+
<div id="tcpWiFiTypeDropdown" class="mt-3">
1641+
<label for="tcpOverWiFiStation">TCP Server Connection: </label>
1642+
<select name="tcpWiFiType" id="tcpOverWiFiStation" class="form-dropdown">
1643+
<option value="1">WiFi</option>
1644+
<option value="0">AP</option>
1645+
</select>
1646+
<span class="tt" data-bs-placement="right"
1647+
title="In WiFi mode, the device will attempt to connect to local WiFi to broadcast TCP packets. In AP mode, the device will become an Access Point that devices can connect to over WiFi.">
1648+
<span class="icon-info-circle text-primary ms-2"></span>
1649+
</span>
1650+
</div>
16401651
</div>
16411652
<div class="form-group row">
16421653
<p id="enableTcpServerError" class="inlineError"></p>
@@ -1661,24 +1672,22 @@
16611672
<input type="text" class="form-control" id="udpServerPort">
16621673
<p id="udpServerPortError" class="inlineError"></p>
16631674
</div>
1675+
<div id="udpWiFiTypeDropdown" class="mt-auto">
1676+
<label for="udpOverWiFiStation">UDP Server Connection: </label>
1677+
<select name="udpWiFiType" id="udpOverWiFiStation" class="form-dropdown">
1678+
<option value="1">WiFi</option>
1679+
<option value="0">AP</option>
1680+
</select>
1681+
<span class="tt" data-bs-placement="right"
1682+
title="In WiFi mode, the device will attempt to connect to local WiFi to broadcast UDP packets. In AP mode, the device will become an Access Point that devices can connect to over WiFi.">
1683+
<span class="icon-info-circle text-primary ms-2"></span>
1684+
</span>
1685+
</div>
16641686
</div>
16651687
</div>
16661688
<div class="form-group row">
16671689
<p id="enableUdpServerError" class="inlineError"></p>
16681690
</div>
1669-
1670-
<div id="tcpUdpWiFiTypeDropdown" class="mt-3">
1671-
<label for="tcpUdpOverWiFiStation">TCP/UDP Server Connection: </label>
1672-
<select name="tcpUdpWiFiType" id="tcpUdpOverWiFiStation" class="form-dropdown">
1673-
<option value="1">WiFi</option>
1674-
<option value="0">AP</option>
1675-
</select>
1676-
<span class="tt" data-bs-placement="right"
1677-
title="In WiFi mode, the device will attempt to connect to local WiFi to broadcast TCP/UDP packets. In AP mode, the device will become an Access Point that devices can connect to over WiFi.">
1678-
<span class="icon-info-circle text-primary ms-2"></span>
1679-
</span>
1680-
</div>
1681-
16821691
</div>
16831692
</div>
16841693

@@ -2016,7 +2025,7 @@
20162025
<label for="maxLogTime" class="box-margin40 col-sm-3 col-7 col-form-label">Max Logging
20172026
Time (min):
20182027
<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.">
2028+
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.">
20202029
<span class="icon-info-circle text-primary ms-2"></span>
20212030
</span>
20222031
</label>
@@ -2027,15 +2036,23 @@
20272036
<div class="form-group row">
20282037
<label for="maxLogLength" class="box-margin40 col-sm-3 col-7 col-form-label">Max Log
20292038
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.">
2039+
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.">
20312040
<span class="icon-info-circle text-primary ms-2"></span>
20322041
</span>
20332042
</label>
2034-
20352043
<input type="number" class="form-control box-small" id="maxLogLength">
20362044
<p id="maxLogLengthError" class="inlineError"></p>
20372045
</div>
20382046

2047+
<div class="form-check mt-1 box-margin20">
2048+
<label class="form-check-label" for="alignedLogFiles">Aligned Log Files</label>
2049+
<input class="form-check-input" type="checkbox" value="" id="alignedLogFiles" unchecked>
2050+
<span class="tt" data-bs-placement="right"
2051+
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.">
2052+
<span class="icon-info-circle text-primary ms-2"></span>
2053+
</span>
2054+
</div>
2055+
20392056
<div id="logFile" class="row">
20402057
<div class="mb-2">
20412058
<label for="logFile" class="form-group box-margin20">Log file name: <span
@@ -2069,7 +2086,7 @@
20692086
<label for="ARPLoggingInterval" class="box-margin40 col-sm-3 col-7 col-form-label">ARP
20702087
Logging Interval (s):
20712088
<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.">
2089+
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.">
20732090
<span class="icon-info-circle text-primary ms-2"></span>
20742091
</span>
20752092
</label>
@@ -2491,4 +2508,4 @@
24912508
</script>
24922509
</body>
24932510

2494-
</html>
2511+
</html>

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
@@ -850,10 +850,10 @@ void beginSD()
850850

851851
gotSemaphore = false;
852852

853-
while (settings.enableSD == true)
853+
while (settings.enableSD == true) // Note: settings.enableSD is never set to false
854854
{
855855
// Setup SD card access semaphore
856-
if (sdCardSemaphore == nullptr)
856+
if (sdCardSemaphore == NULL)
857857
sdCardSemaphore = xSemaphoreCreateMutex();
858858
else if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_shortWait_ms) != pdPASS)
859859
{
@@ -869,7 +869,7 @@ void beginSD()
869869
break; // Give up on loop
870870

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

874874
// Allocate the data structure that manages the microSD card
875875
if (!sd)
@@ -937,7 +937,7 @@ void beginSD()
937937
sdCardSize = 0;
938938
outOfSDSpace = true;
939939

940-
systemPrintln("microSD: Online");
940+
systemPrintf("microSD: Online @ %s\r\n", getTimeStamp());
941941
online.microSD = true;
942942
break;
943943
}
@@ -958,7 +958,7 @@ void endSD(bool alreadyHaveSemaphore, bool releaseSemaphore)
958958
sd->end();
959959

960960
online.microSD = false;
961-
systemPrintln("microSD: Offline");
961+
systemPrintf("microSD: Offline @ %s\r\n", getTimeStamp());
962962
}
963963

964964
// Free the caches for the microSD card
@@ -1712,7 +1712,7 @@ void tpISR()
17121712
{
17131713
if (online.rtc) // Only sync if the RTC has been set via PVT first
17141714
{
1715-
if (timTpUpdated) // Only sync if timTpUpdated is true
1715+
if (timTpUpdated) // Only sync if timTpUpdated is true - set by storeTIMTPdata on ZED platforms only
17161716
{
17171717
if (millisNow - lastRTCSync >
17181718
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/Developer.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ bool webServerStart(int httpPort = 80)
171171
bool parseIncomingSettings() {return false;}
172172
void sendStringToWebsocket(const char* stringToSend) {}
173173
void stopWebServer() {}
174+
bool webServerSettingsCheckAndFree() {return false;}
175+
void webServerSettingsClone() {}
174176
void webServerStop() {}
175177
void webServerUpdate() {}
176178
void webServerVerifyTables() {}
@@ -213,6 +215,7 @@ bool wifiEspNowOn(const char * fileName, uint32_t lineNumber) {return false;}
213215
void wifiEspNowChannelSet(WIFI_CHANNEL_t channel) {}
214216
int wifiNetworkCount() {return 0;}
215217
void wifiResetTimeout() {}
218+
IPAddress wifiSoftApGetBroadcastIpAddress() {return IPAddress((uint32_t)0);}
216219
IPAddress wifiSoftApGetIpAddress() {return IPAddress((uint32_t)0);}
217220
const char * wifiSoftApGetSsid() {return "";}
218221
bool wifiSoftApOff(const char * fileName, uint32_t lineNumber) {return true;}

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
{

0 commit comments

Comments
 (0)