Skip to content

Commit d18ea8f

Browse files
committed
settings.configurePPP : use spaces not commas
1 parent 451b3d5 commit d18ea8f

File tree

5 files changed

+54
-6
lines changed

5 files changed

+54
-6
lines changed

Firmware/RTK_Everywhere/AP-Config/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,12 @@
363363
</span>
364364
</div>
365365
<div class="form-group row">
366-
<label for="configurePPP" class="box-margin20 col-sm-3 col-5 col-form-label">Configure
367-
PPP:</label>
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>
368372
<div class="col-sm-8 col-6">
369373
<input type="text" class="form-control" id="configurePPP">
370374
<p id="configurePPPError" class="inlineError"></p>

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ function validateFields() {
877877
checkElementValue("rtcmMinElev", -90, 90, "Must be between -90 and 90", "collapseGNSSConfig");
878878
}
879879
if (ge("enableGalileoHas").checked == true) {
880-
checkElementString("configurePPP", 1, 30, "Must be 1 to 30 characters", "collapseGNSSConfig");
880+
checkElementStringSpacesNoCommas("configurePPP", 1, 30, "Must be 1 to 30 characters. Separated by spaces. Commas not allowed", "collapseGNSSConfig");
881881
}
882882
if (ge("enableNtripClient").checked == true) {
883883
checkElementString("ntripClientCasterHost", 1, 45, "Must be 1 to 45 characters", "collapseGNSSConfig");
@@ -1381,6 +1381,19 @@ function checkElementString(id, min, max, errorText, collapseID) {
13811381
clearError(id);
13821382
}
13831383

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+
13841397
function checkElementIPAddress(id, errorText, collapseID) {
13851398
value = ge(id).value;
13861399
var data = value.split('.');

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,28 @@ void GNSS_LG290P::menuConstellations()
19331933
}
19341934
else if ((incoming == MAX_LG290P_CONSTELLATIONS + 2) && present.galileoHasCapable && settings.enableGalileoHas)
19351935
{
1936-
getUserInputString(settings.configurePPP, sizeof(settings.configurePPP));
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);
19371958
}
19381959
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
19391960
break;
@@ -2437,7 +2458,7 @@ bool GNSS_LG290P::setHighAccuracyService(bool enableGalileoHas, const char *conf
24372458
// $PQTMCFGPPP,W,2,1,120,0.10,0.15*68
24382459
// Enable E6 HAS, WGS84, 120 timeout, 0.10m Horizontal convergence accuracy threshold, 0.15m Vertical threshold
24392460
char paramConfigurePPP[sizeof(settings.configurePPP) + 4];
2440-
snprintf(paramConfigurePPP, sizeof(paramConfigurePPP), ",W,%s", configurePPP);
2461+
snprintf(paramConfigurePPP, sizeof(paramConfigurePPP), ",W,%s", configPppSpacesToCommas(configurePPP));
24412462
if (_lg290p->sendOkCommand("$PQTMCFGPPP", paramConfigurePPP) == true)
24422463
{
24432464
systemPrintln("Galileo E6 HAS service enabled");

Firmware/RTK_Everywhere/settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +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
1114+
char configurePPP[30] = "2 1 120 0.10 0.15"; // PQTMCFGPPP: 2,1,120,0.10,0.15 ** Use spaces, not commas! **
11151115
#endif // COMPILE_LG290P
11161116

11171117
bool debugSettings = false;

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)