APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > News Posts > transparent print pass-thru print terinal print––>Passthru printing on Link Mc5
Printer Friendly Version




News Group Posts

transparent print pass-thru print terinal

print

See How do I do Transparent or pass-through printing? for more on transparent printing.



From: "Brian K. White" <brian@aljex.com>
Newsgroups: comp.unix.sco.misc
References: <9p09ar$mdb$1@news.inav.net> 
Subject: Re: Passthru print on Link Mc5 kills login session
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Message-ID: <c%Rs7.3943$c8.512497@news1.rdc1.nj.home.com> 
Date: Fri, 28 Sep 2001 03:19:36 GMT


"Gregory Calvert" <gmc@inav.net> wrote in message
news:9p09ar$mdb$1@news.inav.net...
>
> When I issue a unix print job to my passthru printer attached to a Link
Mc5
> terminal running in VT220-7 mode, the job prints but my login session
never
> comes back. I am kicked out to a login prompt.
>
> The terminal responds correctly to the following string when entered from
> the keyboard:
>
>         echo "\033[5ithis is a test \033[4i"
>
> This terminal is attached via a modem.
>
> Thanks for any suggestions














----- Original Message -----
From: "Gregory Calvert" <gmc@inav.net>
Sent: Thursday, September 27, 2001 6:24 PM
Subject: Passthru printing on Link Mc5


> Thanks for your reply. After modifying termcap for vt220, and terminfo, it
prints when I issue the following command:
>
>    echo "\033[5i thisis a test\033[4i"
>
> It still wouldn't print a unix file, printing it to the screen instead. I
put the printer off and printer on codes in the printer > interface script
( /usr/spool/lp/admins/lp/interfaces/nlib ), and then it would print a unix
file but it kills my session- kicks > me out to a login. This terminal is
attached via modem. Any ideas?
> Thanks for your help.


[ I'm replying to this back in public. it is of general interest to others,
and if you want exclusive attention, then generally my company and
subsequently me gets paid for that. :)  ]




if the above command prints to the printer, then it proves that your
terminal does in fact use ansi passthru print codes as opposed to some other
flavor, or none at all. The above command does not care about termcap or
terminfo or the $TERM variable since it doesn't use any of them. This tells
us what we need to know in order to set those things up so that all your
other applications will work, which *do* need those systems to be configured
properly since that is how they figure out that they should send "\E[5i" and
such.

First, where are you getting "vt220" from? Does the terminal manual say that
is the emulation it supports best?
[ ok, I see from the newsgroup post that you know the terminal is in
"vt220-7" mode. that answers this question and several of the following
ones, so you can skip to the part where I say "assuming it really is a
vt220..." ]

Log in via this terminal and perform a few tests and tell me the results.

echo $TERM
    what does it say?)

hit ctrl-v followed by the F1 key, followed by the enter key.
    Note down the escape sequence displayed and then hit enter or delete to
