×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

How to use smartphone GPS with INDI-GPSD

  • Posts: 1309
  • Thank you received: 226
Regarding setting Linux system time with GPS/NTP server, from my experience the NTP daemon will not sync the system time if it is too far off automatically. It considers the time to be in error. My solution is to run a python script to force the system time to sync with the NMEA source. NTP will then keep in sync. My script requires Sudo, perhaps it can be improved or a replacement integrated? Because if Kstars/INDI can keep my system clock set, that is one less thing to do when I power on a Raspberry Pi.
Time sync script:
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)

It also requires configuration of ntp.conf with the addition of these lines.
server 127.127.28.0 minpoll 4
fudge  127.127.28.0 time1 0.183 refid NMEA
server 127.127.28.1 minpoll 4 prefer
fudge  127.127.28.1 refid PPS
6 years 5 months ago #20445

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

  • Posts: 447
  • Thank you received: 30
I tried this driver today.

It will work fine without GPSD! !

But time was registered a little bit.

Tried environment
OrangePi 2 plus (WiFi AP mode)
ubuntu 16.04
iPad 2 (GPS model)
GPS 2 IP

I attach photos.
The following user(s) said Thank You: Jasem Mutlaq
6 years 5 months ago #20454
Attachments:

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

Thanks for testing! The GPS NMEA driver does not change system not. At least not yet.
6 years 5 months ago #20455

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

  • Posts: 2877
  • Thank you received: 812

Yes, It does not use gpsd, Jasem wanted to avoid that. The phone's NMEA server communicates straight to the INDI driver. This of course means that currently the system time is not updated, just the time in KStars.
6 years 5 months ago #20456

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

  • Posts: 447
  • Thank you received: 30
Connecting without using GPSD is a big improvement!
(Connection with smartphone is not complicated)

I did not have enough words.
A time offset is sent.
The ipad time is the same as the screen time on the upper right, but in my environment, it will be registered in about 5 minutes in another time.
6 years 5 months ago #20459

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

  • Posts: 447
  • Thank you received: 30
Compare with the time part of the driver.
6 years 5 months ago #20461

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

  • Posts: 447
  • Thank you received: 30
That is a correction.
It is time display of Kstars.

Several minutes have elapsed since setting the time from the driver.

When sending GPS transmission ipad, VNC remote OSX will display the same time, but the time of kstars synchronized with the driver and telescope driver will be registered about 5 minutes apart.
6 years 5 months ago #20462

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

  • Posts: 447
  • Thank you received: 30
I tested it later.

As written earlier, different times are written to the driver. (Different about 5 minutes)

Latitude, longitude, and time information are not sent to the mount.

I am logging, so please check.
Last edit: 6 years 5 months ago by T-Studio.
6 years 5 months ago #20487

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

  • Posts: 447
  • Thank you received: 30
I can not send a log file. .
Last edit: 6 years 5 months ago by T-Studio.
6 years 5 months ago #20488

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

Can anyone else confirm? All the times and locations setting here are propagated just fine to clients and drivers.
6 years 5 months ago #20491

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

  • Posts: 447
  • Thank you received: 30
I got a log again.
See also the image.
Last edit: 6 years 5 months ago by T-Studio.
6 years 5 months ago #20494
Attachments:

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

  • Posts: 2877
  • Thank you received: 812
I think mine did work, but I cannot say for sure because it is very similar to the time and location the computer already had. But I do notice that in your iNDI control panel, you clicked "Device." To my knowledge that means it gets its time/date information from the mount. When you click "computer", I believe that means it gets its information from the computer and sends it to the mount. I think in this case you want the GPS information from the GPS device to be used and for that to go to the mount. There almost needs to be a 3rd button. But I think if you have selected computer, it sends it from the computer unless it has a GPS and then it sends it from that. Am I correct in this thinking?
6 years 5 months ago #20512

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

Time to create page: 0.366 seconds