Stallion Technologiessupport
User documentation
online documentation
 
Documetation image, 8K

Using EasyServer II in a UNIX Environment


EasyConnection

EasyIO

EasyServer II

Go to Previous PageGo to Contents PageGo to Next Page

Setting Up a Remote Port Facility

Contents:

Part Two:


Setting up svr_tty - Direct Connection for Remote Port

Use where the serial line is accessed via a network port on the Communications Server (i.e., for use with svr_tty). 

Using Web Configuration. 
Invoke the Server's setup utility by entering its IP address in a network-connected web-browser, (i.e. http://192.168.80.17). 
When the Setup front page is displayed: 

Step 1. 
Press the 'Setup' button. Specify a valid user name and password, if prompted. 

Step 2. 
Select the 'Direct Connection' hyperlink from the main Setup screen. 

Step 3. 
Select 'Direct Connection' from the 'Setup Direct Connection' screen. 

Step 4.
Specify the following: 

  • Ports to which terminal(s) are to be connected - Port 01 to 08 or 16.
  • Baud Rate - from 5 to 230,400 or autobaud (default 115,200).
  • Character size - 8 or 7 (default 8).
  • Parity - none, even, odd, mark or space (default none)
  • Stop bits - 1 or 2 (default 1)
  • Flow Control - none, hardware or software (default hardware)

Step 5. 
Press the Configure button when ready. The input parameters are implemented immediately. The setup program now confirms that the input has been accepted by displaying the Configuration Results screen. 

Setting up svr_tty - the Configuration File

As described above, a svr_tty daemon process must be used to make connection between pseudo-ttys and Communications Server serial ports.  This mapping is defined in a configuration file.  The configuration file may contain one or more lines, each of which can be a: 

  • blank line; or
  • comment (line starting with '#'); or
  • port configuration entry

A port configuration entry consists of a single line with three fields separated by white-space characters.  These fields specify: 

  • a  pseudo-tty device name;
  • the IP address of an Communications Server unit (hostname or dotted notation);
  • a TCP port number

The pseudo-tty device will be connected to the serial port specified by the IP address (server name) and TCP port number (telnet listener).  The exact form of the master pseudo-tty device name varies depending on the operating system, and whether tty cloning is available (see below for more details). 

Example configuration using psuedo-ttys:: 

#
# R&D lab printer
#
ptyq2 lab_ts 2001

#
# Support modems
#
ptyq3 192.168.80.17 2007
ptyq4 192.168.80.17 2008

The above configuration file uses psuedo-ttys, where the psuedo-tty name refers to a master psuedo-tty device (i.e. ptyq2 refers to /dev/ptyq2). 

This would connect pseudo-tty '/dev/ptyq2' to telnet listener 2001 on the 'lab_ts' EasyServer II.  Likewise, '/dev/ptyq3' and '/dev/ptyq4' would be connected to serial ports 7 and 8 on the EasyServer II identified by the IP address 192.168.80.17. 

Applications that wish to use  the above serial ports should use the corresponding slave psuedo-tty device.  For example, the printer interface script for the R&D lab printer above would send data to /dev/ttyq2 (this being the slave end of /dev/ptyq2).  See Setting up a Remote Port Facility for a discussion on the theory of operation for master / slave ttys. 

When selected pseudo-tty devices to use in a configuration file, you should pick ones which will not be in use when svr_tty is invoked.  If svr_tty is started at boot time, this is generally easy (none will normally be allocated at this time).  Don't use the same pseudo-tty device in more than one configuration entry or more than one configuration file. 

To help avoid this problem, it is possible to use cloned psuedo-ttys.
Example configuration, using cloned psuedo-ttys: 

#
# a few more printers
#
doc_printer 192.159.80.17 2005
hw_printer 192.159.80.17 2006

Instead of having to select appropriate psuedo-ttys, svr_ttys can create its own links to the psuedo-ttys.  svr_tty will establish these links to the documentation and hardware printers (/dev/doc_printer and /dev/hw_printer) by finding valid psuedo_ttys when invoked with the '-n' switch (see Invoking the Daemon). 

