Skip to content

Commit e029e35

Browse files
committed
Add prelim support for PPP logging to Torch/Postcard
1 parent 936db2f commit e029e35

File tree

5 files changed

+178
-2
lines changed

5 files changed

+178
-2
lines changed

Firmware/RTK_Everywhere/GNSS_LG290P.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,18 @@ class GNSS_LG290P : GNSS
111111
// Set the minimum satellite signal level for navigation.
112112
bool setMinCnoRadio(uint8_t cnoValue);
113113

114+
// Set all NMEA message report rates to one value
115+
void setNmeaMessageRates(uint8_t msgRate);
116+
117+
// Given the name of a message, find it, and set the rate
118+
bool setNmeaMessageRateByName(const char *msgName, uint8_t msgRate);
119+
120+
// Set all RTCM Rover message report rates to one value
121+
void setRtcmRoverMessageRates(uint8_t msgRate);
122+
123+
// Given the name of a message, find it, and set the rate
124+
bool setRtcmRoverMessageRateByName(const char *msgName, uint8_t msgRate);
125+
114126
public:
115127
// Constructor
116128
GNSS_LG290P() : GNSS()

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,8 @@ void GNSS_LG290P::menuMessages()
17031703
systemPrintln("4) Set PQTM Messages");
17041704

17051705
systemPrintln("10) Reset to Defaults");
1706+
systemPrintln("11) Reset to PPP Logging (NMEAx1 / RTCMx8 - 30 second decimation)");
1707+
systemPrintln("12) Reset to High-rate PPP Logging (NMEAx1 / RTCMx8 - 1Hz)");
17061708

17071709
systemPrintln("x) Exit");
17081710

@@ -1736,6 +1738,35 @@ void GNSS_LG290P::menuMessages()
17361738

17371739
systemPrintln("Reset to Defaults");
17381740
}
1741+
else if (incoming == 11 || incoming == 12)
1742+
{
1743+
// setMessageRate() on the LG290P sets the output of a message
1744+
// 'Output once every N position fixes'
1745+
1746+
setNmeaMessageRates(0); // Turn off all NMEA messages
1747+
setNmeaMessageRateByName("GGA", 1);
1748+
1749+
setRtcmRoverMessageRates(0); // Turn off all RTCM messages
1750+
setRtcmRoverMessageRateByName("RTCM3-1019", 1);
1751+
setRtcmRoverMessageRateByName("RTCM3-1020", 1);
1752+
setRtcmRoverMessageRateByName("RTCM3-1042", 1);
1753+
setRtcmRoverMessageRateByName("RTCM3-1046", 1);
1754+
setRtcmRoverMessageRateByName("RTCM3-107X", 1);
1755+
setRtcmRoverMessageRateByName("RTCM3-108X", 1);
1756+
setRtcmRoverMessageRateByName("RTCM3-109X", 1);
1757+
setRtcmRoverMessageRateByName("RTCM3-112X", 1);
1758+
1759+
if (incoming == 12)
1760+
{
1761+
setRate(1); // Go to 1 second between desired solution reports
1762+
systemPrintln("Reset to High-rate PPP Logging Defaults (NMEAx1 / RTCMx8 - 1Hz)");
1763+
}
1764+
else
1765+
{
1766+
setRate(30); // Go to 30 seconds between desired solution reports
1767+
systemPrintln("Reset to PPP Logging Defaults (NMEAx1 / RTCMx8 - 30 second decimation)");
1768+
}
1769+
}
17391770

17401771
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
17411772
break;
@@ -2328,6 +2359,50 @@ uint32_t GNSS_LG290P::baudGetMaximum()
23282359
return (lg290pAllowedRates[lg290pAllowedRatesCount - 1]);
23292360
}
23302361

