大网数据广告活动
服务器运维问答

chrony and gpsd: socket or PPS connection

· 52CE 我爱测

I've try to get high precision time from gps receiver GlobalSat BU-353s4 ( /dev/ttyUSB0 ) through gpsd in Raspberry PI with ArchLinux. /etc/chrony.conf contains: refclock SHM 0 delay 0.5 refid NEMA refclock SHM 1 offset 0.0 delay…

问题原文

原帖链接 · Stanislav Ivanov · CC BY-SA 3.0

I've try to get high precision time from gps receiver GlobalSat BU-353s4 (/dev/ttyUSB0) through gpsd in Raspberry PI with ArchLinux.

/etc/chrony.conf contains:

refclock SHM 0  delay 0.5 refid NEMA
refclock SHM 1 offset 0.0 delay 0.1 refid PPS
refclock SOCK /var/run/chrony.ttyUSB0.sock delay 0.0 refid SOCK

I've get time through NEMA (SHM 0 source) (but with low accuracy).

gpsd did not find kernel PPS extension, as the result SHM 1 source did not working:

gpsd:WARN: KPPS:/dev/ttyUSB0 kernel PPS unavailable, PPS accuracy will suffer

But lsmod shows that pps modules is loaded:

# lsmod
Module                  Size  Used by
pps_ldisc               2305  0
pps_core                7982  1 pps_ldisc

Socket source also did not working:

# chronyc sources
210 Number of sources = 9
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
#x NEMA                          0   4   377    18   -532ms[ -532ms] +/-  252ms
#? SOCK                          0   4     0     -     +0ns[   +0ns] +/-    0ns

But gpsd -N -D8 /dev/ttyUSB0 shows that sock file is opened:

gpsd:RAW: PPS:/dev/ttyUSB0 using chrony socket: /var/run/chrony.ttyUSB0.sock

The question: How to make kernel PPS available for gpsd or make the socket work?

已采纳解答

原帖链接 · robin · CC BY-SA 3.0

First, pps is NOT available via USB. You need to use a direct connection. USB is polled and thus cannot provide an accurate enough signal. I learned this trying to set up some Windows boxes at work.

Your GPS module doesn't have PPS out, it will be on a separate pin or connector. This needs to be connected to a GPIO pin on the Pi.

I have just set up two Pi's for ntp and this is the site I used for reference using the Adafruit GPS module. (Picture with blue box)

http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html

I fought with the second one because I didn't have a GPS lock as I needed a second antenna and it was raining outside.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-04-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。