Skip to content

Commit 8e7b13d

Browse files
committed
Add rtcmMinElev
1 parent 33f92f2 commit 8e7b13d

File tree

5 files changed

+90
-23
lines changed

5 files changed

+90
-23
lines changed

Firmware/RTK_Everywhere/AP-Config/index.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
</div>
364364
</div>
365365

366-
<div id="useMSM7Setting">
366+
<div id="lg290pGnssSettings">
367367
<div class="form-check mt-3">
368368
<label class="form-check-label" for="useMSM7">MSM7 RTCM Selection</label>
369369
<input class="form-check-input" type="checkbox" value="" id="useMSM7">
@@ -372,6 +372,21 @@
372372
<span class="icon-info-circle text-primary ms-2"></span>
373373
</span>
374374
</div>
375+
376+
<div class="form-group row" id="rtcmMinElevConfig">
377+
<div class="form-group row">
378+
<label for="rtcmMinElev" class="col-sm-4 col-6 col-form-label">Min SV Elevation for RTCM:
379+
<span class="tt" data-bs-placement="right"
380+
title="Minimum elevation in degrees for a GNSS satellite to be used for RTCM corrections.">
381+
<span class="icon-info-circle text-primary ms-2"></span>
382+
</span>
383+
</label>
384+
<div class="col-sm-4 col-6">
385+
<input type="number" class="form-control" id="rtcmMinElev">
386+
<p id="rtcmMinElevError" class="inlineError"></p>
387+
</div>
388+
</div>
389+
</div>
375390
</div>
376391