2362+
// Set all NMEA message report rates to one value
2363+
void GNSS_LG290P::setNmeaMessageRates(uint8_t msgRate)
2364+
{
2365+
for (int x = 0; x < MAX_LG290P_NMEA_MSG; x++)
2366+
settings.lg290pMessageRatesNMEA[x] = msgRate;
2367+
}
2368+
2369+
// Set all RTCM Rover message report rates to one value
2370+
void GNSS_LG290P::setRtcmRoverMessageRates(uint8_t msgRate)
2371+
{
2372+
for (int x = 0; x < MAX_LG290P_RTCM_MSG; x++)
2373+
settings.lg290pMessageRatesRTCMRover[x] = msgRate;
2374+
}
2375+
2376+
// Given the name of a message, find it, and set the rate
2377+
bool GNSS_LG290P::setNmeaMessageRateByName(const char *msgName, uint8_t msgRate)
2378+
{
2379+
for (int x = 0; x < MAX_LG290P_NMEA_MSG; x++)
2380+
{
2381+
if (strcmp(lgMessagesNMEA[x].msgTextName, msgName) == 0)
2382+
{
2383+
settings.lg290pMessageRatesNMEA[x] = msgRate;
2384+
return (true);
2385+
}
2386+
}
2387+
systemPrintf("setNmeaMessageRateByName: %s not found\r\n", msgName);
2388+
return (false);
2389+
}
2390+
2391+
// Given the name of a message, find it, and set the rate
2392+
bool GNSS_LG290P::setRtcmRoverMessageRateByName(const char *msgName, uint8_t msgRate)
2393+
{
2394+
for (int x = 0; x < MAX_LG290P_RTCM_MSG; x++)
2395+
{
2396+
if (strcmp(lgMessagesRTCM[x].msgTextName, msgName) == 0)
2397+
{
2398+
settings.lg290pMessageRatesRTCMRover[x] = msgRate;
2399+
return (true);
2400+
}
2401+
}
2402+
systemPrintf("setRtcmRoverMessageRateByName: %s not found\r\n", msgName);
2403+
return (false);
2404+
}
2405+
23312406
//----------------------------------------
23322407
void lg290pBoot()
23332408
{

Firmware/RTK_Everywhere/GNSS_UM980.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,18 @@ class GNSS_UM980 : GNSS
465465
// modelNumber: Number of the model to use, provided by radio library
466466
bool setModel(uint8_t modelNumber);
467467

468+
// Set all NMEA message report rates to one value
469+
void setNmeaMessageRates(uint8_t msgRate);
470+
471+
// Given the name of a message, find it, and set the rate
472+
bool setNmeaMessageRateByName(const char *msgName, uint8_t msgRate);
473+
474+
// Set all RTCM Rover message report rates to one value
475+
void setRtcmRoverMessageRates(uint8_t msgRate);
476+
477+
// Given the name of a message, find it, and set the rate
478+
bool setRtcmRoverMessageRateByName(const char *msgName, uint8_t msgRate);
479+
468480
bool setRadioBaudRate(uint32_t baud);
469481

470482
// Specify the interval between solutions

Firmware/RTK_Everywhere/GNSS_UM980.ino

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,8 @@ void GNSS_UM980::menuMessages()
13311331
systemPrintln("3) Set Base RTCM Messages");
13321332

13331333
systemPrintln("10) Reset to Defaults");
1334+
systemPrintln("11) Reset to PPP Logging (NMEAx1 / RTCMx8 - 30 second decimation)");
1335+
systemPrintln("12) Reset to High-rate PPP Logging (NMEAx1 / RTCMx8 - 1Hz)");
13341336

13351337
systemPrintln("x) Exit");
13361338

@@ -1358,6 +1360,38 @@ void GNSS_UM980::menuMessages()
13581360

13591361
systemPrintln("Reset to Defaults");
13601362
}
1363+
else if (incoming == 11 || incoming == 12)
1364+
{
1365+
// setMessageRate() on the UM980 sets the seconds between reported messages
1366+
// 1, 0.5, 0.2, 0.1 corresponds to 1Hz, 2Hz, 5Hz, 10Hz respectively.
1367+
// Ex: RTCM1005 0.5 <- 2 times per second
1368+
1369+
int reportRate = 30; // Default to 30 seconds between reports
1370+
if (incoming == 12)
1371+
reportRate = 1;
1372+
1373+
setNmeaMessageRates(0); // Turn off all NMEA messages
1374+
setNmeaMessageRateByName("GPGGA", reportRate);
1375+
1376+
setRtcmRoverMessageRates(0); // Turn off all RTCM messages
1377+
setRtcmRoverMessageRateByName("RTCM31019", reportRate);
1378+
setRtcmRoverMessageRateByName("RTCM31020", reportRate);
1379+
setRtcmRoverMessageRateByName("RTCM31042", reportRate);
1380+
setRtcmRoverMessageRateByName("RTCM31046", reportRate);
1381+
setRtcmRoverMessageRateByName("RTCM31074", reportRate);
1382+
setRtcmRoverMessageRateByName("RTCM31084", reportRate);
1383+
setRtcmRoverMessageRateByName("RTCM31094", reportRate);
1384+
setRtcmRoverMessageRateByName("RTCM31124", reportRate);
1385+
1386+
if (incoming == 12)
1387+
{
1388+
systemPrintln("Reset to High-rate PPP Logging (NMEAx1 / RTCMx8 - 1Hz)");
1389+
}
1390+
else
1391+
{
1392+
systemPrintln("Reset to PPP Logging (NMEAx1 / RTCMx8 - 30 second decimation)");
1393+
}
1394+
}
13611395

