gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-users] Setting the time via NTP


From: Lisandro Damián Nicanor Pérez Meyer
Subject: [gpsd-users] Setting the time via NTP
Date: Wed, 25 Jul 2012 14:10:29 -0300
User-agent: KMail/1.13.7 (Linux/3.2.21+edid; KDE/4.8.4; x86_64; ; )

I'm having some problems while trying to set the system time of a board with 
gpsd, so I though that it would be better to ask to those who know =)

= Situation

I have a GPS receiver attached to a PC which outputs the NMEA sentences as UDP 
broadcast:

cat /dev/ttyS0 | netcat -b -u 192.168.255.255 4886

Yes, the device works perfectly with gpsd if I start it in that machine with 
/dev/ttyS0.

But as my board will be receiving NMEA trough UDP (I can't change this) I'm 
broadcasting it like this.

Then I have my mips board with Debian and gpsd running on it.

address@hidden:~# cat /etc/default/gpsd 
# Default settings for gpsd.
# Please do not edit this file directly - use `dpkg-reconfigure gpsd' to
# change the options.
START_DAEMON="true"
GPSD_OPTIONS="-n -G"
DEVICES="udp://0.0.0.0:4886"
USBAUTO="true"
GPSD_SOCKET="/var/run/gpsd.sock"

If I run gpsmon it works perefectly.

= Using NTP

The pint is that my board does not has a RTC with battery, so it forgets about 
the time every time it's switched off. More over, it would not be connected to 
the internet while in production, so I thought it would be good to use the 
instance of gpsd running on it to set the time. So i added:

server 127.127.28.0 
fudge 127.127.28.0 time1 0.420 refid GPS

server 127.127.28.1 prefer
fudge 127.127.28.1 refid GPS1

At the bottom of /etc/ntp.conf. Polling ntpq after some minutes:

address@hidden:~# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 SHM(0)          .GPS.            0 l    -   64    0    0.000    0.000   0.000
 SHM(1)          .GPS1.           0 l    -   64    0    0.000    0.000   0.000

address@hidden:~# ntpq
ntpq> cl
associd=0 status=00f1 , 15 events, clk_no_reply,
device="SHM/Shared memory interface", timecode=, poll=19, noreply=21,
badformat=0, baddata=19, fudgetime1=420.000, stratum=0, refid=GPS,
flags=0

= Without PPS

I repeated the experiment without using the PPS entry, and I get:

address@hidden:~# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 SHM(0)          .GPS.            0 l    -   64    0    0.000    0.000   0.000

address@hidden:~# ntpq
ntpq> cl
associd=0 status=00f1 , 15 events, clk_no_reply,
device="SHM/Shared memory interface", timecode=, poll=33, noreply=58,
badformat=0, baddata=33, fudgetime1=420.000, stratum=0, refid=GPS,
flags=0

The date has, of coure, not changed and still far away:

address@hidden:~# LANG=C date
Wed Dec 31 22:35:06 ART 1969

Any ideas of what I may be missing?

Kinds regards, Lisandro.

-- 
"La política es una actividad noble. Hay que revalorizarla, ejerciéndola con
vocación y una dedicación que exige testimonio, martirio, o sea, morir
por el bien común."
  Padre Bergoglio - http://www.lanacion.com.ar/1153060

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]