Sensorsoft

SCOM TCP Serial Port Server Manual

March 10, 2016



 
 

NAME
scomd - TCP/IP serial port server

SYNTAX
scomd [-options] serialport service
 

DESCRIPTION
scomd is a daemon server that shares serial/USB ports and peripherals with TCP/IP network or Internet clients. Using scomd, it is possible to share modems, printers, cameras, sensors and just about any device that has a serial interface. scomd can replace more expensive terminal servers by instead using the serial ports already available on your UNIX or LINUX computer.

scomd is easy to setup and allows quick sharing of serial peripherals to a wider variety of users, across large distances, without running cables or having to be at a remote site. It works in conjunction with the scom client or any client that supports communications over TCP/IP sockets with serial devices.

scomd can be launched from any login session or startup file that has permissions to run in the /etc directory and creates a lock file in the lock file directory (see FILES heading below). scomd also provides a shutdown feature to stop the server quickly for maintenance purposes.

scomd starts up by checking for an existing lock file, if not present, creates its own. It then opens the target serial port device, setting up the serial port communications parameters and accepting socket connections from TCP/IP clients that know its TCP port number. By using a serial port lock file, scomd, prevents domination of that serial peripheral by users and programs, in the following ways;

See the SECURITY heading below for discussion about security issues with scomd.

scomd provides the flexibility to share a variety of different serial devices, by allowing command options that specify the communication parameters and modes to be used with each device.
 

OPTIONS
scomd accepts the following options:

-d [ulongval]        Idle Timeout
This option is followed by a unsigned long integer value (ulongval) that represents the time in seconds to wait before closing the socket connection when there is no data flow between the client and the serial peripheral. When this option is not specified, the default is 10 seconds.

If ulongval is 0, scomd will disable the idle timer. This feature is useful when it is necessary to keep the connection open regardless of activity thereon.

-b        Output debug messages
Allows scomd to produce verbose details of its activity. Output is by default to the console, unless the -f option is used to specify a log file path and name.

-f [path-filename]        Send error and debug messages to a file
scomd opens the path-filename and records all error and debug messages to the named file. Maximum path-filename specification is 255 characters.

-c [XON | RTS | NONE]        Flow control
The XON option-argument is for software flow control also known as XON/XOFF. The RTS option-argument is for hardware flow control also known as RTS/CTS. The NONE option-argument simply turns off all flow control. The NONE option is the default.

-s [bps]        Bit rate or Speed
Valid speeds or bit rates are 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200 and 38400 bits per second (bps).

The SOLARIS version of scom supports the following higher rates; 57600, 76800, 115200, 153600, 230400, 307200 and 460800 bps. The 4.4 BSD version of scom supports the following additional rates; 7200, 14400, 28800, 57600, 76800 and 115200 bps. The Linux version of scom supports the following additional rates; 57600, 76800 and 115200 bps. If this option is not specified, the default is 9600.

-e, -o        Parity and data byte size
The -e option sets parity to even and data bits to 7. The -o option sets parity to odd and data bits to 7. The default, if these options are not used, is 8 data bits and no parity.

