Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Firmware/RTK_Everywhere/AP-Config/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,18 @@
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</div>
<div class="form-group row">
<label for="configurePPP" class="box-margin20 col-sm-3 col-5 col-form-label">Configure PPP:
<span class="tt" data-bs-placement="right"
title="The configuration string for PPP. Enter values separated by spaces, not commas. Default: 2 1 120 0.10 0.15">
<span class="icon-info-circle text-primary ms-2"></span>
</span>
</label>
<div class="col-sm-8 col-6">
<input type="text" class="form-control" id="configurePPP">
<p id="configurePPPError" class="inlineError"></p>
</div>
</div>
</div>

<div id="lg290pGnssSettings">
Expand Down
17 changes: 16 additions & 1 deletion Firmware/RTK_Everywhere/AP-Config/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,9 @@ function validateFields() {
if (isElementShown("lg290pGnssSettings") == true) {
checkElementValue("rtcmMinElev", -90, 90, "Must be between -90 and 90", "collapseGNSSConfig");
}

if (ge("enableGalileoHas").checked == true) {
checkElementStringSpacesNoCommas("configurePPP", 1, 30, "Must be 1 to 30 characters. Separated by spaces. Commas not allowed", "collapseGNSSConfig");
}
if (ge("enableNtripClient").checked == true) {
checkElementString("ntripClientCasterHost", 1, 45, "Must be 1 to 45 characters", "collapseGNSSConfig");
checkElementValue("ntripClientCasterPort", 1, 99999, "Must be 1 to 99999", "collapseGNSSConfig");
Expand Down Expand Up @@ -1379,6 +1381,19 @@ function checkElementString(id, min, max, errorText, collapseID) {
clearError(id);
}

function checkElementStringSpacesNoCommas(id, min, max, errorText, collapseID) {
value = ge(id).value;
var commas = value.split(',');
var spaces = value.split(' ');
if ((value.length < min) || (value.length > max) || (commas.length > 1) || (spaces.length == 1)) {
ge(id + 'Error').innerHTML = 'Error: ' + errorText;
ge(collapseID).classList.add('show');
errorCount++;
}
else
clearError(id);
}

function checkElementIPAddress(id, errorText, collapseID) {
value = ge(id).value;
var data = value.split('.');
Expand Down
2 changes: 1 addition & 1 deletion Firmware/RTK_Everywhere/GNSS_LG290P.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ class GNSS_LG290P : GNSS
// elevationDegrees: The elevation value in degrees
bool setElevation(uint8_t elevationDegrees);

bool setHighAccuracyService(bool enableGalileoHas);
bool setHighAccuracyService(bool enableGalileoHas, const char *configurePPP);

// Enable all the valid messages for this platform
bool setMessages(int maxRetries);
Expand Down
40 changes: 35 additions & 5 deletions Firmware/RTK_Everywhere/GNSS_LG290P.ino
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ bool GNSS_LG290P::configureRover()
if (settings.debugGnss && response == false)
systemPrintln("configureRover: Set rate failed");

response &= setHighAccuracyService(settings.enableGalileoHas);
response &= setHighAccuracyService(settings.enableGalileoHas, (const char *)settings.configurePPP);

response &= enableRTCMRover();
if (settings.debugGnss && response == false)
Expand Down Expand Up @@ -528,7 +528,7 @@ bool GNSS_LG290P::configureBase()

response &= setMinCnoRadio(settings.minCNO);

response &= setHighAccuracyService(settings.enableGalileoHas);
response &= setHighAccuracyService(settings.enableGalileoHas, (const char *)settings.configurePPP);

response &= enableRTCMBase(); // Set RTCM messages
if (settings.debugGnss && response == false)
Expand Down Expand Up @@ -1912,6 +1912,9 @@ void GNSS_LG290P::menuConstellations()
{
systemPrintf("%d) Galileo E6 Corrections: %s\r\n", MAX_LG290P_CONSTELLATIONS + 1,
settings.enableGalileoHas ? "Enabled" : "Disabled");
if (settings.enableGalileoHas)
systemPrintf("%d) PPP Configuration: \"%s\"\r\n", MAX_LG290P_CONSTELLATIONS + 2,
settings.configurePPP);
}

systemPrintln("x) Exit");
Expand All @@ -1928,6 +1931,31 @@ void GNSS_LG290P::menuConstellations()
{
settings.enableGalileoHas ^= 1;
}
else if ((incoming == MAX_LG290P_CONSTELLATIONS + 2) && present.galileoHasCapable && settings.enableGalileoHas)
{
systemPrintln("Enter the PPP configuration separated by spaces, not commas:");
char newConfig[sizeof(settings.configurePPP)];
getUserInputString(newConfig, sizeof(newConfig));
bool isValid = true;
int spacesSeen = 0;
for (size_t i = 0; i < strlen(newConfig); i++)
{
if ((isValid) && (newConfig[i] == ',')) // Check for no commas
{
systemPrintln("Comma detected. Please try again");
isValid = false;
}
if (newConfig[i] == ' ')
spacesSeen++;
}
if ((isValid) && (spacesSeen < 4)) // Check for at least 4 spaces
{
systemPrintln("Configuration should contain at least 4 spaces");
isValid = false;
}
if (isValid)
snprintf(settings.configurePPP, sizeof(settings.configurePPP), "%s", newConfig);
}
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
break;
else if (incoming == INPUT_RESPONSE_GETNUMBER_TIMEOUT)
Expand All @@ -1939,7 +1967,7 @@ void GNSS_LG290P::menuConstellations()
// Apply current settings to module
gnss->setConstellations();

setHighAccuracyService(settings.enableGalileoHas);
setHighAccuracyService(settings.enableGalileoHas, (const char *)settings.configurePPP);

clearBuffer(); // Empty buffer of any newline chars
}
Expand Down Expand Up @@ -2415,7 +2443,7 @@ bool GNSS_LG290P::setElevation(uint8_t elevationDegrees)
}

//----------------------------------------
bool GNSS_LG290P::setHighAccuracyService(bool enableGalileoHas)
bool GNSS_LG290P::setHighAccuracyService(bool enableGalileoHas, const char *configurePPP)
{
bool result = true;

Expand All @@ -2429,7 +2457,9 @@ bool GNSS_LG290P::setHighAccuracyService(bool enableGalileoHas)
{
// $PQTMCFGPPP,W,2,1,120,0.10,0.15*68
// Enable E6 HAS, WGS84, 120 timeout, 0.10m Horizontal convergence accuracy threshold, 0.15m Vertical threshold
if (_lg290p->sendOkCommand("$PQTMCFGPPP", ",W,2,1,120,0.10,0.15") == true)
char paramConfigurePPP[sizeof(settings.configurePPP) + 4];
snprintf(paramConfigurePPP, sizeof(paramConfigurePPP), ",W,%s", configPppSpacesToCommas(configurePPP));
if (_lg290p->sendOkCommand("$PQTMCFGPPP", paramConfigurePPP) == true)
{
systemPrintln("Galileo E6 HAS service enabled");
}
Expand Down
2 changes: 2 additions & 0 deletions Firmware/RTK_Everywhere/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,7 @@ struct Settings
254}; // Mark first record with key so defaults will be applied. Int value for each supported message - Report
// rates for RTCM Base. Default to Quectel recommended rates.
int lg290pMessageRatesPQTM[MAX_LG290P_PQTM_MSG] = {254}; // Mark first record with key so defaults will be applied.
char configurePPP[30] = "2 1 120 0.10 0.15"; // PQTMCFGPPP: 2,1,120,0.10,0.15 ** Use spaces, not commas! **
#endif // COMPILE_LG290P

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

{ 0, 0, 0, 1, 1, 1, 1, 1, 1, ALL, 1, _bool, 0, & settings.debugSettings, "debugSettings", nullptr, },
Expand Down
10 changes: 10 additions & 0 deletions Firmware/RTK_Everywhere/support.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1208,3 +1208,13 @@ void WeekToWToUnixEpoch(uint64_t *unixEpoch, uint16_t GPSWeek, uint32_t GPSToW)
*unixEpoch += GPSToW; // 518400
*unixEpoch += 315964800;
}

const char *configPppSpacesToCommas(const char *config)
{
static char commas[sizeof(settings.configurePPP)];
snprintf(commas, sizeof(commas), "%s", config);
for (size_t i = 0; i < strlen(commas); i++)
if (commas[i] == ' ')
commas[i] = ',';
return (const char *)commas;
}