Skip to content

Commit 69ea5e0

Browse files
authored
Merge pull request #762 from sparkfun/pcUpdates
Add settings.configurePPP - to resolve issue #756
2 parents 249f9bd + d18ea8f commit 69ea5e0

File tree

6 files changed

+76
-7
lines changed

6 files changed

+76
-7
lines changed

Firmware/RTK_Everywhere/AP-Config/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,18 @@
362362
<span class="icon-info-circle text-primary ms-2"></span>
363363
</span>
364364
</div>
365+
<div class="form-group row">
366+
<label for="configurePPP" class="box-margin20 col-sm-3 col-5 col-form-label">Configure PPP:
367+
<span class="tt" data-bs-placement="right"
368+
title="The configuration string for PPP. Enter values separated by spaces, not commas. Default: 2 1 120 0.10 0.15">
369+
<span class="icon-info-circle text-primary ms-2"></span>
370+
</span>
371+
</label>
372+
<div class="col-sm-8 col-6">
373+
<input type="text" class="form-control" id="configurePPP">
374+
<p id="configurePPPError" class="inlineError"></p>
375+
</div>
376+
</div>
365377
</div>
366378

367379
<div id="lg290pGnssSettings">

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,9 @@ function validateFields() {
876876
if (isElementShown("lg290pGnssSettings") == true) {
877877
checkElementValue("rtcmMinElev", -90, 90, "Must be between -90 and 90", "collapseGNSSConfig");
878878
}
879-
879+
if (ge("enableGalileoHas").checked == true) {
880+
checkElementStringSpacesNoCommas("configurePPP", 1, 30, "Must be 1 to 30 characters. Separated by spaces. Commas not allowed", "collapseGNSSConfig");
881+
}
880882
if (ge("enableNtripClient").checked == true) {
881883
checkElementString("ntripClientCasterHost", 1, 45, "Must be 1 to 45 characters", "collapseGNSSConfig");
882884
checkElementValue("ntripClientCasterPort", 1, 99999, "Must be 1 to 99999", "collapseGNSSConfig");
@@ -1379,6 +1381,19 @@ function checkElementString(id, min, max, errorText, collapseID) {
13791381
clearError(id);
13801382
}
13811383

1384+
function checkElementStringSpacesNoCommas(id, min, max, errorText, collapseID) {
1385+
value = ge(id).value;
1386+
var commas = value.split(',');
1387+
var spaces = value.split(' ');
1388+
if ((value.length < min) || (value.length > max) || (commas.length > 1) || (spaces.length == 1)) {
1389+
ge(id + 'Error').innerHTML = 'Error: ' + errorText;
1390+
ge(collapseID).classList.add('show');
1391+
errorCount++;
1392+
}
1393+
else
1394+
clearError(id);
1395+
}
1396+
13821397
function checkElementIPAddress(id, errorText, collapseID) {
13831398
value = ge(id).value;
13841399
var data = value.split('.');

Firmware/RTK_Everywhere/GNSS_LG290P.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ class GNSS_LG290P : GNSS
450450
// elevationDegrees: The elevation value in degrees
451451
bool setElevation(uint8_t elevationDegrees);
452452

453-
bool setHighAccuracyService(bool enableGalileoHas);
453+
bool setHighAccuracyService(bool enableGalileoHas, const char *configurePPP);
454454

455455
// Enable all the valid messages for this platform
456456
bool setMessages(int maxRetries);

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ bool GNSS_LG290P::configureRover()
412412
if (settings.debugGnss && response == false)
413413
systemPrintln("configureRover: Set rate failed");
414414

415-
response &= setHighAccuracyService(settings.enableGalileoHas);
415+
response &= setHighAccuracyService(settings.enableGalileoHas, (const char *)settings.configurePPP);
416416

417417
response &= enableRTCMRover();
418418
if (settings.debugGnss && response == false)
@@ -528,7 +528,7 @@ bool GNSS_LG290P::configureBase()
528528

529529
response &= setMinCnoRadio(settings.minCNO);
530530

531-
response &= setHighAccuracyService(settings.enableGalileoHas);
531+
response &= setHighAccuracyService(settings.enableGalileoHas, (const char *)settings.configurePPP);
532532

533533
response &= enableRTCMBase(); // Set RTCM messages
534534
if (settings.debugGnss && response == false)
@@ -1912,6 +1912,9 @@ void GNSS_LG290P::menuConstellations()
19121912
{
19131913
systemPrintf("%d) Galileo E6 Corrections: %s\r\n", MAX_LG290P_CONSTELLATIONS + 1,
19141914
settings.enableGalileoHas ? "Enabled" : "Disabled");
1915+
if (settings.enableGalileoHas)
1916+
systemPrintf("%d) PPP Configuration: \"%s\"\r\n", MAX_LG290P_CONSTELLATIONS + 2,
1917+
settings.configurePPP);
19151918
}
19161919

19171920
systemPrintln("x) Exit");
@@ -1928,6 +1931,31 @@ void GNSS_LG290P::menuConstellations()
19281931
{
19291932
settings.enableGalileoHas ^= 1;
19301933
}
1934+
else if ((incoming == MAX_LG290P_CONSTELLATIONS + 2) && present.galileoHasCapable && settings.enableGalileoHas)
1935+
{
1936+
systemPrintln("Enter the PPP configuration separated by spaces, not commas:");
1937+
char newConfig[sizeof(settings.configurePPP)];
1938+
getUserInputString(newConfig, sizeof(newConfig));
1939+
bool isValid = true;
1940+
int spacesSeen = 0;
1941+
for (size_t i = 0; i < strlen(newConfig); i++)
1942+
{
1943+
if ((isValid) && (newConfig[i] == ',')) // Check for no commas
1944+
{
1945+
systemPrintln("Comma detected. Please try again");
1946+
isValid = false;
1947+
}
1948+
if (newConfig[i] == ' ')
1949+
spacesSeen++;
1950+
}
1951+
if ((isValid) && (spacesSeen < 4)) // Check for at least 4 spaces
1952+
{
1953+
systemPrintln("Configuration should contain at least 4 spaces");
1954+
isValid = false;
1955+
}
1956+
if (isValid)
1957+
snprintf(settings.configurePPP, sizeof(settings.configurePPP), "%s", newConfig);
1958+
}
19311959
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
19321960
break;
19331961
else if (incoming == INPUT_RESPONSE_GETNUMBER_TIMEOUT)
@@ -1939,7 +1967,7 @@ void GNSS_LG290P::menuConstellations()
19391967
// Apply current settings to module
19401968
gnss->setConstellations();
19411969

1942-
setHighAccuracyService(settings.enableGalileoHas);
1970+
setHighAccuracyService(settings.enableGalileoHas, (const char *)settings.configurePPP);
19431971

19441972
clearBuffer(); // Empty buffer of any newline chars
19451973
}
@@ -2415,7 +2443,7 @@ bool GNSS_LG290P::setElevation(uint8_t elevationDegrees)
24152443
}
24162444

24172445
//----------------------------------------
2418-
bool GNSS_LG290P::setHighAccuracyService(bool enableGalileoHas)
2446+
bool GNSS_LG290P::setHighAccuracyService(bool enableGalileoHas, const char *configurePPP)
24192447
{
24202448
bool result = true;
24212449

@@ -2429,7 +2457,9 @@ bool GNSS_LG290P::setHighAccuracyService(bool enableGalileoHas)
24292457
{
24302458
// $PQTMCFGPPP,W,2,1,120,0.10,0.15*68
24312459
// Enable E6 HAS, WGS84, 120 timeout, 0.10m Horizontal convergence accuracy threshold, 0.15m Vertical threshold
2432-
if (_lg290p->sendOkCommand("$PQTMCFGPPP", ",W,2,1,120,0.10,0.15") == true)
2460+
char paramConfigurePPP[sizeof(settings.configurePPP) + 4];
2461+
snprintf(paramConfigurePPP, sizeof(paramConfigurePPP), ",W,%s", configPppSpacesToCommas(configurePPP));
2462+
if (_lg290p->sendOkCommand("$PQTMCFGPPP", paramConfigurePPP) == true)
24332463
{
24342464
systemPrintln("Galileo E6 HAS service enabled");
24352465
}

Firmware/RTK_Everywhere/settings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,7 @@ struct Settings
11111111
254}; // Mark first record with key so defaults will be applied. Int value for each supported message - Report
11121112
// rates for RTCM Base. Default to Quectel recommended rates.
11131113
int lg290pMessageRatesPQTM[MAX_LG290P_PQTM_MSG] = {254}; // Mark first record with key so defaults will be applied.
1114+
char configurePPP[30] = "2 1 120 0.10 0.15"; // PQTMCFGPPP: 2,1,120,0.10,0.15 ** Use spaces, not commas! **
11141115
#endif // COMPILE_LG290P
11151116

11161117
bool debugSettings = false;
@@ -1849,6 +1850,7 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
18491850
{ 0, 1, 1, 0, 0, 0, 0, 0, 1, L29, 1, tLgMRBaRT, MAX_LG290P_RTCM_MSG, & settings.lg290pMessageRatesRTCMBase, "messageRateRTCMBase_", gnssCmdUpdateMessageRates, },
18501851
{ 0, 1, 1, 0, 0, 0, 0, 0, 1, L29, 1, tLgMRRvRT, MAX_LG290P_RTCM_MSG, & settings.lg290pMessageRatesRTCMRover, "messageRateRTCMRover_", gnssCmdUpdateMessageRates, },
18511852
{ 0, 1, 1, 0, 0, 0, 0, 0, 1, L29, 1, tLgMRPqtm, MAX_LG290P_PQTM_MSG, & settings.lg290pMessageRatesPQTM, "messageRatePQTM_", gnssCmdUpdateMessageRates, },
1853+
{ 1, 1, 0, 0, 0, 0, 0, 0, 1, L29, 1, tCharArry, sizeof(settings.configurePPP), & settings.configurePPP, "configurePPP", nullptr, },
18521854
#endif // COMPILE_LG290P
18531855

18541856
{ 0, 0, 0, 1, 1, 1, 1, 1, 1, ALL, 1, _bool, 0, & settings.debugSettings, "debugSettings", nullptr, },

Firmware/RTK_Everywhere/support.ino

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,3 +1208,13 @@ void WeekToWToUnixEpoch(uint64_t *unixEpoch, uint16_t GPSWeek, uint32_t GPSToW)
12081208
*unixEpoch += GPSToW; // 518400
12091209
*unixEpoch += 315964800;
12101210
}
1211+
1212+
const char *configPppSpacesToCommas(const char *config)
1213+
{
1214+
static char commas[sizeof(settings.configurePPP)];
1215+
snprintf(commas, sizeof(commas), "%s", config);
1216+
for (size_t i = 0; i < strlen(commas); i++)
1217+
if (commas[i] == ' ')
1218+
commas[i] = ',';
1219+
return (const char *)commas;
1220+
}

0 commit comments

Comments
 (0)