Re: [chrony-users] Not getting time from gpsd

2016-08-08 Thread Steve Horton
I see gpsd using the socket but I don't see chrony accessing it at all. Can
you comment out the shm line and strace chrony again? I think that's where
the issue is.

On Aug 7, 2016 10:27 PM, "Chris Greenman" <chris.m.green...@gmail.com>
wrote:

> I've attached the strace files.   The commands I used were:
>
> root@IrishMistII:/tmp# strace -o /tmp/chrony.strace.out chronyd
> root@IrishMistII:/tmp# strace -o /tmp/gpsd.strace.out gpsd -D 8 -F
> /var/run/chrony.ttyACM0.sock /dev/ttyACM0
>
> On Aug 7, 2016 12:50 AM, "Steve Horton" <stevejhor...@gmail.com> wrote:
>
>> We need to see if gpsd is sending and if chrony is rx anything on that
>> socket. I'd start both process in strace to srart. Then maybe start gpsd in
>> debug -D 8 and see if its writing to that chrony socket. Strace will show
>> what's happening underneath.
>>
>> On Aug 6, 2016 11:37 PM, "Chris Greenman" <chris.m.green...@gmail.com>
>> wrote:
>>
>>> $ file /var/run/chrony.ttyACM0.sock
>>> /var/run/chrony.ttyACM0.sock: socket
>>>
>>> cat /etc/init.d/gpsd
>>>
>>> $ cat /etc/init.d/gpsd
>>> #!/bin/sh
>>> ### BEGIN INIT INFO
>>> # Provides:  gpsd
>>> # Required-Start:$remote_fs $syslog $network
>>> # Should-Start:  bluetooth dbus udev
>>> # Required-Stop: $remote_fs $syslog $network
>>> # Default-Start: 2 3 4 5
>>> # Default-Stop:  0 1 6
>>> # X-Start-Before:ntp
>>> # Short-Description: GPS (Global Positioning System) daemon
>>> # Description:   The gpsd service daemon is able to monitor one or
>>> #more GPS devices connected to a host computer,
>>> making
>>> #all data on the location and movements of the
>>> sensors
>>> #available to be queried on TCP port 2947.
>>> ### END INIT INFO
>>>
>>> # Author: Bernd Zeimetz <b...@debian.org>
>>> #
>>> # Please remove the "Author" lines above and replace them
>>> # with your own name if you copy and modify this script.
>>>
>>> # Do NOT "set -e"
>>>
>>> # PATH should only include /usr/* if it runs after the mountnfs.sh script
>>> RUNDIR=/run/gpsd
>>> PATH=/sbin:/usr/sbin:/bin:/usr/bin
>>> DESC="GPS (Global Positioning System) daemon"
>>> NAME=gpsd
>>> DAEMON=/usr/sbin/$NAME
>>> PIDFILE=$RUNDIR/$NAME.pid
>>> SCRIPTNAME=/etc/init.d/$NAME
>>>
>>> # Exit if the package is not installed
>>> [ -x "$DAEMON" ] || exit 0
>>>
>>> # Read configuration variable file if it is present
>>> [ -r /etc/default/$NAME ] && . /etc/default/$NAME
>>>
>>> if [ -z "$GPSD_SOCKET" ] && [ -z "$DEVICES" ]; then
>>> GPSD_SOCKET=/var/run/gpsd.sock
>>> fi
>>>
>>> if [ -n "$GPSD_SOCKET" ]; then
>>> GPSD_OPTIONS="$GPSD_OPTIONS -F $GPSD_SOCKET"
>>> fi
>>>
>>> # Load the VERBOSE setting and other rcS variables
>>> . /lib/init/vars.sh
>>>
>>> # Define LSB log_* functions.
>>> # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
>>> . /lib/lsb/init-functions
>>>
>>> #
>>> # Function that starts the daemon/service
>>> #
>>> do_start()
>>> {
>>> # Return
>>> #   0 if daemon has been started
>>> #   1 if daemon was already running
>>> #   2 if daemon could not be started
>>>
>>> mkdir -p $RUNDIR || return 2
>>>
>>> start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
>>> --test > /dev/null \
>>> || return 1
>>> start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
>>> $GPSD_OPTIONS -P $PIDFILE $DEVICES \
>>> || return 2
>>> }
>>>
>>> #
>>> # Function that stops the daemon/service
>>> #
>>> do_stop()
>>> {
>>> # Return
>>> #   0 if daemon has been stopped
>>> #   1 if daemon was already stopped
>>> #   2 if daemon could not be stopped
>>> #   other if a failure occurred
>>> start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile
>>> $PIDFILE --name $NAME
>>> RETVAL="$?"
>>> [ "$RETVAL" = 2 ] && return 2
>>> # Many daemons don't delete their pidfiles when t

Re: [chrony-users] Not getting time from gpsd

2016-08-07 Thread Steve Horton
We need to see if gpsd is sending and if chrony is rx anything on that
socket. I'd start both process in strace to srart. Then maybe start gpsd in
debug -D 8 and see if its writing to that chrony socket. Strace will show
what's happening underneath.

On Aug 6, 2016 11:37 PM, "Chris Greenman" <chris.m.green...@gmail.com>
wrote:

> $ file /var/run/chrony.ttyACM0.sock
> /var/run/chrony.ttyACM0.sock: socket
>
> cat /etc/init.d/gpsd
>
> $ cat /etc/init.d/gpsd
> #!/bin/sh
> ### BEGIN INIT INFO
> # Provides:  gpsd
> # Required-Start:$remote_fs $syslog $network
> # Should-Start:  bluetooth dbus udev
> # Required-Stop: $remote_fs $syslog $network
> # Default-Start: 2 3 4 5
> # Default-Stop:  0 1 6
> # X-Start-Before:ntp
> # Short-Description: GPS (Global Positioning System) daemon
> # Description:   The gpsd service daemon is able to monitor one or
> #more GPS devices connected to a host computer, making
> #all data on the location and movements of the sensors
> #available to be queried on TCP port 2947.
> ### END INIT INFO
>
> # Author: Bernd Zeimetz <b...@debian.org>
> #
> # Please remove the "Author" lines above and replace them
> # with your own name if you copy and modify this script.
>
> # Do NOT "set -e"
>
> # PATH should only include /usr/* if it runs after the mountnfs.sh script
> RUNDIR=/run/gpsd
> PATH=/sbin:/usr/sbin:/bin:/usr/bin
> DESC="GPS (Global Positioning System) daemon"
> NAME=gpsd
> DAEMON=/usr/sbin/$NAME
> PIDFILE=$RUNDIR/$NAME.pid
> SCRIPTNAME=/etc/init.d/$NAME
>
> # Exit if the package is not installed
> [ -x "$DAEMON" ] || exit 0
>
> # Read configuration variable file if it is present
> [ -r /etc/default/$NAME ] && . /etc/default/$NAME
>
> if [ -z "$GPSD_SOCKET" ] && [ -z "$DEVICES" ]; then
> GPSD_SOCKET=/var/run/gpsd.sock
> fi
>
> if [ -n "$GPSD_SOCKET" ]; then
> GPSD_OPTIONS="$GPSD_OPTIONS -F $GPSD_SOCKET"
> fi
>
> # Load the VERBOSE setting and other rcS variables
> . /lib/init/vars.sh
>
> # Define LSB log_* functions.
> # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
> . /lib/lsb/init-functions
>
> #
> # Function that starts the daemon/service
> #
> do_start()
> {
> # Return
> #   0 if daemon has been started
> #   1 if daemon was already running
> #   2 if daemon could not be started
>
> mkdir -p $RUNDIR || return 2
>
> start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test
> > /dev/null \
> || return 1
> start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
> $GPSD_OPTIONS -P $PIDFILE $DEVICES \
> || return 2
> }
>
> #
> # Function that stops the daemon/service
> #
> do_stop()
> {
> # Return
> #   0 if daemon has been stopped
> #   1 if daemon was already stopped
> #   2 if daemon could not be stopped
> #   other if a failure occurred
> start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE
> --name $NAME
> RETVAL="$?"
> [ "$RETVAL" = 2 ] && return 2
> # Many daemons don't delete their pidfiles when they exit.
> rm -f $PIDFILE
> return "$RETVAL"
> }
>
> #
> # Function that sends a SIGHUP to the daemon/service
> #
> do_reload() {
> #
> # If the daemon can reload its configuration without
> # restarting (for example, when it is sent a SIGHUP),
> # then implement that here.
> #
> start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
> return 0
> }
>
> case "$1" in
>   start)
> if [ "$START_DAEMON" = "true" ]; then
> [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
> do_start
> case "$?" in
> 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
> 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
> esac
> else
> [ "$VERBOSE" != no ] && \
> log_daemon_msg "Not starting $DESC" "$NAME" && \
> log_end_msg 0
> fi
> ;;
>   stop)
> [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
> do_stop
> case "$?" in
> 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
> 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
> esac
> ;;
>   status)
>status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
>;;
>   reload|force-reload)
> log_da

