×

INDI Library v1.7.9 Released (23 Jun 2019)

INDI Library v1.7.9 is mostly a maintenance release to fix a few bugs in several drivers.

[ indi_gpsd ] Time is not pulled from gpsd?

  • Posts: 33
  • Thank you received: 5

[ indi_gpsd ] Time is not pulled from gpsd? was created by ecloud

I have not setup ntpd yet. So my system time is not synchronized.
The UTC time in indi client seems to be system time, but not gpsd time.
Is it a bug?
1 month 3 weeks ago #39431
Attachments:

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

  • Posts: 108
  • Thank you received: 22

Replied by petarm on topic [ indi_gpsd ] Time is not pulled from gpsd?

Why not just write a python script which populates GPS time after boot. Then when you start kstars, the time is correct.
Lots of trial and error, mainly error, but in hindsight, it was easy!!!
Takahashi FC100DF, Skywatcher HEQ5 Pro via Wifi, QHY-163C, Baader mod Canon 550D, ZWO ASI 224MC on Orion 50mm guide scope, VNC to Asus Tinker Board or Intel Compute Stick in hot spot mode running Ubuntu 18.04LTS and KStars/Ekos...
1 month 3 weeks ago #39483

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

  • Posts: 541
  • Karma: 1
  • Thank you received: 97

Replied by Ihoujin on topic [ indi_gpsd ] Time is not pulled from gpsd?

gpstime.py
A Python script I use for force the system clock to update.
import os
import sys
import time
from gps import *

print 'Attempting to access GPS time...'

try:
	gpsd = gps(mode=WATCH_ENABLE)
except:
	print 'No GPS connection present. TIME NOT SET.'
	sys.exit()

while True:
	gpsd.next()
	if gpsd.utc != None and gpsd.utc != '':
		gpstime = gpsd.utc[0:4] + gpsd.utc[5:7] + gpsd.utc[8:10] + ' ' + gpsd.utc[11:19]
		print 'Setting system time to GPS time...'
		os.system('sudo date -u --set="%s"' % gpstime)
		print 'System time set.'
		sys.exit()
	time.sleep(1)
INDI/KStars on Raspberry Pi 3B+
Lubuntu 16.04
Skywatcher HEQ5 Pro Mount
Canon 600D Camera
Orion SSAG @280mm Guide Scope
PHD2
Adafruit Motor Hat shield
Adafruit GPS Module
Generic Bluetooth Joystick.
Startech 7 port powered USB Hub.
1 month 2 weeks ago #39532

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

  • Posts: 33
  • Thank you received: 5

Replied by ecloud on topic [ indi_gpsd ] Time is not pulled from gpsd?

Hi, this is not about 'How to get datetime from gpsd'.
This is to concern which time should be displayed on the panel of indi_gpsd.
Does this work as design or be a bug?
And which time will kstars use?
The system time is shown on the panel will make confusion.
1 month 2 weeks ago #39548

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

  • Posts: 108
  • Thank you received: 22

Replied by petarm on topic [ indi_gpsd ] Time is not pulled from gpsd?

As ihoujin and i have said, a simple script will also do the job. I don't know if it is a bug, that is a question for the developers.

I had similar issues as you and fixed it with the script.

Check out this thread

www.indilib.org/forum/general/2730-how-t...ver-work-for-me.html

it may help.
Lots of trial and error, mainly error, but in hindsight, it was easy!!!
Takahashi FC100DF, Skywatcher HEQ5 Pro via Wifi, QHY-163C, Baader mod Canon 550D, ZWO ASI 224MC on Orion 50mm guide scope, VNC to Asus Tinker Board or Intel Compute Stick in hot spot mode running Ubuntu 18.04LTS and KStars/Ekos...
1 month 2 weeks ago #39609

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

  • Posts: 541
  • Karma: 1
  • Thank you received: 97

Replied by Ihoujin on topic [ indi_gpsd ] Time is not pulled from gpsd?

Kaczorek wrote:

petarm wrote: Hi Kaczorek, yep i did all that, gpsmon in a terminal tells me the gps adapter is connect and working and acquiring gps data. But when i then run gpsd in kstars/ekos, it was not populating UTC, it was using the time from the asus tinker board.


It's a feature not a bug ;-)
GPSD driver gets time from the system not from gps directly. The reason is noted in the comments in the source code:
// Update time regardless having gps fix.
// We are using system time assuming the system is synced with the gps
// by gpsd using chronyd or ntpd.


It looks to me like you need to complete the configuration of NTPD to use the GPS time, then the driver should sync up.
INDI/KStars on Raspberry Pi 3B+
Lubuntu 16.04
Skywatcher HEQ5 Pro Mount
Canon 600D Camera
Orion SSAG @280mm Guide Scope
PHD2
Adafruit Motor Hat shield
Adafruit GPS Module
Generic Bluetooth Joystick.
Startech 7 port powered USB Hub.
Last edit: 1 month 2 weeks ago by Ihoujin.
1 month 2 weeks ago #39625

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

  • Posts: 33
  • Thank you received: 5

Replied by ecloud on topic [ indi_gpsd ] Time is not pulled from gpsd?

As @IHOUJIN described, it very easy to get the GPS time. So why the indi_gpsd does not get it?
To run the ntpd/chrony will cause a problem under indi.
The gpsd is default to run as plug&play mode, that mean it will scan all the serial ports (ttyUSB0 and other ttyXXX). And to setup chrony to sync datetime needs "-n" option of gpsd, which makes gpsd to lock all the serial ports all the time.
So the mount model will report "the device is used by other program" on /dev/ttyUSB0
To fix it we need to turn the plug&play off (USBAUTO=false) and input the device name for gpsd, /dev/ttyACM0 for example.
This is so boring.
BTW, I didn't find any info like above in the document. I wonder if there is anyone really has tried USB gps device with indi.

People need to write a script / or to change many settings to make the gps work for indi. Is it the true design of this function?
Why not get and update the datetime by inde_gpsd?
The following user(s) said Thank You: Herrhausen
Last edit: 2 weeks 3 days ago by ecloud.
2 weeks 3 days ago #40677

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

Replied by knro on topic [ indi_gpsd ] Time is not pulled from gpsd?

I actually just checked the code for the indi-gpsd and was surprised to find that it uses system time... in there a comment that assumes gpsd is synched with ntpd or chronyd but I don't think a driver should make this assumption. I will make it use the GPS actual time and maybe add a switch to toggle this behavior so that the existing use case would be perserved via config switch.
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
The following user(s) said Thank You: Herrhausen, DrawsACircle
2 weeks 1 day ago #40702

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

Replied by knro on topic [ indi_gpsd ] Time is not pulled from gpsd?

Ok fix pushed.
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
The following user(s) said Thank You: Herrhausen, Ihoujin
2 weeks 1 day ago #40704

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

Time to create page: 0.290 seconds