Skip to content

Commit 4d13e84

Browse files
committed
Add useMSM7 - see #735
1 parent 39ed7b9 commit 4d13e84

File tree

6 files changed

+83
-4
lines changed

6 files changed

+83
-4
lines changed

Firmware/RTK_Everywhere/AP-Config/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,17 @@
363363
</div>
364364
</div>
365365

366+
<div id="useMSM7Setting">
367+
<div class="form-check mt-3">
368+
<label class="form-check-label" for="useMSM7">MSM7 RTCM Selection</label>
369+
<input class="form-check-input" type="checkbox" value="" id="useMSM7">
370+
<span class="tt" data-bs-placement="right"
371+
title="Use MSM7 format RTCM mesages. Default: Disabled (MSM4).">
372+
<span class="icon-info-circle text-primary ms-2"></span>
373+
</span>
374+
</div>
375+
</div>
376+
366377
<div class="form-check mt-3">
367378
<label class="form-check-label" for="enableNtripClient">Enable NTRIP Client</label>
368379
<input class="form-check-input" type="checkbox" value="" id="enableNtripClient">

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ function parseIncoming(msg) {
112112
hide("externalPortOptions");
113113
show("logToSDCard");
114114
hide("galileoHasSetting");
115+
hide("useMSM7Setting");
115116
hide("tiltConfig");
116117
hide("beeperControl");
117118
show("measurementRateInput");
@@ -145,6 +146,7 @@ function parseIncoming(msg) {
145146
show("externalPortOptions");
146147
show("logToSDCard");
147148
hide("galileoHasSetting");
149+
hide("useMSM7Setting");
148150
hide("tiltConfig");
149151
hide("beeperControl");
150152
show("measurementRateInput");
@@ -165,6 +167,7 @@ function parseIncoming(msg) {
165167
show("externalPortOptions");
166168
show("logToSDCard");
167169
hide("galileoHasSetting");
170+
hide("useMSM7Setting");
168171
hide("tiltConfig");
169172
hide("beeperControl");
170173
hide("measurementRateInput");
@@ -255,6 +258,7 @@ function parseIncoming(msg) {
255258
show("logToSDCard");
256259

257260
hide("galileoHasSetting");
261+
show("useMSM7Setting");
258262
hide("tiltConfig");
259263
hide("beeperControl");
260264

@@ -324,6 +328,7 @@ function parseIncoming(msg) {
324328
hide("constellationSbas"); //Not supported on LG290P
325329
show("constellationNavic");
326330
hide("galileoHasSetting"); //Not supported on LG290P
331+
show("useMSM7Setting");
327332
hide("tiltConfig"); //Not supported on Torch X2
328333

329334
show("measurementRateInput");

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,10 @@ bool GNSS_LG290P::enableRTCMBase()
860860
systemPrintln("Enabling Base RTCM output");
861861

862862
// PQTMCFGRTCM fails to respond with OK over UART2 of LG290P, so don't look for it
863+
char cfgRtcm[40];
864+
snprintf(cfgRtcm, sizeof(cfgRtcm), "PQTMCFGRTCM,W,%c,0,-90,07,06,2,1", settings.useMSM7 ? '7' : '4');
863865
_lg290p->sendOkCommand(
864-
"PQTMCFGRTCM,W,4,0,-90,07,06,2,1"); // Enable MSM4, output regular intervals, interval (seconds)
866+
cfgRtcm); // Enable MSM4/7, output regular intervals, interval (seconds)
865867
}
866868

867869
return (response);
@@ -1016,12 +1018,13 @@ bool GNSS_LG290P::enableRTCMRover()
10161018
if (settings.debugCorrections)
10171019
systemPrintf("Enabling Rover RTCM MSM output with rate of %d\r\n", minimumRtcmRate);
10181020

1019-
// Enable MSM7 (for faster PPP CSRS results), output at a rate equal to the minimum RTCM rate (EPH Mode = 2)
1021+
// Enable MSM4/7 (for faster PPP CSRS results), output at a rate equal to the minimum RTCM rate (EPH Mode = 2)
10201022
// PQTMCFGRTCM, W, <MSM_Type>, <MSM_Mode>, <MSM_ElevThd>, <Reserved>, <Reserved>, <EPH_Mode>, <EPH_Interval>
10211023
// Set MSM_ElevThd to 15 degrees from rftop suggestion
10221024

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

10261029
// PQTMCFGRTCM fails to respond with OK over UART2 of LG290P, so don't look for it
10271030
_lg290p->sendOkCommand(msmCommand);
@@ -1915,6 +1918,10 @@ void GNSS_LG290P::menuMessages()
19151918
systemPrintln("11) Reset to PPP Logging (NMEAx7 / RTCMx4 - 30 second decimation)");
19161919
systemPrintln("12) Reset to High-rate PPP Logging (NMEAx7 / RTCMx4 - 1Hz)");
19171920

1921+
1922+
if (namedSettingAvailableOnPlatform("useMSM7")) // Redundant - but good practice for code reuse
1923+
systemPrintf("13) MSM Selection: MSM%c\r\n", settings.useMSM7 ? '7' : '4');
1924+
19181925
systemPrintln("x) Exit");
19191926

19201927
int incoming = getUserInputNumber(); // Returns EXIT, TIMEOUT, or long
@@ -1988,6 +1995,8 @@ void GNSS_LG290P::menuMessages()
19881995
systemPrintln("Reset to PPP Logging Defaults (NMEAx7 / RTCMx4 - 30 second decimation)");
19891996
}
19901997
}
1998+
else if ((incoming == 13) && (namedSettingAvailableOnPlatform("useMSM7"))) // Redundant - but good practice for code reuse)
1999+
settings.useMSM7 ^= 1;
19912000

19922001
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
19932002
break;

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3764,6 +3764,27 @@ bool settingAvailableOnPlatform(int i)
37643764
return true;
37653765
}
37663766

