Raspberry Pi Experiments

I purchased a raspberry pi and will be experimenting with it.

The comments are quick notes.

14 Responses to Raspberry Pi Experiments

  1. Michael Peer says:

    Raspberry PI default login information:
    Username: pi
    Password: raspberry

  2. Michael Peer says:

    Keeping the raspberry pi updated”
    sudo apt-get update
    sudo apt-get upgrade

    and sometimes you need:
    sudo apt-get dist-upgrade

    and also, but this does not work for me:
    sudo apt-get rpi-update

  3. Michael Peer says:

    Adafruit Ultimate GPS tutorial for raspberry pi:
    Aafruit Ultimate GPS Tutorial link

  4. Michael Peer says:

    Making gpsd start on boot:
    Run the following command to add the boot script:
    sudo dpkg-reconfigure gpsd

    It will as the question of whether you want gpsd to start on boot, say YES. It will ask if you want it to seach for usb gps devices, say NO. We are connecting the gps via hardware UART. The device to use is /dev/ttyAMA0. The status is /var/run/gpsd.sock.

  5. Michael Peer says:

    To verify the gps is working and locked:
    cgps -s

    You should see a curses like screen showing the gps readings.

  6. Michael Peer says:

    The raspberry pi I was using died and the memory card has errors and is not worth recovering. It looks like it is time for a rebuild!

  7. Michael Peer says:

    As of the time of me writing this. raspberrypi.org website has newer version of raspbian than I was running. The new version is codenamed “Jessie”. It has some additions that make using the gps for time synchronization much easier. Here we go….

  8. Michael Peer says:

    This was a pain. The dhcp client overwrites your interfaces including ntp.conf even though I am using a static IP address. Here is the command to remove it from startup:

    sudo update-rc.d dhcpd5 remove

    This does remove the package, just from the startup.

  9. Michael Peer says:

    Modify the /boot/cmdline.txt by adding:


    This is from:

    In section “Prerequisite settings”
    The section on reducing ethernet latency

  10. Michael Peer says:

    Getting ntp source:
    ( Always get the latest source! )
    wget http://archive.ntp.org/ntp4/ntp-4.2.8p3.tar.gz
    tar zxvf ntp-4.2.8p3.tar.gz
    cd ntp-4.2.8p3

    Commands to compile ntp from source:

    ./configure -enable-linuxcaps -disable-all-clocks -disable-parse-clocks -enable-NMEA -enable-ATOM -enable-ntpdate-step
    sudo make
    sudo make install
    Stop ntpd if necessary: sudo service ntp stop
    Copy some files around: sudo cp /usr/local/bin/ntp* /usr/bin/ && sudo cp /usr/local/sbin/ntp* /usr/sbin/

    Create a startup script to automatically create the devices:
    sudo vi /etc/udev/rules.d/55-ntp-gps.rules
    Add these lines:
    SUBSYSTEM==”pps”, KERNEL==”pps0″, SYMLINK+=”gpspps0″
    KERNEL==”ttyAMA0″, SYMLINK+=”gps0″
    KERNEL==”pps0″, OWNER=”root”, GROUP=”tty”, MODE=”0660″, SYMLINK+=”gpspps0″

    Site: http://www.satsignal.eu/ntp/Raspberry-Pi-quickstart.html
    This is from the section: Enabling PPS/ATOM support in NTPD

  11. Michael Peer says:

    Alot more to come. Gotta take a break.

  12. Michael Peer says:

    Final results:
    mpeer@raspberrypi ~ $ ntpq -pn
    remote refid st t when poll reach delay offset jitter
    o127.127.20.0 .GPS. 0 l 2 16 377 0.000 0.006 0.009

    The lower case “o” at the beginning of the line shows that it is PPS discplined and locked.

  13. Michael Peer says:

    Update my pi to Jessie using the sudo apt-get commands below.

  14. Michael Peer says:

    Doing a netstat -l4n I found the pi listening on ports 68, 5353 and 55340. I only need ssh and eventually ntpd. So I have turned off those services on startup.

    The ports 5353 and 55340 are mdns. The command to turn those off is:
    sudo systemctl disable avahi-daemon

    The port 68 is dhcp client. The command to turn that off on is:
    sudo systemctl disable dhcpcd

Comments are closed.