mbalkham
Posts: 7
Joined: Sun Sep 08, 2019 7:59 am

GPS pi4 incorrect date

Sun Sep 08, 2019 8:05 am

Hi all. First time post from novice user.

I've installed gspd and chrony on a pi4 with the aim of syncing date, time and location for astronony.

I ran the same process on pi3 b+ all works fine. But on the pi4 gpsmon reads date of 2000-01-23T08:04 and chrony syncs the pi date and time to that date.

Any ideas?

Thanks

User avatar
topguy
Posts: 5780
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: GPS pi4 incorrect date

Sun Sep 08, 2019 3:52 pm

What is the GPS ? Are you using the same GPS with the Pi3 as the Pi4 ?

It might look like your GPS is rather old and has a bug that makes it report the date wrong.

If you can look at raw gps data you might find lines like this:

Code: Select all

$GPRMC,072404.051,A,6325.298234,N,01023.692289,E,0.700,32.08,170100,,,A*6C
My example are from a few days ago, so the date is 170100 ( 17.Jan 2000 ).

This problem started 6th of April this year when a 10bit counter for week number in GPS satellite data flipped from max value 1023 to 0.
Those GPS that haven't taken this into account in their firmware are now showing a date 1024 weeks ( 7168 days ) too old.

mbalkham
Posts: 7
Joined: Sun Sep 08, 2019 7:59 am

Re: GPS pi4 incorrect date

Sun Sep 08, 2019 9:54 pm

The GPS is the same physical usb device. I plug it into the pi3, boot and check gpsmon all ok. Then switch to pi4, remove usb from pi3 and connect to pi4 boot and wrong date is displayed in gpsmon.

I think all the settings/ config files are the same (at least I've made the same changes).

I'll look at the raw data later. I can't understand why if it is a 6th of April thing why I get a different result on each pi?

User avatar
topguy
Posts: 5780
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: GPS pi4 incorrect date

Sun Sep 08, 2019 10:17 pm

I can't understand why if it is a 6th of April thing why I get a different result on each pi?
No, that is definitely not obvious, but it fits quite well.

Are you using different SD cards ?
Is it the same version of Raspbian on both SD cards ?

Ideas:
- GPSD has probably some functionality to handle this problem, question is if its a config thing or if it can autodetect it.
- Maybe GPSD on the Pi3 has some way to detect that the date is wrong ? It has (had) internet connection and can ntp sync ?

mbalkham
Posts: 7
Joined: Sun Sep 08, 2019 7:59 am

Re: GPS pi4 incorrect date

Sun Sep 08, 2019 10:52 pm

Different sd cards with files from Stellarmate (as part of the 1.4.2 Stellarmate OS for the Pi3 and 1.4.3 for the Pi4). I'll message them to see if they have any ideas. I'll check which version of Rasabian is running on each when I get home.

Both have been connected to the internet recently but have been powered down since (I noticed the clocks were both initially wrong and then updated using the gps data the pi3 to the right time and the pi 4 to the wrong date and time) and for my test were accessed without network connections (as that is how I will be using them at remote astronomy sites).

mbalkham
Posts: 7
Joined: Sun Sep 08, 2019 7:59 am

Re: GPS pi4 incorrect date

Sun Sep 15, 2019 9:37 am

So the date is always 2000-01-30 and do its not the same number of weeks out its always the same date. Any ideas?

User avatar
DougieLawson
Posts: 36159
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: GPS pi4 incorrect date

Sun Sep 15, 2019 9:49 am

https://www.youtube.com/watch?v=iyz7dSnZItw Matt Parker (the Standup Mathematician) explains the problem in exquisite detail.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

mbalkham
Posts: 7
Joined: Sun Sep 08, 2019 7:59 am

Re: GPS pi4 incorrect date

Sun Sep 15, 2019 9:59 am

Thanks Dougie but I'm pretty sure this isn't a roll over thing given the date is not a different amount out each day (every day the gps thinks is 30-01-2000).

Also the gps dongle is only weeks old and the chrony and gpsd latest versions.

Any other ideas?

Ernst
Posts: 1233
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: GPS pi4 incorrect date

Sun Sep 15, 2019 10:59 am

mbalkham wrote:
Sun Sep 15, 2019 9:59 am
Thanks Dougie but I'm pretty sure this isn't a roll over thing given the date is not a different amount out each day (every day the gps thinks is 30-01-2000).

Also the gps dongle is only weeks old and the chrony and gpsd latest versions.

Any other ideas?
What do you see when you look up, do you see a ceiling or do you see a clear sky ?
The road to insanity is paved with static ip addresses

User avatar
DougieLawson
Posts: 36159
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: GPS pi4 incorrect date

Sun Sep 15, 2019 11:10 am

Try the GPS dongle on another computer. Buy another dongle from eBay.

https://www.ebay.co.uk/itm/GPS-Smart-An ... 3140614746
Note: that one doesn't do PPS but it does work with my 2014 RPiB+.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
topguy
Posts: 5780
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: GPS pi4 incorrect date

Sun Sep 15, 2019 12:09 pm

mbalkham wrote:
Sun Sep 15, 2019 9:59 am
Thanks Dougie but I'm pretty sure this isn't a roll over thing given the date is not a different amount out each day (every day the gps thinks is 30-01-2000).
In your first post ( 8/9 ) the date was 23/1/2000 and now a week later (15/9) its 30/1/2000.. do you not see the pattern ?

As I said in the first post, you can verify this by checking the raw NMEA data for the GPRMC messages. You can try "cat /dev/ttyUSB0" or whatever the device is, but you may need to stop GPSD first.

mbalkham
Posts: 7
Joined: Sun Sep 08, 2019 7:59 am

Re: GPS pi4 incorrect date

Sun Sep 15, 2019 7:54 pm

Thanks topguy no I didn't notice the pattern! In my sleep deprived state I thought birth dates were 30th Jan!

I'll have another look at the raw nmea data as you suggest. Still makes no sense to me why the discrepancy between pi3 and pi4 though!

Dougie yes I'm outside, yes the GPS works fine on pi3 running same software (and on mac and PC). Just reports a different result on pi4.

mbalkham
Posts: 7
Joined: Sun Sep 08, 2019 7:59 am

Re: GPS pi4 incorrect date

Mon Sep 16, 2019 10:29 am

Removed Chrony and I get the correct date. No idea why but it works so that's all good.

Thanks for the suggestions.

Return to “Troubleshooting”