简体   繁体   English

Gpsd错误的时间

[英]Gpsd Wrong Timing

Ehilà everybody! 大家好!

I've this problem: 我有这个问题:

I'm serving ntp (On my Laptop for now ) with GPSD, using an old GPS-Sirf/NMEA module of the company I work for. 我正在使用我工作的公司的旧GPS-Sirf / NMEA模块通过GPSD为ntp服务(目前在我的笔记本电脑上)。

Let's forget about Ntpd.. as soon as I start gpsd, although date and time are correct in gpsmon , if I run an ntpshmmon I have a negative time ( about -69 years in seconds ) in the column tagged as "Real" which I assume to be the clock information of my SHM ( While de column "Clock" is actually the received information ) 让我们忘了Ntpd ..一旦启动gpsd,尽管gpsmon中的日期和时间是正确的, 但是如果我运行ntpshmmon ,则在标记为“真实”的列中我的时间是负数(约- 69年,以秒为单位),假定是我的SHM的时钟信息(而de列“ Clock”实际上是接收到的信息)

If I change module and use an U-blox everything it's ok and the SHM clock return to be +46 years. 如果更换模块并使用U-blox,一切正常,SHM时钟恢复为+46年。 Is there a way to manage the GPS exchange of information with NTP? 有没有办法通过NTP管理GPS信息交换? Or to configure GPS without knowing exactly what GPS module is? 还是要在不知道确切的GPS模块是什么的情况下配置GPS?

Sorry if my question is some kind of airy-fairy... I hope somebody have had my same problem and can detect the clue... 抱歉,如果我的问题是某种童话般的...我希望有人也遇到了同样的问题,并且可以发现线索...

Thx! 谢谢! :) :)

FL FL

The first rule is: Don't Panic . 第一条规则是: 不要惊慌

Try inserting tinker panic 0 into your /etc/ntp.conf 尝试在您的/etc/ntp.conf插入tinker panic 0

ntpd's reaction depends on the difference between the system clock and the reference time. ntpd的反应取决于系统时钟和参考时间之间的差异。

For a tiny offset ntpd will adjust the local clock as usual; 对于一个很小的偏移量,ntpd将照常调整本地时钟。 for small and larger offsets, ntpd will reject the reference time for a while. 对于较小和较大的偏移量,ntpd会暂时拒绝参考时间。 In the latter case the operation system's clock will continue with the last corrections effective while the new reference time is being rejected. 在后一种情况下,操作系统的时钟将继续执行最后的更正,而新的参考时间将被拒绝。 After some time, small offsets (significantly less than a second) will be slewed (adjusted slowly), while larger offsets will cause the clock to be stepped (set anew). 一段时间后,较小的偏移量(显着小于一秒钟)将被摆转(缓慢调整),而较大的偏移量将使时钟步进(重新设置)。 Huge offsets are rejected, and ntpd will terminate itself, believing something very strange must have happened. 巨大的偏移量将被拒绝,并且ntpd会终止自身,以为一定发生了非常奇怪的事情。 ( Citation ) 引文

Setting panic to zero keeps ntpd from strange thoughts presented by large offsets. 将panic设置为零可以使ntpd避免出现大偏移量引起的奇怪想法。

We use one that looks like 我们使用一个看起来像

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

tinker panic 0

# Specify one or more NTP servers.
server 127.127.28.0 minpoll 4 maxpoll 4
fudge 127.127.28.0 time1 0.420 refid GPS
server 127.127.28.1 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.1 refid GPS1

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org

# Use Ubuntu's ntp server as a fallback.
server ntp.ubuntu.com

# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details.  The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust


# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255

# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines.  Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM