GPS date problem [solved] [Returned]

I used to use a GPS and arduino as a replacement to speed gauge in my very old car
it used to work fine and register my position every 30 seconds on a memory card with no problems about date and time the received string like
12:11:20,A,3006.2853,N,03120.6185,E,12.27,N 6 E,121216,231
or
06:20:51,A,2839.15,N,3077.14,E,23.35,20.57,190918,,,D*31

i stopped using it for a while and when i needed it again i was surprised it insist on giving me date with year (2000) the received string like
03:08:31,A,2829.46,N,3074.21,E,16.80,77.67,080400,,,A*31
thank you for help

The time information in NMEA sentences is not formatted using colons, so something else is formatting and printing the time and date (which may be wrong).

Please post the entire content of the string, i.e. the NMEA sentence, and post the code, using code tags and identify the GPS unit.

If the GPS module is old, you might be a victim of GPS rollover, a sort of Y2K which happened on April 6,2019.

fidamon:
no problems about date and time the received string like
12:11:20,A,3006.2853,N,03120.6185,E,12.27,N 6 E,121216,231
06:20:51,A,2839.15, N,3077.14, E,23.35,20.57,190918,,,D31
03:08:31,A,2829.46, N,3074.21, E,16.80,77.67,080400,,,A
31

What model GPS are you using? What sentence type are you parsing? It looks like it might be a $GPRMC sentence except I don't think there should be colons in the time field. Also, your first example has a messed up heading and it's missing the checksum.

Remember that the GPS Week Number rolled over this year. Perhaps the firmware in your GPS doesn't handle the roll-over properly.

I have just wrote about GPS "rollover bug", when I notice new messages arrive about...

Anyway, if your GPS is manufactured before 2000 that may be possible, however, with modules manufactured after 2010, manufacturers where obligated to comply with new standard about, and this bug should not be likely.

Date is coded inside $GPRMC line, thus that is exactly what is needed here.

Thank you all for your support
the GPS module is skylab skm58 and i think it is a rollover problem
it did not affect the time accuracy
how can i solve the date problem,just add to the received date to catch up with the present date ? or is there a better solution ?
thanks

You appear to be missing the data type from the start of the sentence, is this intentional? One of the examples you posted is missing the checksum as well so are some strings missing data from the end of the sentence? I agree that it looks like $GPRMC though.

Adding the difference of 1024 weeks (adding 1024 to the 10 bit week number) should work for about 20 years, if it is in fact a rollover problem. Before doing that however I'd check to see if the manufacturer has posted anything regarding rollover fixes if they also develop the software.

I'm not sure what device this document is for but regardless it is still informative - see "1.1 Compensating algorithms".

Thank you kasi3598
it is $GPRMC but i did some filtering to shorten the string to save space of the memory card i store on
now the problem is : i am a vb6 programmer in my native programming land we use the function
DateAdd(interval as string ,integer,date)
how to do the addition in the Arduino Land ??
thanks
Fidamon

I think you can use the Time library to convert Month/Day/Year to a 32-bit epoch time (seconds since some starting time) then you can add 1024 weeks (7168 days) worth of seconds (1024UL * 7 * 24 * 60 * 60) to get the corrected epoch time. Then convert back to Month,Day, and Year.

thank you all problem solved

kasi3598:
I’m not sure what device this document is for but regardless it is still informative - see “1.1 Compensating algorithms”.

I used the code in the previous site it solved the problem after I converted it to arduino code by removing stdio.h and replacing uint32_t instead of uint16_t for the variables dealing with days
but still i have a problem of 2 days
I wanna make sure
gps date 13/5/2000 should it give me 28/12/2019 or 30/12/2019
thank you all
Fidamon

gps date 13/5/2000 should it give me 28/12/2019 or 30/12/2019

Sorry, that makes no sense.

jremington:
Sorry, that makes no sense.

ok gps date string "130500"
does that make sense ?

Explain why there should be a “choice” of two dates, with one day in between.

My suggestions are to ignore the incorrect date or better, get a new GPS module. $6 USD

fidamon:
ok gps date string "130500"
does that make sense ?

Of course it makes sense, it's what you would expects a GPS should have put out as the date on the 13th May 2000.

Here is one possibility: Since the GPS counts in weeks, they may be using the ISO calendar that is based on a 52-week year and every year starts on a Monday. Since that is only 364 days, the Week calendar has to add a 'leap week' about every 7 years.

This time around, Week 1, 2020 started on Monday, December 30th, 2019. That might explain the two day difference.

Seems unlikely, though.

The purpose of my question is to know the right date to ignore the other
or in another way of expression to know which procedure gives the right result
thank you

May 13, 2000 was a Saturday. 1024 weeks later should also be a Saturday. December 28th was a Saturday and December 30th was not so the correct answer must be December 28th.

johnwasser:
May 13, 2000 was a Saturday. 1024 weeks later should also be a Saturday. December 28th was a Saturday and December 30th was not so the correct answer must be December 28th.

Well that is smart enough
thank you very much
problem solved and it works well now
fidamon