Inhaltsverzeichnis

Raspberry with a gps clock and a etc

RTC

pps-gpio    <<<< PPS
i2c-bcm2708
i2c-dev
rtc-ds1307
...
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s
/bin/echo -e '$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n' > /dev/ttyAMA0
exit 0
...
gpu_mem=16
dtparam=i2c=on
dtparam=i2c_arm=on
dtoverlay=pps-gpio,gpiopin=23    <<< PPS

NTP

Download: http://www.ntp.org/downloads.html

# Change MODE of ttyAMA0 so it is readable by NTP and provide a symlink to
# /dev/gps0
KERNEL=="ttyAMA0", SUBSYSTEM=="tty", DRIVER=="", SYMLINK+''"gps0", MODE''"0666"
# Symlink /dev/pps0 to /dev/gpspps0
KERNEL=="pps0", SUBSYSTEM=="pps", DRIVER=="", SYMLINK+''"gpspps0", MODE''"0666"
./configure --prefix=/usr --enable-all-clocks --enable-parse-clocks --enable-SHM --enable-debugging --sysconfdir=/var/lib/ntp --with-sntp=no --with-lineeditlibs=edit --without-ntpsnmpd --disable-local-libopts --disable-dependency-tracking (--enable-linuxcaps)
make 
make install

alternativ mal probieren NtpBuildOptions

./configure  --disable-all-clocks  --disable-parse-clocks  --without-lineeditlibs  --enable-NMEA  --enable-LOCAL-CLOCK  --enable-SHM  
--enable-linuxcaps  --enable-ATOM
sed -i 's/DAEMON=' /etc/init.d/ntp

ppstest /dev/pps0

# enable clibrate and make a average of the drift
tail -20 /var/log/ntpstats/peerstats | grep 127.127.22.0 | awk '{SUM=SUM+$5; COUNT=COUNT+1;} END {print SUM/COUNT}'

#Optimisation
echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
setserial /dev/ttyAMA0 low_latency

/boot/cmdline.txt smsc95xx.turbo_mode=N

#Check PPS
lsmod | grep pps
ppstest /dev/pps0

ntpd -g -l /var/log/ntpd.log -p var/run/ntpd.pid -c /etc/ntp.conf

gpis readall

sudo apt-get install minicom

minicom -b 115200 -o -D /dev/ttyAMA0

Raspberry ntp-server comparison

device tree

Banana pi

GPS-HAT

Instructions for raspberry nap-server