Hi all,
I think I completely misunderstood what I have to send to chronyd. All my samples are still rejected.
The system's date/time is Jan 1, 1970, 00:18. Every second, I get the correct (UTC) time from the GPS sensor and send it to chronyd.
Here are my logs :
1970-01-01T00:18:02Z refclock.c:267:(RCL_AddRefclock) refclock SOCK refid=SOC1 poll=4 dpoll=0 filter=64
1970-01-01T00:18:08Z
refclock.c:517:(valid_sample_time) SOC1 refclock sample not valid
age=-1428391752.477614 tv=1428392841.000000
1970-01-01T00:18:09Z
refclock.c:517:(valid_sample_time) SOC1 refclock sample not valid
age=-1428391752.941502 tv=1428392842.000000
1970-01-01T00:18:10Z
refclock.c:517:(valid_sample_time) SOC1 refclock sample not valid
age=-1428391752.931989 tv=1428392843.000000
The tv values are what I send : it's the timestamp received from the GPS sensor, in local time (created using mktime()).
My chrony.conf :
refclock SOCK /tmp/chrony.gps.sock
makestep 1000 10
The code that fills the structure that I send to chronyd :
chronydata.tv.tv_sec = mktime(...);
chronydata.tv.tv_usec = 0;
chronydata.offset = 0.0; // What should I store here ?
chronydata.pulse = 0; // What should I store here ?
chronydata.leap = 0; // What should I store here ?
chronydata.magic = 0x534f434b;
send(sockfd,&chronydata,sizeof(chronydata),0);
What is wrong there ? What should I store in offset, pulse and leap ?
Thank you and best regards,
Olivier