Eu usei para registrar dados do sensor enquanto não estava conectado à Internet. Eu quero usar um receptor de GPS para a hora. Eu gostaria de usar gpsd e chrony para conseguir isso.
aqui está o meu arquivo chrony.conf
.
# add servers of your timezone for time synchronization
#server 0.asia.pool.ntp.org iburst
# This directive sets the key ID used for authenticating user commands via the
# 'chronyc' program at run time.
# commandkey 1
# I moved the driftfile to /var/lib/chrony to comply with the Debian
# filesystem standard.
driftfile /var/lib/chrony/drift
makestep 1 10
keyfile /etc/chrony/chrony.keys
commandkey 1
# 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.9999 delay 0.5
refclock SOCK /var/run/chrony.ttyS0.sock refid PPS
# Comment this line out to turn off logging.
log tracking measurements statistics
logdir /var/log/chrony
# Stop bad estimates upsetting machine clock.
maxupdateskew 100.0
# Dump measurements when daemon exits.
dumponexit
# Specify directory for dumping measurements.
dumpdir /var/lib/chrony
# This directive lets 'chronyd' to serve time even if unsynchronised to any
# NTP server.
#local stratum 10
# This directive designates subnets (or nodes) from which NTP clients are allowed
# to access to 'chronyd'.
allow 10.0.0.0/24
# This directive forces 'chronyd' to send a message to syslog if it
# makes a system clock adjustment larger than a threshold value in seconds.
logchange 0.5
# This directive defines an email address to which mail should be sent
# if chronyd applies a correction exceeding a particular threshold to the
# system clock.
# mailonchange root@localhost 0.5
# This directive tells 'chronyd' to parse the 'adjtime' file to find out if the
# real-time clock keeps local time or UTC. It overrides the 'rtconutc' directive.
hwclockfile /etc/adjtime
# This directive enables kernel synchronisation (every 11 minutes) of the
# real-time clock. Note that it can’t be used along with the 'rtcfile' directive.
rtcsync
Quando executo chronyc tracking
e chronyc sources
, parece que a minha máquina está se conectando ao GPS.
aqui minha saída de comando de rastreamento Chronyc:
Reference ID : 116.122.250.120 (116.122.250.120)
Stratum : 1
Ref time (UTC) : wed sep 18 19:05:11 2018
System time : 0.000564536 seconds fast of NTP time
Last offset : +0.000280794 seconds
RMS offset : 0.000322653 seconds
Frequency : 19.616 ppm fast
Residual freq : +0.003 ppm
Skew : 0.053 ppm
Root delay : 0.039604 seconds
Root dispersion : 0.000406 seconds
Update interval : 1042.6 seconds
Leap status : Normal
saída do comando chronyc sources:
210 Number of sources = 2
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
#* GPS 0 4 0 10y +1823us[+2104us] +/- 21ms
#? PPS 0 4 0 10y -415us[ -143us] +/- 31ms
Problema:
Tudo está funcionando bem, mas depois de 10 a 15 minutos o comando chronyc sources mostrando GPS não está sincronizado e meu comando timedatectl mostra NTP não sincronizado.
comando timedatectl.
Local time: Wed 2018-09-19 11:50:38 PKT
Universal time: Wed 2018-09-19 06:50:38 UTC
RTC time: Wed 2018-09-19 06:50:38
Time zone: Asia/Karachi (PKT, +0500)
Network time on: no
NTP synchronized: no
RTC in local TZ: no
AND
210 Number of sources = 2
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
#? GPS 0 4 0 10y +0ns[ +0ns] +/- 0ns
#? PPS
Eu segui todos os procedimentos de solução de problemas e estou totalmente preso para descobrir como consertar isso?