Watchdog 3 (Odyssey IIc & III) Protocol Specification v 0.0.3
Preliminary -- March 17, 2000
John Rieffel
MIT Sea Grant College Program


Changes from 0.0.2
------------------

- added Deadman on/off functionality

Changes from 0.0.1
-------------------

- all lines sent to WD from MVC now end with :<cr><lf>, per joe
curran's request 

- ARB commands (if any exist) are relayed automatically.

- added mission status to WD reply string


Notes:
------

This Watchdog Protocol is based largely upon Aaron Marsh's Watchdog II
protocol specification.

All time formats, specified by <time> are of the form hh.mm.ss


Overview:
---------

The Watchdog 3 (WD3) Circuitry provides several different pieces of
functionality.  Listed in descending priority, the are:

-- "Deadman" Functionality: recieve a "keepalive" command from the MVC
   and, if none is recieved within a timeout period, resets the MVC.

-- Control of Vehicle Antenna Mast

-- Acoustic Comms Relay: act as a relay between the Acoustic Release
   board and the MVC.

-- Sphere Environmental Monitoring: this includes sphere temperature
   and pressure

Protocol Interface:
-------------------

All Commands send to the WD3 from the MVC are of the form:

#WD <command> <parameters> <cr><lf>

where <command> is a >=1 character command string and <parameters> is
the set of command-specific parameters.

All Replies sent from the WD3 to the MVC are of the form:

$WD <readback> <status character> <add'l information>:<cr><lf>

Watchdog Commands:
------------------

K <time>	Keepalive/Kill-timer -- Used by the MVC to set/reset the WD's
		deadman timer. <time> is a time in hh.mm.ss format.
		Example: "#WD K 00.10.00" instructs the WD to set its
		timer to 10 minutes from the current time.

S <time>	Sleep -- Instructs the WD to pu thte MVC to sleep (low
		power mode) for some  <time>, after which power is
		restored to the MVC.
		Example: "#WD S 01.00.00" instructs the WD to power
		down the MVC for one hour.

AM		The prefix for antenna mast commands
		
AMU		Instructs the WD to raise the Antenna Mast

AMD		Instructs the WD to lower the Andtenna Mast

D		The prefix for Deadman commands

DY		"Deadman Yes" -- turns deadman functionality ON

DN		"Deadman No" --  turns deadman functionality OFF 

Watchdog Replies:
----------------
All Replies sent from the WD3 to the MVC are of the form:

$WD <readback> <status character> <status string> <cr><lf>

The <readback> string is an exact echo of the command that the
watchdog recieved.

The status characters and their associated strings  at this point are:

A   All OK.
    
    status string: "KT <time>;WS <watchdog status> ST <sphere temp>;SP <sphere pressure>;
    AM <mast status: (U)p (D)own, (R)ising, (L)Lowering>;ARB <ARB Msg>;"

    example 1: "WD K 00.01.00:A KT 00.01.00;WS R;ST 23.00;SP 00.50;AM U;ARB N;<cr><lf>

    example 2: "WD K 00.05.00:A KT 00.05.00;WS R;ST 23.00;SP 00.50;AM U;ARB S;<cr><lf>

    Note re: Watchdog Status
    ----------------------------
    WS <watchdog status> -- WD status is one of: (R)unning, (N)o
    Mission running, (W)aiting for recovery.

    Note re: ARB Msg
    ----------------
    the messages relayed from the ARB to the MVC via the watchdog have 
    not yet been specified. An "N" specifies "No Message Recieved".
    For now "S" means "Surface".
    
  
Z   Error

    status string: "<error msg>"

    example: "WD K 00.01.00 Z Vehicle Sinking"

    NOTE: Specific Error modes and related codes have yet to be
    determined.


Example Interaction:
--------------------

Below is an example of the messages sent between the MVC and the WD.
In this particular case the MVC sends 3 keepalive messages and the WD
replies without error to each one, in the last notifying the MVC that
it has recieved a "Surface" command from the acoustic release board. 
The MVC then tells the WD to raise its antenna.  While the
Antenna is Raising, the MVC continues to send Keepalive Commands.
Once the Antenna is up, the WD fails and returns an error that the
vehicle is sinking.
     
#WD K 00.05.00:<cr><lf>

$WD K 00.05.00: A KT 00.05.00;WD R;ST 23.00;SP 00.50;AM D;ARB N;<cr><lf>

#WD K 00.05.00:<cr><lf>

$WD K 00.05.00: A KT 00.05.00;WD R;ST 23.00;SP 00.50;AM D;ARB N;<cr><lf>

#WD K 00.05.00:<cr><lf>

$WD K 00.05.00: A KT 00.05.00;WD R;ST 23.00;SP 00.50;AM U;ARB S;<cr><lf>

#WD AMU:<cr><lf>

$WD AMU: A KT 00.05.00;WD R;ST 23.00;SP 00.50;AM R;ARB N;<cr><lf>

#WD K 00.05.00:<cr><lf>

$WD K 00.05.00: A KT 00.05.00;WD R;ST 23.00;SP 00.50;AM R;ARB N;<cr><lf>

#WD K 00.05.00:<cr><lf>

$WD K 00.05.00: A KT 00.05.00;WD R;ST 23.00;SP 00.50;AM R;ARB N;<cr><lf>

#WD K 00.05.00:<cr><lf>

$WD K 00.05.00: A KT 00.05.00;WD R;ST 23.00;SP 00.50;AM U;ARB N;<cr><lf>

#WD K 00.05.00:<cr><lf>

$WD K 00.05.00: Z Vehicle Sinking<cr><lf>





Acronyms:
---------

MVC: Main Vehicle Computer
WD3: Watchdog 3
AM:  Antenna Mast






