Re: [chrony-users] Chrony not taking SOCKET data from Application

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


Hi Miroslav Lichvar,

I have enabled debug option as suggested. I am trying to send the data of GPS time as per the structure mentioned below in refclock_sock.c file:
struct sock_sample {
  /* Time of the measurement (system time) */
  struct timeval tv;

  /* Offset between the true time and the system time (in seconds) */
  double offset;

  /* Non-zero if the sample is from a PPS signal, i.e. another source
     is needed to obtain seconds */
  int pulse;

  /* 0 - normal, 1 - insert leap second, 2 - delete leap second */
  int leap;

  /* Padding, ignored */
  int _pad;

  /* Protocol identifier (0x534f434b) */
  int magic;
};


But I see the data is not received at all. I expected read_sample() function will be triggered when received on the socket. But I am seeing error message from file cmdmon.c file mentioning "Read command packet without the source address". I am using Unix Domain socket with SOCK_DGRAM option.

Please suggest how to resolve this issue and how to format the data to chrony from an application.

Thanks & Regards
Sarveshwar.K

On Thu, Jan 19, 2023 at 2:52 PM Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:
On Thu, Jan 19, 2023 at 09:13:28AM +0530, sarveshwar k wrote:
> chronyd.sock was created under /var/run/chrony when I run chronyd. I wrote
> an application using unix domain socket and connected to socket and
> sent GPS UTC time in the required format accepted by chronyd.
>
> But I dont see chronyd taking this time as I see #? for SOCK and PPS
> reference clocks.

Build chrony with the --enable-debug option and then run chronyd with
-d -d to see the debug messages. There should be a message with some
information what it doesn't like about the SOCK sample. Usually it's
the sample "age", coming from the SOCK tv field. It needs to be the
system time, not the reference time.

--
Miroslav Lichvar


--
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.

Attachment: c1.log
Description: Binary data



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