Raspberry Pi 2 - Unexpected CPU drop

On 2013-Aug-02, I noticed that the timekeeping on RasPi-2 had stopped being PPS, but had reverted to network.  This has happened before, and is cured by resetting the GPS receiver (surplus origin) with a power-down, power-back sequence.  However, on doing this I also noted that the CPU had dropped from a 6-9% level down to a 1% average level, although the timekeeping had kept working.

Further tests showed that contact between the GPS device working over USB and the gpsd has been lost at the same time, and hence ntp had lost data from the gpsd.  The gpsd process is still there, and shows to have consumed some 11.38 hours of CPU in the 9.375 days that RasPi-2 has been up.  That's a steady 5% CPU, consistent with the pre-GPS reboot usage in the graph above.  The ntpq command shows 14 hours since the GPSD was contacted.

pi@raspberrypi ~ $ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
oPPS(0)          .PPS.            0 l    1   16  377    0.000    0.001   0.002
 SHM(0)          .GPSD.           0 l  14h   16    0    0.000   -4.386   0.000
*192.168.0.3     .PPS.            1 u   19   32  377    0.513   -0.035   0.042
+192.168.0.1     .PPS.            1 u   23   32  377    0.518   -0.024   0.065
+192.168.0.2     .GPS.            1 u    9   32  377    0.520    0.007   0.043
 uk.pool.ntp.org .POOL.          16 p    -   64    0    0.000    0.000   0.002
-terra.utvgb.com 130.159.196.118  3 u   13   64  377   23.831    4.911   1.263
-slardar.parseq. 129.215.160.240  3 u   62   64  377   18.613    4.018   0.786
-80.87.128.243 ( 130.88.200.6     3 u   37   64  377   32.039    7.879   1.498
-iodine.cloudfab 178.237.34.68    3 u   62   64  377   28.534   -4.913   0.900
pi@raspberrypi ~ $

.. and here is the NTP configuration:

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

# Enable statistics gathering

statsdir /var/log/ntpstats/
statistics loopstats
filegen loopstats file loopstats type day enable
# filegen peerstats file peerstats type day enable

# keep a log of the drift across restarts
driftfile /var/lib/ntp/ntp.drift

# Kernel-mode PPS ref clock for precise seconds
server 127.127.22.0 minpoll 4 maxpoll 4
fudge  127.127.22.0 refid PPS

# GPSD ref-clock, for measurement only
server 127.127.28.0  minpoll 4 maxpoll 4  noselect
fudge 127.127.28.0  time1 0.329  refid GPSD

# LAN servers
server 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer    # PC Pixie
server 192.168.0.1 minpoll 5 maxpoll 5 iburst           # PC Alta
server 192.168.0.2 minpoll 5 maxpoll 5 iburst           # PC Feenix

# WAN servers
pool  uk.pool.ntp.org  iburst

leapfile /home/pi/ntp/leap-seconds.file

Running cps -s produced a GPS timeout message.  I'm beginning to think that the USB disconnect/reconnect isn't quite as plug-and-play as it might be!  Will try rebooting that Raspberry Pi and ensure it all comes up OK - yes it did.

BTW: I have now changed from that surplus GPS unit to one of the Adafruit modules which talks over a serial line rather than USB.  Perhaps the unit was surplus for a reason!

 

 
Copyright © David Taylor, Edinburgh   Last modified: 2015 Feb 10 at 08:03