×

INDI Library v1.9.9 Released (30 Nov 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

GPS date and time wrong

  • Posts: 122
  • Thank you received: 5

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
TS130 APO & 3" field flattener / Pentax 645 ED 300mm f/4
EQ6 mount / HEQ5
Canon EOS 6D
Lot of patience

Homepage:
www.astrofriend.eu/
Last edit: 2 months 3 weeks ago by Lars.
2 months 4 weeks ago #87691
Attachments:

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

  • Posts: 60
  • Thank you received: 13
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
2 months 3 weeks ago #87702

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

  • Posts: 122
  • Thank you received: 5

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
TS130 APO & 3" field flattener / Pentax 645 ED 300mm f/4
EQ6 mount / HEQ5
Canon EOS 6D
Lot of patience

Homepage:
www.astrofriend.eu/
2 months 3 weeks ago #87708

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

  • Posts: 60
  • Thank you received: 13
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
2 months 3 weeks ago #87732

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

  • Posts: 2
  • Thank you received: 0

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.
2 months 3 weeks ago #87738

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

  • Posts: 122
  • Thank you received: 5

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
TS130 APO & 3" field flattener / Pentax 645 ED 300mm f/4
EQ6 mount / HEQ5
Canon EOS 6D
Lot of patience

Homepage:
www.astrofriend.eu/
2 months 3 weeks ago #87747

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

  • Posts: 60
  • Thank you received: 13


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
2 months 3 weeks ago #87756
Attachments:

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

  • Posts: 122
  • Thank you received: 5

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
TS130 APO & 3" field flattener / Pentax 645 ED 300mm f/4
EQ6 mount / HEQ5
Canon EOS 6D
Lot of patience

Homepage:
www.astrofriend.eu/
Last edit: 2 months 2 weeks ago by Lars.
2 months 2 weeks ago #88124
Attachments:

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

  • Posts: 122
  • Thank you received: 5

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
TS130 APO & 3" field flattener / Pentax 645 ED 300mm f/4
EQ6 mount / HEQ5
Canon EOS 6D
Lot of patience

Homepage:
www.astrofriend.eu/
2 months 1 week ago #88220

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

  • Posts: 122
  • Thank you received: 5

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
TS130 APO & 3" field flattener / Pentax 645 ED 300mm f/4
EQ6 mount / HEQ5
Canon EOS 6D
Lot of patience

Homepage:
www.astrofriend.eu/
2 months 1 week ago #88332

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

Moderators: Radek Kaczorek
Time to create page: 0.420 seconds