[LinuxPPS] LinuxPPS Digest, Vol 29, Issue 4

david dc at cisteme.net
Thu Sep 11 18:44:44 CEST 2008


Thank you Hal for your help,

I patch ntp with the file nmea.patch (link in wiki) and the diff with 
original give this :

diff ntpd/refclock_nmea.c  ntpd/refclock_nmea.c.ori
64d63
< # define DEVICEPPS "/dev/gpspps%d" /* name of alternate PPS radio 
device */
234,249c233,237
<       msyslog(LOG_ERR, "refclock_nmea: found GPS source \"%s\"", device);
<         if (time_pps_create(pp->io.fd, &up->handle) == 0) {
<               msyslog(LOG_INFO, "refclock_nmea: found PPS source 
\"%s\"", device);
<               return(nmea_ppsapi(peer, 0, 0)); }
<       else {
<                /* Try the alternate PPS device */
<                (void) sprintf(device, DEVICEPPS, unit);
<                fd = open(device, O_RDWR);
<               if (fd >= 0) {  /* /dev/gpspps0 exists */
<                       msyslog(LOG_ERR, "refclock_nmea: try \"%s\" for 
PPS", device);
<                       if (time_pps_create(fd, &up->handle) == 0) {
<                               msyslog(LOG_INFO, "refclock_nmea: found 
PPS source \"%s\"", device);
<                               return(nmea_ppsapi(peer, 0, 0));
<                       }
<                       else close(fd);
<               }
---
 >       if (time_pps_create(fd, &up->handle) < 0) {
 >               up->handle = 0;
 >               msyslog(LOG_ERR,
 >                   "refclock_nmea: time_pps_create failed: %m");
 >               return (1);
251,255c239
<       /* No luck, no PPS unit available! */
<       up->handle = -1;
<       msyslog(LOG_ERR, "refclock_nmea: no PPS devices found at " 
DEVICE " nor "
<               DEVICEPPS ": %m", unit, unit);
<       return (1);
---
 >       return(nmea_ppsapi(peer, 0, 0));
276c260,261
<       time_pps_destroy(up->handle);
---
 >       if (up->handle != 0)
 >               time_pps_destroy(up->handle);
384c369
<       if (up->handle == -1)
---
 >       if (up->handle == 0)

AFTER, I build Makefile like this :

./configure --disable-all-clocks --disable-parse-cl 
                              ocks --enable-NMEA --enable-LOCAL-CLOCK 
--prefix=/usr

and make.

I run ntpd like this : /usr/src/ntp-4.2.2p4/ntpd/ntpd -c /etc/ntp.conf

NOTE: If I check timex with a grep output I show that :

./configure --disable-all-clocks --disable-parse-cl 
                              ocks --enable-NMEA --enable-LOCAL-CLOCK 
--prefix=/usr | grep timex
checking timex.h usability... no
checking timex.h presence... no
checking for timex.h... no
checking for sys/timex.h... yes
checking for __adjtimex... yes
configure: WARNING: *** But clock_settime() would be better (if we had 
it) ***
checking if sys/timex.h has STA_FLL... yes

Is it correct or not ?

David at fibie dot network(without work)

linuxpps-request at ml.enneenne.com a écrit :
> Send LinuxPPS mailing list submissions to
> 	linuxpps at ml.enneenne.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://ml.enneenne.com/cgi-bin/mailman/listinfo/linuxpps
> or, via email, send a message with subject or body 'help' to
> 	linuxpps-request at ml.enneenne.com
> 
> You can reach the person managing the list at
> 	linuxpps-owner at ml.enneenne.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of LinuxPPS digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: Re2:  some problems with linuxPPS + GPS system (Hal V. Engel)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Wed, 10 Sep 2008 09:41:00 -0700
> From: "Hal V. Engel" <hvengel at astound.net>
> Subject: Re: [LinuxPPS] Re2:  some problems with linuxPPS + GPS system
> To: linuxpps at ml.enneenne.com
> Message-ID: <200809100941.01576.hvengel at astound.net>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> On Wednesday 10 September 2008 02:15:40 am david wrote:
> snip
>>> First you need to confirm that your pps signal is actaully working.  
>>> Have you tried?
>> Yes it seems to work
>>
>>>  ppstest /dev/pps0
>> trying PPS source "/dev/pps0"
>> found PPS source "/dev/pps0"
>> ok, found 1 source(s), now start fetching data...
>> source 0 - assert 1221037543.828813020, sequence: 88131 - clear
>> 1221037543.028815792, sequence: 88130
>> source 0 - assert 1221037543.828813020, sequence: 88131 - clear
>> 1221037544.028833694, sequence: 88131
>> source 0 - assert 1221037544.828845730, sequence: 88132 - clear
>> 1221037544.028833694, sequence: 88131
>> source 0 - assert 1221037544.828845730, sequence: 88132 - clear
>> 1221037545.028867802, sequence: 88132
>> source 0 - assert 1221037545.828853296, sequence: 88133 - clear
>> 1221037545.028867802, sequence: 88132
>> source 0 - assert 1221037545.828853296, sequence: 88133 - clear
>> 1221037546.028870339, sequence: 88133
>>
> 
> This looks good and it is the GPS PPS signal.  Notice how the assert happens 
> about 200 milliseconds before the clear for the same sequence.
> 
>> Can you explain the difference between pps0 and pps1 ?
>>
>> sonde2:/usr/src/linux/Documentation/pps# ./ppstest /dev/pps1
>> trying PPS source "/dev/pps1"
>> found PPS source "/dev/pps1"
>> ok, found 1 source(s), now start fetching data...
>> source 0 - assert 1221037584.290399089, sequence: 88293 - clear
>> 0.000000000, sequence: 0
>> source 0 - assert 1221037585.290096541, sequence: 88294 - clear
>> 0.000000000, sequence: 0
>> source 0 - assert 1221037586.289778347, sequence: 88295 - clear
>> 0.000000000, sequence: 0
>> source 0 - assert 1221037587.289464624, sequence: 88296 - clear
>> 0.000000000, sequence: 0
>> source 0 - assert 1221037588.289143358, sequence: 88297 - clear
>> 0.000000000, sequence: 0
> 
> This is the fake ktimer PPS signals.  Note that there is no clear events 
> (clear 0.000000000, sequence: 0) for the interupt since the ktimer module only 
> has asert events and not clear events.  Since you have a working refclock PPS 
> signal you should unload ktimer and stop using it.
> 
> snip
> 
>>> If you are not getting the correct results for ppstest then we can help
>>> you get that working.  Once that is working the rest is fairly easy.
>> this is the reason why I'm afraid !
> 
> You didn't give us any information on how you built ntp other than that you 
> patched it and followed the wiki.  You do have to pass it additional configure 
> parms to make it build with PPS support for your refclock and this is covered 
> in the wiki.  What configure command did you use for NTP?  Did you review the 
> output from the configure command to make sure that it found what was needed 
> (not covered in WIKI)?  In addition you need to make sure that it is picking 
> up the right kernel and sys/timex.h headers during the build.  What other 
> things did you do to setup the build?
> 
> I am working on a LinuxPPS howto for this stuff but it is not complete at this 
> point.  It currently covers everthing the wiki does for those who are patching 
> an existing kernel (IE. it does not cover the git stuff) but only for kernels 
> starting with 2.6.26 and later.  In addition, this material has some changes 
> compared to the wiki that reflect some of the things that list members have 
> discovered as well information from other sources such as the OnCore setup 
> stuff from the Remco blog.  I currently have about 8 pages in the howto but I 
> need to spend some more time going through the emails on this list to flesh 
> out things like setting up udev, testing ntpd and ntpd startup scripts and to 
> see if there is additional information that needs to be added to or changed in 
> the existing sections.   Plus I need to spend time cleaning up the document.
> 
> This howto should make it easier for those, like you, who are trying to get 
> this working for the first time since I think what I have is a little clearer 
> and simpler (where this is possible) and goes through things in a step by step 
> fashion.  If you would like I can send you a copy off list with the 
> understanding that it is far form complete, likely has some significant 
> ommissions and maybe even some stuff that is completely wrong.  I started 
> working on this about two weeks ago but then got side tracked.  But I am going 
> to start working on it again today and I hope to have something I can share 
> with the list later this week.
> 
> Hal
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://ml.enneenne.com/pipermail/linuxpps/attachments/20080910/a48879f2/attachment.html 
> 
> ------------------------------
> 
> _______________________________________________
> LinuxPPS mailing list
> LinuxPPS at ml.enneenne.com
> http://ml.enneenne.com/cgi-bin/mailman/listinfo/linuxpps
> 
> 
> End of LinuxPPS Digest, Vol 29, Issue 4
> ***************************************




More information about the LinuxPPS mailing list