Skip to content

Commit 9210942

Browse files
committed
Merge branch 'release_candidate' into pcUpdates
2 parents 9a4bfe8 + 14161b6 commit 9210942

File tree

7 files changed

+77
-141
lines changed

7 files changed

+77
-141
lines changed

Firmware/RTK_Everywhere/Developer.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ void pointperfectPrintKeyInformation(const char *requestedBy) {systemPrintln("**
277277
#ifndef COMPILE_LG290P
278278

279279
void lg290pHandler(uint8_t * buffer, int length) {}
280-
void lg290pModifyGst(char *nmeaSentence, uint16_t *sentenceLength) {}
281280

282281
#endif // COMPILE_LG290P
283282

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 0 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,137 +2229,3 @@ bool lg290pMessageEnabled(char *nmeaSentence, int sentenceLength)
22292229
// If we can't ID this message, allow it by default. The device configuration should control most message flow.
22302230
return (true);
22312231
}
2232-
2233-
// Re-create the GST sentence to increase the horizontal and vertical precision number of decimals
2234-
// ie, 0.0 becomes 0.009
2235-
// See issue: https://github.com/sparkfun/SparkFun_RTK_Everywhere_Firmware/issues/513
2236-
// $GNGST,223954.500,1.7,1.5,1.0,109.3,1.412,1.055,2.4*7E
2237-
// Modifies the sentence length with new length
2238-
void lg290pModifyGst(char *nmeaSentence, uint16_t *sentenceLength)
2239-
{
2240-
// This issue currently only applies to LG290P firmware version 4
2241-
// Version 3 does not support GST messages. Version 5 should fix the issue.
2242-
if (lg290pFirmwareVersion != 4)
2243-
return;
2244-
2245-
if (online.gnss == false)
2246-
return;
2247-
2248-
// Only apply the GST patch if our HPA is very small (<0.1m), ie RTK Float or Fix.
2249-
if (gnss->isRTKFix() == false && gnss->isRTKFloat() == false)
2250-
return;
2251-
2252-
GNSS_LG290P *lg290p = (GNSS_LG290P *)gnss;
2253-
2254-
// Identify sentence type
2255-
char sentenceType[strlen("GST") + 1] = {0};
2256-
strncpy(sentenceType, &nmeaSentence[3],
2257-
3); // Copy three letters, starting in spot 3. Null terminated from array initializer.
2258-
2259-
// We only care about GST sentences
2260-
if (strncmp(sentenceType, "GST", sizeof(sentenceType)) != 0)
2261-
return;
2262-
2263-
const int latitudeErrorComma = 6;
2264-
const int longitudeErrorComma = 7;
2265-
const int altitudeErrorComma = 8;
2266-
2267-
uint8_t latitudeStart = 0;
2268-
uint8_t latitudeStop = 0;
2269-
uint8_t longitudeStart = 0;
2270-
uint8_t longitudeStop = 0;
2271-
uint8_t altitudeStart = 0;
2272-
uint8_t checksumStart = 0;
2273-
2274-
if (settings.enableImuCompensationDebug == true && !inMainMenu)
2275-
systemPrintf("Original GNGST:\r\n%s\r\n", nmeaSentence);
2276-
2277-
int commaCount = 0;
2278-
for (int x = 0; x < strnlen(nmeaSentence, *sentenceLength); x++) // Assumes sentence is null terminated
2279-
{
2280-
if (nmeaSentence[x] == ',')
2281-
{
2282-
commaCount++;
2283-
if (commaCount == latitudeErrorComma)
2284-
latitudeStart = x + 1;
2285-
if (commaCount == latitudeErrorComma + 1)
2286-
latitudeStop = x;
2287-
if (commaCount == longitudeErrorComma)
2288-
longitudeStart = x + 1;
2289-
if (commaCount == longitudeErrorComma + 1)
2290-
longitudeStop = x;
2291-
if (commaCount == altitudeErrorComma)
2292-
altitudeStart = x + 1;
2293-
}
2294-
if (nmeaSentence[x] == '*')
2295-
{
2296-
checksumStart = x;
2297-
break;
2298-
}
2299-
}
2300-
2301-
if (latitudeStart == 0 || latitudeStop == 0 || longitudeStart == 0 || longitudeStop == 0 || altitudeStart == 0 ||
2302-
checksumStart == 0)
2303-
{
2304-
systemPrintln("Delineator not found");
2305-
return;
2306-
}
2307-
2308-
char newSentence[150] = {0};
2309-
2310-
if (sizeof(newSentence) < *sentenceLength)
2311-
{
2312-
systemPrintln("newSentence not big enough!");
2313-
return;
2314-
}
2315-
2316-
char errorString[strlen("0.000") + 1] = {0};
2317-
2318-
// strncat terminates
2319-
2320-
// Add start of message up to latitude
2321-
strncat(newSentence, nmeaSentence, latitudeStart);
2322-
2323-
// Convert error from EPE message to string. We don't have pure lat error, only 2D and 3D.
2324-
snprintf(errorString, sizeof(errorString), "%0.3f", lg290p->getHorizontalAccuracy());
2325-
2326-
// Add latitude error
2327-
strncat(newSentence, errorString, sizeof(newSentence) - 1);
2328-
2329-
// Add interstitial between end of lat and beginning of lon
2330-
strncat(newSentence, nmeaSentence + latitudeStop, longitudeStart - latitudeStop);
2331-
2332-
// Add same error for longitude error
2333-
strncat(newSentence, errorString, sizeof(newSentence) - 1);
2334-
2335-
// Add interstitial between end of lon and beginning of alt
2336-
strncat(newSentence, nmeaSentence + longitudeStop, altitudeStart - longitudeStop);
2337-
2338-
// Convert error from EPE message to string. We don't have pure altitude error, use double 2D error as stand-in.
2339-
snprintf(errorString, sizeof(errorString), "%0.3f", lg290p->getHorizontalAccuracy() * 2);
2340-
2341-
// Add altitude error. We don't really have altitude so use 3D error in its place.
2342-
strncat(newSentence, errorString, sizeof(newSentence) - 1);
2343-
2344-
// From: http://engineeringnotes.blogspot.com/2015/02/generate-crc-for-nmea-strings-arduino.html
2345-
byte CRC = 0; // XOR chars between '$' and '*'
2346-
for (byte x = 1; x < strlen(newSentence); x++)
2347-
CRC = CRC ^ newSentence[x];
2348-
2349-
// Convert CRC to string, add * and CR LF
2350-
snprintf(errorString, sizeof(errorString), "*%02X\r\n", CRC);
2351-
2352-
// Add CRC
2353-
strncat(newSentence, errorString, sizeof(newSentence) - 1);
2354-
2355-
// Increase length of sentence
2356-
*sentenceLength = strlen(newSentence);
2357-
2358-
// Overwrite the original NMEA
2359-
strncpy(nmeaSentence, newSentence, *sentenceLength);
2360-
2361-
nmeaSentence[*sentenceLength] = '\0'; // Terminate string
2362-
2363-
if (settings.enableImuCompensationDebug == true && !inMainMenu)
2364-
systemPrintf("Corrected GNGST:\r\n%s\r\n", nmeaSentence);
2365-
}

Firmware/RTK_Everywhere/NVM.ino

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,17 @@ void recordSystemSettingsToFile(File *settingsFile)
615615
}
616616
}
617617
break;
618+
case tLgMRPqtm: {
619+
// Record LG290P PQTM rates
620+
for (int x = 0; x < rtkSettingsEntries[i].qualifier; x++)
621+
{
622+
char tempString[50]; // lg290pMessageRatesPQTM_EPE=1
623+
snprintf(tempString, sizeof(tempString), "%s%s=%d", rtkSettingsEntries[i].name,
624+
lgMessagesPQTM[x].msgTextName, settings.lg290pMessageRatesPQTM[x]);
625+
settingsFile->println(tempString);
626+
}
627+
}
628+
break;
618629
case tLgConst: {
619630
// Record LG290P Constellations
620631
for (int x = 0; x < rtkSettingsEntries[i].qualifier; x++)
@@ -1480,6 +1491,19 @@ bool parseLine(char *str)
14801491
}
14811492
}
14821493
break;
1494+
case tLgMRPqtm: {
1495+
for (int x = 0; x < qualifier; x++)
1496+
{
1497+
if ((suffix[0] == lgMessagesPQTM[x].msgTextName[0]) &&
1498+
(strcmp(suffix, lgMessagesPQTM[x].msgTextName) == 0))
1499+
{
1500+
settings.lg290pMessageRatesPQTM[x] = d;
1501+
knownSetting = true;
1502+
break;
1503+
}
1504+
}
1505+
}
1506+
break;
14831507
case tLgConst: {
14841508
for (int x = 0; x < qualifier; x++)
14851509
{

Firmware/RTK_Everywhere/Tasks.ino

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,6 @@ void processUart1Message(SEMP_PARSE_STATE *parse, uint16_t type)
650650
parse->buffer[0] = 0;
651651
parse->length = 0;
652652
}
653-
654-
// Gimme three decimals!
655-
lg290pModifyGst((char *)parse->buffer, &parse->length);
656653
}
657654
}
658655

