TACAPASS
The Automated CAP Announcement
System Solution

for Amateur Radio Operators
by KK7VN (kk7vn @ arrl.net)

The TACAPASS system is an automated SW stack, written in both Java and \bin\bash shell scripts which currently run on a RedHat 9.0 Linux IRLP (Inernet Radio linking Protoco - www.irlp.net ) node.  Its purpose is to automatically broadcast Tsunami and Weather alerts from NOAA as they occur for a given region within the United States.  

This application is directed at Amateur Radio Operators in the United States of America who are operating a current IRLP node.  TACAPASS leverages the CAP (Common Alerting Protocol) XML based format which can be found at incident.com.  It acquires these "cap" files from the NOAA website, parses the CAP XML file and presents it to a few automated scripts that run on the base IRLP node platform.  When relevant information is retrieved, the system pushes the modified description to a text2speech solution called flite provided by Carnegie Mellon University where it can be used to broadcast the announcement.

NOTE: this is an Alpha release.  (even though there's a 'b' in the gzip file :-). Any input will be graciously accepted.  I will continue to support this as best I can, but this is a hobby thing, and currently I'm fairly busy at work so please allow me time to get back to you.  I also would like to find out what issues you run into for both install and execution (bugs, challenges etc..).   I will aggregate feedback and publish a Beta version with fixes as soon as I am able.  Please inform me of Amateur radio deployments of this software so I can keep track.  For non amateur deployment, please contact me to discuss its use and permissions for deployment.

Thx & 73's
DE KK7VN - Curt Jutzi

Download

TARBALL DATE DESCRIPTION
tacapass_runtime.tar.gz. (6.2MB) 8/24/2005 Original Version.  It was changed a couple times in the AM because of the weathermon script had a bug :-)..
tacapass_runtime_0.4.b.tar.gz. (6.2MB) 8/25/2005 Added Version control and cleaned up noaacheck directory a bit
tacapass_runtime_0.5.b.tar.gz. (6.2MB) 9/1/2005 Fixed alot of bugs (See Known Issues)

Know Issues

RELEASE # ISSUE DISCRIPTION / Resolution
tacapass_*0.4.b noaacheck.java
exception @ 498
Currently the NOAA site adds an entry in the XML file that is is causing me some problems.  This causes an exception to be thrown because the Alert Info structure is not filled out as I expected.  This will be resolved.
Resolution: This currently is a non-issue for the scripts I've written. They currently work ok even with this exception
FIXED IN NEXT RELEASE
(see noaacheck.class_0.4.fix) c
tacapass_*0.4.b weathermon
No output from weathermon
release 0.4.b weathermon didn't output audio because the Debug Flag DEBUG_NO_FLITE was set to true for debug.
FIXED IN NEXT RELEASE
(see weathermon_0.4.fix - not completely tested)
tacapass_*0.4.b weathermon
tsunamimon
Descriptions expand to list files in a directory (very odd)
Descriptions with the character '*' expand as if you did an `ls *` in the directory.  This is due to the fact that if a shell variable has a '*' in the description and 'echo' is used, it will expand the '*' as if you typed `ls *`. 
Resolution: This can be resolved in all the scripts by placing a double quote character around the shell variable i.e. echo $DESC (in the weathermon script should read echo "$DESC".
FIXED IN NEXT RELEASE
(see weathermon_0.4.fix - not completely tested)
tacapass_*0.4.b weathermon
tsunamimon

IRLP Node unkey's when sending the Audio description
I was constantly getting shut down (unkey'ed) durring tx's of long descriptors.  I'm not clear on why this was occuring (still looking into it)
Resolution: use ${BIN}/forcekey and ${BIN}/forceunkey rather than key and unkey in eihter script.
FIXED IN NEXT RELEASE
(see weathermon_0.4.fix - not completely tested)
tacapass_*0.4.b testnoaacheck - no audio opps.. I moved the cap file to example..
Relolution: move test.cap to the directory you execute it in, or modify the script to support the path to the test.cap file. (sorry)
tacapass_*0.4.b geocodes are not ICAO codes. See geocode section below
FIXED
tacapass_*0.4.b weathermon
ID and Desc. out of sync
When multiple entries in the info structure are found, the WEBID is acquired correctly, but the next ones are off by one (see weathermon_0.4.fix - not completely tested)
tacapass *0.4.b noaacheck.class - didn't allow multiple arguments to the "-l" option. When using noaacheck the command line only allows one entry for the query rather than a multiple number of strings to match for finding the alerts. i.e. to do one for both "warning" and "watch" you'd have to do two queries.  The new one allows you to separate these with commas ",".
Example
-l Warning,Watch,Statement
-l "Sort Term Forecast",Warning,Watch
FIXED IN NEXT RELEASE
(see noaacheck.class_0.4.fix)
tacapass *0.5.b None Yet (released 9/1/2005)  

Next Release - What's Coming

System Requirements

Well, I'm running it on a Tecra730CDT 90Mhz Pentium, but I wouldn't advise it.  Java requires a bit more than that.  My system takes a long time to execute the query, so here is what I would recommend.

  1. PC with Intel Pentium 300Mhz or greater

  2. IRLP RedHat 9.0 release. (NOTE: it has not be validated on any other RedHat release)

  3. Java 2 Runtime v 1.4.2 if your going to just run it on a PC
        - OR -
    Java 2 Runtime v 1.4.2 SDK if your going to modify the Java Class
    The following class files are in the release but are separate from the Runtime and areused in the Java Execution
    HTTPClient.jar - to acquire the CAP File
    JAXB Class Files
        jaxb-api.jar
        jab-impl.jar
        jaxb-libs.jar
        jaxb-xjc.jar
        jax-qname.jar
    namespace.jar
    relaxngDataType.jar
    xsdlib.jar

Install Instructions

  1. Install Sun's Java 2 1.4.2 SDK or Runtime

  2. OPTIONAL: you can go to http://www.speech.cs.cmu.edu/flite/index.html, download and compile the flite excitable, but if your iAx86 it's in the runtime tarball, and you don't need it.

  3. The tacapass tarball is located at tacapass_runtime_x.x.b.tar.gz.

  4. On your Linux IRLP node, go to your IRLP directory (current release puts it at  /home/irlp)

  5. download the tacapass_runtime.tar.gz. to that directory.

  6. gunzip tacapass_runtime_x.x.b.tar.gz

  7. tar -xvf tacapass_runtime_x.x.b.tar
    You'll end up with everything in a directory called /home/irlp/noaacheck. Test to see if this thing "just works" -note: You'll key your IRLP node if you just run it. Make sure you're in the root noaacheck directory(/home/irlp/noaacheck for my system)  enter the following command (SEE BUG ABOVE - you'll have to move the test.cap file from the example directory)
            > ./scripts/testnoaacheck 
        The IRLP node should have stated (in audio) "this is a test description"

  8. If you've gotten this far, get excited, everything "technically" is there to make this thing work..

  9. Type the following at the command line
    > java noaacheck
    This will dump the command line options to the java class.  See below for the noaacheck  manpage for details on this program.

  10. For Weather Notifications in your area

  11. Modify your .profile to reflect the classpath and CAPDIR and CLASSPATH for Java.  See the example in the example directory and below under Profile

  12. Place an entry into your rc.irlp file located in the custom directory to start which ever script operates as your alert script.

  13. Restart the IRLP Node by becoming root and executing rc.irlp script.

  14. You might (probably will) have to modify the scripts to support the inconsistent announcement description you'll find in these CAP files.  In weathermon, you'll find 1/2 way down, after the description is parsed, where this has been modified for Oregon and Idaho.  Good luck here.  The Text2Speech application will do some real interesting things as weird characters are presented so you'll have to spend the time to look at the announcements for a while and see what odd things your state NOAA employees are using.

  15. Please see Known Issues before sending mail :-)