Re: [chrony-users] Getting chrony status

2016-08-07 Thread Steve Horton
It will only show synchronized after such time. It'll be the last line I
think. I pipe it out to a file and grep, loop, clear file, sleep 1 min,
repeat. Not pretty but it works.

On Aug 6, 2016 11:06 PM, "Mauro Condarelli" <mc5...@mclink.it> wrote:

> Thanks Steve.
> I know about "chronyc tracking", but that is human-readable info.
> I need to parse it (in a shell script) to delay starting of my app until
> time has settled down.
> Is it enough to wait for "Leap status" to go to "Normal"?
> ... or should I take into consideration other values?.
>
> typical output at startup is:
>
> / # chronyc tracking
>
> Reference ID: 0.0.0.0 ()
>
> Stratum : 0
>
> Ref time (UTC)  : Thu Jan  1 00:00:00 1970
>
> System time : 0.010319719 seconds fast of NTP time
>
> Last offset : +0.0 seconds
>
> RMS offset  : 0.0 seconds
>
> Frequency   : 6.202 ppm slow
>
> Residual freq   : +0.000 ppm
>
> Skew: 0.000 ppm
>
> Root delay  : 0.00 seconds
>
> Root dispersion : 0.00 seconds
>
> Update interval : 0.0 seconds
>
> Leap status : Not synchronised
>
>
> while a "well behaved" entry looks like:
>
> / # chronyc tracking
>
> Reference ID: 212.45.144.16 (saguaro.bilink.it)
>
> Stratum : 3
>
> Ref time (UTC)  : Sun Aug  7 02:57:32 2016
>
> System time : 0.08512 seconds fast of NTP time
>
> Last offset : -0.000437271 seconds
>
> RMS offset  : 0.000437271 seconds
>
> Frequency   : 6.202 ppm slow
>
> Residual freq   : -7.681 ppm
>
> Skew: 0.040 ppm
>
> Root delay  : 0.024563 seconds
>
> Root dispersion : 0.047727 seconds
>
> Update interval : 1.9 seconds
>
> Leap status : Normal
>
>
>
> Il 07/08/2016 01:07, Steve Horton ha scritto:
>
>>
>> Chronyc tracking -will show how "off" you are from the time of your
>> servers UTC. I usually set my clocks in the bios to utc, or very close and
>> chrony will use this as a starting point after boot.
>>
>>
>> On Aug 6, 2016 12:11 PM, "Mauro Condarelli" <mc5...@mclink.it > mc5...@mclink.it>> wrote:
>>
>> Hi,
>> I need to start an application with stable and confirmed date,
>> i.e.: after chrony has started, initialized and set the system clock to
>> some presumably valid value.
>> Since I am using clock skewing if system time is in the future (need
>> strictly monotonic time), internet connection may be missing at startup and
>> several other mishaps, it may take a somewhat long time for chrony to
>> stabilize (even several minutes).
>>
>> How can I test (from shell script) if and when system time is
>> (supposed to be) stable?
>>
>> TiA
>> Mauro
>>
>> -- To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org
>> <mailto:chrony-users-requ...@chrony.tuxfamily.org> with "unsubscribe" in
>> the subject.
>> For help email chrony-users-requ...@chrony.tuxfamily.org > chrony-users-requ...@chrony.tuxfamily.org> with "help" in the subject.
>> Trouble?  Email listmas...@chrony.tuxfamily.org > listmas...@chrony.tuxfamily.org>.
>>
>>
>
> --
> To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org with
> "unsubscribe" in the subject.
> For help email chrony-users-requ...@chrony.tuxfamily.org with "help" in
> the subject.
> Trouble?  Email listmas...@chrony.tuxfamily.org.
>
>


