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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wyse terminal printing

Status
Not open for further replies.

thwalker

IS-IT--Management
Apr 21, 2003
8
CA
Hey,

I need to set up say lpt6 to print to the aux port on a wyse terminal. Lprint works but it does not have the functionallity that I require. I need anyone to be able to print to this port, not just the local terminal user. I've tried editing /usr/spool/lp/admins/lp/interfaces/lpt6 (the path is something similar to that) and added the escape and control codes to turn on aux and transparent printing but the sequences are not being interpreted by the terminal.

Any thoughts?

Tom
 
Multiport card? Support there?
Multiport card software may make other devices available the automatically insert the required control codes.
What hardware? What OS?


Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
The company had bought a PC clone for their server (mistake #1). It is running SCO 5.05 I believe. It did have a Digiboard in it that went bad, so we switched it over to the onboard serial ports ( company had swapped most of their terminals for PC's, except two). I poked around through the MPI software that comes with it and did not see anything of help. There are some leftover devices, eg. /dev/prA01 to 16 ( and many upper and lower case variations) that corresponded to the terminal connections eg. /dev/ttyA01 to 16. I was unable to extract any information from the former config.

Tom
 
Clone is fine. Thst is all I work with now since I prefer not having to deal with the support services of the big companies.

Digi used the /dev/prAxx to be the printer ports and the printer control stuff was buried in there.

So you need to add the control stuff to the interface script. Something on the order of
echo `\0133\xxxx\xxx` keyboard off
echo `\0133\xxxx\xxx` terminal off
echo `\0133\xxxx\xxx` printer on
aroung the cat f$ file dump section
then the printer off, terminal on, and keyboard on code.

I has been a while, and I don't remember the codes, but I think you can find them in /etc/termcap. Or in the Wyse manual.



Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
One other thing. The terminal that dials in is connected to tty1A. In scoadmin under the printer options for lpt6, I have the port set to /dev/tty1A. Is adding these control codes in /usr/spool/lp/admins/lp/interfaces/lpt6 the right way to do this? Meaning, will the terminal process the control codes? I personally don't see why not. I have yet to make it over to the client's site to try the suggestions from stanhubble.

Tom
 
Yes, that is the correct way.

If you have other wyse terminals you can use, you could temporarily hook one up to the port as tty1a and test it locally. Would require the printer to be directed there also. Once it works locally , go back to 1A.

I had suggested the terminal off code as part of the modification. If you don't use it, you will get a display to the screen at the same time as you are printing. No problem in command line , but if you have screen controls you might not end where you need to be on the screen when the printing is done.

Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Ed,
we use this method all the time with our pos system to print to a receipt printer. It does not echo the print job on the screen and your cursor position is unchanged.

thwalker,
the problem with the dial in line will be if something other than a wyse terminal connects, but then they probably won't have a printer connected......
 
Stan,
I'll have to do some reviewing where I ran across the problem. Maybe Xenix. May have been with a terminal emulator rather than a terminal.
In any case , if Tom gets screen dump, he'll know what to do.
Thanks for calling it to my attention.

Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Hi folks,

I've tried adding the codes to the lpt6 file. When I send a print job ( # cat /test | lp -d lpt6 ), we get some "x"'s printed on the terminal and no job outputted to the printer. The terminal becomes locked and we need to power it off and on and redial the connection. Any thoughts?

Tom

P.S. I haven't been able to test using tty1a instead of tty1A
 
It sounds like your print job is actually getting to the terminal, but the terminal isn't redirecting the job to the printer.

Try "\033[5i" for printer on and "\033[4i" for printer off. These are pretty standard for terminal printing. If that doesn't work you're probably going to have to find a manual for the terminal in order to determine the correct codes. What is the specific model of the terminal?

It sounds like you've already got your interface script figured out, but if not try the script below.

Code:
:
# Pick up input options (only copies used).
request=$1
name=$2
title=$3
copies=$4
options=$5

# Clear out options (all that's left is the files).
shift; shift; shift; shift; shift

#terminal passthrough printing interface file
termport="/dev/tty1A"                  #identify the terminal tty port
penable="\033[5i"                      #string to turn printer output on
pdisable="\033[4i"                     #string to turn printer output off
sttystr="ixon -ixany ixoff"            #string to configure printer flow control
sleep 5                                #wait 5 seconds to let any screen draws finish
exec <$termport >$termport 2>/dev/null #redirect standard out to printer
sttysave=`stty -g`                     #save terminal settings
stty $sttystr                          #turn on printer flow control
echo -n &quot;$penable&quot;                     #turn on printer output

# Send the file(s) to the port $copies times.
(
while   [ &quot;$copies&quot; -gt 0 ]
do
 for file
 do
  cat &quot;$file&quot; 2>&1
  #Note: &quot;cat&quot; does not format the printout for PCL5 or postscript jobs.
  #      To format the printout, use the following syntax for the filter program.
  #      cat &quot;$file&quot; 2>&1 | InsertFilterProgramHere
 done
 copies=`expr $copies - 1`
done
) >$termport

echo -n &quot;$pdisable&quot;                    #turn off printer output
stty $sttysave                         #restore terminal settings
exit 0                                 #exit interface script
 
thwalker,

what model and emulation of wyse terminal are you using?
the codes i gave you were for the 60 family. (I should have asked this before).

The codes ESC[5i and ESC[4i are for VT emulation.
 
G'day,

I cannot identify the terminal make or model that the client is using. There are no identifiying marks on it anywhere (this may be the problem). It is, however, using wyse 50 emulation. I've downloaded a PDF for wyse terminals and looked up the control sequences.

I've had the best results so far have been with apeasepcp's script. When the following command is used:

# cat /test | lp -d lpt6

the file is displayed on the terminal's screen.

The the wyse manual shows these sequences:

aux print mode on: ctrl-R
tranparent print on: ctrl-X
print modes off: ctrl-T

If I do these control sequences on the terminal keyboard, I can send a job to the printer via the same print command. So ctrl-R and ctrl-X, send job, ctrl-T to return to terminal mode. Both the ctrl-R and ctrl-X are required or else we get 1): both display and printer at the same time or 2): nothing at all on either.

But I can't seen to find how to code these in the lpt6 file. I've read that the esc sequence is &quot;\033&quot; , and also that ctrl cab be created by adding a &quot;[&quot; to give me &quot;\033[&quot;. So I used:

aux print mode on: \033[R
tranparent print on: \033[X
print modes off: \033[T

The job still goes to the terminal screen. The R,X and T characters are printed, not interpreted.

I also though I read that ctrl could be represented by going up a byte order from esc. So \033 becomes \0233 (1B to 9B). So I've tried.

aux print mode on: \0233R
tranparent print on: \0233X
print modes off: \0233T

The job still displays on the screen, and no extra characters appear (ie. the R,X and T).

I believe we are close!!

Thoughts?

Tom
 
Replace the &quot;penable&quot; and &quot;pdisable&quot; values in my interface script above with the values you want to try.

Note: &quot;\033&quot; is the ascii code for Esc (also known as Ctrl-[). &quot;\033[&quot; is NOT equivalent to Ctrl rather it is actually Esc followed by the &quot;[&quot; character.

The ascii code for Ctrl-R is &quot;\022&quot;
The ascii code for Ctrl-X is &quot;\030&quot;
The ascii code for Ctrl-T is &quot;\024&quot;

Basically for Ctrl-letter codes you use the octal equivalent of the whatever letter it is in the alphabet (A=1, B=2, etc...). A &quot;\&quot; followed by a 3 digit number is unix octal representation. See thread58-337782 for a decimal to octal conversion table.

To send Ctrl-R and Ctrl-X for printer enable and Ctrl-T for printer disable you should use the following:

penable=&quot;\022\030&quot;
pdisable=&quot;\024&quot;

That is of course presuming that Ctrl-R, Ctrl-X, and Ctrl-T are the correct codes for your terminal.

On the other hand if Stanhubble's original suggestion is correct you should use:

penable=&quot;\033d\043&quot;
pdisable=&quot;\024&quot;

I suggest you try both ways and let us know.
 
Thanks, I've changed the lpt6 filejto reflect those changes. I have to wait until tommorrow in order to test though. By the way, I think that conversion table at Thread58-337782 is wrong. When the octal value gets up to 77, wouldn't the next progression would be 100 instead of 80?

Tom
 
You are right, the table is wrong. I wonder why no one else noticed. I'll have to post a correction to it one of these days when I have some time to waste.
 
and if I remember correctly the code requires \033\xxx\c but that is from the Xenix days and I can't find the scripts that I swore I'd never lose.

The wyse 150 manual shows tranparent on as esc d # and the trans off as ctrl t. The 50+ supposedly the same.

Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Hi Folks,

I finally have it working. I thank everyone for their help. It seems we were so very close the first time. I found that when I printed to the terminal with the lp command, it would, kick off the user, not print anything or print to just the screen. Lprint would work fine. I captured the serial stream and used a hex editor to verify the print codes. From something I had seen before, I went into scoadmin and changed the printer device from /dev/tty1A to /dev/null. I figured that would be ok because we were explicitly setting the tty in the file and ..... shazzam. That combined with the following lpt interface script fixed us up.

# Pick up input options (only copies used).
request=$1
name=$2
title=$3
copies=$4
options=$5

# Clear out options (all that's left is the files).
shift; shift; shift; shift; shift

#terminal passthrough printing interface file
termport=&quot;/dev/tty1A&quot; #identify the terminal tty port
penable=&quot;\022&quot; #string to turn aux print on
penable1=&quot;\030&quot; #string to turn transparent print on
pitch=&quot;\017&quot; #string to turn on compressed print
pdisable=&quot;\033[4i&quot; #string to turn printer output off
sttystr=&quot;ixon -ixany ixoff&quot; #string to configure printer flow control
sleep 5 #wait 5 seconds to let any screen draws finish
exec <$termport >$termport 2>/dev/null #redirect standard out to printer
sttysave=`stty -g` #save terminal settings
stty $sttystr #turn on printer flow control
echo -n &quot;$penable&quot; #turn on printer output
echo -n &quot;$penable1&quot; #turn on printer output
echo -n &quot;$pitch&quot; #set print pitch


# Send the file(s) to the port $copies times.
(
while [ &quot;$copies&quot; -gt 0 ]
do
for file
do
cat &quot;$file&quot; 2>&1
#Note: &quot;cat&quot; does not format the printout for PCL5 or postscript jobs.
# To format the printout, use the following syntax for the filter program.
# cat &quot;$file&quot; 2>&1 | InsertFilterProgramHere
done
copies=`expr $copies - 1`
done
) >$termport

echo -n &quot;$pdisable&quot; #turn off printer output
stty $sttysave #restore terminal settings
exit 0 #exit interface script


Again, thanks everyone for their help with ths battle.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top