@@ -598,11 +598,16 @@ bool GNSS_LG290P::enterConfigMode(unsigned long waitForSemaphoreTimeout_millis)
598598 do
599599 { // Wait for up to waitForSemaphoreTimeout for library to stop blocking
600600 isBlocking = _lg290p->isBlocking ();
601- } while (isBlocking && (millis () < ( start + waitForSemaphoreTimeout_millis) ));
601+ } while (isBlocking && (( millis () - start) < waitForSemaphoreTimeout_millis));
602602
603603 // This will fail if the library is still blocking, but it is worth a punt...
604- return (_lg290p->sendOkCommand (" $PQTMCFGPROT" ,
605- " ,W,1,2,00000000,00000000" )); // Disable NMEA and RTCM on the LG290P UART2
604+
605+ if (lg290pFirmwareVersion >= 6 ) // See #747
606+ // Disable NMEA and RTCM on the LG290P UART2, but leave the undocumented Bit 1 enabled
607+ return (_lg290p->sendOkCommand (" $PQTMCFGPROT" , " ,W,1,2,00000007,00000002" ));
608+
609+ // Disable NMEA and RTCM on the LG290P UART2
610+ return (_lg290p->sendOkCommand (" $PQTMCFGPROT" , " ,W,1,2,00000000,00000000" ));
606611 }
607612 return (false );
608613}
@@ -613,8 +618,14 @@ bool GNSS_LG290P::enterConfigMode(unsigned long waitForSemaphoreTimeout_millis)
613618bool GNSS_LG290P::exitConfigMode ()
614619{
615620 if (online.gnss )
616- return (_lg290p->sendOkCommand (" $PQTMCFGPROT" ,
617- " ,W,1,2,00000005,00000005" )); // Enable NMEA and RTCM on the LG290P UART2
621+ {
622+ if (lg290pFirmwareVersion >= 6 ) // See #747
623+ // Enable NMEA and RTCM on the LG290P UART2, plus the undocumented Bit 1
624+ return (_lg290p->sendOkCommand (" $PQTMCFGPROT" , " ,W,1,2,00000007,00000007" ));
625+
626+ // Enable NMEA and RTCM on the LG290P UART2
627+ return (_lg290p->sendOkCommand (" $PQTMCFGPROT" , " ,W,1,2,00000005,00000005" ));
628+ }
618629 return (false );
619630}
620631
@@ -849,8 +860,10 @@ bool GNSS_LG290P::enableRTCMBase()
849860 systemPrintln (" Enabling Base RTCM output" );
850861
851862 // PQTMCFGRTCM fails to respond with OK over UART2 of LG290P, so don't look for it
863+ char cfgRtcm[40 ];
864+ snprintf (cfgRtcm, sizeof (cfgRtcm), " PQTMCFGRTCM,W,%c,0,-90,07,06,2,1" , settings.useMSM7 ? ' 7' : ' 4' );
852865 _lg290p->sendOkCommand (
853- " PQTMCFGRTCM,W,4,0,-90,07,06,2,1 " ); // Enable MSM4, output regular intervals, interval (seconds)
866+ cfgRtcm ); // Enable MSM4/7 , output regular intervals, interval (seconds)
854867 }
855868
856869 return (response);
@@ -1005,12 +1018,13 @@ bool GNSS_LG290P::enableRTCMRover()
10051018 if (settings.debugCorrections )
10061019 systemPrintf (" Enabling Rover RTCM MSM output with rate of %d\r\n " , minimumRtcmRate);
10071020
1008- // Enable MSM7 (for faster PPP CSRS results), output at a rate equal to the minimum RTCM rate (EPH Mode = 2)
1021+ // Enable MSM4/7 (for faster PPP CSRS results), output at a rate equal to the minimum RTCM rate (EPH Mode = 2)
10091022 // PQTMCFGRTCM, W, <MSM_Type>, <MSM_Mode>, <MSM_ElevThd>, <Reserved>, <Reserved>, <EPH_Mode>, <EPH_Interval>
10101023 // Set MSM_ElevThd to 15 degrees from rftop suggestion
10111024
10121025 char msmCommand[40 ] = {0 };
1013- snprintf (msmCommand, sizeof (msmCommand), " PQTMCFGRTCM,W,7,0,15,07,06,2,%d" , minimumRtcmRate);
1026+ snprintf (msmCommand, sizeof (msmCommand), " PQTMCFGRTCM,W,%c,0,15,07,06,2,%d" ,
1027+ settings.useMSM7 ? ' 7' : ' 4' , minimumRtcmRate);
10141028
10151029 // PQTMCFGRTCM fails to respond with OK over UART2 of LG290P, so don't look for it
10161030 _lg290p->sendOkCommand (msmCommand);
@@ -1904,6 +1918,10 @@ void GNSS_LG290P::menuMessages()
19041918 systemPrintln (" 11) Reset to PPP Logging (NMEAx7 / RTCMx4 - 30 second decimation)" );
19051919 systemPrintln (" 12) Reset to High-rate PPP Logging (NMEAx7 / RTCMx4 - 1Hz)" );
19061920
1921+
1922+ if (namedSettingAvailableOnPlatform (" useMSM7" )) // Redundant - but good practice for code reuse
1923+ systemPrintf (" 13) MSM Selection: MSM%c\r\n " , settings.useMSM7 ? ' 7' : ' 4' );
1924+
19071925 systemPrintln (" x) Exit" );
19081926
19091927 int incoming = getUserInputNumber (); // Returns EXIT, TIMEOUT, or long
@@ -1977,6 +1995,8 @@ void GNSS_LG290P::menuMessages()
19771995 systemPrintln (" Reset to PPP Logging Defaults (NMEAx7 / RTCMx4 - 30 second decimation)" );
19781996 }
19791997 }
1998+ else if ((incoming == 13 ) && (namedSettingAvailableOnPlatform (" useMSM7" ))) // Redundant - but good practice for code reuse)
1999+ settings.useMSM7 ^= 1 ;
19802000
19812001 else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
19822002 break ;
0 commit comments