@@ -72,7 +72,14 @@ void Gps::begin() {
7272 configureGpsModule ();
7373 }
7474 pollStatistics ();
75- if (is_neo8 ()) {
75+ if ((!is_neo6 ()) || (!SD.exists (AID_INI_DATA_FILE_NAME))) {
76+ // we're on a non-6 neo and avoid AID_INI because is deprecated
77+ // or we're on a neo6 but last boot we didn't get far enough to receive fresh
78+ // ALP_INI data after initializing
79+ // so restart GPS for good measure.
80+ if (is_neo6 ()) log_i (" We found no AID_INI on with neo6 on boot - coldstart gps in case its in a state where it doesn't get fixes" );
81+ if (!is_neo6 ()) log_i (" Coldstart because we found that newer neos profit from that." );
82+
7683 coldStartGps ();
7784 }
7885 pollStatistics ();
@@ -414,11 +421,15 @@ void Gps::enableAlpIfDataIsAvailable() {
414421/* Poll or refresh one time statistics, also spends some time
415422 * to collect the results.
416423 */
424+
417425void Gps::pollStatistics () {
418- handle ();
419- sendUbx (UBX_MSG::AID_ALP);
420426 handle ();
421427 sendUbx (UBX_MSG::MON_VER);
428+ handle (20 );
429+ if (is_neo6 ()){
430+ // AID_ALP is a neo6-only thing
431+ sendUbx (UBX_MSG::AID_ALP);
432+ }
422433 handle ();
423434 sendUbx (UBX_MSG::MON_HW);
424435 handle ();
@@ -1206,7 +1217,7 @@ void Gps::parseUbxMessage() {
12061217 mGpsUptime = mGpsBuffer .navStatus .msss ;
12071218 if (mGpsBuffer .navStatus .ttff != 0 ) {
12081219 addStatisticsMessage (" TimeToFix: " + String (mGpsBuffer .navStatus .ttff ) + " ms" );
1209- } else if (!mAidIniSent ) {
1220+ } else if (!mAidIniSent and is_neo6 () ) {
12101221 mAidIniSent = true ;
12111222 aidIni ();
12121223 }
0 commit comments