Background

There are two ways to reset the Galil controller: automatically or manually. Both methods require that you be able to communicate with the Galil controller through the Lantronix terminal server. If attempts to communicate with the controller result in an error like this:
	[1009] kics@keamano% telnet 192.168.6.4 3005
	Trying 192.168.6.4...
	telnet: Unable to connect to remote host: Connection refused
and the command ctx (executed as dmoseng in polo) shows an error message in the dispatcher2 prcesses listed under "Current KEAMANO tasks", then you should first complete the procedure for resetting the Lantronix port before attempting to reset the Galil controller.

Please, review the stage chart for Galil controllers to determine which Galil to reset. Also remember that all motor stages controlled by the reset Galil should be reinitialized after the Galil has been reset.

Manual Procedure

Follow these steps to attempt a manual reset:
  1. Log in to keamano as user kics.
  2. Halt the motor control software using one of the following commands:
    	deimos stop dispatcher2.1
    for Galil 1 or
    	deimos stop dispatcher2.2
    for Galil 2.
  3. To check that Galil controller 1 is responding appropriately, type:
    	telnet 192.168.6.4 3005
    or to check Galil controller 2, type:
    	telnet 192.168.6.4 3006
  4. Once connected, hit the return key several times. If the Galil is responding, it should echo back a colon character (i.e., :) as a prompt. If, instead, it echoes back a question mark, hit several more return keys until you get a : prompt. If you are unable to obtain a colon prompt, then that Galil controller probably needs to be reset or power cycled.
  5. Verify that the Galil controller is okay by issuing the status command:
    	ST
    The unit should echo back ST.
  6. Enter the following command to reset the Galil controller:
    	RS
    The unit should echo back RS and after a moment should respond with
    	:arriba!
  7. Carefully (and without hitting any other characters) enter the telnet escape sequence (i.e., while holding down the Control key hit the right-bracket key) to terminate the telnet connection to the Galil via the Lantronix.
  8. Restart the appropriate dispatchers using the relevant commands (as user kics on keamano:
    	deimos start dispatcher2.1
    or
    	deimos start dispatcher2.2

Automated Procedure

The reset_motor_controller script will shut down the relevant dispatcher, connect to the Galil controller, reset the controller, terminate the connection, and restart the dispatcher. Follow these steps to use it:
  1. Log in to keamano as user kics.
  2. Execute the command:
    	reset_motor_controller [1|2]
    where the number indicates the motor controller to reset.

Example Session of reset_motor_controller

[1002] kics@keamano% reset_motor_controller 1
Are you sure you want to reset motor controller 1? (y/n) [n]: y

-------------------- Stopping dispatcher2.1 --------------------
spawn sh
$ deimos stop dispatcher2.1
-n Stopping dispatcher 1 ... 
deimos status dispatcher2.1
setting disp1mod = shutdown (wait)
Error setting disp1mod: DEIMOS dispatcher: Dispatcher did not respond.
See log files for further details.
Sorry, it's not running normally %
pid file says dispatcher2 -s deimot -n 1 should be 14009, but that's dead
dispatcher2.1 is dead

-------------------- Resetting controller 1 --------------------
spawn telnet 192.168.6.4 3005
Trying 192.168.6.4...
Connected to 192.168.6.4.
Escape character is '^]'.


:ST
ST
:RS
RS
:arriba!
Controller reset successful.
^]
telnet> 
-------------------- Starting dispatcher2.1 --------------------
spawn sh
$ deimos start dispatcher2.1
Starting dispatcher 1: 
Waiting for dispatcher to start...

Dispatcher starting up on keamano.keck.hawaii.edu at 2010/06/10 09:04:55 as process 15561 with:

KTL service name         = deimot
Dispatcher id            = 1
Config directory         = /local/kroot/data/deimot
User config subdirectory = dyna
Log directory            = /local/kroot/var/log/dispatcher_logs
Test mode                = OFF
Verbose mode             = FALSE

Dispatcher proc name = deimot_dispatch_1 (as reported to traffic)
Dispatcher log file  = deimot_dispatch_1_log.2010-06-10
Music log file       = deimot_dispatch_1_musiclog.2010-06-10
Dispatcher log path  = /local/kroot/var/log/dispatcher_logs/deimot_dispatch_1_log.2010-06-10
Music log path       = /local/kroot/var/log/dispatcher_logs/deimot_dispatch_1_musiclog.2010-06-10
--------
$ deimos status dispatcher2.1
dispatcher2 -s deimot -n 1 is running on this host; pid = 15561
dispatcher2.1 restarted

-------------------- Operation complete! --------------------
[1003] kics@keamano% deimos stop dispatcher2.1
-n Stopping dispatcher 1 ... 
setting disp1mod = shutdown (wait)
Error setting disp1mod: DEIMOS dispatcher: Dispatcher did not respond.
See log files for further details.
Sorry, it's not running normally %
pid file says dispatcher2 -s deimot -n 1 should be 15561, but that's dead

--------

See Also