Re: [chrony-users] Not getting time from gpsd

2016-08-07 Thread Steve Horton
Sorry..i meant your start script. So do you start gpsd after chrony is
allready running and the sock created? Does it get built correctly? Can you
do a file on it?

On Aug 6, 2016 10:29 PM, "Chris Greenman" <chris.m.green...@gmail.com>
wrote:

> No gpsd.conf.  /etc/default/gpsd is :
>
> # Default settings for the gpsd init script and the hotplug wrapper.
>
> # Start the gpsd daemon automatically at boot time
> START_DAEMON="true"
>
> # Use USB hotplugging to add new USB devices automatically to the daemon
> USBAUTO="true"
>
> # Devices gpsd should collect to at boot time.
> # They need to be read/writeable, either by user gpsd or the group dialout.
> DEVICES="/dev/ttyACM0"
>
> # Other options you want to pass to gpsd
> GPSD_OPTIONS="-F /var/run/chrony.ttyACM0.sock"
>
>
>
> $ ps -ef |grep gpsd |grep -v grep
> gpsd 31426 1  0 13:36 ?00:00:00 /usr/sbin/gpsd -N -F
> /var/run/chrony.ttyACM0.sock /dev/ttyACM0
>
> cgps shows 3d fix
>
> On Sat, Aug 6, 2016 at 2:11 PM, Steve Horton <stevejhor...@gmail.com>
> wrote:
>
>> Ok..can I see your gpsd conf?
>>
>> On Aug 6, 2016 1:39 PM, "Chris Greenman" <chris.m.green...@gmail.com>
>> wrote:
>>
>>> I only included the relevant lines.  When the socket didn't work either
>>> I commented it out and went back to shm
>>>
>>> Here is my full chrony.conf.  Note, I commented out the ntp servers so
>>> that I can just concentrate on troubleshooting the GPS clock and
>>> uncommented the SOCK line
>>>
>>>
>>> #server 0.us.pool.ntp.org
>>> #server 1.us.pool.ntp.org
>>> #server 2.us.pool.ntp.org
>>> #server 3.us.pool.ntp.org
>>>
>>> driftfile /var/lib/chrony/drift
>>>
>>> allow
>>>
>>> # set larger delay to allow the NMEA source to overlap with
>>> # the other sources and avoid the falseticker status
>>> refclock SHM 0 refid GPS precision 1e-1 offset 0. delay 0.2
>>> #refclock SHM 1 refid PPS precision 1e-9
>>> refclock SOCK /var/run/chrony.ttyACM0.sock refid GPSS
>>>
>>> makestep 1 -1
>>>
>>>
>>>
>>>
>>> On Sat, Aug 6, 2016 at 10:41 AM, Steve Horton <stevejhor...@gmail.com>
>>> wrote:
>>>
>>>> Not really Chris. I don't see a sock option in your configuration file.
>>>> Gpsd should write time out to a device file some where and chrony can read
>>>> the time from that device file via a Unix domain socket. Like I said..look
>>>> into the sock option  and how it relates to gpsd.
>>>>
>>>> On Aug 6, 2016 10:10 AM, "Chris Greenman" <chris.m.green...@gmail.com>
>>>> wrote:
>>>>
>>>>> Same thing.  Already tried it.
>>>>>
>>>>> On Aug 6, 2016 6:35 AM, "Steve Horton" <stevejhor...@gmail.com> wrote:
>>>>>
>>>>>> I'd look closer at the SOCK option under the refclock section.
>>>>>> https://chrony.tuxfamily.org/manual.html#refclock-directive
>>>>>>
>>>>>> On Aug 6, 2016 12:00 AM, "Chris Greenman" <chris.m.green...@gmail.com>
>>>>>> wrote:
>>>>>> >
>>>>>> > Hello,
>>>>>> > I'm having an issue with getting time from gpsd.
>>>>>> >
>>>>>> > My setup is:
>>>>>> > Raspberry Pi 3 running Jessie Lite
>>>>>> > USB U-Blox gps
>>>>>> >
>>>>>> > gpsd is receiving NMEA from the GPS, cgps also shows time and
>>>>>> position properly.
>>>>>> >
>>>>>> > My chrony.conf is:
>>>>>> >>
>>>>>> >> server 0.us.pool.ntp.org
>>>>>> >> server 1.us.pool.ntp.org
>>>>>> >> server 2.us.pool.ntp.org
>>>>>> >> server 3.us.pool.ntp.org
>>>>>> >> driftfile /var/lib/chrony/drift
>>>>>> >> allow
>>>>>> >> refclock SHM 0 refid GPS precision 1e-1 offset 0. delay 0.2
>>>>>> >> makestep 1 -1
>>>>>> >>
>>>>>> > Chronyc sources shows this:
>>>>>> >>
>>>>>> >> $ chronyc sources
>>>>>> >> 210 Number of sources = 5
>>>>>> >> MS Name/IP address Stratum Poll Reach LastRx Last sample
>>>>>> >> 
>>>>>> ===
>>>>>> >> #? GPS   0   4 0   10y +0ns[
>>>>>> +0ns] +/-0ns
>>>>>> >> ^+ time-c.nist.gov   1   9   375   110-23ms[
>>>>>>  -22ms] +/-   47ms
>>>>>> >> ^* pool-96-248-122-64.cmdnnj 1  10   37756  +9749us[
>>>>>>  +11ms] +/-   18ms
>>>>>> >> ^- 104.156.99.2262   9   377   367+15ms[
>>>>>>  +17ms] +/-  107ms
>>>>>> >> ^- 4.53.160.75
>>>>>> >>
>>>>>> > This system is going to be used on a boat and might not have
>>>>>> internet.  I can tell that both programs are accessing the shared memory
>>>>>> using ipcs -m:
>>>>>> >
>>>>>> >> -- Shared Memory Segments 
>>>>>> >> keyshmid  owner  perms  bytes  nattch
>>>>>> status
>>>>>> >> 0x4e545030 0  root   60080 2
>>>>>>
>>>>>> >> 0x4e545031 32769  root   60080 1
>>>>>> >>
>>>>>> > Any idea why chrony isn't getting time from the GPS?
>>>>>> >
>>>>>> > Thanks
>>>>>>
>>>>>
>>>
>