Configuration files should be owned by root and should not be writable by ordinary users, i.e. chmod 644.  A single svr_tty daemon process can handle many individual connections but for performance reasons we recommend that the number is kept small.  For slow or infrequently used devices up to 16 devices per daemon should be fine.  For fast devices an upper limit of 4 devices is generally reasonable. 

Multiple daemon processes can be used to handle large numbers of devices, and the system overhead for each is small.  On some systems you may find that the operating system will not allocate enough file descriptors to a process to allow more than 16 or so devices to be handled by a single daemon. 

Setting up svr_tty - Invoking the Daemon

The svr_tty daemon can be invoked from a shell command-line (useful for testing) or a system startup file.  It should not be invoked until after all TCP/IP initialisation has completed.  It should be invoked with superuser privileges, i.e. with an effective UID of 0. 

svr_tty has the following command line options: 

svr_tty [-?hvdofmnkBF][-t poll-time[,wait-time]][-D debug-file]
[-p "link server port "][config-file]

where

  • -h  displays svr_tty help
  • -?  displays svr_tty help
  • -d  send debug to stderr 
  • -D debug-file sends debug to debug-file
  • -v  display svr-tty version number
  • -o  use old configuration format (psuedo-ttys)
  • -n  use new configuration format (links to psuedo-ttys)
  • -f   open network connection on first pty data
  • -m  close network connection on pty close (not supported on all systems)
  • -k  use TCP keepalives
  • -B run as daemon (default)
  • -F run in foreground
  • -t  poll-time[,wait-time] check for network disconnect

    poll-time = how often to check
    wait-time = how long to wait

  • -p  "link server port" specify port configuration 

    link = device name to link
    server = server name or IP address
    port = TCP port number


The default configuration file is /etc/svr_tty.conf 

Here are some example command lines: 

svr_tty -D /tmp/svr_tty.log

will start svr_tty, using the old configuration format as read from /etc/svr_tty.conf
Debug will be sent to /tmp/svr_tty.log 

sr_tty -f -n /usr/local/svr_tty.conf

will start svr_tty, using the new configuration format as read from the /usr/local/svr_tty.conf
TCP connections will be made the first time data is sent to any tty listed in /usr/local/svr_tty.conf

Troubleshooting

If you have problems, first make sure that the svr_tty daemon is running.  The switches -F and -d can help by keeping svr_tty in the foreground and displaying messages showing what it is doing.  The most common problem is that svr_tty refuses to connect to one or more telnet listeners.  This may occur because the telnet listener is not enabled or access to the port is not configured as 'remote' or 'dynamic'. 

The Communications Server has a number of commands that can be used to check the configuration and status of telnet listeners and serial ports, i.e.: 

show telnet listener all status
show telnet listener all characteristics
show/monitor port <number> characteristics
show/monitor port <number> counters

Building or Retrieving a Copy of svr_tty

The easiest way to get a binary copy of svr_tty for your favourite operating system is via the Stallion WWW pages at http://www.stallion.com

Alternatively, you can find the binaries on our anonymous FTP site: ftp://ftp.stallion.com, in the directories drivers/easyserver2/. 

If you do not have access to our site or we don't have a precompiled binary for your operating system, you can compile svr_tty from the source code.  This is available from an EasyServer II unit itself. The latest source code is always available via the Internet. 

To extract the source code from a server, see the online tutorial section 'Unix Utility Programs' or point a Web browser at the pages built into the server and select 'Files'. 

Compilation instructions for various operating systems are given in the comments at the beginning of the svr_tty source code.  For other operating systems you may need to experiment using the documented instructions as a guideline.  Please contact the distributor from whom you purchased the product if you require any further assistance. 

The svr_tty binary is normally installed in /etc and should be executable by the superuser. 

 


Go to Top of Page

Go to Previous PageGo to Contents PageGo to Next Page

Copyright © 2002 Stallion Technologies. All rights reserved