13621396
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
13631397
break;
@@ -1927,7 +1961,6 @@ uint32_t GNSS_UM980::baudGetMaximum()
19271961
return (um980AllowedRates[um980AllowedRatesCount - 1]);
19281962
}
19291963

1930-
19311964
//----------------------------------------
19321965
// If we have received serial data from the UM980 outside of the Unicore library (ie, from processUart1Message task)
19331966
// we can pass data back into the Unicore library to allow it to update its own variables
@@ -1955,6 +1988,50 @@ void GNSS_UM980::update()
19551988
// We don't check serial data here; the gnssReadTask takes care of serial consumption
19561989
}
19571990

1991+
// Set all NMEA message report rates to one value
1992+
void GNSS_UM980::setNmeaMessageRates(uint8_t msgRate)
1993+
{
1994+
for (int x = 0; x < MAX_UM980_NMEA_MSG; x++)
1995+
settings.um980MessageRatesNMEA[x] = msgRate;
1996+
}
1997+
1998+
// Set all RTCM Rover message report rates to one value
1999+
void GNSS_UM980::setRtcmRoverMessageRates(uint8_t msgRate)
2000+
{
2001+
for (int x = 0; x < MAX_UM980_RTCM_MSG; x++)
2002+
settings.um980MessageRatesRTCMRover[x] = msgRate;
2003+
}
2004+
2005+
// Given the name of a message, find it, and set the rate
2006+
bool GNSS_UM980::setNmeaMessageRateByName(const char *msgName, uint8_t msgRate)
2007+
{
2008+
for (int x = 0; x < MAX_UM980_NMEA_MSG; x++)
2009+
{
2010+
if (strcmp(umMessagesNMEA[x].msgTextName, msgName) == 0)
2011+
{
2012+
settings.um980MessageRatesNMEA[x] = msgRate;
2013+
return (true);
2014+
}
2015+
}
2016+
systemPrintf("setNmeaMessageRateByName: %s not found\r\n", msgName);
2017+
return (false);
2018+
}
2019+
2020+
// Given the name of a message, find it, and set the rate
2021+
bool GNSS_UM980::setRtcmRoverMessageRateByName(const char *msgName, uint8_t msgRate)
2022+
{
2023+
for (int x = 0; x < MAX_UM980_RTCM_MSG; x++)
2024+
{
2025+
if (strcmp(umMessagesRTCM[x].msgTextName, msgName) == 0)
2026+
{
2027+
settings.um980MessageRatesRTCMRover[x] = msgRate;
2028+
return (true);
2029+
}
2030+
}
2031+
systemPrintf("setRtcmRoverMessageRateByName: %s not found\r\n", msgName);
2032+
return (false);
2033+
}
2034+
19582035
#endif // COMPILE_UM980
19592036

19602037
//----------------------------------------

Firmware/RTK_Everywhere/menuMessages.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void menuMessagesBaseRTCM()
166166
systemPrintln();
167167
systemPrintln("Menu: GNSS Messages - Base RTCM");
168168

169-
systemPrintln("1) Set RXM Messages for Base Mode");
169+
systemPrintln("1) Set RTCM Messages for Base Mode");
170170

171171
systemPrintf("2) Reset to Defaults (%s)\r\n", gnss->getRtcmDefaultString());
172172
systemPrintf("3) Reset to Low Bandwidth Link (%s)\r\n", gnss->getRtcmLowDataRateString());

0 commit comments

Comments
 (0)