Re: [chrony-users] Getting chrony status

2016-08-06 Thread Steve Horton
Chronyc tracking -will show how "off" you are from the time of your servers
UTC. I usually set my clocks in the bios to utc, or very close and chrony
will use this as a starting point after boot.

On Aug 6, 2016 12:11 PM, "Mauro Condarelli"  wrote:

> Hi,
> I need to start an application with stable and confirmed date, i.e.:
> after chrony has started, initialized and set the system clock to some
> presumably valid value.
> Since I am using clock skewing if system time is in the future (need
> strictly monotonic time), internet connection may be missing at startup and
> several other mishaps, it may take a somewhat long time for chrony to
> stabilize (even several minutes).
>
> How can I test (from shell script) if and when system time is (supposed to
> be) stable?
>
> TiA
> Mauro
>
> --
> To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org with
> "unsubscribe" in the subject.
> For help email chrony-users-requ...@chrony.tuxfamily.org with "help" in
> the subject.
> Trouble?  Email listmas...@chrony.tuxfamily.org.
>
>


Re: [chrony-users] Not getting time from gpsd

2016-08-06 Thread Steve Horton
Ok..can I see your gpsd conf?

On Aug 6, 2016 1:39 PM, "Chris Greenman" <chris.m.green...@gmail.com> wrote:

