PA6H/MT3339 GPS: how to know if time is GPS locked or from internal RTC?

Image embedded for our convenience:

Technique described here.

In the picture attached you can see the signal on the oscilloscope at power on...

In the signal from GPS, I read in the oscilloscope:
$GPGSV,3,2,10,20,41,.....

Excellent! I'm so glad you can scope this out. This confirms that :

  • The sketch is sending the PMTK configuration command to turn on the GSV sentences.

  • The GPS device receives it correctly on the GPS RX pin.

  • The GPS device is sending GSV sentences.

  • The GPS device can see 10 satellites (3rd field in the GSV sentence).

This eliminates the most common problems. Next:

Now I'm reading:
3 dtsat:4/0
3 dtsat:4/0
near the window.

This shows:

  • the status (3, a good fix),

  • date/time are valid (from RMC and GGA sentences),

  • 4 satellites were used to calculate the current fix (according to the GGA sentence), and

  • 0 satellites were tracked in the gps.satellites[] array.

The first 3 are good. The last one, 0 satellites in the array, is bad.

Since you know the GPS device is sending the GSV sentences, either:

  • the 328 is not receiving anything from the GPS device, or

  • the 328 is receiving GPS characters, but it is not parsing the GSV sentences correctly.

It must be the latter. Are you sure that this line is uncommented?

#define NMEAGPS_PARSE_GSV

NeoGPS will ignore $GPGSV sentences unless this #define is uncommented.

Make sure there are no NeoGPS files in your sketch directory. Having a NeoGPS config file in the sketch directory can make bad things happen. You must modify the config files in the Libraries/NeoGPS/src directory.

Cheers,
/dev

Are you sure that this line is uncommented?

NO! I had uncommented two other lines, but not that!
Now I read:
RTC dtsat:1/2
GPS dtsat:1/2

:slight_smile:

The last version:

It's late, it's 1.20am... I go to sleep!

Now I read:
RTC dtsat:1/2
GPS dtsat:1/2

Very nice! I'm glad it's working.

What's next? :wink:

Hi, /dev :slight_smile:

It works. I only have to understand how variables work.

Now I read:

N/F 0 sats (NoFix)
t 0 sats (only time)
N/F 1 sat (1 sat, but appears again NoFix)
...
F 5 sats

else if (fix.status == gps_fix::STATUS_NONE) lcd.write(byte(0));

makes appear NF symbol when are received 1 or more sats before fix...

Ok. I've found a solution for the loop():

if (fix.status==gps.fix::STATUS_NONE && fix.satellites==0) lcd.write (byte(0));

0 NF
0 t
1 t
2 t
3 t
4 t
4 F
5 F

Now, only when are 0 satellites can appear the symbol "NF". It works, but why STATUS_NONE is true with one or more satellites?

It still doesn't work in Ora e data.

It seems all is working now! :slight_smile:
I've had to change the structure in OraeData(). Do you agree?
GitHub - Gatware/Limiti at Limiti_3.1_190418_NEO_OK_t all

why STATUS_NONE is true with one or more satellites?

This means that the MTK device is using that many satellites to calculate a fix (loc, alt, speed, etc.), but the STATUS_NONE means that it has not successfully calculated a fix yet. I see the same thing with a ublox GPS device. The satellites number goes up just before status becomes STATUS_STD.

The GSV satellites number goes up long before that, which sets the status to STATUS_TIME_ONLY.

Your interpretation of fix.valid.time, fix.satellites and fix.status is acceptable. We don't really know what the MTK is "thinking", but your choices seem reasonable. I think this code is equivalent:

    if(fix.valid.status)
      {
      if(fix.status >= gps_fix::STATUS_STD) lcd.print('F'); // Se ha fatto il punto scrive F
      else if((fix.status==gps_fix::STATUS_NONE) && (fix.satellites==0)) lcd.write(byte(0));
      else lcd.print('t');
      }
    else lcd.print('?');

Thank you for your help, /dev.

God bless you!

Cheers,
Gianluca