Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

framing error ?

Status
Not open for further replies.

itfellow

MIS
Jan 6, 2004
130
US
Hi all,

I'm on OpenServer 5.0.5b.

I recently had to move a MAI BasicFour 4215 printer from a remote location to the main office, and set it plugged directly into our Digi Concentrator (rather than through a modem that went through the concentrator). I used a different port on the concentrator which corresponds to /dev/ttya12.

inittab is set up as follows:
Ea12:23:respawn:/etc/ob/setport ttya12 9600 cs8 -parenb
EA12:23:eek:ff:/etc/getty ttyA12 2

/usr/spool/lp/admins/lp/printers/configuration is:
Banner: on
Content types: simple
Device: /dev/ttya12
Interface: /usr/spool/lp/model/maidumb
Printer type: unknown
Stty: 9600 cs8 -parenb
Number of banners: 0

The printer itself is set to 9600 baud, no parity (8none1), protocol DTR (which matches the Digi port setting).

However, whenever I send something to that printer, I get a mass of garbage printed out, and the error message "framing error" on the printer. When I put another printer on that same port, an Epson LQ-670, it prints fine. I have tried fiddling with every setting on the printer itself, but I cannot get past this framing error.

If anyone could give me any suggestions for whatI might try, I would greatly appreciate it.
 
stanhubble,

/etc/ob/setport is:

#!/bin/sh
#
# $Copyright: $
# Copyright (c) 1988, 1989, 1990, 1991 MAI Systems Corporation.
# All rights reserved
#
# This software is furnished under a license and may be used
# only in accordance with the terms of that license and with the
# inclusion of the above copyright notice. This software may not
# be provided or otherwise made available to, or used by, any
# other person. No title to or ownership of the software is
# hereby transferred.
#
#########################################################################
# #
# setport Set port options and keep port open #
# #
# Summary: Bourne shell script for setting port options of #
# "auxiliary" ports to be used by Open BASIC. These #
# ports do not have a getty process to set and hold #
# their options. This script opens the specified port, #
# sets the specified port options (or a default) via #
# stty(1), and sleeps "forever" to keep the new port #
# options in effect. This script is designed to be #
# run from the /etc/inittab file, but it can be used #
# (carefully) from the command line. #
# #
# Usage: (a line in file /etc/inittab): #
# #
# xx:x:respawn:/usr/ob/bin/setport <port> [ <options> ] #
# #
# (a line in file /etc/ttytab): #
# #
# ttya "/bin/sh /usr/ob/bin/setport -r [ <options> ]" unknown on local #
# (Note: port is not specified since it is passed as the last #
# argument to setport by init. "-r" must be specified. #
# #
# (or, from the command line): #
# #
# nohup setport <port> [ <options> ] & #
# #
# <port> is the device file for the desired port, #
# without the "/dev/" prefix. #
# #
# <options> is a list of options suitable for stty. #
# Default options are: #
# "9600 cs7 -parodd parenb -cstopb ixon -ixany ixoff" #
# Specified options override default options. #
# #
# Example: nohup setport tty05 parodd clocal & #
# #
# ... would set the options of port /dev/tty05 to: #
# 9600 baud, 7 bit characters, odd parity, XON/XOFF #
# bidirectional flow control, and no modem control. #
# Other options would not be changed. #
# #
# when who what and why #
# -------- ------ ---------------------------------------------- #
# 03/20/91 erv Remove redirection of shell's stdin. #
# 10/12/90 erv Remove quotes from options string for stty. #
# #
# 09/17/90 erv Add ixon -ixany ixoff to default options, #
# let stty merge default and specified options. #
# 09/05/90 erv created. #
# 11/21/91 jdb Added "-r" option to support running out of #
# /etc/ttytab file. #
# 02/07/92 erv Added erase/kill character definitions to get #
# away from printable characters. This avoids #
# conflict with ATP, which often sends '#'. #
# #
#########################################################################
#
# $Header: /ccs/oae/3b/build/oae/rcs/usr/src/scripts/setport.src,v 1.2 92/02/07
14:20:54 vancee Exp $
#
DEFAULTS="9600 cs7 -parodd parenb -cstopb ixon -ixany ixoff erase \^H kill \^U"
OPTIONS="$DEFAULTS"
USAGE="
Usage: nohup `basename $0` <port> [ <options> ] &
nohup `basename $0` -r <options> <port> &

