jAmaSeis installation

jAmaSeis logo https://www.iris.edu/hq/programs/education_and_outreach/software/jamaseis

Instead of using the Python programs shown on this website, you could use jAmaSeis as an alternative. This page shows how to install it on a RaspberryPi to log data read from a seismometer.

First, we need to download jAmaSeis, once you have connected to the Internet on the Raspberry Pi.

To install the software: in terminal 'cd' to the folder where you downloaded it (probably /home/pi/Downloads). Then run the installer (in the GUI) and include the code below, clicking next where prompted.

java -jar jAmaseis_install.jar

But before we open the application we must install dependencies: librxtx-java, use the commands below to install and link it.

sudo apt-get install librxtx-java
sudo ln -s /usr/lib/jni/librxtxSerial.so /usr/lib/

Next we can open jAmaSeis, use the next to commands (in the GUI) to open it, both essential as if you don't execute it from the correct directory it may not run. The '-Dgnu...'is needed as it otherwise won't detect the USB device. 'ttyACM0' is for a Mindsets digitiser, if you are using something else, with it unplugged run 'ls /dev/' then plug it in and run 'ls /dev/' again, then use the new file name in the command.

cd /home/pi/jAmaSeis/
java -Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0 -jar jAmaseis.jar

Now a window should appear, and fill out the information as to your server.

To make jAmaSeis start on boot we must first create a script in /home/pi/jAmaSeis/. So open it with nano/vi/leafpad or your editor of choice. Then fill it with the following:

#!/bin/bash
cd /home/pi/jAmaSeis/
nohup java -Djava.awt.headless=true -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0 -jar /home/pi/jAmaSeis/jAmaseis.jar &

What does this code do?

The '#!..' is called a shebang, and it tells the parser to run the file with the specified program (bash, which is the default anyway). The next line is the same as before, aswell as most of the third, but it includes 'nohup', this stops it being closed. The 'Djava..' runs it without the GUI, therefore saving memory. and the '&' backgrounds the process.

We must now make this script run on boot. To do this we add a line to /etc/rc.local which is always executed after startup before login. But jAmaSeis must be run as Pi, as root (or as you may know it 'sudo') won't work, so we add an option to the sudo command: '-u pi'. The line must be before the exit 0 though. So without the comments the file is:

_IP=$(hostname -I) || true
if [ "$_IP" ]; then
   printf "My IP address is %s\n" "$_IP"
fi
sudo -u pi /home/pi/jAmaSeis/j.sh
exit 0

Now when you reboot it will take samples. To test it you can install jAmaSeis from the same link as above and check for servers, yours should appear.