Firmware/RTK_Everywhere/form.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// python main_js_zipper.py
2727

2828
static const uint8_t main_js[] PROGMEM = {
29-
0x1F, 0x8B, 0x08, 0x08, 0x8C, 0x6B, 0xAB, 0x67, 0x02, 0xFF, 0x6D, 0x61, 0x69, 0x6E, 0x2E, 0x6A,
29+
0x1F, 0x8B, 0x08, 0x08, 0xDC, 0xC8, 0xAF, 0x67, 0x02, 0xFF, 0x6D, 0x61, 0x69, 0x6E, 0x2E, 0x6A,
3030
0x73, 0x2E, 0x67, 0x7A, 0x69, 0x70, 0x00, 0xED, 0x7D, 0xFD, 0x5E, 0xDC, 0x3A, 0x92, 0xE8, 0xFF,
3131
0x79, 0x0A, 0x4D, 0xDF, 0xB9, 0x03, 0x0C, 0x4D, 0xE3, 0x6E, 0x3E, 0x02, 0x21, 0x64, 0x2F, 0x01,
3232
0x92, 0x70, 0x07, 0x08, 0x97, 0x26, 0xE7, 0x9C, 0x9C, 0x6C, 0x96, 0x35, 0x6D, 0xD1, 0x78, 0xD3,
@@ -1049,7 +1049,7 @@ static const uint8_t main_js[] PROGMEM = {
10491049
// python index_html_zipper.py
10501050

10511051
static const uint8_t index_html[] PROGMEM = {
1052-
0x1F, 0x8B, 0x08, 0x08, 0x8C, 0x6B, 0xAB, 0x67, 0x02, 0xFF, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x2E,
1052+
0x1F, 0x8B, 0x08, 0x08, 0xDC, 0xC8, 0xAF, 0x67, 0x02, 0xFF, 0x69, 0x6E, 0x64, 0x65, 0x78, 0x2E,
10531053
0x68, 0x74, 0x6D, 0x6C, 0x2E, 0x67, 0x7A, 0x69, 0x70, 0x00, 0xED, 0x7D, 0x59, 0x76, 0xDB, 0xCA,
10541054
0x92, 0xE0, 0xFF, 0x5D, 0x45, 0x16, 0xAB, 0xBB, 0x2C, 0x57, 0x8B, 0x14, 0x48, 0x4A, 0xB2, 0xAC,
10551055
0x67, 0xEB, 0x1C, 0x8D, 0xB6, 0xFA, 0x49, 0x32, 0x4B, 0x94, 0xDF, 0x1D, 0xFA, 0x74, 0xDF, 0x03,

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,19 @@ SettingValueResponse updateSettingWithValue(bool inCommands, const char *setting
10761076
}
10771077
}
10781078
break;
1079+
case tLgMRPqtm: {
1080+
for (int x = 0; x < qualifier; x++)
1081+
{
1082+
if ((suffix[0] == lgMessagesPQTM[x].msgTextName[0]) &&
1083+
(strcmp(suffix, lgMessagesPQTM[x].msgTextName) == 0))
1084+
{
1085+
settings.lg290pMessageRatesPQTM[x] = settingValue;
1086+
knownSetting = true;
1087+
break;
1088+
}
1089+
}
1090+
}
1091+
break;
10791092
case tLgConst: {
10801093
for (int x = 0; x < qualifier; x++)
10811094
{
@@ -1868,6 +1881,17 @@ void createSettingsString(char *newSettings)
18681881
}
18691882
}
18701883
break;
1884+
case tLgMRPqtm: {
1885+
// Record LG290P PQTM rates
1886+
for (int x = 0; x < rtkSettingsEntries[i].qualifier; x++)
1887+
{
1888+
char tempString[50]; // lg290pMessageRatesPQTM_EPE=1 Not a float
1889+
snprintf(tempString, sizeof(tempString), "%s%s,%d,", rtkSettingsEntries[i].name,
1890+
lgMessagesPQTM[x].msgTextName, settings.lg290pMessageRatesPQTM[x]);
1891+
stringRecord(newSettings, tempString);
1892+
}
1893+
}
1894+
break;
18711895
case tLgConst: {
18721896
// Record LG290P Constellations
18731897
// lg290pConstellations are uint8_t, but here we have to convert to bool (true / false) so the web page
@@ -2732,6 +2756,19 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
27322756
}
27332757
}
27342758
break;
2759+
case tLgMRPqtm: {
2760+
for (int x = 0; x < qualifier; x++)
2761+
{
2762+
if ((suffix[0] == lgMessagesPQTM[x].msgTextName[0]) &&
2763+
(strcmp(suffix, lgMessagesPQTM[x].msgTextName) == 0))
2764+
{
2765+
writeToString(settingValueStr, settings.lg290pMessageRatesPQTM[x]);
2766+
knownSetting = true;
2767+
break;
2768+
}
2769+
}
2770+
}
2771+
break;
27352772
case tLgConst: {
27362773
for (int x = 0; x < qualifier; x++)
27372774
{
@@ -3278,6 +3315,18 @@ void commandList(bool inCommands, int i)
32783315
}
32793316
}
32803317
break;
3318+
case tLgMRPqtm: {
3319+
// Record LG290P PQTM rates
3320+
for (int x = 0; x < rtkSettingsEntries[i].qualifier; x++)
3321+
{
3322+
snprintf(settingName, sizeof(settingName), "%s%s", rtkSettingsEntries[i].name,
3323+
lgMessagesPQTM[x].msgTextName);
3324+
3325+
getSettingValue(inCommands, settingName, settingValue);
3326+
commandSendExecuteListResponse(settingName, "uint8_t", settingValue);
3327+
}
3328+
}
3329+
break;
32813330
case tLgConst: {
32823331
// Record LG290P Constellations
32833332
for (int x = 0; x < rtkSettingsEntries[i].qualifier; x++)

Firmware/RTK_Everywhere/settings.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,7 @@ typedef enum {
10731073
tLgMRNmea,
10741074
tLgMRRvRT,
10751075
tLgMRBaRT,
1076+
tLgMRPqtm,
10761077
tLgConst,
10771078
// Add new settings types above <---------------->
10781079
// (Maintain the enum of existing settings types!)
@@ -1616,7 +1617,7 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
16161617
{ 0, 1, 1, 0, 0, 0, 0, 0, 1, tLgMRNmea, MAX_LG290P_NMEA_MSG, & settings.lg290pMessageRatesNMEA, "messageRateNMEA_", },
16171618
{ 0, 1, 1, 0, 0, 0, 0, 0, 1, tLgMRBaRT, MAX_LG290P_RTCM_MSG, & settings.lg290pMessageRatesRTCMBase, "messageRateRTCMBase_", },
16181619
{ 0, 1, 1, 0, 0, 0, 0, 0, 1, tLgMRRvRT, MAX_LG290P_RTCM_MSG, & settings.lg290pMessageRatesRTCMRover, "messageRateRTCMRover_", },
1619-
{ 0, 1, 1, 0, 0, 0, 0, 0, 1, tLgMRNmea, MAX_LG290P_PQTM_MSG, & settings.lg290pMessageRatesPQTM, "messageRatePQTM_", },
1620+
{ 0, 1, 1, 0, 0, 0, 0, 0, 1, tLgMRPqtm, MAX_LG290P_PQTM_MSG, & settings.lg290pMessageRatesPQTM, "messageRatePQTM_", },
16201621
#endif // COMPILE_LG290P
16211622

16221623
{ 0, 0, 0, 1, 1, 1, 1, 1, 1, _bool, 0, & settings.debugSettings, "debugSettings", },

0 commit comments

Comments
 (0)