<port> device file for the desired port, without the "/dev/" prefix.

<options> list of options suitable for stty command.
Defaults options are:
\"$DEFAULTS\"
Specified options override default options.

-r options and port are reversed (for systems with
/etc/ttytab)
"

# Error if <port> was not specified
if [ "$#" -lt 1 ]
then
echo `basename $0`: port must be specified. >&2
echo "$USAGE" >&2
exit 1
fi

# get the arguments (if reversed, portname is last, otherwise its first.)
if [ "$1" = "-r" ]
then
shift
i=1
numargs=$#
while [ $i -lt $numargs ]
do
OPTIONS="$OPTIONS $1"
shift
i=`expr $i + 1`
done
PORT="/dev/$*"
else
PORT="/dev/$1"
shift
OPTIONS="$DEFAULTS $*"
fi

# Error if <port> is not a device file
if [ ! -c "$PORT" ]
then
echo `basename $0`: \""$PORT"\" is not a character special file. >&2
echo "$USAGE" >&2
exit 1
fi

# Error if <port> device is not a terminal port
if ( [ ! -t 0 ] ) < "$PORT"
then
echo `basename $0`: \""$PORT"\" is not a terminal port. >&2
echo "$USAGE" >&2
exit 1
fi

# Set stdout to specified <port>
exec > "$PORT"

# Set port options
stty $OPTIONS < "$PORT"

# Sleep forever or until a signal arrives
while :
do
sleep 60
done

exit 0


********
the output of ditty /dev/ttya12 is:

onstr \033[5i offstr \033[4i term ansi
maxcps 100 maxchar 50 bufsize 100 edelay 100
-forcedcd fastcook -altpin -fastbaud (9600) -printer
eia232 -rtspace -dtrpace -ctspace -dsrpace -dcdpace
DTR+ RTS+ CTS- CD- DSR- RI-
startc = 0x11 stopc = 0x13
-aixon astartc = 0x0 astopc = 0x0
-2200flow -2200print
speed 9600 baud; ispeed 9600 baud; ospeed 9600 baud;
-parity hupcl clocal
erase = \; kill = \; eof = ^A; eol = ^A; swtch = <undef>; susp = <undef>;
-inpck -istrip -ixany -opost
-isig -icanon -echo -echoe -echok

 
OK, I found the problem. Turns out the serial-cat 5 adapter was wrong (I was still trying to use the one that was originally on the printer when it was working). This is the adapter that lets you plug your regular cat 5 network cable into the serial port, the other end of which runs into the Digi concentrator.

The serial port has 25 pins, but the adapters only use some of those pins.

The incorrect adapter had 8 pins in this configuration:
.......oooooo
oooooo.ooooo

The correct adapter had 7 pins in this configuration:
o..o....ooooo
oooooo.ooooo

Not sure what the specific differences are, but I'm sure it has to do with the type of cable you are emulating.

Anyway, thought I'd share this solution in case anyone else runs into this problem.
 
ok you may have the pinning correct now, but the flow control on the port is still wrong, well not wrong but just xon/xoff. If you want to use hardware flow control and whether it needs to be rts/cts or dsr/dtr pacing will depend on the adapter that you have on the printer end. On the digiboard, the rj45 port has 10 wires.

1 - ri ring indicator
2 - dsr
3 - rts
4 - gnd
5 - txd
6 - rxd
7 - gnd
8 - cts
9 - dtr
10- cd carrier detect

we tend to use an rj12 6 wire connection so we only use the center 6 signals and therefore rts/cts flow control.

the MIA script is just a way of "fixing" the port settings, which is unnecessary with the digiboard.

ditty printer 9600 cs8 -parenb -cstopb ixon -ixany ixoff

will set things as they are now and you can remove the inittab entry. you can run this anytime during the rc scripts. I tend to use a S99digi script for setting any/all the ports needed for printing. (its the printer option to the ditty command that makes the port stay open with the current settings). To turn on hardware flow control you would add the rtspace ctspace commands or dsrpace dtrpace commands depending on your adapter and printer settings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top