> I only included the relevant lines.  When the socket didn't work either I
> commented it out and went back to shm
>
> Here is my full chrony.conf.  Note, I commented out the ntp servers so
> that I can just concentrate on troubleshooting the GPS clock and
> uncommented the SOCK line
>
>
> #server 0.us.pool.ntp.org
> #server 1.us.pool.ntp.org
> #server 2.us.pool.ntp.org
> #server 3.us.pool.ntp.org
>
> driftfile /var/lib/chrony/drift
>
> allow
>
> # set larger delay to allow the NMEA source to overlap with
> # the other sources and avoid the falseticker status
> refclock SHM 0 refid GPS precision 1e-1 offset 0. delay 0.2
> #refclock SHM 1 refid PPS precision 1e-9
> refclock SOCK /var/run/chrony.ttyACM0.sock refid GPSS
>
> makestep 1 -1
>
>
>
>
> On Sat, Aug 6, 2016 at 10:41 AM, Steve Horton <stevejhor...@gmail.com>
> wrote:
>
>> Not really Chris. I don't see a sock option in your configuration file.
>> Gpsd should write time out to a device file some where and chrony can read
>> the time from that device file via a Unix domain socket. Like I said..look
>> into the sock option  and how it relates to gpsd.
>>
>> On Aug 6, 2016 10:10 AM, "Chris Greenman" <chris.m.green...@gmail.com>
>> wrote:
>>
>>> Same thing.  Already tried it.
>>>
>>> On Aug 6, 2016 6:35 AM, "Steve Horton" <stevejhor...@gmail.com> wrote:
>>>
>>>> I'd look closer at the SOCK option under the refclock section.
>>>> https://chrony.tuxfamily.org/manual.html#refclock-directive
>>>>
>>>> On Aug 6, 2016 12:00 AM, "Chris Greenman" <chris.m.green...@gmail.com>
>>>> wrote:
>>>> >
>>>> > Hello,
>>>> > I'm having an issue with getting time from gpsd.
>>>> >
>>>> > My setup is:
>>>> > Raspberry Pi 3 running Jessie Lite
>>>> > USB U-Blox gps
>>>> >
>>>> > gpsd is receiving NMEA from the GPS, cgps also shows time and
>>>> position properly.
>>>> >
>>>> > My chrony.conf is:
>>>> >>
>>>> >> server 0.us.pool.ntp.org
>>>> >> server 1.us.pool.ntp.org
>>>> >> server 2.us.pool.ntp.org
>>>> >> server 3.us.pool.ntp.org
>>>> >> driftfile /var/lib/chrony/drift
>>>> >> allow
>>>> >> refclock SHM 0 refid GPS precision 1e-1 offset 0. delay 0.2
>>>> >> makestep 1 -1
>>>> >>
>>>> > Chronyc sources shows this:
>>>> >>
>>>> >> $ chronyc sources
>>>> >> 210 Number of sources = 5
>>>> >> MS Name/IP address Stratum Poll Reach LastRx Last sample
>>>> >> 
>>>> ===
>>>> >> #? GPS   0   4 0   10y +0ns[   +0ns]
>>>> +/-0ns
>>>> >> ^+ time-c.nist.gov   1   9   375   110-23ms[
>>>>  -22ms] +/-   47ms
>>>> >> ^* pool-96-248-122-64.cmdnnj 1  10   37756  +9749us[  +11ms]
>>>> +/-   18ms
>>>> >> ^- 104.156.99.2262   9   377   367+15ms[  +17ms]
>>>> +/-  107ms
>>>> >> ^- 4.53.160.75
>>>> >>
>>>> > This system is going to be used on a boat and might not have
>>>> internet.  I can tell that both programs are accessing the shared memory
>>>> using ipcs -m:
>>>> >
>>>> >> -- Shared Memory Segments 
>>>> >> keyshmid  owner  perms  bytes  nattch
>>>> status
>>>> >> 0x4e545030 0  root   60080 2
>>>>
>>>> >> 0x4e545031 32769  root   60080 1
>>>> >>
>>>> > Any idea why chrony isn't getting time from the GPS?
>>>> >
>>>> > Thanks
>>>>
>>>
>