3767+
// Determine if the named setting is available on this platform
3768+
// Note: this does a simple 1:1 comparison of settingName and
3769+
// rtkSettingsEntries[].name. It doesn't handle suffixes.
3770+
bool namedSettingAvailableOnPlatform(const char *settingName)
3771+
{
3772+
// Loop through the settings entries
3773+
int rtkIndex;
3774+
for (rtkIndex = 0; rtkIndex < numRtkSettingsEntries; rtkIndex++)
3775+
{
3776+
const char *command = rtkSettingsEntries[rtkIndex].name;
3777+
3778+
if (strcmp(command, settingName) == 0) // match found
3779+
break;
3780+
}
3781+
3782+
if (rtkIndex == numRtkSettingsEntries)
3783+
return false; // Not found
3784+
3785+
return settingAvailableOnPlatform(rtkIndex);
3786+
}
3787+
37673788
// Determine if the setting is possible on this platform
37683789
bool settingPossibleOnPlatform(int i)
37693790
{

Firmware/RTK_Everywhere/menuMessages.ino

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ void menuMessagesBaseRTCM()
230230
systemPrintf("2) Reset to Defaults (%s)\r\n", gnss->getRtcmDefaultString());
231231
systemPrintf("3) Reset to Low Bandwidth Link (%s)\r\n", gnss->getRtcmLowDataRateString());
232232

233+
if (namedSettingAvailableOnPlatform("useMSM7"))
234+
systemPrintf("4) MSM Selection: MSM%c\r\n", settings.useMSM7 ? '7' : '4');
235+
233236
systemPrintln("x) Exit");
234237

235238
int incoming = getUserInputNumber(); // Returns EXIT, TIMEOUT, or long
@@ -253,6 +256,12 @@ void menuMessagesBaseRTCM()
253256
systemPrintf("Reset to Low Bandwidth Link (%s)\r\n", gnss->getRtcmLowDataRateString());
254257
restartBase = true;
255258
}
259+
else if ((incoming == 4) && (namedSettingAvailableOnPlatform("useMSM7")))
260+
{
261+
settings.useMSM7 ^= 1;
262+
restartBase = true;
263+
}
264+
256265
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
257266
break;
258267
else if (incoming == INPUT_RESPONSE_GETNUMBER_TIMEOUT)

