×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

GPS date and time wrong

  • Posts: 145
  • Thank you received: 7

GPS date and time wrong was created by Lars

Hi,
I have got a lot of help from all of you earlier and my Astroberry system worked fine after all problem was solved, thanks a lot for that. That was at the end of our astro season at spring 2022. In september the astro season has started again.

I updated Astroberry to latest version. Everything looked okay at home. When I went out and don't connected to internet anymore it take the coordinates and date time from the GPS module as it is setup to do. I didn't understand at first why it positioned at wrong objects. But now when home and I can examine it in details I see what's wrong. The GPS date and time is wrong by 116 years. How could it be ?

When I click the GPS button and update it overwrite KStars date/time. The coordinates are okey.

My GPS dongle is the BU:353, it's about ten years old and the drivers doesn't work in Windows anymore, but in Linux okay.



Anyone any idea how it could be like this ?

Sorry that the screendumps are partly in Swedish, but it's not possible to change to English anymore.

/Lars
Last edit: 1 year 4 months ago by Lars.
1 year 4 months ago #87691
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 96
  • Thank you received: 25
What kind of GPS? I have a VK-172 (Ublox-7) on my stellarmate which sometimes gets confused. In my case the time is correct but the position is way off even though it reports a 3D fix, and is tracking 8+ PRNs at >30 SNR. Restarting gpsd clears up that confusion... then I start up INDI.
The following user(s) said Thank You: Lars
1 year 4 months ago #87702

Please Log in or Create an account to join the conversation.

  • Posts: 145
  • Thank you received: 7

Replied by Lars on topic GPS date and time wrong

Thanks for fast reply!

It's very strange, yesterday when I did this, I tried to power up the Raspberry once but still the same problem. I think that must be the same as restart the GPSD. Today when I spend some time on this problem, I start the system and now the time is correct.

That's very good, but I must trust the system, out in the cold dark with only a pad I can't do very much. From my friend I got the commando I need to run to restart the GPSD: sudo systemctl restart gpsd. I write it down so I can do this out on the field.

Thanks a lot for your idea about the problem.

/Lars
1 year 4 months ago #87708

Please Log in or Create an account to join the conversation.

  • Posts: 96
  • Thank you received: 25
I wrote this little script that runs as part of my observatory start. It just checks that my position is reasonable, and runs that systemctl command if not. It would be easy to extend the check to restart gpsd if the reported date is too old while the gps thinks it has a fix.
#!/usr/bin/env python3
 
import subprocess
from json import loads
from time import sleep
 
 
def get_gps_data():
    cmd = ['gpspipe', '-w', '-n', '8']
    cmd_out = subprocess.run(cmd, text=True, capture_output=True).stdout
    rv = {}
    for x in cmd_out.splitlines():
        d = loads(x)
        k = d.pop('class', None)
        rv[k] = d
 
    return rv
 
def check_gps_confusion():
    gps = get_gps_data()
 
    #print(gps['TPV'])
    #print(gps['SKY'])
 
    have_fix = (gps['TPV']['mode'] in [2, 3] and gps['TPV']['status'] in [1,2,3,4])
    is_zero = (gps['TPV']['lat'] == 0.0 and  gps['TPV']['lon'] == 0.0 and gps['TPV']['altHAE'] == 0.0)
    have_sats = gps['SKY']['uSat'] > 5
 
    return have_sats and have_fix and is_zero
 
def main():
 
    if check_gps_confusion():
        print("Restarting GPSD")
        subprocess.run(['sudo', 'systemctl', 'restart','gpsd'])
        sleep(5)
        if check_gps_confusion():
            print("ERROR: GPSD did not reset")
        else:
            print("GPS OK")
    else:
        print("GPS OK")
 
 
if __name__ == '__main__':
    main()
The following user(s) said Thank You: Lars
1 year 4 months ago #87732

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 1

Replied by Georg Papp on topic GPS date and time wrong

I had a similar problem some time ago. the position was correct but the time was all wrong. I am using my Galaxy Tab as gps-source. It turned out that the problem was in the tablet itself, verified with a random positioning app. The error did not return after an update and reboot of the tablet.
1 year 4 months ago #87738

Please Log in or Create an account to join the conversation.

  • Posts: 145
  • Thank you received: 7

Replied by Lars on topic GPS date and time wrong