Re: [chrony-users] Not getting time from gpsd

2016-08-06 Thread Steve Horton
Agreed. Shms live in /dev along with the real time clocks /dev/rtc0. Your
kernel config dictates what's there. Look around in dev and see what shms
are there and mod your chrony configuration to point to one of them and
check tracking. I'd also comment out all server lines until you get it
syncing with the GPS device.

On Aug 6, 2016 11:18 AM, "Bill Unruh" <un...@physics.ubc.ca> wrote:

> shm should also work. Question is if they are reading the same shm
> location.
>
>
>
>
> William G. Unruh __| Canadian Institute for| Tel: +1(604)822-3273
> Physics _|___ Advanced Research _| Fax: +1(604)822-5324
> UBC, Vancouver,BC _|_ Program in Cosmology | un...@physics.ubc.ca
> Canada V6T 1Z1 | and Gravity __|_ www.theory.physics.ubc.ca/
>
> On Sat, 6 Aug 2016, Steve Horton wrote:
>
>
>> Not really Chris. I don't see a sock option in your configuration file.
>> Gpsd should write time out to a device
>> file some where and chrony can read the time from that device file via a
>> Unix domain socket. Like I said..look
>> into the sock option  and how it relates to gpsd.
>>
>>
>> On Aug 6, 2016 10:10 AM, "Chris Greenman" <chris.m.green...@gmail.com>
>> wrote:
>>
>>   Same thing.  Already tried it.
>>
>>
>>   On Aug 6, 2016 6:35 AM, "Steve Horton" <stevejhor...@gmail.com>
>> wrote:
>>
>> I'd look closer at the SOCK option under the refclock section.
>> https://chrony.tuxfamily.org/manual.html#refclock-directive
>>
>> On Aug 6, 2016 12:00 AM, "Chris Greenman" <
>> chris.m.green...@gmail.com> wrote:
>> >
>> > Hello,
>> > I'm having an issue with getting time from gpsd.
>> >
>> > My setup is:
>> > Raspberry Pi 3 running Jessie Lite
>> > USB U-Blox gps
>> >
>> > gpsd is receiving NMEA from the GPS, cgps also shows time
>> and position properly.
>> >
>> > My chrony.conf is:
>> >>
>> >> server 0.us.pool.ntp.org
>> >> server 1.us.pool.ntp.org
>> >> server 2.us.pool.ntp.org
>> >> server 3.us.pool.ntp.org
>> >> driftfile /var/lib/chrony/drift
>> >> allow
>> >> refclock SHM 0 refid GPS precision 1e-1 offset 0.
>> delay 0.2
>> >> makestep 1 -1
>> >>
>> > Chronyc sources shows this:
>> >>
>> >> $ chronyc sources
>> >> 210 Number of sources = 5
>> >> MS Name/IP address Stratum Poll Reach LastRx Last
>> sample
>> >> ==
>> =
>> >> #? GPS   0   4 0   10y
>> +0ns[   +0ns] +/-0ns
>> >> ^+ time-c.nist.gov   1   9   375   110
>>  -23ms[  -22ms] +/-   47ms
>> >> ^* pool-96-248-122-64.cmdnnj 1  10   37756
>>  +9749us[  +11ms] +/-   18ms
>> >> ^- 104.156.99.2262   9   377   367
>>  +15ms[  +17ms] +/-  107ms
>> >> ^- 4.53.160.75
>> >>
>> > This system is going to be used on a boat and might not
>> have internet.  I can tell
>> that both programs are accessing the shared memory using ipcs
>> -m:
>> >
>> >> -- Shared Memory Segments 
>> >> keyshmid  owner  perms  bytes
>>  nattch status
>> >> 0x4e545030 0  root   60080 2
>>
>> >> 0x4e545031 32769  root   60080 1
>> >>
>> > Any idea why chrony isn't getting time from the GPS?
>> >
>> > Thanks
>>
>>
>>


