[chrony-users] Question about adding custom serial time source with PPS to chrony

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


Hello,

I’m working on a system where a microcontroller receives CAN messages from a GNSS sensor, extracts the GNSS timestamps, and outputs the time over an RS-232 serial port. The PPS signal comes directly from the sensor and is available to the Linux PPS subsystem (/dev/pps0).

I’m aware of the standard approach using gpsd → SHM / SOCK → chrony, where gpsd reads time from a serial device and aligns it with PPS. I’ve tested this path and it works, but I’m exploring whether chrony can use the serial time data directly, without gpsd in the middle.

My question is:

What would be required to add support in chrony for a custom serial refclock that provides timestamps along with a PPS signal?

Specifically:

I would like chrony to read ASCII time messages from /dev/ttyS0.

PPS would still be handled through the kernel PPS interface (/dev/pps0).

The timestamps are already aligned with PPS at the microcontroller level.


I’m trying to understand whether a new refclock driver (similar to SHM, SOCK, or NMEA) would be the right approach, and what the minimal set of functions/structures would be for integrating such a driver into chrony’s refclock framework.

Any pointers, examples of existing drivers that are easiest to start from, or architectural guidance on how chrony expects to correlate a serial time source with PPS, would be greatly appreciated.

Thank you,
Awais


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/