I am having some issues with SkySafari and time updates. I’m not entirely sure how all of this is *supposed* to work, so I’m going to explain what I’m doing in a long post. I hope someone takes the time to read all of this and shed some light on it for me.
I have the gpsd daemon running on a Raspberry Pi using Astroberry. In addition to gpsd, chronyc is running to keep the system time in sync with GPS. When I am plugged into my home network, I unplug the GPS device and turn on Astroberry’s virtual GPS service to set a static location and the system gets the time from the network. This all seems to work just fine both with an actual GPS and with the virtual GPS.
On INDI, I’m running the GPSD driver, the SkySafari Driver, and the EQMod Mount driver. (I also have a guide camera, joystick, etc, but they are not relevant to this post). It is also important to note that I am not using KStars/Ekos.
The GPSD INDI driver is configured to use the system time instead of using the GPS time directly. As I understand it, this allows chronyc to smoothly handle any time blips due to any possible GPS issues.
The EQMod Mount driver is set to snoop “GPSD”. This eventually reverts to “GPS Simulator” even though GPSD is still able to update EQMod Mount. I’m unsure why this happens, but it continues to work as expected.
After the GPSD INDI driver starts and it gets a GPS lock from the gpsd service, it will update the EQMod Mount driver’s Location (EQMod Mount.GEOGRAPHIC_COORD.*) and UTC Time (EQMod Mount.TIME_UTC.UTC) parameters. If the GPSD Refresh parameter is set to 0, it updates the mount once and is essentially done. After this initialization is done, the EQMod Mount.JULIAN.JULIANDATE parameter is synchronized and continues to move forward in time. The EQMod Mount.TIME_UTC.UTC parameter stays static. It shows the moment in time of the last location and time synchronization with the mount.
Now, enter SkySafari. When the SkySafari app (in this case Android) talks to the SkySafari INDI driver, it gets the time and location. The time sent to the SkySafari app is based on the mount’s EQMod Mount.TIME_UTC.UTC parameter and not the EQMod Mount.JULIAN.JULIANDATE parameter. This means that SkySafari lags in time. The pointing accuracy for GOTO ends up being off by the amount of time difference between the actual time and the time saved in the UTC parameter.
This is the problem I want to solve.
One thing I tried was to set the GPSD driver’s REFRESH parameter to be non-zero. I’m not sure what value is appropriate. I first tried a value of 1. This worked for a very short while and fixed the pointing accuracy in SkySafari. It proved to me that SkySafari is being sent the UTC date. An interval of 1 second causes a very chatty communication between drivers, however. It also quickly stops working. The logs show “[ERROR] GPSD read error” for every refresh attempt after it stops working. Setting the REFRESH parameter to a larger value will allow me to run longer before getting the read error, but it will still hit the error. Even refreshing every 60 seconds will eventually hit the GPSD read error and cause the time sync to stop working.
So, the GPSD refresh parameter is not a workable solution, at least not without fixing the read error bug in the GPSD driver. It also seems silly (to me at least) to keep updating the GPS coordinates just so we can have an accurate time. Is it wrong to assume the SkySafari driver should be using the Julian date as a time source instead of the more static UTC date?
What’s the better way to make this work? Fix the GPSD bug so it continues to refresh without read errors, or fix the SkySafari driver so it uses a non-static date? Maybe both?
What am I doing wrong? What do I not understand?