Linux installation notes

CSN for Linux is currently in an "alpha" stage of development, so Linux clients take a bit more manual work and technical skill, in lieu of an installation tool.  Please do provide feedback to us via help@communityseismicnetwork.org.  The instructions below tend to be Ubuntu/Debian flavored; other Linux variants might require slightly different syntax and mods to the systemwide initialization methods.


Installing the CSN client on Linux

==================================

Linux kernel version

The phidget21 library packaged below (taken from http://www.phidgets.com/drivers.php) requires kernel version 2.6 or higher.


Privileges

Ensure you have "root" privileges via sudo or su.


Download Binaries

Download the Gzip'd tar archive here:

   http://crust.cacr.caltech.edu/~leif/csn/old/csn-linux-r254.tar.gz


Extract

$ tar -xvzf csn-linux-r254.tar.gz

csn-linux-r254/

csn-linux-r254/usr/

csn-linux-r254/usr/local/

csn-linux-r188254/usr/local/lib/

csn-linux-r254/usr/local/lib/libphidget21.so

csn-linux-r254/usr/local/lib/libphidget21.so.0.0.0

csn-linux-r188254/usr/local/lib/libphidget21.so.0

csn-linux-r254/usr/local/bin/

csn-linux-r254/usr/local/bin/csn-config

csn-linux-r254/usr/local/bin/csndaemon

$


Install

Copy the files from the archive to their appropriate locations; this will probably require "root" privileges.

The placement of the files in the 'tar' archive represents their suggested location on your system.  'csn-config' and 'csndaemon' can go anywhere, perhaps in "/usr/local/bin/".  'libphidget21.so*' MUST be placed someplace where it can be found the by the dynamic library loader; we suggest "/usr/local/lib/".  Note that the two symbolic links must be preserved.

$ cp -d csn-linux-r254/usr/local/lib/* /usr/local/lib/


Some installations may need to have the dynamic loader cache updated; this is idempotent and safe for all systems:

$ ldconfig -v /usr/local/lib/


Setup

'csndaemon' is a daemon which runs continuously in the background, recording data from the USB accelerometer.  'csndaemon' must be run as 'root'.  Ideally, you should configure your system to launch it at boot time, using an executable Bourne shell script in /etc/init.d/csn, such as this sample one:

#! /bin/sh -e

#### BEGIN INIT INFO

# Provides:          csn

# Required-Start:    $network $time $local_fs

# Required-Stop:     $network $time $local_fs

# Default-Start:     2 3 4 5

# Default-Stop:      S 0 1 6

# Short-Description: CSN client daemon

# Description:       Background daemon to poll CSN phidget 1056 device

### END INIT INFO

#

# Author:       Richard Guy <help@communityseismicnetwork.org>

#

set -e


PATH=/bin:/usr/bin:/sbin:/usr/sbin

DAEMON=/usr/local/bin/csndaemon


test -x $DAEMON || exit 0


. /lib/lsb/init-functions


case "$1" in

   start)

       log_daemon_msg "Starting CSN daemon" "csndaemon"

       start_daemon $DAEMON $1

       log_end_msg $?

   ;;

 stop)

       log_daemon_msg "Stopping CSN daemon" "csndaemon"

       $DAEMON $1

       log_end_msg $?

   ;;

 force-reload|restart)

   $0 stop

   $0 start

   ;;

 *)

   echo "Usage: /etc/init.d/csn {start|stop|restart|force-reload}"

   exit 1

   ;;

esac


exit 0

Remember to make the script executable with "chmod a+x /etc/init.d/csn".

To ensure proper startup/shutdown with other daemons:  "sudo update-rc.d csn defaults 98 02"

Configuration (one time)

Once 'csndaemon' is running, use the 'csn-config' utility to set your location and CSN computer name.  'csn-config' can be run as an ordinary user; it communicates with csndaemon, which in turn creates a file /etc/CSNClientSettings to hold non-volatile settings.

First, visit the following web page to determine your geographic coordinates:

   http://crust.cacr.caltech.edu/~leif/csn/geocoord/

After you pinpoint your location, take note of the example 'csn-config' command presented at the bottom of the page, for example:

   csn-config set-location 34.13834 -118.12443 1

The final argument "1" represents the "floor", with "1" meaning "ground floor"; replace this with "2" if you are on the second floor, "3" for the 3rd floor, etc.  

Run the command from a terminal window to set your location.


Finally, run 'csn-config' once more to set your CSN computer name:

   csn-config set-name NAME

Replace "NAME" with a descriptive name, which will be used to identify your computer on our map.

(Run 'csn-config' with no arguments to see other options.)


Test

Open this page in your web browser:

   http://map.communityseismicnetwork.org/#picks


Physically tap your USB device.  After 3-5 seconds, an indicator should appear on the map, indicating activity at your location.



Comments