Hi,
Interesting with the script, maybe I don't need it for this particular problem if it not occur more often. But script can solve other things. Are there some examples somewhere to read about what it can be useful for ?

/Lars
1 year 4 months ago #87747

Please Log in or Create an account to join the conversation.

  • Posts: 96
  • Thank you received: 25


I have a couple of scripts to do stuff when starting and stopping an observing session. These scripts then call other scripts that do single things like checking the GPS, turning the camera cooler on or off, making the filter selection dialog shut up, parking or unparking the mount, ... In short: what do you do every time you're observing? What make you say "why do I have to do this every time? why can't the computer do it for me?" ... and then you put that in a script.
The following user(s) said Thank You: Lars
1 year 4 months ago #87756
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 145
  • Thank you received: 7

Replied by Lars on topic GPS date and time wrong

I have now been out in the dark and use my equipment. It works better now and the GPS coordinates is transfered to EKOS/KStars. But still the time isn't corrected.

In the EKOS GPSD it looks like this:



The coordinates, time and date are correct. It transfer the coordinats to KStars, and the manual update also work.

But in KStars the time is correct in one place (the tablet clock) but not the other KStars' clock.



It's the clock at the green arrow that's wrong. It's say that the GPS place is used, but nothing if it also use the GPS date and time. Anyway everything looks to work now, only that the timestamps of the photos take the wrong time (the green arrow). I have another problem, when doing a meridian flip the plate solver can no longer find the object, could it too be related to this problem ?

How to fix that also the date and time is transfered to the KStars' time , is there a setup for that ?

/Lars
Last edit: 1 year 4 months ago by Lars.
1 year 4 months ago #88124
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 145
  • Thank you received: 7

Replied by Lars on topic GPS date and time wrong

I must have done something wrong last time when the date / clock was wrong. Next time I used it and did the recommended restart of GPSD it worked. I hope it will do it all time now.

Thanks for all help !

/Lars
1 year 4 months ago #88220

Please Log in or Create an account to join the conversation.

  • Posts: 145
  • Thank you received: 7

Replied by Lars on topic GPS date and time wrong

Now when I understand a bit better about the problem. It looks that I need to type the command: sudo systemctl restart gpsd often when I start up the Raspberry.

If I want to do it very simple, I want a button on the screen that send this command:

sudo systemctl restart gpsd

To the command window, how I do that ?

Lars
1 year 4 months ago #88332

Please Log in or Create an account to join the conversation.

  • Posts: 145
  • Thank you received: 7

Replied by Lars on topic GPS date and time wrong

Now I have used my Raspberry a lot, most of the time it work perfectly.

But some problem left to solve if there is a solution for it:
When I'm out on the field without internet connection I get a problem. If the Raspberry hasn't been connected to internet during the day earlier I get the wrong date. The GPSD with a connected GPS dongle set the correct time and location but not the date. In the GPSD INDI window I see that it receives the correct date but it still doesn't correct the date. I have to correct the date with a sudo command. Maybe that's is the way it must be done because when reading in the setup I can enable the GPSD to force the other devices to use GPSD time and location. But there is nothing about the date.

Or is there a way to even let it correct the Raspberrys date ?

I can solve this if I during the day connect the Raspberry to internet before I go out to my dark places without internet. It looks if the Raspberry remember the last day it was up and running. Just have to remember to do this, or I can do a sudo command to set the date later.

My setup is documented here:
www.astrofriend.eu/astronomy/projects/project-heq5/07-heq5.html

/Lars
11 months 3 weeks ago #91744

Please Log in or Create an account to join the conversation.

  • Posts: 155
  • Thank you received: 12
Are you setting up ntp to get the date/time from your gps or just the indi drivers?

I setup a usb gps dongle recently (just because..) and configured ntp to get the time from gpsd by the shared memory driver. I also had the indi gpsd configured. Not sure if I really needed both for time but at least ntp would configure the system before I even got round to getting indi going.

In the end I decided that as my setup is static and my ipad feeds it gps and my internet connection time plus the cheap dongle I got didn’t lock onto the satellites very quickly, that there was no point in using it. ( I had my play time and decided the extra stress wasn’t worth it)
The following user(s) said Thank You: Lars
11 months 3 weeks ago #91747

Please Log in or Create an account to join the conversation.

Moderators: Radek Kaczorek
Time to create page: 1.060 seconds