-z [ # ]        Number of stop bits
Choose from 1 or 2 stop bits. When this option is not used, the default is 1.

-v        Display version, target CPU and OS
This option displays the following information and exits; software version, target CPU class such as x86 (32 bit) or x64 (64 bit) and operating system type.

-D        Do not drop DTR on socket close (Unixware, SOLARIS and HP-UX ONLY)
This option is useful when working with modems and you do not want to drop a modem connection between client sessions. It can also be used with port powered RS232 peripherals where DTR is used to power the device. When this option is not selected, by default DTR will be dropped on closing of the socket connection.

-R        Do not drop RTS on socket close (UnixWare, SOLARIS and HP-UX ONLY)
This can be used with port powered RS232 peripherals where RTS or RTS/DTR is used to power the device. When this option is not selected, by default RTS will be dropped on closing of the socket connection.

-F [setupfile]        Setupfile Mode
Allows launching of predefined setup files using easy to understand keywords. This provides an alternative to having to remember or use scomd option letters.

-S [serialport]        Shutdown server immediately
Shutdown a running server by sending it a SIGHUP signal. The running server responds to the signal by immediately closing any open socket, serial port, descriptors or log file - regardless of what client it may be servicing and then exits. This same action can be achieved using kill [pid].

EXAMPLE:

scomd -S ttya

-I [serialport]        Close current session and reinitialize server
Close current session of a running server by sending it a SIGUSR1 signal. The running server responds to the signal by closing any open socket, regardless of what client it may be servicing.

EXAMPLE:

scomd -I ttya
 

LOCK FILES
Lock files are used by programs like cu, uucp, scom and scomd to signal other processes that a serial port is in use. scomd checks for an existing lock file, if not present, it creates its own. The format for this lock file is identical to that used by cu, uucp, tip and scom.

See FILES heading below for the directory where lock files are created.
 
 

-L [path or filename]        Specify custom lock file directory or filename

Solaris and UnixWare:
Allows user to specify an alternate lock filename. Supply only the filename. The directory name is included by scom. A maximum of 80 characters is allowed for the entire file specification. When this option is not specified, scom uses a default algorithm for generating the file name.

ALL OTHER UNIX's
Allows user to specify an alternate lock file directory path. The file name is generated by scom. A maximum of 80 characters is allowed for the entire file specification. When this option is not specified, scom uses the default directory path for the lock file.

-N        Use no lock file
Do not create a lock file. This can be used if the user does not have permissions to the lock file directory. Using this option will prevent you from shutting down the server using the -S option above. Instead you would have to look up the process id of the server and then use the kill command to stop it.
 
 

OPERANDS

serialport
This is the device name where your serial/USB peripheral is connected that you intend to share.

The physical device name may be entered as ttya or with the complete path name /dev/ttya. Some SPARC machines may require an alternate device name to work correctly (/dev/cua/a vs. /dev/term/a or /dev/ttya). The difference is in the minor device number for each of these devices.

UnixWare user's should note that accessing any of the available COM ports requires the use of device names ending with the "t" character (i.e. term/00t). Other device names (i.e. term/00 term/00h term/00s) require that the DCD input of the port, be asserted (+12V) before the port can be used.

service
This is the name of the TCP port used by the scomd server for accepting socket connections from TCP/IP clients. This service name must be added first by the system administrator to the /etc/services file. The format for entries in this file are;

service_name <tab> port/protocol <tab> aliases <tab> #comment

Each of the above fields should be separated by white space or tabs. service_name is a string defining the name of the port, usually 10 characters or less. This provides a quick mnemonic name or handle of the service. port is a 4 digit number usually 2000 decimal or greater. Do not duplicate port numbers already in use. The protocol string indicates the protocol used by the port, usually tcp. The aliases are alternate names by which the service might be requested. The # sign is the start of any comments used to describe the service more exactly. Here are some samples of service entries for scomd usage;
 
stherm   6100/tcp   ST6105   # temperature in computer room A  
pager   6005/tcp   pager_modem   # pager modem at remote site to avoid long distance charges  
cu_device   6006/tcp   CU5000A   # control AC power to remote equipment for reboot purposes  
cam   6004/tcp   D200L   # digital camera for remote surveillance  

SECURITY
The scomd server provides absolutely no access to your UNIX filesystem. scomd only shares serial devices. If you are concerned about opening up a TCP port on your Internet server, consider that in the worst case, scomd only allows access to the serial device it shares.
 

EXIT STATUS
1 indicates an error occured preventing the server from starting
 

FILES
/scom/scom executable scom client program
/scom/scomd executable scom server program
/scom/setupfiles/*.ini setup files for supported peripherals
/scom/scripts/*.sh application shell scripts
/var/spool/locks/* lock files for Sun Solaris 2.X, 7 and 8
/var/spool/locks/* lock files for HP-UX
/var/spool/lock/* lock files for 4.4 FreeBSD
/var/lock/* lock files for Linux
/usr/spool/uucp/* lock files for SCO OpenServer UNIX 4.2 and 5.X
/var/spool/locks/* lock files for SCO UnixWare 2.X and 7.X
/etc/hosts names and ip addresses of hosts where remote serial devices are connected
/etc/services names of services and TCP port numbers
/scom/html/*.html HTML manual pages
 

SEE ALSO
scom_app(HTML) , scom(HTML)
 
 

NOTES

Remember when the server is running - all messages are output to /dev/console unless otherwise redirected using the -f option.

If you encounter the message;

scomd: DEVICE LOCKED

There may be a number of possible causes. Most likely, the serial port is in use by another program or process. In some instances it may be possible for a lock file to get left behind even though no processes are using the serial port. This can happen if scomd ends abnormally without a chance to remove its lock file. In this case it would be necessary to remove the lock file manually using the rm command. See the FILES heading for the location of lock files.

Each time scomd opens a connection with a client, it flushes both receive and transmit queues of the serial port.

Under Sunsoft Solaris 2.4 and possibly some earlier releases, an error message can be issued by the operating system - complaining about a problem with library ld.so.1 and the usleep system call. Refer to sunsolve.sun.com for a patch to solve this problem.
 
 

Copyright (C) 1997-2019 Sensorsoft Corporation, All rights reserved.
Sensorsoft, SCOM Serial Communications Tool and Soft Thermometer are trademarks of Sensorsoft Corporation.