General word of caution, do not put this script into your custom cron file for IRLP unless you execute it far enough apart to ensure that two instances of the script will not run concurrently.  You can write your own script to abort if it is active, but that's up to you.

NOTE: this is an Alpha release.  Any input will be graciously accepted.  I will continue to support this as best I can, but this is a hobby thing, and currently I'm fairly busy at work so please allow me time to get back to you.  I also would like to find out what issues you run into for both install and execution (bugs, challenges etc..).   I will aggregate feedback and publish a Beta version with fixes as soon as I am able.  Please inform me of Amateur radio deployments of this software so I can keep track.  For non amateur deployment, please contact me to discuss its use and permissions for deployment.

Thx & 73's
Curt Jutzi - KK7VN (kk7vn @ arrl.net)

Profile

This is my profile from my /home/irlp/.profile directory

if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
. /home/irlp/custom/environment
export set PATH=./:$PATH:/usr/java/j2sdk1.4.2_09/bin
export set CLASSPATH=.:/usr/java/j2sdk1.4.2_09/lib

export set CAP_PROXY=   #your cap proxy goes here.. to get past firewall
export set CAPDIR=~/noaacheck
if [ -d ${CAPDIR} ]
then
    source ${CAPDIR}/scripts/classpath
fi
 

Keeping it Running

The Log Files

The way the scripts work (weathermon, tsunamimon) to keep from re-announcing alerts, (at least for the Weather script) it uses the target WEB site in the CAP announcement to uniquely identify the notice.  This is stored in a log file in the logs directory in the file weather.log.   This same is true for tsunami warnings, the file is tsunami.log.  The tsunami is uniquely identified by the first word in the description (so much for standardization :-)..  These files keep the same announcements from being broadcast multiple times.

These log files needs to be cleaned out every once in a while.  To keep the file size to a minimum, you might want to run the script trimalog script every week that reduces the long to the latest few entries.  Both these file contain id's separated by spaces.  See trimlog for details.

COPYRIGHT

