@@ -617,16 +617,21 @@ bool GNSS_LG290P::enableNMEA()
617617 // Check if this NMEA message is supported by the current LG290P firmware
618618 if (lg290pFirmwareVersion >= lgMessagesNMEA[messageNumber].firmwareVersionSupported )
619619 {
620+ // Disable NMEA output on UART3 RADIO
621+ int msgRate = settings.lg290pMessageRatesNMEA [messageNumber];
622+ if ((portNumber == 3 ) && (settings.enableNmeaOnRadio == false ))
623+ msgRate = 0 ;
624+
620625 // If firmware is 4 or higher, use setMessageRateOnPort, otherwise setMessageRate
621626 if (lg290pFirmwareVersion >= 4 )
622627 // Enable this message, at this rate, on this port
623628 response &=
624629 _lg290p->setMessageRateOnPort (lgMessagesNMEA[messageNumber].msgTextName ,
625- settings. lg290pMessageRatesNMEA [messageNumber] , portNumber);
630+ msgRate , portNumber);
626631 else
627632 // Enable this message, at this rate
628633 response &= _lg290p->setMessageRate (lgMessagesNMEA[messageNumber].msgTextName ,
629- settings. lg290pMessageRatesNMEA [messageNumber] );
634+ msgRate );
630635 if (response == false && settings.debugGnss )
631636 systemPrintf (" Enable NMEA failed at messageNumber %d %s.\r\n " , messageNumber,
632637 lgMessagesNMEA[messageNumber].msgTextName );
@@ -659,11 +664,25 @@ bool GNSS_LG290P::enableNMEA()
659664 if (pointPerfectIsEnabled ())
660665 {
661666 // Force on any messages that are needed for PPL
662- if (gpggaEnabled == false )
663- response &= _lg290p->setMessageRate (" GGA" , 1 );
667+ // If firmware is 4 or higher, use setMessageRateOnPort, otherwise setMessageRate
668+ if (lg290pFirmwareVersion >= 4 )
669+ {
670+ // Enable GGA / ZDA on port 2 (ESP32) only
671+ if (gpggaEnabled == false )
672+ response &= _lg290p->setMessageRateOnPort (" GGA" , 1 , 2 );
664673
665- // if (gpzdaEnabled == false)
666- // response &= _lg290p->setMessageRate("ZDA", 1);
674+ // if (gpggaEnabled == false)
675+ // response &= _lg290p->setMessageRateOnPort("GGA", 1, 1);
676+ }
677+ else
678+ {
679+ // Enable GGA / ZDA on all ports. It's the best we can do.
680+ if (gpggaEnabled == false )
681+ response &= _lg290p->setMessageRate (" GGA" , 1 );
682+
683+ // if (gpzdaEnabled == false)
684+ // response &= _lg290p->setMessageRate("ZDA", 1);
685+ }
667686 }
668687
669688 return (response);
0 commit comments