Firmware/RTK_Everywhere/settings.h

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,14 @@ struct Settings
687687
int observationSeconds = 60; // Default survey in time of 60 seconds
688688
float observationPositionAccuracy = 5.0; // Default survey in pos accy of 5m
689689
float surveyInStartingAccuracy = 1.0; // Wait for this horizontal positional accuracy in meters before starting survey in
690+
// Use MSM7 over MSM4: on platforms where that is possible and where it requires parameter selection
691+
// Needed on:
692+
// LG290P (PQTMCFGRTCM)
693+
// Not needed on:
694+
// mosaic-X5 (it has MSM4 and MSM7 message groups)
695+
// ZED (it has separate messages for MSM4 vs. MSM7)
696+
// UM980 (it has separate messages for MSM4 vs. MSM7)
697+
bool useMSM7 = false;
690698

691699
// Battery
692700
bool enablePrintBatteryMessages = true;
@@ -1192,6 +1200,7 @@ typedef enum
11921200
ZX2 = (1 << 4), // ZED-X20P - Tilt TBC
11931201
ALL = (1 << 5) - 1, // ALL - must be the highest single variant
11941202
ZED = ZF9 | ZX2, // Hybrids are possible (enums don't have to be consecutive)
1203+
MSM = L29, // Platforms which require parameter selection of MSM7 over MSM4
11951204
} Facet_Flex_Variant;
11961205

11971206
typedef struct
@@ -1264,7 +1273,6 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
12641273
// i d i v V i c n r e X
12651274
// g s x k 2 c h d d x 2 Type Qual Variable Name
12661275

1267-
12681276
// =======================================================================================================
12691277
// Priority Settings which are not alphabetized in commandIndex
12701278
// =======================================================================================================
@@ -1297,6 +1305,21 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
12971305
// Everything below here will be sorted (alphabetized) in commandIndex
12981306
// =======================================================================================================
12991307

1308+
// F
1309+
// a
1310+
// F c
1311+
// i a e
1312+
// n i c t
1313+
// W n u e
1314+
// e C s F t V P T
1315+
// b o e a 2 o o
1316+
// C m S c M s r
1317+
// o m u e o T L t c
1318+
// n a f t s o B c F h
1319+
// f n f E a r a a l
1320+
// i d i v V i c n r e X
1321+
// g s x k 2 c h d d x 2 Type Qual Variable Name
1322+
13001323
// Antenna
13011324
{ 1, 1, 0, 1, 1, 1, 1, 1, 1, ALL, 1, _int16_t, 0, & settings.antennaHeight_mm, "antennaHeight_mm", },
13021325
{ 1, 1, 0, 1, 1, 1, 1, 1, 1, ALL, 1, _float, 2, & settings.antennaPhaseCenter_mm, "antennaPhaseCenter_mm" },
@@ -1316,6 +1339,7 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
13161339
{ 1, 1, 0, 1, 1, 1, 1, 1, 1, ALL, 1, _int, 0, & settings.observationSeconds, "observationSeconds", },
13171340
{ 1, 1, 0, 1, 1, 1, 1, 1, 1, ALL, 1, _float, 2, & settings.observationPositionAccuracy, "observationPositionAccuracy", },
13181341
{ 0, 1, 0, 1, 1, 0, 1, 1, 1, ALL, 1, _float, 1, & settings.surveyInStartingAccuracy, "surveyInStartingAccuracy", },
1342+
{ 0, 1, 0, 0, 0, 0, 0, 0, 1, MSM, 1, _bool, 0, & settings.useMSM7, "useMSM7", },
13191343

13201344
// Battery
13211345
{ 0, 0, 0, 0, 1, 1, 1, 1, 1, ALL, 1, _bool, 0, & settings.enablePrintBatteryMessages, "enablePrintBatteryMessages", },

0 commit comments

Comments
 (0)