377392
<div class="form-check mt-3">

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

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function parseIncoming(msg) {
112112
hide("externalPortOptions");
113113
show("logToSDCard");
114114
hide("galileoHasSetting");
115-
hide("useMSM7Setting");
115+
hide("lg290pGnssSettings");
116116
hide("tiltConfig");
117117
hide("beeperControl");
118118
show("measurementRateInput");
@@ -146,7 +146,7 @@ function parseIncoming(msg) {
146146
show("externalPortOptions");
147147
show("logToSDCard");
148148
hide("galileoHasSetting");
149-
hide("useMSM7Setting");
149+
hide("lg290pGnssSettings");
150150
hide("tiltConfig");
151151
hide("beeperControl");
152152
show("measurementRateInput");
@@ -167,7 +167,7 @@ function parseIncoming(msg) {
167167
show("externalPortOptions");
168168
show("logToSDCard");
169169
hide("galileoHasSetting");
170-
hide("useMSM7Setting");
170+
hide("lg290pGnssSettings");
171171
hide("tiltConfig");
172172
hide("beeperControl");
173173
hide("measurementRateInput");
@@ -257,8 +257,8 @@ function parseIncoming(msg) {
257257
show("externalPortOptions");
258258
show("logToSDCard");
259259

260-
hide("galileoHasSetting");
261-
show("useMSM7Setting");
260+
show("galileoHasSetting");
261+
show("lg290pGnssSettings");
262262
hide("tiltConfig");
263263
hide("beeperControl");
264264

@@ -273,8 +273,8 @@ function parseIncoming(msg) {
273273
show("constellationNavic");
274274

275275
hide("dynamicModelDropdown"); //Not supported on LG290P
276-
hide("minElevConfig"); //Not supported on LG290P
277-
hide("minCNOConfig"); //Not supported on LG290P
276+
show("minElevConfig");
277+
show("minCNOConfig");
278278

279279
ge("rtcmRateInfoText").setAttribute('data-bs-original-title', 'RTCM is transmitted by the base at a default of 1Hz for messages 1005, 1074, 1084, 1094, 1114, 1124, 1134. This can be lowered for radios with low bandwidth or tailored to transmit any/all RTCM messages. Limits: 0 to 20. Note: The measurement rate is overridden to 1Hz when in Base mode.');
280280

@@ -327,8 +327,8 @@ function parseIncoming(msg) {
327327

328328
hide("constellationSbas"); //Not supported on LG290P
329329
show("constellationNavic");
330-
hide("galileoHasSetting"); //Not supported on LG290P
331-
show("useMSM7Setting");
330+
show("galileoHasSetting");
331+
show("lg290pGnssSettings");
332332
hide("tiltConfig"); //Not supported on Torch X2
333333

334334
show("measurementRateInput");
@@ -341,8 +341,8 @@ function parseIncoming(msg) {
341341
hide("enableNmeaOnRadio");
342342

343343
hide("dynamicModelDropdown"); //Not supported on LG290P
344-
hide("minElevConfig"); //Not supported on LG290P
345-
hide("minCNOConfig"); //Not supported on LG290P
344+
show("minElevConfig");
345+
show("minCNOConfig");
346346

347347
ge("rtcmRateInfoText").setAttribute('data-bs-original-title', 'RTCM is transmitted by the base at a default of 1Hz for messages 1005, 1074, 1084, 1094, 1124, and 0.1Hz for 1033. This can be lowered for radios with low bandwidth or tailored to transmit any/all RTCM messages. Limits: 0 to 20. Note: The measurement rate is overridden to 1Hz when in Base mode.');
348348

@@ -714,6 +714,13 @@ function show(id) {
714714
ge(id).style.display = "block";
715715
}
716716

717+
function isElementShown(id) {
718+
if (ge(id).style.display == "block") {
719+
return (true);
720+
}
721+
return (false);
722+
}
723+
717724
//Create CSV of all setting data
718725
function sendData() {
719726
var settingCSV = "";
@@ -841,6 +848,9 @@ function validateFields() {
841848

842849
checkElementValue("minElev", 0, 90, "Must be between 0 and 90", "collapseGNSSConfig");
843850
checkElementValue("minCNO", 0, 90, "Must be between 0 and 90", "collapseGNSSConfig");
851+
if (isElementShown("lg290pGnssSettings") == true) {
852+
checkElementValue("rtcmMinElev", -90, 90, "Must be between -90 and 90", "collapseGNSSConfig");
853+
}
844854

845855
if (ge("enableNtripClient").checked == true) {
846856
checkElementString("ntripClientCasterHost", 1, 45, "Must be 1 to 45 characters", "collapseGNSSConfig");

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ void GNSS_LG290P::begin()
116116
lg290pFirmwareVersion, gnssFirmwareVersion);
117117

118118
// Determine if the "LG290P03AANR01A03S_PPP_TEMP0812 2025/08/12" firmware is present
119-
// This version has support for testing out E6/HAS PPP, but confusingly was released after v05.
119+
// Or "LG290P03AANR01A06S_PPP_TEMP0829 2025/08/29 17:08:39"
120+
// The 03S_PPP_TEMP version has support for testing out E6/HAS PPP, but confusingly was released after v05.
120121
if (strstr(gnssFirmwareVersion, "PPP_TEMP") != nullptr)
121122
{
122123
present.galileoHasCapable = true;
@@ -793,6 +794,8 @@ bool GNSS_LG290P::enableRTCMBase()
793794

794795
int portNumber = 1;
795796

797+
int minimumRtcmRate = 1000;
798+
796799
while (portNumber < 4)
797800
{
798801
for (int messageNumber = 0; messageNumber < MAX_LG290P_RTCM_MSG; messageNumber++)
@@ -843,7 +846,12 @@ bool GNSS_LG290P::enableRTCMBase()
843846

844847
// If any message is enabled, enable RTCM output
845848
if (settings.lg290pMessageRatesRTCMBase[messageNumber] > 0)
849+
{
846850
enableRTCM = true;
851+
// Capture the message with the lowest rate
852+
if (settings.lg290pMessageRatesRTCMBase[messageNumber] < minimumRtcmRate)
853+
minimumRtcmRate = settings.lg290pMessageRatesRTCMBase[messageNumber];
854+
}
847855
}
848856
}
849857

@@ -857,11 +865,14 @@ bool GNSS_LG290P::enableRTCMBase()
857865
if (enableRTCM == true)
858866
{
859867
if (settings.debugGnss)
860-
systemPrintln("Enabling Base RTCM output");
868+
systemPrintf("Enabling Base RTCM MSM%c output with rate of %d\r\n",
869+
settings.useMSM7 ? '7' : '4', minimumRtcmRate);
861870

862871
// PQTMCFGRTCM fails to respond with OK over UART2 of LG290P, so don't look for it
863872
char cfgRtcm[40];
864-
snprintf(cfgRtcm, sizeof(cfgRtcm), "PQTMCFGRTCM,W,%c,0,-90,07,06,2,1", settings.useMSM7 ? '7' : '4');
873+
snprintf(cfgRtcm, sizeof(cfgRtcm), "PQTMCFGRTCM,W,%c,0,%d,07,06,2,%d",
874+
settings.useMSM7 ? '7' : '4', settings.rtcmMinElev,
875+
minimumRtcmRate);
865876
_lg290p->sendOkCommand(
866877
cfgRtcm); // Enable MSM4/7, output regular intervals, interval (seconds)
867878
}
@@ -1016,15 +1027,16 @@ bool GNSS_LG290P::enableRTCMRover()
10161027
if (enableRTCM == true)
10171028
{
10181029
if (settings.debugCorrections)
1019-
systemPrintf("Enabling Rover RTCM MSM output with rate of %d\r\n", minimumRtcmRate);
1030+
systemPrintf("Enabling Rover RTCM MSM%c output with rate of %d\r\n",
1031+
settings.useMSM7 ? '7' : '4', minimumRtcmRate);
10201032

10211033
// Enable MSM4/7 (for faster PPP CSRS results), output at a rate equal to the minimum RTCM rate (EPH Mode = 2)
10221034
// PQTMCFGRTCM, W, <MSM_Type>, <MSM_Mode>, <MSM_ElevThd>, <Reserved>, <Reserved>, <EPH_Mode>, <EPH_Interval>
10231035
// Set MSM_ElevThd to 15 degrees from rftop suggestion
10241036

10251037
char msmCommand[40] = {0};
1026-
snprintf(msmCommand, sizeof(msmCommand), "PQTMCFGRTCM,W,%c,0,15,07,06,2,%d",
1027-
settings.useMSM7 ? '7' : '4', minimumRtcmRate);
1038+
snprintf(msmCommand, sizeof(msmCommand), "PQTMCFGRTCM,W,%c,0,%d,07,06,2,%d",
1039+
settings.useMSM7 ? '7' : '4', settings.rtcmMinElev, minimumRtcmRate);
10281040

10291041
// PQTMCFGRTCM fails to respond with OK over UART2 of LG290P, so don't look for it
10301042
_lg290p->sendOkCommand(msmCommand);
@@ -1921,6 +1933,8 @@ void GNSS_LG290P::menuMessages()
19211933

19221934
if (namedSettingAvailableOnPlatform("useMSM7")) // Redundant - but good practice for code reuse
19231935
systemPrintf("13) MSM Selection: MSM%c\r\n", settings.useMSM7 ? '7' : '4');
1936+
if (namedSettingAvailableOnPlatform("rtcmMinElev")) // Redundant - but good practice for code reuse
1937+
systemPrintf("14) Minimum Elevation for RTCM: %d\r\n", settings.rtcmMinElev);
19241938

19251939
systemPrintln("x) Exit");
19261940

@@ -1997,6 +2011,17 @@ void GNSS_LG290P::menuMessages()
19972011
}
19982012
else if ((incoming == 13) && (namedSettingAvailableOnPlatform("useMSM7"))) // Redundant - but good practice for code reuse)
19992013
settings.useMSM7 ^= 1;
2014+
else if ((incoming == 14) && (namedSettingAvailableOnPlatform("rtcmMinElev")))
2015+
{
2016+
systemPrintf("Enter minimum elevation for RTCM: ");
2017+
2018+
int elevation = getUserInputNumber(); // Returns EXIT, TIMEOUT, or long
2019+
2020+
if (elevation >= -90 && elevation <= 90)
2021+
{
2022+
settings.rtcmMinElev = elevation;
2023+
}
2024+
}
20002025

20012026
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
20022027
break;
@@ -2353,7 +2378,7 @@ bool GNSS_LG290P::setHighAccuracyService(bool enableGalileoHas)
23532378
{
23542379
bool result = true;
23552380

2356-
// E6 reception requires version v03 with 'PPP_TEMP' in firmware title
2381+
// E6 reception requires version v03/v06 with 'PPP_TEMP' in firmware title
23572382
// Present is set during LG290P begin()
23582383
if (present.galileoHasCapable == false)
23592384
return (result); // We are unable to set this setting to report success

Firmware/RTK_Everywhere/menuMessages.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ void menuMessagesBaseRTCM()
232232

233233
if (namedSettingAvailableOnPlatform("useMSM7"))
234234
systemPrintf("4) MSM Selection: MSM%c\r\n", settings.useMSM7 ? '7' : '4');
235+
if (namedSettingAvailableOnPlatform("rtcmMinElev"))
236+
systemPrintf("5) Minimum Elevation for RTCM: %d\r\n", settings.rtcmMinElev);
235237

236238
systemPrintln("x) Exit");
237239

@@ -261,6 +263,18 @@ void menuMessagesBaseRTCM()
261263
settings.useMSM7 ^= 1;
262264
restartBase = true;
263265
}
266+
else if ((incoming == 5) && (namedSettingAvailableOnPlatform("rtcmMinElev")))
267+
{
268+
systemPrintf("Enter minimum elevation for RTCM: ");
269+
270+
int elevation = getUserInputNumber(); // Returns EXIT, TIMEOUT, or long
271+
272+
if (elevation >= -90 && elevation <= 90)
273+
{
274+
settings.rtcmMinElev = elevation;
275+
restartBase = true;
276+
}
277+
}
264278

265279
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
266280
break;
@@ -872,7 +886,7 @@ void checkGNSSArrayDefaults()
872886
}
873887
else if (present.gnss_lg290p)
874888
{
875-
// settings.minCNO = 10; // Not yet supported
889+
settings.minCNO = 10; // Default 10 dBHz
876890
settings.surveyInStartingAccuracy = 2.0; // Default 2m
877891
settings.measurementRateMs = 500; // Default 2Hz.
878892
}

Firmware/RTK_Everywhere/settings.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ struct Settings
697697
// ZED (it has separate messages for MSM4 vs. MSM7)
698698
// UM980 (it has separate messages for MSM4 vs. MSM7)
699699
bool useMSM7 = false;
700+
int rtcmMinElev = -90; // LG290P - minimum elevation for RTCM (PQTMCFGRTCM)
700701

701702
// Battery
702703
bool enablePrintBatteryMessages = true;
@@ -1023,7 +1024,7 @@ struct Settings
10231024
bool enableImuCompensationDebug = false;
10241025
bool enableImuDebug = false; // Turn on to display IMU library debug messages
10251026
bool enableTiltCompensation = true; // Allow user to disable tilt compensation on the models that have an IMU
1026-
bool enableGalileoHas = true; // Allow E6 corrections if possible
1027+
bool enableGalileoHas = true; // Allow E6 corrections if possible. Also needed on LG290P
10271028
#ifdef COMPILE_UM980
10281029
uint8_t um980Constellations[MAX_UM980_CONSTELLATIONS] = {254}; // Mark first record with key so defaults will be applied.
10291030
float um980MessageRatesNMEA[MAX_UM980_NMEA_MSG] = {254}; // Mark first record with key so defaults will be applied.
@@ -1203,6 +1204,7 @@ typedef enum
12031204
ALL = (1 << 5) - 1, // ALL - must be the highest single variant
12041205
ZED = ZF9 | ZX2, // Hybrids are possible (enums don't have to be consecutive)
12051206
MSM = L29, // Platforms which require parameter selection of MSM7 over MSM4
1207+
HAS = L29, // Platforms which support Galileo HAS
12061208
} Facet_Flex_Variant;
12071209

12081210
typedef bool (* AFTER_CMD)(int cmdIndex);
@@ -1323,7 +1325,7 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
13231325
// n a f t s o B c F h
13241326
// f n f E a r a a l
13251327
// i d i v V i c n r e X
1326-
// g s x k 2 c h d d x 2 Type Qual Variable Name
1328+
// g s x k 2 c h d d x 2 Type Qual Variable Name afterSetCmd
13271329

13281330
// Antenna
13291331
{ 1, 1, 0, 1, 1, 1, 1, 1, 1, ALL, 1, _int16_t, 0, & settings.antennaHeight_mm, "antennaHeight_mm", nullptr, },
@@ -1345,6 +1347,7 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
13451347
{ 1, 1, 0, 1, 1, 1, 1, 1, 1, ALL, 1, _float, 2, & settings.observationPositionAccuracy, "observationPositionAccuracy", nullptr, },
13461348
{ 0, 1, 0, 1, 1, 0, 1, 1, 1, ALL, 1, _float, 1, & settings.surveyInStartingAccuracy, "surveyInStartingAccuracy", nullptr, },
13471349
{ 0, 1, 0, 0, 0, 0, 0, 0, 1, MSM, 1, _bool, 0, & settings.useMSM7, "useMSM7", nullptr, },
1350+
{ 0, 1, 0, 0, 0, 0, 0, 0, 1, MSM, 1, _int, 0, & settings.rtcmMinElev, "rtcmMinElev", nullptr, },
13481351

13491352
// Battery
13501353
{ 0, 0, 0, 0, 1, 1, 1, 1, 1, ALL, 1, _bool, 0, & settings.enablePrintBatteryMessages, "enablePrintBatteryMessages", nullptr, },
@@ -1782,7 +1785,7 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
17821785
// g s x k 2 c h d d x 2 Type Qual Variable Name afterSetCmd
17831786

17841787
// UM980 GNSS Receiver - TODO these apply to more than UM980
1785-
{ 1, 1, 0, 0, 0, 0, 1, 0, 1, NON, 1, _bool, 0, & settings.enableGalileoHas, "enableGalileoHas", nullptr, },
1788+
{ 1, 1, 0, 0, 0, 0, 1, 0, 1, HAS, 1, _bool, 0, & settings.enableGalileoHas, "enableGalileoHas", nullptr, },
17861789
{ 1, 1, 0, 0, 0, 0, 1, 0, 0, ALL, 0, _bool, 3, & settings.enableMultipathMitigation, "enableMultipathMitigation", nullptr, },
17871790
{ 0, 0, 0, 0, 0, 0, 1, 0, 0, ALL, 0, _bool, 0, & settings.enableImuCompensationDebug, "enableImuCompensationDebug", nullptr, },
17881791
{ 0, 0, 0, 0, 0, 0, 1, 0, 0, ALL, 0, _bool, 0, & settings.enableImuDebug, "enableImuDebug", nullptr, },

0 commit comments

Comments
 (0)