aquarat wrote:Hi Chrisprt
Would it be possible for you to post your kernel to a file-sharing site ? I have a Trimble Thunderbolt-E GPS/OCXO which currently runs into a an x86 machine and forms part of the NTP Pool project... it would be great to hand this duty off to a Pi

.
Side note... my Raspberry Pis automatically detected the presence of my NTP server the first time I turned them on, which made me very happy.
Sounds great. I'd love to get someone else working on this.
The following kernel and modules are based from the raspbian install image provided by raspberrypi.org. If you aren't running raspbian (debian wheezy I believe), then you need to install that first.
Here's a tar of the current kernel that I'm working with:
http://www.4shared.com/archive/kXRVBttE/kerneltar.html
Here's the modules
http://www.4shared.com/archive/d9KtErm_/modulestar.html
Instructions:
First, boot into the regular raspbian image. Download the modules that I listed above, and unzip them into the /lib/modules directory on the install. Once you're done, if you list /lib/modules, you should see something like 3.1.9, and then 3.1.9-pps+ in the same directory.
The intention here is to avoid overwriting your modules for your default install, so that you can roll back if needed.
After those are in place, pop the SD card into a reader, and find the boot partition. It's in FAT32, so in windows, it will be the only files shown on the SD card. rename the kernel.img file to something like kernel-backup.img. unzip the kernel.tar.gz file provided above into the partition and rename it from "Image" to kernel.img.
At this point, plug it back into your pi and attempt to boot.
If everything was setup correctly, you should see something like this on boot:
Code: Select all
pi@raspberrypi's password:
Linux raspberrypi 3.1.9-pps+ #6 PREEMPT Wed Aug 1 19:44:18 EDT 2012 armv6l
If you're this far, then you should be able to load the necessary modules by typing "sudo modprobe pps-gpio"
After this, type "dmesg" and you should hopefully see an output similar to this:
Code: Select all
[ 773.164041] pps_core: LinuxPPS API ver. 1 registered
[ 773.164080] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 773.172256] pps_core: source pps-gpio.-1 got cdev (252:0)
[ 773.172288] pps pps0: new PPS source pps-gpio.-1
[ 773.172359] pps pps0: Registered IRQ 108 as PPS source
At this point, your pps device is at /dev/pps0, and you can use the LinuxPPS testing suite (pps-test) to test your device. The quickest way to test I found is to take a wire and connect it to the pin (GPIO 23 for the kernel list above), and then lightly close the connection on the 3.3v pin. The 3.3v pin is the one w/ the P1 on the board next to it. Warning: accidentally connecting it to the 5v could fry your pi, so be careful doing this.
if everything is setup correctly, you should see something like this:
Code: Select all
pi@raspberrypi /usr/src/pps-tools $ sudo ./ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)
source 0 - assert 1343872739.754885657, sequence: 1 - clear 0.000000000, sequence: 0
source 0 - assert 1343872739.854118652, sequence: 3 - clear 0.000000000, sequence: 0
source 0 - assert 1343872740.377387067, sequence: 4 - clear 0.000000000, sequence: 0
source 0 - assert 1343872740.420147201, sequence: 6 - clear 0.000000000, sequence: 0
source 0 - assert 1343872740.472563140, sequence: 7 - clear 0.000000000, sequence: 0
If you've got this far, it's probably time to try to run a wire from your clocking device to the pi pin.
Remember, the Pi only takes 3.3v, so you might need to get a level shifter or make a voltage divider if you're pushing 5 or 12v.
Once that's connected, you'll have to download and compile the ntpd source, since the refclocks aren't included in the version on the pi. Finally, after that's done, you should be able to add
Code: Select all
#PPS Source /dev/pps0 using assert
server 127.127.22.0 minpoll 4 maxpoll 4
to the ntp.conf file which will register the ATOM driver. If all is well, you'll sync appropriately. If you're like me, you might encounter the atom driver being marked as a false ticker, which sucks. I haven't found a fix for that yet.
One last thing: I've read from some time nerds (I use the term lovingly) that the Ethernet on the pi is controlled by the USB controller, which is poll rather than push. Because of that, they worry that the pi will never be able to be more accurate than 1 millisecond, since that's the rate that the USB controller polls. I'm not sure if that's too imprecise to be part of the pool project or not.