NTP stratum-1 on Ubuntu 14.04LTS

Some (incomplete) notes on setting up a stratum-1 NTP server on Ubuntu 14.04LTS

To handle the upcoming leap-second we want a leapfile, from: http://www.ietf.org/timezones/data/leap-seconds.list

The path of the leapfile goes into /etc/ntp.conf
leapfile /etc/leap-seconds.list
But Ubuntu uses apparmor, so we must grant permission for the ntp service to read this file in /etc/apparmor.d/usr.sbin.ntpd by adding:
/etc/leap-seconds.list r,
To make apparmor parse and apply the new rules we do:
sudo apparmor_parser -r /etc/apparmor.d/usr.sbin.ntpd
when the ntp service starts it is useful to look at /var/log/syslog where ntp will complain if it doesn't have permission to read the leapfile or if it is badly formatted.

Now let's edit the default options for the ntp service in /etc/default/ntp by adding:
(-N runs ntpd at highest priority, -g makes it more robust agaist large time offsets, see man ntpd)

To get time in NMEA-format and a pulse-per-second (PPS) from gpsd we add two shared-memory (type 28) refclock drivers to /etc/ntp.conf

# GPS Serial data reference
server maxpoll 3
fudge time1 -0.230 refid GPS

# GPS PPS reference
server prefer maxpoll 2
fudge refid PPS

(the time1 adjustment number needs to be calibrated somehow..).

Finally we let ntp distribute time to the outside world by adding this line to /etc/ntp.conf (this is usually at the end of the file).
restrict default noquery

Now let's set up gpsd. The service configuration file is /etc/default/gpsd, and as suggested in the file we edit it with the utility:
sudo dpkg-reconfigure gpsd
The options that worked for me are device /dev/ttyS0 and options -n (don't wait for clients to connect). After running the utility /etc/default/gpsd should look something like:


You can verify that gpsd is working with cgps, xgps, or gpsmon.

This should result in Ubuntu automagically starting gpsd and ntpd in the correct order at bootup, and ntpq -p should show something along the lines of:
Screenshot - 06262015 - 10:18:31 AM

If you want to manually restart (or just start or stop) the services, required e.g. after any changes are made to /etc/ntp.conf, it is done with
sudo service ntp restart
sudo service gpsd restart

Rack PC Build - Part Two

Another rack-PC put together this week. Intel X99-chipset with LGA2011-3 CPU socket. Only PCI-e slots, no legacy PCI-slots.

Again I didn't get the polarity of the HDD-LED and Power-LED wires right on the first try. How come the industry cannot agree on a standard connector for the bundle that has the power-switch, reset-switch, HDD-LED, and Power-LED?

Another glitch was that this board has 8 slots for RAM, and the two RAM-sticks I got need to be installed exactly in the right slots - otherwise it won't even boot into the BIOS. Some reading of the motherboard manual was required.

After installing Ubuntu 14.04LTS (from USB-stick! No CD/DVD required) the NVIDIA-drivers (for the GTX750TI) were not automatically detected. I downloaded the latest driver from NVIDIA and installed it manually. This requires logging in to a text-only console (CTRL-ALT-F1), and then killing X for the duration of the install (sudo service lightdm stop)

Installing the latest KiCAD on Ubuntu 14.04LTS

Add the ppa:js-reynaud/ppa-kicad to your list of sources:

sudo add-apt-repository ppa:js-reynaud/ppa-kicad

Then update package repository info

sudo apt-get update

Then install kicad

sudo apt-get install kicad kicad-common

Done. As of 2014-10-19 I get "Build 2014-jul-16 BZR unknown" - which should be new enough to contain most of the features I want.

There is a problem with this install because the environment variable KIGITHUB is not set. We do that by adding this line to ~/.profile

export KIGITHUB="https://github.com/KiCad"

For this to take effect you need to log out and then log in again. You should now see KIGITHUB defined in the under Preferences/Library Tables in Pcbnew. I still have KISYSMOD undefined, but that doesn't seem to matter(?).

So far so good. Next stop is learning how to work with the kicad github plugin so I can store my own symbols/footprints in my own github repo.