Skip to content

Commit f410748

Browse files
committed
Add support for elevation and CNR.
1 parent b523e86 commit f410748

File tree

4 files changed

+47
-9
lines changed

4 files changed

+47
-9
lines changed

.github/workflows/compile-rtk-everywhere.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
"SparkFun u-blox PointPerfect Library"@1.11.4
9595
"SparkFun IM19 IMU Arduino Library"@1.0.1
9696
"SparkFun UM980 Triband RTK GNSS Arduino Library"@1.0.4
97-
"SparkFun LG290P Quadband RTK GNSS Arduino Library"@1.0.2
97+
"SparkFun LG290P Quadband RTK GNSS Arduino Library"@1.0.5
9898
"SparkFun I2C Expander Arduino Library"@1.0.1
9999

100100
- name: Patch libmbedtls

Firmware/RTK_Everywhere/Begin.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,10 @@ void beginBoard()
702702
present.gpioExpander = true;
703703
present.microSdCardDetectGpioExpanderHigh = true; // CD is on GPIO 5 of expander. High = SD in place.
704704

705+
//We can't enable here because we don't know if lg290pFirmwareVersion is >= v05
706+
//present.minElevation = true;
707+
//present.minCno = true;
708+
705709
pin_I2C0_SDA = 7;
706710
pin_I2C0_SCL = 20;
707711

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,22 @@ void GNSS_LG290P::begin()
122122
"firmware on your LG290P to allow for these features. Please see https://bit.ly/sfe-rtk-lg290p-update\r\n",
123123
lg290pFirmwareVersion, gnssFirmwareVersion);
124124
}
125+
if (lg290pFirmwareVersion < 5)
126+
{
127+
systemPrintf(
128+
"Current LG290P firmware: v%d (full form: %s). Elevation and CNR mask configuration require v5 or newer. "
129+
"Please "
130+
"update the "
131+
"firmware on your LG290P to allow for these features. Please see https://bit.ly/sfe-rtk-lg290p-update\r\n",
132+
lg290pFirmwareVersion, gnssFirmwareVersion);
133+
}
134+
135+
if (lg290pFirmwareVersion >= 5)
136+
{
137+
// Supported starting in v05
138+
present.minElevation = true;
139+
present.minCno = true;
140+
}
125141

126142
printModuleInfo();
127143

@@ -323,6 +339,10 @@ bool GNSS_LG290P::configureRover()
323339
systemPrintln("configureRover: Set mode rover failed");
324340
}
325341

342+
response &= setElevation(settings.minElev);
343+
344+
response &= setMinCnoRadio(settings.minCNO);
345+
326346
// Set the fix rate. Default on LG290P is 10Hz so set accordingly.
327347
response &= setRate(settings.measurementRateMs / 1000.0); // May require save/reset
328348
if (settings.debugGnss && response == false)
@@ -432,6 +452,10 @@ bool GNSS_LG290P::configureBase()
432452
systemPrintln("configureBase: disable survey in failed");
433453
}
434454

455+
response &= setElevation(settings.minElev);
456+
457+
response &= setMinCnoRadio(settings.minCNO);
458+
435459
response &= enableRTCMBase(); // Set RTCM messages
436460
if (settings.debugGnss && response == false)
437461
systemPrintln("configureBase: Enable RTCM failed");
@@ -514,7 +538,8 @@ bool GNSS_LG290P::enterConfigMode(unsigned long waitForSemaphoreTimeout_millis)
514538
{
515539
unsigned long start = millis();
516540
bool isBlocking;
517-
do { // Wait for up to waitForSemaphoreTimeout for library to stop blocking
541+
do
542+
{ // Wait for up to waitForSemaphoreTimeout for library to stop blocking
518543
isBlocking = _lg290p->isBlocking();
519544
} while (isBlocking && (millis() < (start + waitForSemaphoreTimeout_millis)));
520545

@@ -1837,7 +1862,8 @@ void GNSS_LG290P::printModuleInfo()
18371862
std::string version, buildDate, buildTime;
18381863
if (_lg290p->getVersionInfo(version, buildDate, buildTime))
18391864
{
1840-
systemPrintf("LG290P version: v%02d - %s %s %s - v%d\r\n", lg290pFirmwareVersion, version.c_str(), buildDate.c_str(), buildTime.c_str());
1865+
systemPrintf("LG290P version: v%02d - %s %s %s - v%d\r\n", lg290pFirmwareVersion, version.c_str(),
1866+
buildDate.c_str(), buildTime.c_str());
18411867
}
18421868
else
18431869
{
@@ -1975,8 +2001,12 @@ bool GNSS_LG290P::setCorrRadioExtPort(bool enable, bool force)
19752001
//----------------------------------------
19762002
bool GNSS_LG290P::setElevation(uint8_t elevationDegrees)
19772003
{
1978-
// Not a feature on LG290p
1979-
return false;
2004+
// Present on >= v05
2005+
if (lg290pFirmwareVersion >= 5)
2006+
return(_lg290p->setElevationAngle(elevationDegrees));
2007+
2008+
// Because we call this during module setup we rely on a positive result
2009+
return true;
19802010
}
19812011

19822012
//----------------------------------------
@@ -2005,8 +2035,12 @@ bool GNSS_LG290P::setMessagesUsb(int maxRetries)
20052035
//----------------------------------------
20062036
bool GNSS_LG290P::setMinCnoRadio(uint8_t cnoValue)
20072037
{
2008-
// Not a feature on LG290p
2009-
return false;
2038+
// Present on >= v05
2039+
if (lg290pFirmwareVersion >= 5)
2040+
return(_lg290p->setCNR((float)cnoValue)); // 0.0 to 99.0
2041+
2042+
// Because we call this during module setup we rely on a positive result
2043+
return true;
20102044
}
20112045

20122046
//----------------------------------------

Firmware/RTK_Everywhere/settings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,8 +1775,8 @@ struct struct_present
17751775
float antennaPhaseCenter_mm = 0.0; // Used to setup tilt compensation
17761776
bool galileoHasCapable = false; // UM980 has HAS capabilities
17771777
bool multipathMitigation = false; // UM980 has MPM, other platforms do not
1778-
bool minCno = false; // ZED, mosaic, UM980 have minCN0. LG290P does not.
1779-
bool minElevation = false; // ZED, mosaic, UM980 have minElevation. LG290P does not.
1778+
bool minCno = false; // ZED, mosaic, UM980 have minCN0. LG290P does on version >= v5.
1779+
bool minElevation = false; // ZED, mosaic, UM980 have minElevation. LG290P does on versions >= v5.
17801780
bool dynamicModel = false; // ZED, mosaic, UM980 have dynamic models. LG290P does not.
17811781
} present;
17821782

0 commit comments

Comments
 (0)