Morten, Ok I overlooked that GPIO, I normally use RS232 ports (DCD input) and then ldattach is required. For GPIO you will need to do a different setup.
It is best to use PPS only with a "lock" directive like this: # PPS via /dev/pps0 refclock PPS /dev/pps0 refid PPS trust prefer lock THUN # SHM clock from thunderbolt running with SHM0 parameter refclock SHM 0 poll 6 refid THUN noselect (in my case the SHM segment is "connected" to a Trimble Thunderbolt GPSDO hence the name THUN) The "lock THUN" will indicate to chrony that it should only use the PPS refclock when the THUN refclock is locked, i.e. when it has already locked to absolute time. Of course when you try to debug it you issue the command "chronyc sources" to see what inputs are received and if they are locked. You can look under the "Reach" header for the 377 which means the inputs are seen and valid, and in the second column a * shows the source is locked. I hate systemd so I normally work around it. The original initd could run a script to start deamons and it could do several things in defined sequence. So I normally use my old scripts and start them from /etc/rc.local. systemd people say that this is bad, so probably you will find one that can explain you how it is to be done with systemd. Of course when debugging you can just start the programs from the prompt and at least see if the configuration works. Rob On 2024-07-08 18:51, Morten Nissov wrote: > Rob, > > I know that an absolute source of time information is necessary, I just > figured there would be some indication of PPS being received by chrony. Note, > this is not actually a GPS, and the PPS line is going to a GPIO pin, as a > result I do not believe ldattach is necessary following > http://paul.chavent.free.fr/pps.html. > > I don't entirely understand the last point, my understanding was that it is > chrony who creates the SHM/socket depending on the configuration, in this > case how can I start the SHM program before starting chrony? The motivation > of the original question is that without some confirmation that at least the > PPS is received, it becomes very difficult to debug with PPS+SHM > simultaneously, if this doesn't work immediately (which it didn't). Do you > have any suggestions for how to proceed? > > Best regards, > Morten > > On Mon, Jul 8, 2024 at 6:06 PM Rob Janssen <[email protected]> wrote: > > Morten > > You cannot have only a PPS source, because that does not give you > absolute time information, only modulo-1-second information. > So when you use PPS you always need to add another source. > That can be a network source (NTP) with server or pool, or you can use a > serial port (NMEA) to the GPS device. > When you have internet or the PPS source provides NTP, it is preferable > to use that. > It is also possible to use SHM for that, but you need another program > that puts the time info into SHM. > Furthermore, when you start things using systemd it is tricky because > systemd provides no sequence of starting > daemons, and you have to start the program for SHM and the pps (ldattach) > BEFORE starting chrony! > > Rob > > On 2024-07-08 10:07, Morten Nissov wrote: > > Hi all, > > > > I am looking at setting up a relatively custom thing for timekeeping, > which attempts to function as a GPS (in terms of PPS + unix stamp) using an > RTC and microcontroller. > > > > -- > To unsubscribe email [email protected] > with "unsubscribe" in the subject. > For help email [email protected] > with "help" in the subject. > Trouble? Email [email protected]. >
