CONNECT - Remote Connection to spec

Mark Lumsden
McMaster University

Connect is a program which allows connection to spec from another terminal providing a mirror of the local terminal running spec. It allows full control and monitoring of spec from any terminal - including a home pc. (Connect is not written to allow exclusive connection to spec and could be easily modified for any other program).

Connect is a front end to another program kibitz2 which provides the "guts" of the connection. kibitz2 is a version of kibitz (Don Libes, NIST) which I modified to make it more flexible and to better suit our needs. Both connect and kibitz2 are written in expect and to operate, both expect and tcl must be present on your system. (I have listed an ftp site at the end of this document)

For the rest of this document, I will refer to two users and two terminals:

  1. the local user running spec on the local terminal (i.e. in the lab)

  2. the remote user connecting to spec from the remote terminal (a home pc for example)
In addition, I will assume spec is accessed by the command fourc.

INITIALIZATION

The local user simply begins the program by running

	connect fourc
instead of simply fourc to start spec. If spec is accessed by another command other than fourc, simply substitute for fourc in the above command. (This program is not limited to spec and can be used for any application on your system). This begins spec and allows it to run as usual while constantly (approximately every second) checking for an external connection.

The remote user types:

	connect
to allow connection to spec remotely. If the remote user and the local user are the same (or the remote user is root), the connection is made with no prompts for further information. If the remote user is not the local user (or root), the remote user will be prompted for the password of the local user and will only connect if this password is entered correctly.

The connection is made when the prompt

	Escape sequence is ^A
is shown on the remote terminal. It may be necessary to hit ENTER once to get the FOURC prompt on the remote terminal. If nothing is seen on the terminal, the control program could be in the process of taking a data point and nothing will be seen until this point completes.

This should give a complete mirror of the local terminal allowing the remote user to see data appear on the screen and enter commands as if sitting in the lab.

EXITING

The remote user exits connect by simply hitting the escape sequence ^A. This gives the user the connect prompt and the user exits by typing exit. This breaks the connection and things in the local terminal continue as if no connection had ever been made.

The local user ends the connect session by exiting from fourc as usual (by typing quit for example). If any other program is being run, simply terminate this program and connect automatically terminates.

For either user, if the escape sequence is hit by mistake, the user can return to the connect session by typing return.

IMPORTANT NOTES

  1. This program was written for a linux system and some of the commands used in the script may not be the same on other systems. For instance, the mkfifo procedure in the kibitz2 script assumes that the system can use the mkfifo command. This may not be the case for all systems and some examples of other commands are given in a comment in the kibitz2 script.

  2. The script assumes that all users have read and write permissions to the /tmp directory as a number of temporary files are created here.

  3. The scripts require at least expect version 5.0 and will exit if the version number is less than this. (This may or may not be necessary and can be changed by changing the exp_version line in both scripts.)

  4. The two scripts connect and kibitz2 as well as fourc should be placed in a directory which is in the path (i.e. we have all three in /usr/local/bin)

ACKNOWLEDGEMENTS

I'd like to thank Don Libes at NIST for providing the original kibitz script.

expect, tcl, and tk can be obtained via anonymous ftp at ftp.cme.nist.gov.

For an excellent resource on expect, see the book Exploring Expect by Don Libes.


Converted to HTML by CSS 12/24/95.