Generation-2 Wireless Sensor Network Users
Manual
Running
a field campaign
Notes for
Sridhar
New Versions of stuff
I created a new tarfile and also attempted to attach new items to
email. The tarfile is "sridhar_2005_dec_2.tar" and it unpacks to a
directory of the same name. The version of gps therein produces more
informative output during it's first phase of operation.
My Stomp Tests
I did stomp tests at Vexcel using for input some geophone clusters
rather than the
PPS square wave signal. Actually these were benchtop so I was just
looking at coincidence from taps/impulses. The idea was to ensure that
geophone responses line up. Results appear just fine except during the
first 12 seconds of each datatake. In that startup period the time
stamps are slightly awry. This can be fixed by back-extrapolation but
more practically: Avoid firing shots until 20+ seconds into a given
Brick seismo acquisition; remember you can run for up to 8 minutes at
1000 sps. I performed 11 bench tests and all of them showed good signal
alignment across all channels for two minute datatakes after the first
12 seconds.
The 's' argument for gps
Don't forget that you can obtain some peace of mind by running gps like
this:
wsn 12 # gps s 5
instead of like this
wsn 12 # gps 0 5
In the former case you get 10 seconds (usually about 8 lines) of gps
diagnostics (you hope) like:
gps working time yes lat/lon yes elevation yes GOOD !!!!
gps working time yes lat/lon yes
elevation no GOOD !!!
gps working time yes lat/lon yes
elevation yes GOOD
!!!!
gps working time yes lat/lon yes
elevation yes GOOD
!!!!
I have modifed gps to produce output
like this
gps 1111 2005 12 2 2 30
6.00 40 0 56.59 105 14 36.21 1597.1
so if possible try and run the newer version. I will upload it to
the website and attach it to an email.
Post-Processing
Here for reference is my post-processing procedure including the script
file:
1. smd 50 from each brick.
2. move the datafiles from ftp/uploads to a single "source" directory
for this shot which contains the script file "all.script". It also
contains a subdirectory "proc" where the results will go. Supposing you
use bricks 7 and 8; then this all.script script file reads:
-------------------
parse_gps 7.cpu_pps.serial
7.cpu_pps.short 7.cpu_pps.time
parse_gps 8.cpu_pps.serial
8.cpu_pps.short 8.cpu_pps.time
prepdata ./ 7 7.cpu_pps.time
prepdata ./ 8 8.cpu_pps.time
mv *.?.data proc
mv *.utc proc
rm *.00*
---------------------
That last line removes intermediate junk files from the source
directory. All my raw files have filenumbers starting with 1133 (e.g.
7.1133486953.data and so on) so this cleanup command should not delete
source data.
brick.config parameters
(Mother hen item)
Make sure you have the following parameters set in your brick.config
files (all of them!) contained in the arena subdirectory before loading
them into their respective bricks. I'm only noting the ones you should
verify or change, not the others that should be fine.
cpu_pps_times_file: /root/bin/d/2.cpu_pps
driver_name: SrParXch278
xch_model_name: PAR4CH
port_mode: bpp
parx_sps: 1000.
parx_naverage: 1
data_volume_limit: 80000000
parx_sleep_ms: 10
reads_per_timestamp: 1
sec_per_file: 120
parx_report_file: /root/d/2.parx.report
Of these: You
can play around with parx_sps, the requested samples per second, for
example if things are working properly and you want to try and get 2000
samples per second on a datatake. You can also modify sec_per_file if
you want to create larger data files, up to 480 seconds, the 8 minute
limit. (...or more, per the notes below, if you
have 32MBytes of RAM.) Remember that parx_sps x sec_per_file <=
480,000.
Trapping Actual Sampling Rate
Notice that when you start 'seismo' it will tell you what the actual
sampling rate is, e.g. 1001.6..., compared to what you asked for, e.g.
1000. This number is also written into the "7.parx.report" file that
you will recover to your source directory using smd etcetera, so you
don't need to record it.
Running Passively for a long
time
First test I ran (gps s 50) and (seismo 0 48) with sec_per_file set to
480. This should be 6 seismo file writes and a single gps file write.
Worked just fine, creating 6 x 8MBytes worth of data. These 48 minutes
of data occupied about 5% of the brick's disk space, where 95% is
available for data storage. With a margin of error this means that one
could run for 900 minutes or 15 hours before the disk capacity is
reached.
Second test: Overnight with mother logout after starting background
jobs. Attempting 12 hours on both bricks, 720 minutes. The brick with
32MB ran fine, the other one lost a little data towards the end. Both
gps programs finished fine.
Bottom line: You should be fine for long periods of
acquisition--several hours. Allot the necessary time to ftp all the
data back to your laptop and "clean" the bricks of data before starting
new data acquisitions.
0.
Contents
0.
Contents
Navigate this manual.
1. Setup
How to physically set up sensor nodes.
2.
Configuration
How to
configure mother and the sensor nodes.
3. Data
Acquisition
How to schedule a data
acquisition.
4. Data
Visualization
How to rapidly verify the most
recent data (uses python).
5.
Troubleshooting
How to diagnose
some potential problems.
Appendix A. The wsn program
How to use the wsn node-interface program.
1. Setup
1.1 Introduction
Before beginning the "Introduction Proper" I provide some
links to 'Normal Operation' sections. In these sections I have avoided
technical details in favor of describing basic operation.
Configuring Mother
Updating WSN nodes
Basic "Quickstart" operation
The gps program
The seismo program
The smd program
Formatting data on mother
Generation-2 WSN nodes (abbrev. 'nodes' or sometimes 'bricks') are
prototype units. We do not know--yet--how robust they are in
harsh environments. In consequence: In the field, treat them as gently
as possible. In keeping with my open-environment attitude,
this manual (a work-in-progress describing
work-in-progress) does not gloss over unresolved issues and problems
with Gen-2 bricks.
WSN nodes should be thought of as two
combined devices: A data acquisition device and a communication device
tied together via a single board computer (SBC) running Linux. Should
one
part fail the rest may continue to function, with the exception of the
SBC. If it fails then try the ideas here
and here.
1.1.1
Terminology
WSN: Wireless Sensor Network comprised
of sensor nodes and a manager's laptop (see 'mother').
WSN node, equivalently a 'brick': A
sensor device and associated wireless.
SBC: The Single Board Computer installed in each wsn node.
TS-Linux: The reduced-size version of RedHat Linux run on each SBC
(distributed by Technologic Systems).
Mother: The laptop used to
manage the WSN. Mother is assumed to run Linux or compatible.
Network manager: A person managing the WSN in the field.
User: The network manager's user id on
mother. This is a standard user account, not root, in contrast to the
brick log-on where the manager is always root.
The operational model for WSN managed deployment places considerable
responsibility on the network manager:
- The network manager deploys the units and
provides them power.
- The network manager controls the network
wirelessly for a series of data acquisitions.
- After each data acquisition the data is recovered to a unique
directory.
- The data can be processed and viewed to verify that it's ok.
To this end, contents of this document should be very familiar to the
network manager, particularly the remarks offset as centered italicized
boldface on red backing:
A very useful tip
in using the Linksys WET-11 wireless ethernet bridge:
If mother is not
connecting: Power cycle mother's WET-11.
If this fails, power cycle the node's WET-11 and/or reboot the SBC.
The wireless connections are used to send instructions to the bricks
and to recover data. There is an alternative method of connecting to
the SBC console over a serial port described
here.
Archiving the raw data is a good policy. The suggested method is to
create a well-named directory for each dataset and back up datasets to
CD-ROM. A useful WSN feature that
is unfortunately not implemented yet is automatic message relay to
nodes that are
out of mother's range. It is possible to effect this manually (by daisy
chain file pushing/pulling) but the practice
should be avoided if possible. Therefore:
Deploy mother to a
location visible to all active WSN nodes.
Data is written to files by the two SBC acquisition programs (gps and seismo) in a raw format
to avoid overloading the SBC. It is
recovered to mother using a third program (smd) and
post-processed on mother by a set of formatting programs.
The resulting formatted datasets are ascii files, five per brick per
acquisition.
The first four files are the data from each of the four digitizer
channels, one ascii value (pseudo-voltage) per line. The fifth file
contains
corresponding UTC times for these samples.
1.2 External connections
There should be four ports to work with on the side of each node, and
particular care should be taken when attaching/detaching cables. An
external
ethernet port is also available but is not described at this time.
The main cable trick:
Alternate screwing down the threads with gently pushing in the cable.
Conversely: Alternate unscrewing with jiggling and pulling the cable
out when unfastening.
This trick relieves stress on the threads and thereby facilitates ease
of cable attachment/detachment. Here are the four connectors of
interest; the ordering on a given wsn node may vary as each Gen-2 node
was built by hand. Here they are from left to right: GPS BNC,
2-conductor Amphenol power, 10-pin geophone/PV in, and wireless antenna.
Cable 1: Power
Two-conductor (smaller) amphenol connector. Notch at the top. Red wire
is positive, black negative, 12 volts. In practice the input voltage
should be a little higher, say 12.5 volts.
Cable 2: Geophone
Ten-conductor (larger) amphenol connector, notch at the top. Note that
4 attached geophones (3-axis plus single-axis) result in 8 input wires
for the analog seismic signals. The remaining two bare wires are
intended for attachment to photovoltaic panels for recharging the
battery. As a rule the "color" wire should be positive but this should
be verified against the charge controller terminals mounted on the
inside lid. If no PV panels are available the two "extra" wires
can be
ignored (but not shorted).
10-Conductor Pinout
Pins
A and B:
North
Digitizer channel 1
Pins
C and D:
East
Digitizer channel 2
Pins
E and F:
Z-axis
Digitizer channel 3
Pins
G and H: Independent
Digitizer channel 4
Pin
I: +Charging supply
Pin
J: -Charging supply
Cable 3: GPS
antenna
BNC connector (coax), twist-lock. The enthusiastic amount of waterproof
glue on some of the BNC sockets can make attaching the GPS antenna BNC
connector difficult. Strongly recommended: Have a pair of blunt pliers
(such as
lineman's pliers) to assist.
Cable 4: Wireless
antenna
N-type coax connector, threaded. Again note the main cable trick above.
The external ethernet port can be
connected to one of the
unused SBC ports--possibly using a crossover cable--but this is not
addressed further herein.
1.3 Case-Internal Operation and
Diagnostics
The only necessary internal operation is power up / power down by means
of the toggle switch on the power board. (Note LED power light.)
Optimally throwing the power switch will bring the system up fully
operational.
There follow four subsections
1.2.1 Internal hardware component
list
1.2.2 How to verify the system is working
1.2.3 Description of the
internal cable connections
1.2.4 Basic in-case diagnostics.
1.3.1 Internal Hardware Component List
In addition to cables, connectors, and padding there are eight internal
components to be aware of. Locations here assume the user is facing
into the case opposite the lid hinges.
1. Digitizer. White / silver box mounted "upside-down" at bottom left.
2. Wireless. Blue box mounted on top of the digitizer.
3. Charge Controller. Mounted inside lid, black with screw terminals.
4. Power board. Perforated board, substrate for remaining components,
right side of chassis box.
5. Single board computer. Mounted on the power board.
6. Parallel port board mounted on the computer.
7. GPS board. Attached on top of the parallel port board.
8. (Optional) Voltage converter. Semi-board mounted atop parallel
port board. Identifiable by four large brown cylindrical capacitors and
a red-wire induction coil.
Here are the guts of wsn Node 1. Being an early prototype it is not
quite typical in configuration but this photo does show most of the
main components (with the exception of the wireless unit). Following
this photo are a series of remarks on components going from left to
right.
- Left connectors, bottom to top: Wireless antenna out, ethernet
connector, GPS BNC connector, -+ power, 10-pin geophone and PV-input
connector.
- At left: Silver box, inverted: PAR4CH 4-channel digitizer from
Symmetric Research. Note wide grey ribbon cable connects to SBC
parallel port at right center. Some of these cables will connect
right-side-up or upside-down. In the latter case the digitizer
connection will fail.
- Center: GPS board mounted on yellow perf-board. Note ribbon cable
at top connects to SBC serial port. The PPS cable is a yellow RCA-type
barrel plug (obscured by orange wire bundle) at the lower-left of the
GPS board.
- Right: Single Board Computer (SBC), TS-5400 produced by
Technologic Systems. This consists of a main board and a daughter board
above which is included for the parallel port.
- The partially obscured ribbon cable emanating from top-left is
attached to a 16-pin socket; this is the Digital I/O / General Purpose
I/O (DIO or GPIO) connector where the interrupt PPS signal from the GPS
board is routed. Additional GPIO pins attach to the PIC microcontroller
partially visible on the perf-board at lower-right.
- The Compact Flash card is visible in its socket at upper right.
- The vertically oriented 10-pin socket at lower right adjacent
to the board-edge is the COM2 console connector.
- Partially obscured by the ribbon cable at lower right is the
reset button. This is located just to the left of the serial port (to
which the ribbon cable is connected).
- Power light is visible at lower left of the yellow perboard; but
the adjacent power switch is obscured by the grey ribbon cable.
- Attached on the inside lid, not shown is the SunSaver-6 charge
controller.
- Missing from this photograph is the WET-11 802.11b wireless
ethernet bridge, a blue box that velcroes to the top of the digitizer
at left. This box has three cables connected to it:
- An ethernet cable to the ethernet port on the lower-left of the
SBC.
- A power plug visible resting atop the lower-left part of the
digitizer.
- An antenna connector visible resting atop the digitizer at
center. This connects to the bulkhead external antenna connector.
Many later-built Generation 2 nodes were modified to provide 5 volts to
the wireless bridge by means of an in-line 12-to-5 voltage converter.
This MOSFET-sized 3-pin component (when present) is built into the
WET-11's power cable, screwed to a flat plate heat-sink, and taped in
place at the top of the WET-11.
1.3.2 Verifying Proper Operation
Assuming the WSN node powers up with power lights on, proper operation
is verified via wireless.
1.3.3 Internal cable connections
Digitizer: 4 cables
10-pin Amphenol bulkhead connector to
digitizer analog input: 8 wires to 15-pin D-ring connector.
15 pin D-ring digital i/o connector: ground wire and PPS signal from
GPS board.
Parallel ribbon cable: Parallel port on SBC daughter to parallel port
on digitizer.
12-volt barrel-plug power cable to power board (underside).
GPS board: 3 cables
Serial cable to SBC serial port ttyS0.
RCA-connector PPS signal to: SBC GPIO socket, digitizer DIO, spare wire
for testing.
12-volt barrel-plug power cable to power board (underside).
SBC
12-volt pair to power supply daughter
board (top right of SBC stack)
Serial cable to GPS board
GPIO (DIO) connector: Ribbon cable and various destinations
Parallel port ribbon cable to digitizer
Ethernet cable to wireless
Note: COM2 10-pin socket can be used for direct serial login e.g. using
"minicom"
Charge controller: 3 [+/-] pairs (possibly some additional)
10-pin Amphenol bulkhead connector to
charge controller Photovoltaic terminals.
Input 2-pin Amphenol connector 12Volts to charge controller battery
terminals.
Charge controller load terminals to power board 12 volt input terminal.
Some wsn nodes take off an additional ground wire for WET-11 power.
WET-11 Wireless Ethernet Bridge
5-volt barrel-plug power supply from
power board.
Ethernet cable (non-crossover) to eth0 port on SBC.
Coax antenna cable connector to bulkhead N-connector.
The
small WET-11 slide switch on the WET case should be on crossover (X).
1.3.4 In-case checklist:
inspection/diagnostics
Power
- Verify the charge controller Load Disconnect red LED is not lit.
If this light is lit, the voltage supply is low.
- Verify 3 of the 4 WET-11 lights are on: Power, WLAN and LAN.
- Verify the digitizer power light LED is on.
- Verify the GPS "PPS" light is blinking once per second.
- Verify the SBC LED (back of board by CF card) blinks occasionally
(more frequent on boot).
SBC (Computer) Shutdown
Under normal conditions the wsn node computer should be shut
down prior to power-off. This is accomplished while logged on to the
node like this:
wsn 12 #
shutdown -h now
This is destinct from the reboot version
of shutdown:
wsn 12 #
shutdown -r now
Shutdown and reboot can also be accomplished using milo, the task scheduler, using
mother's wsn program:
% wsn
shutdown 12
%
wsn reboot 12
1.3.5 Power
Outage
In the event that power to a wsn node is cut:
- Turn off the wsn power switch (case internal)
- Reconnect power
- Turn on the power switch.
Sometimes a power cutoff will put the system into
a state of vapor lock. This is indicated by a complete inability to
connect for a log-in prompt, get a ping, etcetera. (The WET-11 will
ping but the wsn node will not.) That is, the machine appears to boot
but the manager cannot gain access via wireless.
In this case doing a hardware reset will
not solve the problem although this should be tried first. Should that
fail to bring the machine back up it will be necessary to
connect to the node via the 10-pin serial port socket located on the
SBC main board, front right, labeled "COM2".
This is accomplished using the spare ribbon cable provided. The
lettering on this cable should face outward, i.e. face towards the COM2
label on the SBC board. COM2
is the "console" for the SBC. The other end of the ribbon cable is a
9-pin D-ring connector; this will connect to a laptop serial port. The
console log-on connection is established via some terminal emulator
such as minicom. Terminal rate should be 115k.
Once connected, reboot the SBC and watch the boot sequence text
scrolling across the terminal window. At
some point (assuming this is the problem) it will complain about file
system problems and prompt for the root password. The user should log
on as root and run the fsck
program:
# fsck /dev/hda2
Hit return when prompted and eventually when fsck is done: reboot the
SBC. It should come up normally.
1.3.6 Hardware Reset
The small button mounted at the top front of the SBC board (near the
serial ports) can be pressed to reset (reboot) the SBC. There is less danger of a catastrophic
system hang because the SBC disk is solid-state rather than a spinning
hard drive. Nevertheless resets should be avoided unless proper
shutdown is impossible (see previous sections).
Why
are resets necessary at all? Under some as-yet-not-fully-understood
conditions a node will not permit
log-ins; that is, it will allow the user to type in the username root
and the root password but it will refuse to let you on. Hitting the
reset button has proven to be a way to overcome this strange reticence.
Locate the black
reset button near the front edge (serial port side) of the Single Board
Computer.
If root/password are rejected in the log-on, hit the reset button and
try again.
1.4 Mother's Support Case
The 'Mother Box' is a wsn case containing hardware facilitating
mother's
wireless operation, particularly including mother's WET-11. It is
labelled with an "M" and a "juneauwireless" sticker.
The WET-11 is powered (5 volts) by means of a transformer and an
inverter inside the case. The inverter is driven off of a 12 volt
battery and produces 110 volts AC. Into this is plugged the
transformer power supply for the WET-11. There is room
in this case for an amplifier that increases mother's
wireless range.
Mother's WET-11 has an ethernet out (unplugged for transportation) that
plugs into the bulkhead ethernet connector. An external ethernet cable
from the mother laptop to this connector will provide access to the
WET-11 and hence to the rest of the network. No crossovers are
necessary. If the case is open of course the laptop can also be plugged
directly into the WET-11.
The WET-11 has a pigtail coax cable to the bulkhead N-type connector.
An external antenna cable can connect this to a grey omnidirectional
antenna giving 2 km range line of sight. Alternatively for more
convenience and possibly less range, one of the small wire omni
antennas (rubber-ducky) will screw directly onto the bulkhead
connector. Finally for case-open operation a black plastic rubber-ducky
can be screwed directly onto the WET-11.
Also included in the Mother Box
- Wirecutters
(for zip ties)
- VO meter
- Crossover cable
- External Ethernet cable
- Serial connection cable
- 3 x Rubber Ducky antennas
- Antenna cable for Grey Omni
Antenna
- Spare voltage converters for 12
-> 5 (WET-11)
2.
Configuration
2.1 Introduction
In the managed network mode we have two systems to configure:
1. The mother computer, operated by the network manager.
2. The wsn node, controlled from mother by the network manager.
In this manual a command issued on mother is indicated with a % prompt
as in:
% wsn
ping all
A command issued on mother as root is indicated as:
# chmod a+rwx *
A command issued on wsn node 12 (for example) is indicated by:
wsn 12 # seismo brick.config
2.2
Configuration of Mother
2.2.1 Mother wireless ip address
The configuration procedure
for the main operating environment is described below. Mother is
obliged at this time to have ip address 192.168.1.50.
On mother, as root, under SuSE
Linux we have:
# more /etc/sysconfig/network/ifcfg-eth0
BOOTPROTO='static'
MTU=''
REMOTE_IPADDR=''
STARTMODE='onboot'
UNIQUE='GA8e.RlzwFdb+Or5'
BROADCAST='192.168.1.255'
IPADDR='192.168.1.50'
NETMASK='255.255.255.0'
NETWORK='192.168.1.0'
The corresponding file on the wsn nodes has already been modified. For
reference see 2.3.1 WSN ethernet
addresses.
It is important to note that data returning to the ftp uploads
directory will be owned by the ftp user. It may therefore be necessary
(as root) to change ownership
and permissions on uploaded data before it can be moved to storage
elsewhere. Easiest is to ensure
that the ftp program on mother automatically sets ownership and
permissions of uploaded files to usable states.
2.2.2
Configuring an iBook as Mother
These steps were taken November 14 2005.
- Obtain iBook (G4 processor) running OSX.
- This Mac has a built-in Airporter. (This device noticed a linksys
wireless unit.)
- Select Apple Pulldown Menu.
- Select System Preferences.
- Select Network (icon at top of Network application).
- Click on AirPort.
- Select TCP/IP.
- Set "Manually".
- Set IP address 192.168.1.50.
- Subnet mask: 255.255.255.0.
- Router 192.168.1.0.
- Click Apply.
- Launch the X11 terminal application.
- Mac now ready to communicate to a brick network.
Next step is to ftp the brick
environment and install it. The
current installation is maintained at www.robfatland.net.
It is a tarfile called rob.tar.
It
unpacks from its current directory into the subdirectory /rob.
ftp to source for WSN tarfile 'rob.tar',
get this file (25 MB), move to a 'brick'
subdirectory for unpacking.
% tar -xvf rob.tar
Brick directory structure unpacks to directory 'rob'.
% cd rob/Setup
% vi setup.bash
Suppose the 'rob' directory has
a full path = /Users/sak/brick/rob;
then edit the first line of setup.bash
to read
export BRICK=/Users/sak/brick/rob
Save the setup.bash file and
if you like: Configure the account to source it as desired (e.g. on
shell startup). Source the file to establish the aliases and so on
therein:
%
source setup.bash
Should now be able to use all the aliases in this file. A simple test
(assuming brick 14 is up) would be:
% putgps14
This will test that the $BRICK/bin
directory is part of your $PATH,
it will verify the putgps14
alias, and it will verify that the adhoc
ftp script runs properly.
The smd program will
automatically ftp all files in the brick's /var/ftp/downloads
directory to 192.168.1.50, assuming you issue the command
wsn 14 #
smd 50
Note that this directory is also symlinked from the brick home
directory as /root/d .
2.2.3
Mother ftp configuration (SuSE Linux)
In the case of SuSE Linux (9.0 or so) the ftp daemon is vsFTPd which
stands for Very Secure FTP Daemon. A problem will arise when using the
wsn program: A wsn node will send a file to mother's ftp/uploads
directory which will have difficult permissions. Consequently the wsn
program will not see this file, let alone be able to read its contents.
anonymous-ftp files
uploaded to mother should automatically be readable by User.
(i.e. User should not
be
obliged to be root to read the data!)
The solution requires root
privilege on mother; as root
edit the /etc/vsftpd.conf
file. You can change the anonymous umask
value or, slightly more secure, you can set the chown_uploads and chown_username variables as follows:
# cd /etc
# vi
vsftpd.conf
chown_uploads=YES
chown_username=apex
2.2.4
Mother filestructure
We indicate the mother home directory as $BRICK/
as it is defined in the setup.bash
file. This might for
example be in practice /Users/home/fred/wsn/.
This top-level directory
contains all of the wsn node software, scripts, and configuration
files. The following is mother's $BRICK/
top level contents: subdirectories,
files, and symbolic links.
directories
$BRICK/arena
configuration files "brick.config"
$BRICK/bin
executables and scripts
$BRICK/testdata
test datasets to verify that post-processing and plotting are ok
$BRICK/tmp
temporary files, particularly from the 'wsn'
program
$BRICK/Bricklib
wsn
source code library
$BRICK/Documents
storage for documentation, notes
etcetera
$BRICK/Milo
source code for milo, the
brick task manager
$BRICK/Oncore
source code for gps, the gps
interface program
$BRICK/pargps
location of the digitizer's gps driver
$BRICK/parxch
source code for seismo,
digitizer data acquisition program
$BRICK/Setup
location of setup.bash, the
important alias script
$BRICK/Short
source code for 'short', the
timing-related kernel driver
$BRICK/Util
utility programs
files
$BRICK/wsn.node.list
simple listing of in-use wsn nodes (listed by index).
symbolic links related
to development (suggested)
$BRICK/python:
python root directory: plotting modules
$BRICK/data:
data depository
$BRICK/d:
ftp downloads (files to send away)
$BRICK/u:
ftp uploads (files received, particularly from bricks)
2.2.5
Mother configuration To-Do-List
- Tar open the tarfile.
- Save the tarfile some place safe!
- Modify the $BRICK/Setup/setup.bash file to point to $BRICK
properly.
- Go through the above sections 2.2.1--4 and take care of those
issues.
- Build mother's main executables as follows
Unless you are compiling on an X86 machine or have a cross-compiler,
you can't build brick executables.
You can however build mother executables, particularly { abstime,
counts2volts, prepdata, parse_gps }.
From these directories type these associated commands:
$BRICK/Bricklib: mother%
gmake
(This makes the bricklib.o library.)
$BRICK/Util:
mother% gmake abstime
$BRICK/Util:
mother% gmake prepdata
$BRICK/Util:
mother% gmake counts2volts
$BRICK/Util:
mother% gmake <other programs here
might also be useful>
$BRICK/Oncore:
mother% gmake parse_gps
A backup directory of binaries might
prove useful.
2.3 Configuration of the WSN nodes
2.3.1 Initial Upgrade /
Operation Check
The following procedural upgrades to the current WSN
software. The idea is to make use of
aliases established (for mother) in the $BRICK/Setup/setup.bash
file and (for bricks) in the $BRICK/arena/bashrc.generic
files. Note that both of these files reside on mother.
How are the brick aliases installed on a brick if they reside in a file
on mother? The answer is: The same way everything else is installed on
bricks: First the
brick bashrc.generic
file is modified on mother and then it is sent to the brick's uploads
directory. Next it is installed
on that brick from the command line using the inbash
alias. The same procedure goes for any other upgrade:
First modify the file (if necessary) on mother, then send it to the
brick,
then install from the brick command line using the
appropriate inXXX alias.
These send/install aliases are listed below. Notice the send commands
have the form putXXXN. XXX indicates the type of file and N indicates
which brick to send it to. Hence putconf4
means 'send the config file to
brick 4' and putconf12 sends a
different config file to brick 12. (Configuration files are unique to
each brick.)
The following list of put/installs should be carried out on each brick:
on mother
on the brick installs
......... ............ ........
putconf4
inconf
configuration file 'brick.config'
putgps4
ingps
gps program
putseismo4
inseismo seismo program
putbash4
---
---see next line---
putgenbash4
inbash both
.bashrc and .bashrc.generic are installed and run
putsmd4
insmd
smd (send-mother-data) program
putadhoc4
inadhoc adhoc
auto-ftp script
putmilo4
inmilo milo task
manager program
This
procedure is presented on a
one-node-at-a-time basis. However it is also possible to edit the $BRICK/Setup/setup.bash
alias file so that putXXX
(rather than putXXXN) will
send the appropriate upgrades to all the
nodes currently in the network, saving some time. To do this requires
all wsn nodes up and connected in
order to receive the upgrade files. For example a blanket 'putconf'
alias would be:
alias
putconf14='adhoc put $BRICK/arena/14 brick.config 14'
(etcetera)
alias putconf='putconf5;
putconf6; putconf7; putconf8; putconf12; putconf14; putconf15;
putconf16'
It is recommended that while managing the network, multiple windows be
used, two or three for mother and one log-in window for each wsn node.
Labeling the node windows with the node index will facilitate
maneuvers. The command line prompt will also indicate the bricknum of
that login session. As usual in what follows a mother-issued command is
indicated by the mother%
prompt and a node command by the wsn 14 #
prompt. The user on the wsn node is logged in as root.
After updating the brick files the gps
program should be run. This should preferrably be done with the antenna
placed outdoors with a clear view of the sky. If this is not feasible
the gps return-records will
give incorrect dates and positions. Prior to acquiring seismic data the gps program should be allowed to
run long
enough to permit the gps board to bootstrap its new time and location.
Once the brick is 'established' in a new location the gps lock doesn't
take long--a few seconds--but the first time it could
require up to 20 minutes or so.
Since the gps program takes
two consecutive time-arguments (in minutes) there are a couple of ways
to do a test run. First with the following command the gps board will
acquire data for 20 minutes,
printing a diagnostic about data quality once per second. No data will
be saved.
wsn
14 # gps 20 0
Alternatively the next version of a gps
command will not be verbose but will save 20 minutes
of acquired data as two raw binary files.
wsn
14 # gps 0 20
The two resulting data files can be sent to mother and
translated to ascii using the parse_gps
program described below.
The drawback to reduced-CPU
operation is that the gps
program does not write its data buffer to disc until the program
finishes its full acquisition period.
2.3.1
Wireless ethernet address
Ethernet configuration should not be necessary;
this material is provided for reference. Each wsn node has an ip
address 192.168.1.<bricknum>. That is, node 8 (i.e. brick 8) will
reside at 192.168.1.8. The ethernet configuration file on the node
resides in the /etc/sysconfig
directory and (for eth0) is called ifcfg-eth0.
Here are the contents of this file, configured to be "Brick 8" with ip
address 192.168.1.8:
/etc/sysconfig/ifcfg-eth0 reads:
DEVICE=eth0
IPADDR=192.168.1.8
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
#BOOTPROTO=dhcp
BOOTPROTO=static
ENABLE=yes
/etc/sysconfig/ifcfg-eth1 reads:
DEVICE=eth1
IPADDR=192.168.2.8
NETMASK=255.255.255.0
NETWORK=192.168.2.0
BROADCAST=192.168.2.255
ENABLE=yes
Note that eth1 can provide access to the computer via the second
physical ethernet port on the SBC. At the moment (9/2005) this probably
will require a crossover ethernet cable as opposed to the straight
cable connecting eth0 to the wireless unit. The crossover cable can be
connected from the interior socket of the chassis wall bulkhead
connector to the 2nd ethernet port on the SBC. An external connection
would be made by connecting a non-crossover cable from an external
device to the external socket of the bulkhead ethernet connector.
The wireless units, LinkSys WET-11, have their own ethernet addresses
as well, of the form: 192.168.1.1XX. That is, they begin at 101 and
continue 102, 103 etcetera. See label on the WET-11 (blue box inside
node case). In the event that the wsn node can not be ping'd, it may be
of interest to determine whether the WET-11 can be pinged.
2.3.3 WSN ftp
WSN nodes should permit anonymous ftp with receive directory 'uploads'
and send directory 'downloads'.
2.3.3
WSN node
configuration: Basics and directory
structure
In this section the terms brick and
equivalently wsn
node refer in fact to the single board computer which runs a
modified (reduced) distribution of Redhat Linux. The wsn node directory
structure is quite simple. There is one user: root. There is a single
password and there is no WEP encryption on the wireless. Each wsn node
has an identification index, e.g. 4, 5, 6, 7, 12, 14, 15, 16 etcetera,
and a corresponding IP address: 192.168.1.4, 192.168.1.5, etcetera.
There is a home directory /root
and a /root/bin
sub-directory which serves as the center of operations. There is a var/ftp/uploads
directory where files are imported, and there is a /var/ftp/downloads directory
where data is accumulated. These latter two directories are accessed
from /root
and /root/bin
via symlinks u/ and
d/
respectively. Other directories and files concern run-time kernel
drivers and run-time processes (notably milo)
and are not described in this manual.
The
crucial core elements of a brick's directory structure are:
Home
directory:
/root
Short-driver directory: /root/.short
Bin
directory:
/root/bin
Tmp
directory:
/root/tmp
Data/Output
directory: /var/ftp/downloads
Control/Input
directory: /var/ftp/uploads
Symlinks
to Data and Input: /root/d and /root/u
Directory structure
/root
.bashrc, .bashrc.generic go here
/root/bin
executables, brick.config, go here; base of operations
/root/tmp
temporary files, particularly milo-generated replies
/var/ftp/uploads
ftp files to this brick go here
/var/ftp/downloads
data storage directory
/root/u
symlink to /var/ftp/uploads
/root/d
symlink to /var/ftp/downloads
/root/bin/u
symlink to /var/ftp/uploads These symlinks are
more a matter
/root/bin/d
symlink to /var/ftp/downloads of convenience.
/root/bin/d/u
symlink to /var/ftp/uploads "
/root/bin/u/d
symlink to /var/ftp/downloads "
The crucial core
programs a brick runs are:
/root/.short/short.o GPS interrupt
handler (this is auto-run on boot).
/root/bin/gps
GPS data acquisition
/root/bin/seismo
Seismic data acquisition
/root/bin/smd
SendMotherData (contents of /root/d).
2.3.4 Disk usage
Each wsn node has approximately 925 MBytes of available compact flash
disk storage capacity. At a rate of 200 samples per second this disk
will fill up in approximately 3 days of continuous data acquisition
(including the accompanying GPS data stream). For this reason it is
important to manage the wsn node data acquisition and recover datasets
frequently. To determine how full a node disk is, log on and issue the
command
wsn 4# df
which will produce a output something like:
Filesystem
1k-blocks Used Available Use% Mounted on
/dev/hda2
982200 56984
875320 7% /
This indicates that 875 MBytes are still available.
2.3.5 .bashrc and .bashrc.generic
These two files are used to establish aliases and otherwise
configure the bash shell. Their details should not come into
consideration, but for completeness the following describes where these
files reside on mother and how they can be re-installed on a given wsn
node. Note that these notes are outside the purview of the wsn program.
On the wsn node the file .bashrc
executes when a shell script is started. On mother these .bashrc
files are stored under the name bashrc
(no leading period). Similarly on the wsn node the script .bashrc.generic
is run by .bashrc.
On mother this file is stored as bashrc.generic.
There is only one copy of this file for the entire wsn network whereas
there is a separate version of .bashrc
for each node. There is an alias in the mother setup file which will
send updated versions of the .bashrc
and bashrc.generic
files to a given wsn node.
%
putbash12
will send $BRICK/arena/12/bashrc
to brick 12. Similarly
%
putgenbash12
will send $BRICK/arena/genbashrc
to brick 12. Note that genbashrc resides
in the main $BRICK/arena directory
while
bashrc is specific to $BRICK/arena/12,
the subdirectory for brick 12.
Once logged onto brick 12, these two files can be installed using the
command
wsn
12# inbash
2.3.6 brick.config
The operation of a wsn node is controlled in its details by parameters
stored in the file
wsn 12#
ls /root/bin/*.config
/root/bin/brick.config
This file should not be altered on its native wsn node. Rather it
should be modified in its source directory on mother
% ls
$BRICK/arena/12/*.config
/home/apex/rob/arena/12/brick.config
and installed on the respective wsn node using the wsn program. For
example:
% vi
$BRICK/arena/12/brick.config
<the network manager then changes a parameter value in this file and
saves the new version>
% wsn
update 12 brick.config
This will send the new brick.config
file to wsn node 12 where it will be installed by the node task manager
program milo.
There is also a simple alias to ftp this file to its node:
% putconf12
In this case the file will reside in node 12's ftp/uploads directory.
It can be installed from the command line like this:
wsn 12 #
inconf
dmesg
The data acquisitions benefit from being single-file-write (see seismo below).
The amount of time the program can acquire before writing depends on
the sampling rate and the available memory. The latter is printed at
the top of the boot output file and can be accessed using the dmesg command. In the following
example the system has only 16MBytes. At 1000 samples per second the
single-data acquisition limit for a 16MB-RAM SBC is (empirically) 8
minutes. 32MB-RAM can handle at least 16 minutes of data at 1000
samples per second before writing a file. Acquisitions longer than 8/16
minutes will require multiple file writes which can compromise sample
timing while the file is written to disk.
wsn 12 #
dmesg
... text ...
Memory:
14036k/16384k available (1175k kernel code, etcetera)
... more text
...
Use dmesg to determine how much
memory a brick has.
When the seismo acquisition program is run and tries to acquire
more-than-available-memory worth of data it will seg-fault.
The following is an abbreviated version of the all-important
brick.config
file. Some comments are added in italics and some parameters are
omitted for simplicity. The main parameter to note is parx_sps which
is the samples per second for the PAR4CH digitizer. There are two
important ideas with regard to digitizer operation:
Some PAR4CH digitizers
can support a sampling rate of 2000+ samples per second.
PAR4CH on WSN nodes 7
and 8 currently support only up to 1200 samples per second.
The error messsage when
the requested sample rate is too high:
ERROR: Could not open
PARxCH (Err = A/D READBACK)
Solution: Reduce the brick.config requested samples per second
'parx_sps'.
Parameters susceptible to change during normal operation are in dark green font.
---------------------------------
comment:
GENERAL info
my_id:
12
my_ip:
12
mother_id:
17
map_id_to_ip:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 50
num_wsn_nodes:
9
wsn_node_ip_list: 4 5 6 7 10 12 14 15
16 <this
should correspond to wsn.node.list on mother>
comment:
comment:
SERIAL PORT and GPS info
comment:
gps_comment (brief, no spaces) might go into out_fnm (future mod)
tty:
0
epoch_start:
0
cpu_pps_times_file:
/root/bin/d/4.cpu_pps.time
gps_report_file:
/root/d/4.gps.report
do_gps_relaunch:
1
do_gps_stdout:
0
do_gps_comment:
0
gps_comment:
lab_roof_ant_Sep_2005
comment:
comment:
HALT info
gps_halt:
/root/u/gps.halt
seismo_halt:
/root/u/seismo.halt
comment:
comment:
PAR4 info
driver_name:
SrParXch278
xch_model_name:
PAR4CH
port_mode:
bpp
parx_sps:
200
<This is samples per second for
the
digitizer>
parx_naverage:
1
data_volume_limit:
80000000
data_format:
counts
parx_sleep_ms:
10
reads_per_timestamp:
1
sec_per_file:
600
parx_report_file:
/root/d/4.parx.report
comment:
comment:
MILO scheduler info
milo_task_directory:
/var/ftp/uploads
milo_fast_latency_sec:
1
milo_slow_latency_sec:
15
milo_n_tasks:
6
milo_task_0:
all_data_return_and_wipe
<etcetera;
further milo tasks are listed here>
---------------------------------
2.3.7 Run-level execution on boot: The
milo task manager or data acquisition programs
This section is quite particular to the reduced distribution of
TS-Linux. Eventually milo will start on boot. Installing a script to do
this properly creates one important unresolved issue. Therefore as of
this moment, milo is run manually by logging on to the wsn node and
typing
wsn 4 #
cd bin
wsn 4 # milo
brick.config
At this time milo is
not tested so all further milo-related remarks can be skipped over for
now.
3.
Data Acquisition
3.1 Introduction
There are two ways of interfacing with a wsn network for data
acquistion.
1. Log on (using multiple windows) to each node and issue (gps and seismo) commands.
2. Ensure the task manager milo
is running on each node and use mother's wsn interface program with all for the
target node.
In what follows, method 1 will be described first, followed by method 2.
3.1.1
Method 1: "Quickstart" gps / seismo data
acquisition
Getting the two data acquisition programs running is fairly simple;
simply log on and run them, first gps
then seismo. For example, from
mother logging on to brick 12:
mother%
br12
Trying
192.168.1.12...
Connected to
192.168.1.12.
Escape
character is '^]'.
Technologic
Systems Linux
Version 3.07a
miniepc.embeddedx86.com
login: root
Password:
/sbin:/usr/sbin:/bin:/usr/bin:/root/bin:./
wsn 12 # (gps
s 6) &
>> diagnostic output <<
wsn 12 # (seismo 0 5) &
>> more diagnostic output <<
Both of the above commands use the same two-argument structure with
slight distinctions described below. Both are run as background jobs to
keep the command line available. This also means the SBC has only one
terminal connection to keep track of; anything that makes the CPU load
lighter is good. Finally it is important to note that these commands
are actually aliased in the .bashrc.generic file, so the above two
commands could have been entered as:
wsn 12 #
g6
wsn 12 # s5
gps
This program performs a dual function and in so doing creates two raw
binary data files:
bricknum.cpu_pps.serial 54
byte records received on the Motorola GPS board serial port connection.
bricknum.cpu_pps.short
16 byte ascii time values captured by the 'short' kernel
driver interrupt handler.
Both files are sent to mother where they are combined into a single
ascii file for subsequent time-stamping using the parse_gps program.
The result of this operation is a single ascii file:
bricknum.cpu_pps.time
= CPU times + associated UTC times + lat/lon/elevation at
1 second intervals
An important thing to bear in mind for a data acquisition is
that gps lock does not always occur quickly, particularly after
relocating WSN nodes to a new location like Antarctica. It can in fact
sometimes
take upwards of 20 minutes for the GPS boards to lock on after a major
transplant. For this
reason it
is good practice to allow the WSN to operate for a period of time and
verify that GPS fixes are good. This should be done prior to each data
acquisition.
seismo
wsn 12 #
seismo 0 5
Produces file pairs: 12.45334535452.data, .stamp.
smd
wsn 12 #
smd 50
sends all files in /root/d =
/var/ftp/downloads to the ftp/uploads
directory at 192.168.1.50 (mother).
Formatting
data on mother
parse_gps
As described above, the gps program will produce two raw
files:
bricknum.cpu_pps.serial
bricknum.cpu_pps.short
Both these files are transferred to mother using smd
where they are combined into a single ascii file for subsequent
time-stamping using the parse_gps program.
mother%
parse_gps 6.cpu_pps.serial 6.cpu_pps.short 6.cpu_pps.time
The result of this operation is the ascii file:
6.cpu_pps.time
= CPU times + associated UTC times + lat/lon/elevation at
1 second intervals
This file can be viewed to ensure that time / lat / lon / elevations
are sensible. It is subsequently used as input to the prepdata program.
prepdata
prepdata is used to format raw
digitizer data files into UTC-timestamped pseudo-voltage ascii files. prepdata is in fact a C program that
uses the system("command")
call to run other programs, notably counts2volts
and abstime. Here is an
example of source files to be ingested by prepdata:
2.1132659471.data
2.1132659471.stamp
2.1132659772.data
2.1132659772.stamp
2.cpu_pps.time
The data files are 4-byte-long x 4 channels interleaved. This is much
more pleasant to deal with when each channel is resident in its own
file. Note that two data/stamp pairs are sequentially delineated by the
10-digit number in the filename (an arbitrary time in seconds). These
multiple pairs will be automatically combined into a single datatake by
prepdata. The fifth file is the
output of parse_gps, both cpu
times and gps time/lat/lon/elevations.
A typical prepdata command
would look like this:
mother%
prepdata ./ 2 2.cpu_pps.time
prepdata will attempt to
process and combine all 2.XXXXX.data/stamp
pairs into five ascii output files:
2.0.data
channel 0 pseudo-voltages
2.1.data
channel 1 pseudo-voltages
2.2.data
channel 2 pseudo-voltages
2.3.data
channel 3 pseudo-voltages
2.utc
corresponding UTC times
prepdata runs two additional
program vis the C system(cmd)
call:
counts2volts
abstime
All of these programs have source code in the $BRICK/Util
directory.
3.1.2
Method 2: Data
acquisition using wsn and milo (the brick task manager)
Ignore this section for now.
wsn is a brick-interface
program run on mother. The wsn
instruction set
is described in Appendix A.
This section describes
how wsn can be used to
schedule a data acquisition.
Example command:
mother%
wsn
acquire all 10 30
mother%
wsn
retrieve all
wsn has other applications as
well. For example it may be used to determine if the gps boards have
locked onto respective timing solutions
% wsn
gpslock all
Kilroy this section incomplete.
Kilroy the following section
should be rethought/revised (and skipped for now.)
3.2
Acquiring Data: Tutorial
3.2.1 Basics and Diagnostics
The wireless sensor network command set always begins with 'wsn'; this
is a simple C program that parses the command.
The simplest model for a data acquisition and recovery would go like
this: The user would set up the bricks in wireless range and issue the
command from mother:
% wsn
acquire all 5 30
This will trigger milo to start both a gps process and a seismo
process. The gps process will simply acquire data and write the results
to an ascii output file once per second. The seismo process would sleep
for 5 minutes and then acquire 30 minutes of seismic data. Before
acquisition of seismic data the manager will want to verify
that all bricks "see" GPS signals and have good timing available. Issue
the
wsn command:
% wsn
gpslock all
The resulting diagnostic verifies that all bricks have good timing; the
investigator then fires a seismic shot. Suppose that ten minutes later
he wishes
to recover the data. He should first halt the
gps and
seismo processes and then request a
data retrieval. The latter is accomplished via another program run by
milo called '
smd' which stands
for 'send mother data'.
% wsn halt all gps
% wsn halt all
seismo
% wsn retrieve all
Suppose that four nodes were running during this test and that each
produced 2 file-pairs plus a gps output file. The resulting files in
the ftp uploads directory would look like this (with 10-minute-duration
data files):
% cd
/var/ftp/uploads
% ls
10.5453848585.data
10.5453848585.stamp
10.5453849186.data
10.5453849186.stamp
10.cpu_pps.time.0
12.1234555100.data
12.1234555100.stamp
12.1234555700.data
12.1234555700.stamp
12.cpu_pps.time.0
14.4328770200.data
14.4328770200.stamp
14.4328770801.data
14.4328770801.stamp
14.cpu_pps.time.0
15.8420713150.data
15.8420713150.stamp
15.8420713750.data
15.8420713750.stamp
15.cpu_pps.time.0
This data is returned to the
ftp/uploads
directory. The investigator
then creates a data directory
% mkdir $BRICK/data/Shot1.12.12.2005
and puts the data there, for example:
% mv
ftp/uploads/*.*.* $BRICK/data/Shot1.12.12.2005
The diagnostic printout of any wsn command will be a status report from
each brick involved in the command. If the command is:
% wsn acquire 4 20
50
the resulting report should hopefully read:
node 4: gps
running. seismo running: sleep %d minutes, acquire %d minutes.
or it may return:
node 4: command
failed: no connection established
Suppose instead you issue
% wsn acquire all
10 100
and the reply returns like this:
brick
4:
command failed: no connection established
brick
5: gps running. seismo running: sleep 5 minutes, acquire 30 minutes.
brick 6: gps running. seismo running:
sleep 5 minutes, acquire 30 minutes.
brick 7: gps running. seismo running:
sleep 5 minutes, acquire 30 minutes.
brick 12: gps running. seismo running:
sleep 5 minutes, acquire 30 minutes.
brick 14: gps running. seismo running:
sleep 5 minutes, acquire 30 minutes.
brick
15: gps running. seismo running:
sleep 5 minutes, acquire 30 minutes.
brick
16: gps running. seismo running:
sleep 5 minutes, acquire 30 minutes.
In this case you would assume brick 4 is not properly connected via
wireless. You would then issue:
% wsn
ping 4
to verify this connection is not working. If this is the case you would
first power-cycle mother's WET-11 and try again. If node 4 was still
not visible you would visit node 4 and power-cycle its WET-11, and
proceed from there. Diagnosing wireless connection failure should
always start with (a) power cycle the WET-11s and (b) reboot the wsn
SBC.
The full
wsn command
list is described in
Appendix A.
3.2.2 Very important summary: How to
think like mother and how to think like a brick
Please bear in mind that at this stage in development it is helpful to
think as both mother and as the wsn node.
To think as mother:
The wsn program is run with a command; this typically produces a
command file which is ftp'd to the node or nodes specified.
The wsn program then waits for a reply and reports on the
success/failure of the command issued for that node.
The wsn program then proceeds to the next node if more than one
are specified.
To think as a wsn
node:
Your task manager program is milo.
Milo has a list of possible tasks that he can do.
He cycles through that list in between sleep intervals.
The sleep interval is "fast" (e.g. 1 second) if there is no data
acquisition going on.
The sleep interval is "slow" (e.g. 15 seconds) if there is data
acquisition going on.
There are two data acquisition programs: gps and seismo.
When Milo receives a command from mother he typically takes the
following steps:
1. Delete mother's command file.
2. Create a reply file.
3. Perform the specified operation and indicate how
it went in the reply file.
4. Send the reply file back to mother.
5. Delete the reply file from the local /root/tmp
directory.
Finally to
synthesize the two: Suppose the network manager wishes to acquire data,
so we have:
- Network manager issues
% wsn
acquire all 5 30
- wsn puts an acquire command file (containing '5' and '30') on all the
nodes.
- Milo must be running!
- Milo notices the command file and immediately
. halts any existing gps programs
. starts a new gps program.
- Milo also immediately starts the seismo program.
- Milo checks that both processes exist.
- Milo reports back the results of his efforts.
- The wsn program relays the return result for each node to the network
manager.
So far so good; now what happens next:
- Meanwhile the gps program is running. It will save cpu times and UTC
times in its usual output file.
. The gps program should have sufficient
time to acquire a lock before any seismic test
. This can be checked using the wsn
gpslock all command.
- Meanwhile the seismo program is also running.
. The seismo program will immediately go
into a sleep for the requested time interval (5 minutes).
. The seismo program will then acquire
data and write output files to its
/ftp/downloads
directory.
. Seismo writes file pairs: Time stamp
files and data files:
.data
and
.stamp extensions
respectively.
- seismo output files are written with one write() call apiece.
. Therefore if each file is 5 minutes of data: Let
the last file finish writing.
. This means after a test: wait a bit before
halting seismo.
- Once the acquisition is complete, move on to data recovery, wiping
the files from the brick, and verification of data quality.
3.2.2 Output data files
3.2.2.1 Introduction: Four file types
Output data file formats are described here in more detail; for
conversion on mother see the sections above on parse_gps and prepdata.
Due to the potential to refine or fix this
timing glitch it is important to retain all original source files
in addition to the processed datasets
produced by parse_gps / prepdata.
There are four output data file types of interest (in addition to an
ascii
report file which notes the datatake duration and the actual sampling
rate used).
The first two output filetypes are produced by seismo in pairs every sec_per_file seconds (set in the brick.config file). They have the
same filename with different extensions: .data and .stamp. The filenames in full are:
<bricknum>.<timestring>.data
<bricknum>.<timestring>.stamp
The timestring is a number of seconds returned by the system function
gettimeofday(). It is produced when the file is written and is
therefore associated (with some latency) with the last sample acquired
for that file. Its actual value is not important as it serves merely to
order a time-series of .data/.stamp
file pairs. By using the first two fields--brick id and time index--any
data file pairs can be sorted. However it is strongly recommended that
the data from all bricks for a given shot/acquisition be kept in a
uniquely labeled source directory to maintain their association.
The remaining two output files are produced by the gps program: <bricknum>.cpu_pps.serial
and
<bricknum>.cpu_pps.short. These are combined into a
single ascii file <bricknum>.cpu_pps.time
using the parse_gps
program.
3.2.2.2 .data, .stamp, and
cpu_pps.time file contents
4-channel digitizer data is interleaved in the .data
files with one sequence of four numbers corresponding to one sample
apiece on all channels 0, 1, 2, and 3. These values are written by the seismo program. It does minimal data
manipulation to minimize the load it places on the operating system.
Output time stamps contained in the .stamp
files are also written by the seismo
program. They consist of cpu-times paired with data sample indices.
Kilroy left off here; this section needs editing to bring it current.
Output <bricknum>.cpu_pps.time
files are produced by the gps
program. These contain cpu times
paired with UTC times generated by the GPS board. The UTC times
correspond to the PPS-signal (pulse-per-second) rising edge. This
rising edge is used to trigger an interrupt which causes the kernel
driver 'short' to note the cpu
time to a user-accessible file /dev/short.
The UTC times themselves are recorded over the serial port.
3.2.2.3 The prepdata program and data
archiving
4.
Data Visualization
This section is written with a
view to rapid visualization of recently acquired data.
It can be skipped for now.
The seismo program maintains two
pointer files. One points
to the most recently written data file, the other to the most recently
written stamp file. Similarly the gps program maintains a pointer file
which indicates the current gps output file. This changes once every 10
days or so, so there is a very good probability that the three files
so-indicated will comprise a self-consistent dataset.
Either via milo or manually, the triplet of files can be returned to
mother for analysis and viewing. There are two programs required plus
some additional called programs that are not described. The first step
in visualization is to produce utc-tagged data (1 data file for each of
the 4 digitizer channels plus an accompanying time file, one time value
for each sample). The next step is to look at the data or multiple
datasets from more than one wsn node using a visualization progrm.
These programs are dataprep and seiplot.py respectively.
5.
Troubleshooting
The network manager should be familiar with the
bold centered large font green admonitions distributed throughout this
user's manual. The main steps in troubleshooting are:
1. Examine wsn node case contents, verify power LEDS.
2. Check cable connections.
3. Power cycle the WET-11s if there are communication problems.
Appendix
A: The Managed-Mode milo/wsn programs
A.1 Introduction
The wsn program executes on
mother and is the principle means of interfacing with wsn nodes. The
corresponding program on the wsn node that will 'react' to wsn directives is milo. The source code for both wsn (wsn.c) and milo (milo.c) resides on mother in
the $BRICK/Milo directory. The other directory of note is Bricklib
which contains the WSN-specific library bricklib.c and associated files.
The first argument to
wsn is always a specific
command.
The second argument is always { a
single number corresponding to a node OR
or the string all }.
When a single number is specified the command will be carried
out with respect to that node.
When all is specified,
wsn will load a list of bricks
from the file $BRICK/wsn.node.list.
Some wsn commands require additional arguments.
For example suppose the wsn.node.list
file has these contents:
5
6
7
8
12
14
15
16
and the network manager types
% wsn
update all brick.config
The result: wsn will attempt
to do two things:
1. send the current respective brick.config
configuration files to each of the eight nodes { 4, 5, 6, 7, 12, 14,
15, 16}.
2. send an install directive to each node
Then assuming milo is running
on each node, milo will
attempt to do two things:
1. replace the current brick.config file with
the new version
2. notify mother (the wsn
program) that this has been done successfully.
Then wsn will report the
results of this operation for each node.
For