SIAM is configured primarily through environment variables and Java Properties files. The following table describes the main SIAM configuration files' location and purpose:
| Configuration File | Description | - |
|---|---|---|
| SIAM_HOME/properties/siamPort.cfg | Configure SIAM ports and behavior (via Java Properties) | - |
| SIAM_HOME/properties/siam.log4j | Configure SIAM logging output | - |
| /etc/siam/siamEnv | Platform-specific SIAM environment (via Java properties) | - |
| SIAM_HOME/properties/policy | Java security policy definition | - |
The configuration of main SIAM environment variables is discussed in the Installation Guide.
The file siamPort.cfg (SIAM_HOME/properties/siamPort.cfg) is a Java properties file for SIAM node configuration. The Java API documentation describes the syntax rules of properties files, but essentially they contain name=value pairs that define configuration parameters.
siamPort.cfg is conventionally organized in sections: port configuration, node configuration, platform-specific settings. However, no specific ordering is required. If duplicate property names exist, the last one (towards the end of the file) is used.
The sections below provide details about the various properties.
The examples directory contains a version of siamPort.cfg
| Parameter | Description | Example |
|---|---|---|
| serialPort0 | /dev/tty.KeySerial1 |
|
| NVTserialPort0 | 134.89.13.76 | |
| powerPort0 | NULL | |
| portName0 | louver | |
| serviceJar0 | ElmoLouver-1762.jar | |
| maxPorts | 21 | |
| platformSerialPorts | /dev/ttys0:\
/dev/ttys1:\
/dev/ttys2:\
/dev/ttys3:\
/dev/ttys4:\
/dev/ttys5:\
/dev/ttys6:\
/dev/ttys7:\
/dev/ttys8:\
/dev/ttys9:\
/dev/ttys10:\
/dev/tty.KeySerial1:\
/dev/ttysX15:
|
|
| - |
| Parameter | Description | Example |
|---|---|---|
| nodeID | 1726 | |
| nodeType | primary | |
| jarLocation | - | |
| logLocation | - | |
| codeBaseLocation | /mnt/hda/codebase |
|
| - |
| Parameter | Description | Example |
|---|---|---|
| platformPower | 0x310 0x320 | |
| platformAnalog | 0x300 0x330 | |
| platformAnalogTypes | d s | |
| analogPort1 | 0 8-14,24-30 | |
| analogName1 | PMonitor |
| Parameter | Description | Example |
|---|---|---|
| networkNumberBase | 35 | |
| networkNumber | Add to networkNumberBase to obtain 3rd octet of network address | 0 |
| ethernetAddressBase | first two octets of network address | 134.89. |
| pppAddressBase | - | |
| pppHostName | - | |
| pppHostName | enabled|disabled | |
| DHCP | enabled|disabled | |
| advertiseService | ||
| lrrDevice | globalstar | |
| srrDevice | freewave | |
| lrrConnection | portal | |
| srrConnection | auxConsole | |
| SleepManager.enabled | true to enable, false means you'll never go to sleep | TRUE|FALSE |
| SleepManager.sleepString | command to invoke to put us to sleep | nice --20 /root/suspend.sh |
| SleepManager.pollSeconds | How often we poll to see if we can go to sleep (sec) | 2 |
| SleepManager.wakeupSeconds | How many seconds we wake up early, to allow things to stabilize before sampling. | 3 |
| SleepManager.sleepDelay | How long to delay before going to sleep, to allow logs to sync | 3 |
| SleepManager.minSleepSeconds | Minimum time we'll go to sleep. If less than this, we'll just stay awake. | 5 |
| SleepManager.minAwakeSeconds | Minimum to stay awake. Avoids race that puts node to sleep when trying to wake it up | 60 |
| CommsManager.enabled | TRUE|FALSE | |
| CommsManager.auxEnabled | TRUE|FALSE | |
| NodeService.leaseInterval | (connection duration sec) 60000 primary nodes 10000 for the subnodes | - |
| NodeService.auxLeaseInterval | (connection duration sec) 60000 primary nodes 10000 for the subnodes | 60000 |
| NodeService.leaseRenewalInterval | (connection period) 60000 for deployment 120000 for testing on ethernet | 60000 |
| NodeService.auxLeaseRenewalInterval | (connection period) 60000 for deployment 120000 for testing on ethernet | 60000 |
| CommsManager.parentLinkOn | (system call to exec on connection) | globalstarOn 300 |
| CommsManager.parentLinkOff | (system call to exec on connection) | commsOff |
| CommsManager.parentLinkStatus | (system call to check status of network interfaces) | linkStatus ppp |
| CommsManager.auxLinkOn | globalstarOn 300 | |
| CommsManager.auxLinkOff | commsOff | |
| CommsManager.protocolWaitTime,auxProtocolWaitTime | (time to wait when establishing connection) 15000 primary nodes with Globalstar wireless 5000 for other nodes 0 for testing on ethernet | 5000 |
| CommsManager.processWaitTime, CommsManager.auxProcessWaitTime | (time to wait when disconnection) 240000 for primary nodes with Globalstar wireless 60000 for primary nodes 30000 for the subnodes | 60000 |
| CommsManager.reassert | Set true to reassert parent link when it breaks or if there are leases pending when the link terminates. | TRUE|FALSE |
| CommsManager.maxReassertTries | if CommsManager.reassert=true, retry this many times to reassert the link | 1 |
The siam.log4j file is a configuration file for the log4j open source logging package. It may be used to determine what logging information appears in the SIAM application logs.
At runtime, the environment variable LOG4J_THRESHOLD sets the default logging output level, and is set by the script that runs the SIAM application. It may be overridden in siam.log4j. The configuratio file may also be used to format the debug output. A sample file appears below:
# For the general syntax of property based configuration files see the
# documenation of org.apache.log4j.PropertyConfigurator. See also
# http://www.vipan.com/htdocs/log4jhelp.html
#log4j.rootCategory=WARN, stdout, rolling, lf5
log4j.rootCategory=INFO, rolling
# Set logging level for specific packages
# Recommend leaving the following loggers in DEBUG to aid in
# diagnosis of bug SIAM-58 (EventManager loses track of DevicePacketAggregator
# listener)
#log4j.logger.org.mbari.siam.core.DevicePacketAggregator=DEBUG
log4j.logger.org.mbari.siam.core.EventManager=INFO
#log4j.logger.org.mbari.siam.devices.dummy.DummyInstrument=DEBUG
# CONSOLE APPENDER (stdout) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
#log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c %x - %m%n
log4j.appender.stdout.layout.ConversionPattern=%r %-5p %x %c{1} [%t]: %m%n
# ROLLING FILE APPENDER (rolling) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
log4j.appender.rolling=org.apache.log4j.RollingFileAppender
log4j.appender.rolling.File=${siam.node.log}
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
#log4j.appender.rolling.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c %x - %m%n
log4j.appender.rolling.layout.ConversionPattern=%r %-5p %x %c{1} [%t]: %m%n
log4j.appender.rolling.MaxFileSize=10000KB
log4j.appender.rolling.MaxBackupIndex=5
# LF5 APPENDER (lf5) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
log4j.appender.lf5=org.apache.log4j.lf5.LF5Appender
log4j.appender.lf5.MaxNumberOfRecords=10000
SIAM directs stdout and stderr to the siam application logs (SIAM_HOME/logs/nodeName-startDate); log4j also uses this log file for its rolling log appender, so the logs are rotated so they will not grow beyond some maximum size defined in siam.log4j. As can be seen in the example, it is possible to configure the debug level on a class by class basis, or use a common default value for all appenders.
The file siamEnv (found in the distribution as SIAM_HOME/native/arm-linux/top/etc/siam/siamEnv) may be used to configure key environment variables for the SIAM application. These settings may also be set in (or sourced from) .bashrc for user accounts used for SIAM administration. siamEnv also contains convenient aliases for frequently used commands, as well as options for the Java virtual machine used for SIAM.
# .bashrc # Environment for SIAM applications # Note that SIAM_HOME *must* be set prior to executing this script. # Setup Java . /j9/j9env export JAVA=j9 export JAVA_OPTIONS="-mca:32 -mco:64 -mx:24576 -mo:1024 -moi:256" export SIAM_BIN=$SIAM_HOME/bin/arm-linux export SIAM_CODEBASE=http://`hostname`/codebase/ export PARENT_HOST=surface export SIAM_CLASSPATH=$JAVA_HOME/lib/jclMax/classes.zip:$JAVA_HOME/lib/prsnlmot.jar:$JAVA_HOME/lib/RXTXcomm.jar:$SIAM_HOME/classes:/mnt/hda/codebase:$SIAM_HOME/jars/javax.jar:$SIAM_HOME/jars/gnu_getopt.jar:$SIAM_HOME/jars/jrendezvous.jar:$SIAM_HOME/jars/log4j-1.2.13.jar:$SIAM_HOME/jars/XModem.jar:$SIAM_HOME/jars/jddac-common.jar:$SIAM_HOME/jars/jddac-probe-j2me.jar:$SIAM_HOME/jars/backport-util-concurrent.jar:$SIAM_HOME/jars/rbnb.jar # Set to TRUE if you want SIAM node app to start on reboot export LOG4J_THRESHOLD=DEBUG export SIAM_LOG4J=$SIAM_HOME/properties/siam.log4j export PATH=.:$PATH:$SIAM_HOME/utils:$SIAM_BIN:/etc/siam:$HOME/bin alias gosiam='cd $SIAM_HOME' alias java=j9 alias ls='ls -F' alias ll='ls -AlF' alias dhcp=ifswitch-to-dhcp export SIAM_AUTOSTART=TRUE export ETHERNET_ADDRESS_PREFIX=134.89.37 export PARENT_LINK_ON_SCRIPT= export PARENT_LINK_OFF_SCRIPT= export SIAM_EXIT_SCRIPT=/etc/siam/postSIAM