get a fresh command prompt, then do the same for F4, F5, and F10, and
Delete, and Backspace. Delete and/or Backspace might not display any
sequence, just tell me what it does do. delete might make a new command
prompt, backspace might simply move the cursor to the left one space, or
Delete might show something like ^[[3~ and backspace might show something
like ^?
If your terminal is really vt220, F1 might show ^[[[A , or if it is really
scoansi, it might show ^V^[[M: not found
of that, the ^[[M is the important part.

do all of them and report what they say
ctrl-v F1 enter
ctrl-v F4 enter
ctrl-v F5 enter
ctrl-v F10 enter
ctrl-v Delete enter
ctrl-v Backspace enter

This will tell us:
  what kind of terminal your system *thinks* you have   (value of $TERM)
and
  what kind of terminal you really have  (determined via the ctrl-v stuff)
and then we can make sure that they match and if necessary fix one or the
other until they match.
untill we get that, nothing else can be done, since everything else depends
on this being correct.

assuming for now that it really is a vt220 compatible terminal, then this is
what you need to do:

vi /etc/ttytype
  find the line that has the tty the modem is on, change the first word from
"unknown" (or whatever it says now) to "vt220"

log ot, log back in, you should get a prompt immediately after login that
looks like:
TERM = (vt220)
just hit return, or, if it does not say vt220 in the parenthesis, then type
in vt220 and hit return, instead of just hitting return. then proceed...

first verify TERM is currently set to vt220,
  echo $TERM
it should print "vt220", if it does, proceed. If it does not then type:
  TERM=vt220 ;export TERM
and proceed...

infocmp >vt220.src
echo "\tmc5=\\E[5i, mc4=\\E[4i," >>vt220.src
tic vt220.src

vi /etc/termcap
  find the vt220 entry, go to the end of the last line in the vt220 entry
and add a singe backslash immediately followed by a carriage return, then a
tab, then this:
  :PN=\E[5i:PS=\E[4i:


now, at this point you should have a working lprint command,
   echo "this is a test" |lprint
also try
   echo "this is a test" |lp -L local


now... All that is nice and good so far, but many applications cannot
actually print to a local printer using passthru print via lprint or lp -L
local because they write to the screen at the same time they write to the
printer, like a little "busy" or progress indicator like "now printing
record 1 ...2 ...3 etc..." if the application does not know that the print
data is actually going through the same channel as the screen, and that the
screen has been shunted to the printer for the moment, that screen display
data will go to the printer and mess up the print job. In these cases,
usually the application provides it's own means of passthru printing, and
you have to tell the *application* that your printer is using passthru, and
you must tell the *application* what the escape codes are it should use.
often this is in the form of a termcap file similar to /etc/termcap, but
which comes with the application, and resides somewhere in the applications
home directory, and which is only used by the application. Or, sometimes the
application has a config file or a setup screen somewhere where you can
define the printer on/off sequences.

If the computer has a multi-port serial card, (specialix, digiboard,
equinox, cyclades...) then you have another option that sidesteps all of the
above. you can put the modem on one of the serial ports on the multiport
adapter (instead of one of the motherboard built-in ports) and define a new
local printer on a special "printer" device that corresponds to the serial
port the modem is on.

taking an example from an Equinox, #6 port has all these device names
associated with it
/dev/tty1a6      plain serial line, without modem control
/dev/tty1A6     serial line with modem control
/dev/tty1a6p    printer on port 6 without modem control
/dev/tty1A6p   printer on port 6 with modem control

they all are ways to access the same physical port, but depending on which
device you use, determines how the serial line is accessed. connecting to
/dev/tty1a6 simply means that the operating system ignores a few of the
signals in the serial port, namely, the ones that are usually only used by a
modem to tell the computer that it is on or off hook, or has carrier detect
, these are not necessary for direct connected terminals so this is a way to
ignore them. However, if you are connecting via a modem, you it is for all
intents and purposes necessary to use the modem control form of the device,
so that when the modem loses carrier, the operating system is notified and
can kill any processes that might have been running and reset the modem to
accept the next incoming call and allw the caller to login.

the devices with the p added are special virtual devices provided by the
multiport adapter driver software.
When you send data to them, the serial driver automatically handles sending
the escape sequences and data for passthru printing, and this *does* work
even for applications that try to print to both the screen and the printer
at once. The serial driver takes in data on both devices, and you do *not*
tell the application anything about passthru printing, nor do you use lprint
or lp -L local, you simply send data to the ...p device whenever you want,
including sending data to both devices at the same time, and the serial
driver simply sends a little from each channel either with or without escape
codes around it as needed.

the actual names of the serial devices and the actual names of the
printer-only versions are different for each brand of serial card, but the
idea is the same. You may need to run some kind of port setup utility that
came with the serial card to turn this feature on, oradjust it in some way.
For Equinox, the programs is ssdiag, I forget what it is for digiboard but I
know it's very similar in operation.

Then you define a printer like usual either in the application, or in
scoadmin, or both, and you say that the printer is on "/dev/tty1A6p", don't
say anything about passthru or local print, and the serial drive takes care
of everything from then on... this way also has one other really handy
advantage, doing it this way means anyone can print to this printer. As long
as the computer is turned on and the terminal is connected (even if it's not
logged in, so long as it is connected (IE: sitting at the the login prompt)
then other users or background processes can print to the printer if you so
desire, not just yourself. It opens up some nifty possibilities.

Brian K. White  --  brian@aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx  Linux SCO  Prosper/FACTS AutoCAD  #callahans Satriani




If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

Comments?



Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



ad

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

g_face.jpg

This post tagged:

       - SCO_OSR5




Unix/Linux Consultants

Skills Tests

Guest Post Here