##############################################################
# Copyright (c) 2005 by KK7VN Curt Jutzi
##############################################################
#
# ------- COPYRIGHT NOTICE -----------
#
# Permission to use, copy, modify, and distribute this
# software and its documentation for any purpose and
# without fee is hereby granted, provided that the above
# copyright notice appear in all copies and that both the
# copyright notice and this permission notice and warranty
# disclaimer appear in supporting documentation, and that
# the author or entity using, copying, modifying or
# distributing this software receive or acquire no financial
# revenue or benefit from its use, and that written notification
# and permission be granted from Curt Jutzi KK7VN
# (kk7vn @ arrl.net, curtjutzi @ yahoo.com) before its use.
#
# Curt Jutzi or KK7VN may not be used in advertising
# or publicity pertaining to distribution of the software
# without specific, written prior permission.
#
# Curt Jutzi (KK7VN) disclaims all warranties with regard
# to this software, including all implied warranties of
# merchantability and fitness. In no event shall Curt Jutzi
# (KK7VN) be liable for any special, indirect or
# consequential damages or any damages whatsoever resulting
# from loss of use, data or profits, whether in an action
# of contract, negligence or other tortious action, arising
# out of or in connection with the use or performance of
# this software, or its distribution.
#
##############################################################
 

 

MAN PAGES

weathermon - manpage

Command:

weathermon <secwait> <state> <region/geocode> <keyword/level> [nonotify] [nowait]

Description:

This script attempts to deal with the NOAA weather cap warnings.  The secwait, if set to 0 will only go through the script once.   If it is non-zero, it will pause this amount of time, after the announcement, or query for new cap alerts.  You could use this directly rather than using the original script tsunami_weater_mon.

The state must be a 2 letter abbreviation.  It is simply attached to the url request for the CAP file to http://www.weather.gov/alerts/<your_state_here>.cap

keyword is used to search the headline of the alert.  Standardized NOAA headings can be found at http://weather.gov/alerts/product_list.txt on the NOAA website. When you enter a string on this line (quoted or not) it will search for a match somewhere in the headline.  Example: you set the keyword to "Warning".  It will match all the entries that have the word "warning" in them. (not case sensitive), if you entered "Excessive Heat" you'd end up with every entry that had that key phrase in the headline.

nonotify is the string "nonotify" without the quotes.  If you don't put this there, everytime the script runs, it tells you what it's doing over the air, so put it in. 

nowait simply does not wait for a pause on the repeater.  You must be using the script waitclear for this to make a difference. 

tsunamimon - manpage

 Command:

tsunamimon  [nonotify] [nowait]

Description:

nonotify is the string "nonotify" without the quotes.  If you don't put this there, everytime the script runs, it tells you what it's doing over the air, so put it in. 

nowait simply does not wait for a pause on the repeater.  You must be using the script waitclear for this to make a difference. 

noaacheck - manpage

Command:

noaacheck (-u <wxURL>|-f <filename>)[-p <proxyhostURL:port#>][-g <geocode[,geocode]>][-s <String>][-l <String>][-v][-c][-d][-h][-a][-e][-w][-n [<file>]]

Description:

-u <wxURL> Required: Fully qualified URL to a xml based CAP file
see http://www.weather.gov/alerts/<state>.cap - weather
see http://wcatwc.arh.noaa.gov/message.xml  - tsunami
-u or -f must be specified
-f <filename> Required: Specify a local CAP file
either -u or -f must be specified
-p <proxyURL> Optional: Fully qualified URL for the proxy e.g. http://proxy.com:911 (remember to include the port)
-s <StatusString> Optional: FILTER: Level "Actual", "Test" etc..NOTE: This comes from searching the CAP entry "Status"
-l <LevelString> Optional:FILTER: Event severity "Warning", "Watch", "Advisory","Statement","Outage", "Forcast", "Emergency" - no quotes -
NOTE: This comes from searching the CAP/info entry "Event"
see http://weather.gov/alerts/product_list.txt for full statements.

You can now also add multiple strings if you separate them with a comas:
Example:
-l Warning,Watch,Statement
-l "Sort Term Forecast",Warning,Watch
-g <geocode[,geocode]> Optional: FILTER: Geocode code for your area of interest
This is an aggregation of the state code and the county FIPS codes which can be found at http://www.itl.nist.gov/fipspubs/co-codes/<state.txt> (see geocode section)
-v Optional: verbose: dumps all the info for the alert and all event info
-c Optional: get the number of events based on your input FILTER options, or all (if no code given),
NOTE: This overrides/disables the -d, -e, -w and -h options
-d Optional: dump the description for each event in the CAP or for each ICAO
-h Optional: dump the headline field - one line summary
-r Optional: removes CRLF from description
-n Optional: replaces abrev. for NOAA with full text for Text2Speech
-e Optional: dump time that this warning is effective until
-w Optional: WEB in the CAP - used to uniquely id the message for weather script, but can be used other ways.

GEOCODES:

Geocodes are made up of 2 things.  First is the Country Code http://www.itl.nist.gov/fipspubs/co-codes/<your state>.txt. The state code is at the top of the page (I missed this the first time). These are the prefix in the <gocode> section of the NOAA cap announcement.  The second half is the FIPS code which can be found for each county listed below the state code.  As an example, the Geocode  012086 in the Florida announcement indicates that the message is meant for FL. and the county is 86 - or Miami-Dade