Comtrol RocketPort Series Device Driver for the SCO UnixWare 7 User Manual
Page 7
![background image](/manuals/672109/7/background.png)
RocketPort® Series Device Driver for the SCO UnixWare 7 Operating System Software Installation Card
7 of 8
Checking Flow Control
To check flow control setup, enter this command:
stty -a XX
Where XX is the port to which the printer is attached.
The system should respond with something like this:
speed 38400 baud;
intr = DEL; quit = ^\; erase = ^H; kill = ^U;
eof = ^D; eol = ^@; eol2 =
start =^q; stop = ^s; susp = ^2; dsusp =
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -
parext
-ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr
icrnl -iuclc
ixon ixany -ixoff -imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop -echoctl -echoprt -echoke -detecho -flusho -pendin -
iextern
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
rtsxoff ctsxon -dtrxoff -cdxon -isxoff xcibrg rcibrg tsetcoff
restcoff
-isscancode
Note: These lines are shown for example only. The
parameters for your system will probably be
different. A minus sign (-) in front of a parameter
indicates that it is not configured, while a blank
space means that it is configured.
Software (XON/XOFF) Flow Control
Pay particular attention to the minus signs (-) in front of
ixon, ixany, and ixoff. A minus sign means that the
parameter is turned off, which in turn may mean that flow
control is not being handled correctly. To force XON/XOFF
flow control, enter these commands:
cat XX >/dev/term/null &
stty 38400 IXON -IXANY IXOFF XX
Where XX is the port to which the printer is attached.
This example assumes the printer is running XON/XOFF
handshaking and 38400 baud. The cat command opens a
background process on the printer port and the stty
command sets the baud rate and handshaking.
If this solves the problem, make the corrections permanent
by adding the cat and stty commands shown above to the
boot file, then rebooting the system.
Hardware (CTS/RTS) Flow Control
Pay particular attention to the minus signs (-) in front of
ctsxon and rtsxoff. A minus sign means that the parameter
is turned off, which in turn may mean that flow control is
not being handled correctly. To force CTS/RTS flow control,
enter these commands:
cat XX >/dev/term/null &
stty 38400 -IXON -IXANY IXOFF ctsxon rtsxoff term/rXX
Where XX is the port to which the printer is attached.
This example assumes the printer is running hardware
handshaking and 38400 baud. The cat command opens a
background process on the printer port and the stty
command sets the baud rate and handshaking.
If this solves the problem, make the corrections permanent
by adding the cat and stty commands shown above to the
boot file, then rebooting the system.
UNIX Spooler Problems
The System V lp spooler has a known problem that causes
serial ports with buffers beyond the UNIX internal buffers
to drop characters at the end of print jobs.
When the lp spooler daemon wants to print something, it
forks a child process. The child opens the printer port, then
forks a process to run the interface shell script. When the
shell is finished printing, it exits.
There can still be characters in the output buffer at this
point, but because the child still has the printer port open,
the shell exits immediately. The child is notified that the
shell has exited, it sends a message to the daemon (via the
named FIFO) indicating the print job has completed, the
child then exits, and the exit code eventually enters the
port’s close routine.
If there are still characters left to be output to the printer,
the process sleeps in the close routine until the characters
have gone out the port or until the process gets a signal.
The lp spooler, however, upon receipt of the “print done”
message, sends a sigterm signal to the child. If the child is
in the close routine waiting for characters, it wakes up,
flushes its buffers, and exits. This is how the data is lost.
Possible Solutions
1.
Enter stty -hupcl <&1 ; in the interface shell script
immediately before every possible exit. This prevents
the shell from exiting before all the characters have
been sent out the serial port.
2.
Enter sleep 30 in the interface shell script immediately
before every possible exit. This also prevents the shell
from exiting before all the characters have been sent
out the serial port.
3.
For applications which must access the printer device
directly, insert the following command in the boot file:
stty baud IXON IXOFF -IXANY; while: ; do sleep 3600;
done)< portname &
Where baud is the printer baud rate and portname is
the serial device name. This line can also be issued as a
command from the root prompt, but unless nohup is
used, this process will exit and the serial line will be
reset when root logs out. Placing this command in the
boot file will ensure that the process will be spawned
upon going into multi-user mode, and continue until the
system is shut down or the process is killed manually.