Re: [chrony-users] Not getting time from gpsd

2016-08-06 Thread Steve Horton
I'd look closer at the SOCK option under the refclock section.
https://chrony.tuxfamily.org/manual.html#refclock-directive

On Aug 6, 2016 12:00 AM, "Chris Greenman" 
wrote:
>
> Hello,
> I'm having an issue with getting time from gpsd.
>
> My setup is:
> Raspberry Pi 3 running Jessie Lite
> USB U-Blox gps
>
> gpsd is receiving NMEA from the GPS, cgps also shows time and position
properly.
>
> My chrony.conf is:
>>
>> server 0.us.pool.ntp.org
>> server 1.us.pool.ntp.org
>> server 2.us.pool.ntp.org
>> server 3.us.pool.ntp.org
>> driftfile /var/lib/chrony/drift
>> allow
>> refclock SHM 0 refid GPS precision 1e-1 offset 0. delay 0.2
>> makestep 1 -1
>>
> Chronyc sources shows this:
>>
>> $ chronyc sources
>> 210 Number of sources = 5
>> MS Name/IP address Stratum Poll Reach LastRx Last sample
>>
===
>> #? GPS   0   4 0   10y +0ns[   +0ns] +/-
   0ns
>> ^+ time-c.nist.gov   1   9   375   110-23ms[  -22ms] +/-
  47ms
>> ^* pool-96-248-122-64.cmdnnj 1  10   37756  +9749us[  +11ms] +/-
  18ms
>> ^- 104.156.99.2262   9   377   367+15ms[  +17ms] +/-
 107ms
>> ^- 4.53.160.75
>>
> This system is going to be used on a boat and might not have internet.  I
can tell that both programs are accessing the shared memory using ipcs -m:
>
>> -- Shared Memory Segments 
>> keyshmid  owner  perms  bytes  nattch status

>> 0x4e545030 0  root   60080 2

>> 0x4e545031 32769  root   60080 1
>>
> Any idea why chrony isn't getting time from the GPS?
>
> Thanks