Enabling tempcomp in Chrony

339 Views Asked by At

I'm working on a Raspberry Pi running Buster with an Adafruit Ultimate GPS hat. I'm trying to get Chrony to temperature compensate. I've modified the chrony.conf file to contain.

# Uncomment the following line to turn logging on.
log measurements refclocks statistics tempcomp tracking
tempcomp /sys/class/hwmon/hwmon0/temp1_input 30 26000 0.0 0.000183 0.0
#tempcomp /sys/class/hwmon/hwmon0/temp1_input 30 /var/log/chrony/tempcomp.log

The system is currently adding measurements to the tempcomp.log file every 30 seconds. However, if I enable the second (commented out) tempcomp line above, chrony dies on restart with the error

Sep  6 12:31:45 rpi-tick2 chronyd[24713]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 -DEBUG)
Sep  6 12:31:45 rpi-tick2 chronyd[24713]: Frequency 23.662 +/- 0.165 ppm read from /var/lib/chrony/chrony.drift
Sep  6 12:31:45 rpi-tick2 chronyd[24713]: Fatal error : Could not read tempcomp point from /var/log/chrony/tempcomp.log
Sep  6 12:31:45 rpi-tick2 chronyd[24711]: Could not read tempcomp point from /var/log/chrony/tempcomp.log

I believe this is due to the fact that the tempcomp.log files has entries like

===========================================
   Date (UTC) Time        Temp.       Comp.
===========================================
2021-09-06 17:40:47  5.2095e+04  4.7754e+00
2021-09-06 17:41:17  5.2582e+04  4.8645e+00
2021-09-06 17:41:47  5.2582e+04  4.8645e+00
2021-09-06 17:42:17  5.3069e+04  4.9536e+00
2021-09-06 17:42:47  5.2582e+04  4.8645e+00

Where chrony is expecting something like

20000 1.0
21000 0.64
22000 0.36
23000 0.16
24000 0.04

and sorted by temperature not sample time.

So it seems like I'm missing a step somewhere.

Also, once set up, is this a dynamic process where new datapoints are added as we go, or do we stop collecting data and just use the static table to compensate for temps?

Thanks for any insights.

1

There are 1 best solutions below

0
On

I think you have to manually create a chrony.tempcomp file, likely by analyzing the tempcomp.log file. They are separate files. Then specify the chrony.tempcomp file like this: tempcomp /sys/class/hwmon/hwmon0/temp2_input 30 /etc/chrony.tempcomp