Re: [gpsd-users] time setting chicken and egg

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [gpsd-users] time setting chicken and egg

by Yan Seiner :: Rate this Message:

| View Threaded | Show Only this Message

Do you have a script or some hints on how to do that?

Thanks.


David Edwards wrote:

> What I've done in the past is to just directly read the GPS NMEA
> stream, parse out the time, set the date/time, and then fire up gpsd
> and let it handle fine adjustments.
>
> On Sun, Oct 23, 2011 at 9:50 PM, Yan Seiner <yan@...
> <mailto:yan@...>> wrote:
>
>     I'm working on a platform that is mobile it sometimes has access
>     to the internet and sometimes not.   The hardware does not have a
>     RTC so at power-up it sets the clock to something like Dec 31, 1969.
>
>     I'm trying to set up chrony + gpsd to set the time from the gps
>     directly.
>
>     The behavior I'm seeing from gpsd is that it won't report a time
>     to chrony until the system clock is close to what gpsd is seeing
>     from the gps.  I have not found a way to override this.
>
>     I'm attaching a log of what happens.  On wifi connect the system
>     gets a system time via rdate, at which point gpsd and chrony start
>     to function normally.  You can see that gpsd reports a discrepancy
>     and chrony doesn't set the clock at all.....
>
>     Does anyone have any ideas on where to look?
>
>     --
>     Few people are capable of expressing with equanimity opinions
>     which differ from the prejudices of their social environment. Most
>     people are even incapable of forming such opinions.
>       Albert Einstein
>


--
Few people are capable of expressing with equanimity opinions which differ from the prejudices of their social environment. Most people are even incapable of forming such opinions.
    Albert Einstein

_______________________________________________
Gpsd-users mailing list
Gpsd-users@...
https://lists.berlios.de/mailman/listinfo/gpsd-users

Re: [gpsd-users] time setting chicken and egg

by Wouter Pelgrum :: Rate this Message:

| View Threaded | Show Only this Message

Check out the makestep command in the chrony.conf.

4.2.27 makestep
Normally chronyd will cause the system to gradually correct any time offset, by slowing down or speeding up the clock as required. In certain situations, the system clock may be so far adrift that this slewing process would take a very long time to correct the system clock.

This directive forces chronyd to step system clock if the adjustment is larger than a threshold value, but only if there were no more clock updates since chronyd was started than a specified limit (a negative value can be used to disable the limit).

This is particularly useful when using reference clocks, because the initstepslew directive (see section initstepslew) works only with NTP sources.

An example of the use of this directive is

 
makestep 1000 10
This would step system clock if the adjustment is larger than 1000 seconds, but only in the first ten clock updates.



On Sunday Oct 23 2011, at 22:15:36, Yan Seiner wrote:

> Do you have a script or some hints on how to do that?
>
> Thanks.
>
>
> David Edwards wrote:
>> What I've done in the past is to just directly read the GPS NMEA stream, parse out the time, set the date/time, and then fire up gpsd and let it handle fine adjustments.
>>
>> On Sun, Oct 23, 2011 at 9:50 PM, Yan Seiner <yan@... <mailto:yan@...>> wrote:
>>
>>    I'm working on a platform that is mobile it sometimes has access
>>    to the internet and sometimes not.   The hardware does not have a
>>    RTC so at power-up it sets the clock to something like Dec 31, 1969.
>>
>>    I'm trying to set up chrony + gpsd to set the time from the gps
>>    directly.
>>
>>    The behavior I'm seeing from gpsd is that it won't report a time
>>    to chrony until the system clock is close to what gpsd is seeing
>>    from the gps.  I have not found a way to override this.
>>
>>    I'm attaching a log of what happens.  On wifi connect the system
>>    gets a system time via rdate, at which point gpsd and chrony start
>>    to function normally.  You can see that gpsd reports a discrepancy
>>    and chrony doesn't set the clock at all.....
>>
>>    Does anyone have any ideas on where to look?
>>
>>    --     Few people are capable of expressing with equanimity opinions
>>    which differ from the prejudices of their social environment. Most
>>    people are even incapable of forming such opinions.
>>      Albert Einstein
>>
>
>
> --
> Few people are capable of expressing with equanimity opinions which differ from the prejudices of their social environment. Most people are even incapable of forming such opinions.
>   Albert Einstein
>
> _______________________________________________
> Gpsd-users mailing list
> Gpsd-users@...
> https://lists.berlios.de/mailman/listinfo/gpsd-users

_______________________________________________
Gpsd-users mailing list
Gpsd-users@...
https://lists.berlios.de/mailman/listinfo/gpsd-users

Re: [gpsd-users] time setting chicken and egg

by Yan Seiner :: Rate this Message:

| View Threaded | Show Only this Message

Wouter Pelgrum wrote:
> Check out the makestep command in the chrony.conf.
That was my initial thought too..... Unfortunately if the time
difference is great enough gpsd reports the (broken) system time and not
the gps time, so makestep does not do any good until the system time is
set and I need gpsd to report the gps time to do that.

I write out a file datestamped with the time gps reports so I know it's
gpsd and not chrony....

It would be really useful in cases like this to have a flag to tell gpsd
to ignore system time and just report gps time.

--
Few people are capable of expressing with equanimity opinions which differ from the prejudices of their social environment. Most people are even incapable of forming such opinions.
    Albert Einstein

_______________________________________________
Gpsd-users mailing list
Gpsd-users@...
https://lists.berlios.de/mailman/listinfo/gpsd-users