Commit | Line | Data |
---|---|---|
bd43ea90 GW |
1 | This version of NTP was converted to the BSD-style Makefile system by |
2 | Garrett Wollman (wollman@freefall.cdrom.com); it is based on version | |
f064a358 | 3 | 3.3p (late beta) from the University of Delaware. |
bd43ea90 GW |
4 | |
5 | Besides the Makefile changes, the DES code has been completely removed | |
6 | in order to make this code exportable. If you have a legal copy of | |
7 | `authdes.c', you can just add it to the lib/ directory and add `-DDES' | |
8 | to the AUTHDEFS in Makefile.inc. | |
9 | ||
fa1a6f22 | 10 | You can change CLOCKDEFS in the same file to add other reference clocks. |
f555592b PHK |
11 | |
12 | ---------------------------------------------------- | |
13 | Support for Conrad electronic's "DCF-77 Uhr, Mobil". | |
14 | ---------------------------------------------------- | |
15 | Conrad electronic in Germany,, Phone (+49) 962230111 (?), sells a gadget | |
16 | called "DCF77 Uhr, mobil", which is a DCF77 timecode receiver with a | |
17 | rs-232 interface. The price is around DM130. | |
18 | 9-pin interface is Order# 97 94 57 66 | |
19 | 25-pin interface is Order# 97 94 81 66 | |
20 | ||
21 | You must define | |
22 | -DDCF77 -DPPS -DFREEBSD_CONRAD -DDEBUG | |
23 | when you compile xntpd. You can later remove -DDEBUG, if you feel like it. | |
24 | ||
25 | You must also have | |
26 | options COM_BIDIR | |
27 | defined in your kernel, and finally the ttyport you intend to use must | |
28 | have special interrupt vector: | |
29 | device sio1 at isa? port "IO_COM2" tty irq 3 vector siointrts | |
30 | ^^^^^^^^^^^^ | |
31 | connect the radio-clock to the tty port and link it to /dev/refclock-0: | |
32 | ||
33 | cd /dev | |
34 | sh MAKEDEV cua1 | |
35 | ln -s /dev/cua01 /dev/refclock-0 | |
36 | ||
37 | make a directory to gather statistics in: | |
38 | mkdir /var/tmp/ntp | |
39 | ||
40 | Create a /etc/ntp.conf along these lines: | |
41 | ||
42 | # DCF77 without PPS | |
43 | server 127.127.8.20 | |
44 | # DCF77 with PPS | |
45 | #server 127.127.8.148 prefer | |
46 | ||
47 | driftfile /var/tmp/ntp/ntp.drift | |
48 | statsdir /var/tmp/ntp | |
49 | statistics loopstats | |
50 | statistics peerstats | |
51 | statistics clockstats | |
52 | filegen peerstats file peerstats type day enable | |
53 | filegen loopstats file loopstats type day enable | |
54 | filegen clockstats file clockstats type day enable | |
55 | ||
56 | Try to start it: | |
57 | comcontrol ttyd1 bidir | |
58 | tickadj -A | |
59 | xntpd -d -d -d | |
60 | ||
61 | You should see the red LED flash on the receiver every second now. You | |
62 | may have to experiment a bit with the location, and possibly adjust the | |
63 | minute variable resistor inside to get a good signal. Be aware, that just | |
64 | because you see the light flash, is not the same as the signal being | |
65 | received by the computer. The chip doing the work in the reciver uses | |
66 | less than 1 micro-ampere, so even if RTS isn't pulled low, it will happily | |
67 | receive, but be unable to buffer the signal to the rs-232 levels needed. | |
68 | ||
69 | You can see what's going on in /var/log/messages, and query the | |
70 | daemon using xntpdc and ntpq, in particular the "clockvar" command | |
71 | of ntpq will tell about the clocks healt. | |
72 | ||
73 | I live in Slagelse, Denmark, which is ~1000 Km from Mainflingen, yet | |
74 | I have +/- 2 ms precision from this cheap gadget. If you have a very | |
75 | stable signal, you can use the 'pps' address instead to improve your | |
76 | timing. | |
77 | ||
78 | Have fun... Poul-Henning Kamp <phk@login.dkuug.dk> |