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!

Help on printing from SCO Open Server 5.05 1

Status
Not open for further replies.

stilley

Programmer
Jan 16, 2003
52
CA
Hi, I am using an emulator to connect to an application that runs on my Unix box. The emulator is called Power Term version 4. I want to be able to print reports from my application to a parallel printer hooked up to a Windows based PC that runs Power Term. I don't mean things like print screens or windows based printouts but actual Unix system software reports. I'm not having any luck setting this up although it seems very easy. Maybe someone has been in this situation before and can advise me. Thanks.
 
This raises a series of questions. Using a multiport card? What terminal emulation within your terminal program? Does the terminal program have print thru capability.

You can specify the printer driver on some multiport cards or you can force the printer stuff thru your interface scripts.

Depending on what hardware you have it may take a combo of both to accomplish it for all possible serial ports you want to use. Ed Fair
unixstuff@juno.com
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, bare with me as I am new to this. I am using SCO ANSI emulation on my emulator. I'm not sure what you mean by a multiport card? How can I tell if it has print thru capability? The printer I am using is an Epson FX 880.
 
Basic computer normally has 2 serial ports. Unix is capable of handling more than 2 users on those 2 ports so multiport cards were developed for multiple users to use separate ports.
Your software documentation should tell you if you have printthru. ANSI has printthru but if your terminal emulator doesn't implement it you are sunk.

You need to find out what port you are working off of.
Can you gain root access? if so then "who am i" to see the port you are connecting thru. Ed Fair
unixstuff@juno.com
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.
 
What you are needing is terminal passthru printing. How this works is the print spooler temporarily takes over the port you are connected to, sends a signal to the terminal program that it is sending a print job, spools the print job through the port, then tells the terminal that the job is done. The terminal program forwards the print data to the printer.

Unfortunately setting this up isn't exactly easy. Since you say you are new at this, you might be better off hiring a consultant to help you set it up.

To find documentation on how it is done, go into the help documentation in the SCO x-windows gui of your system and choose:

Operating Systems Documentation Set
System Administration Guide
Chapter 4 - Managing Printers and Print Jobs
Customizing Printer Configuration
Configuring a spooled local terminal printer
 
Do you guys know of an emulator I could use that supports passthru printing for SCO ANSI?

 
Most do. ICE and Century term both do. And are you sure that your's does not.

Do you have root access? Easier to test if you do. Ed Fair
unixstuff@juno.com
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.
 
Yes I have root access. I found an emulator that works for passthru but I still can't get it to work. I guess I didn't set up the printer properly in Unix. Unfortunately we are unable to hire a consultant to do this. Its my task. I did the 'who am i' and all it tells me is ttyp14. I don't want this printer to be hooked up by serial but by parallel. Maybe I have it set up wrong in printer manager in Unix.
 
Do I need to modify printcaps in order to set this printer up?
 
You are on a pseudo terminal, via the network, I do believe.
I need to look into the OS setup on a system to see what the printer ports associated with pseudo terminals address as, most of my stuff is serial and the brain is filled with those interfaces now.
Usually it is just a matter of setting the device in print manager to point to the printer device associated with the terminal device, but networking complicates it a bit since you won't always log on at the same place. Ed Fair
unixstuff@juno.com
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.
 
It needs to be on a session by session basis because the ttypXX is assigned dynamically. You either need the application to print the report to stdout (standard out) or something that can print to a hostname.

We do this all the time with receipt printers.

The easiest way I have found is to use samba:
(assuming samba is installed and your application knows how to talk/format for the appropriate printer)

1. define a generic/text printer on your windows client (wincli) machine and share it (prt1)
2. define a local printer in unix (ptprint1)
3. edit /usr/spool/lp/admins/interfaces/ptprint1
- basically remove everything and add the following

server=wincli1
service=prt1
copies=$4
shift; shift; shift; shift; shift
files="$*"
options=$5
Wide=no
i=1
spool_dir=/usr/tmp
while [ $i -le $copies ]
do
for file in $files
do
cat "$file" >> $spool_dir/temp.$$
echo "print $spool_dir/temp.$$" | /usr/local/samba/bin/smbclient "\\\\$server\\$service" -N -P
rm -f /$spool_dir/temp.$$
done
i=`expr $i + 1`
done
exit 0

 
Ok hold on a minute. Let's back up and figure out exactly what you are wanting to do again.

You say you want to print to a parallel printer attached to a windows based machine running power term. I am assuming that "power term" is just the terminal emulation package you are using to log into the unix box, and you want to also print to the printer on the machine with "power term".

Your "who am I" shows that you are connected to a psuedo tty (i.e. over a network telnet rather than a serial port). It is still possible for you to set up passthrough printing with this configuration, but since you have a network connection it will actually be better to set up printing over the network using samba (a freeware product for unix that you can download. See: like stanhubble is suggesting.
 
i do not know if you have solved yr problem or not, but to me it appears thta you simly want local printing.

for that you can try a script where it first call
esc [5i
and then prints
and then simply cat your file
and then close print by
esc [4i.

now 5i and 4i are relevent to terminal. You try teminal emulation as ansi or vt100

for entring esc [5i, u can enter in vi and it shows like ^[[5i and ^[[4i.
plse note that power term uses local printing/pass through printing. However, your printer driver should match your printer.

sco has c command lprint. It uses PS and PN in termcap. The value for PN and PS are 5i and 4i.
 
I'm sorry guys, I'm really more confused than I was before.
 
Sorry for your confusion.
Local printing to a printer attached to the PC from which you are working (or a terminal) does a normal print to the physical address where you are located, but adds 3 commands before it dumps the file and 3 commands after the file.
The 3 commands on either side of the file dump are excape sequences.
Before printing, the keyboard is turned off, the terminal display is turned off, and the printer port is turned on.
After printing the printer port is turned off, the display is turned on, and the keyboard is turned on.
In a normal printer interface, 6 to 8 lines from the bottom there is a line "cat file$" or something similar. That is the instruction to actually dump the text to the hardware that is to do the printing. For "passthru" there would be 1 to 3 lines of info before and after (containg escape codes) to accomplish the required details.
If, as root, you do an env and get the terminal type you are operating from (ANSI), you can then look in /etc/termcaps and find the escape codes that are required to match what ANSI uses. PS and PN as tshot mentions, but those are the printer port only, to do the complete job you would need the other 2 sets of commands.
I will try to find some documentation to post from an old Xenix app. But that was strictly serial and will only be for example.
Hope this clarifies somewhat. Ed Fair
unixstuff@juno.com
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.
 
I understand why you are confused. It seems that everyone has a different answer for your question, and they are all technically correct because there is more than 1 solution. You are the one who is going to have to decide which solution is correct.

Based on all of your posts, your current situation is that you have a windows computer that you are using to access your SCO server. That windows computer is connected to the SCO server by a network, and is using terminal software to connect with a telnet session. You want to send print jobs from the SCO server to the printer which is attached to the windows computer.

You can accomplish this two different ways. One way is to send the print job to the terminal software over the telnet session. The other way is to send the print job to the windows computer using windows networking and print sharing. Both methods will work and have their advantages and disadvantages. I will try to give you the information you need to determine which method will be best for you.

Method 1 - Printing through the terminal software (passthrough printing):
SETUP: In order to set this up you have to create a printer on the SCO server, modify the SCO printer interface file to identify the port you are using for the telnet and send the appropriate printer commands through that port to the terminal software, and configure the terminal software to send the print job to the printer.
ADVANTAGES: Terminal passthrough printing is useful if a given user uses several different workstations because it is tied to the user name rather than the workstation used.
DISADVANTAGES: In order to work, terminal passthrough printing must be able to correctly identify the port the user is connected to. This is easy if the user always connects to the same port (i.e. a specific modem or hard wired serial connection), however with telnet sessions over a network this is much more difficult because the session may connect to many different ports.

Method 2 - Printing to a windows shared printer over the network.
SETUP: In order to set this up you have to install the samba software on the SCO server, create a printer on the SCO server, modify the SCO printer interface file to spool the print job using the samba software, and set up a shared printer on the windows computer.
ADVANTAGES: Samba printing is compatible with standard windows networking. Once the samba software is installed and the first printer is configured, setting up additional printers is relatively easy. Samba printing does not rely on the terminal software.
DISADVANTAGES: Installing the samba software can be a little intimidating. Samba printing is workstation based, not user based.

I recommend you use Method 2.

No matter which method you choose you are going to have to learn some basic UNIX scripting in order to modify the SCO printer interfaces.
 
Thanks for your help! I have a couple of questions. would the SCO printer interface file be called "printcap"? I may already have Samba installed on my SCO box but not sure how to check to see if it is installed? How can I get it if it is not installed, and how intimidating is it to set up? If it is not installed, and I do install it, will that effect my current printer configurations. I don't want to change them because they are working fine, although they are configured as serial.

Thanks again!
 
1- sco printer interface file = /etc/printcap
this is the printer capabilty database (similare to termcap), the interface file for a local printer is in /usr/spool/lp/admins/lp/interfaces

2- swconfig will show "custom" installed packages
3- ftp://ftp2.caldera.com/pub/skunkware/osr5/net/samba
4- If you take one of the "VOLS" tar files it contains media images that are suitable for a "custom" install.

If you don't want to configure the unix system for any file or printer shares you don't need to. The smbclient application will work for printing by itself, but it is not difficult to configure.

This will not affect any of your currently configured printers.
 
Thanks, on another note, I hear people talking about LPR print server programs that you can run on your PC to listen to printing requests from Unix and print them to your printer. Any suggestions on that?
 
No /etc/printcap is not a printer interface file, but it is used to configure some kinds of printers. Printer interface files are located in /usr/spool/lp/admins/lp/interfaces. Except for special cases there would be a separate interface file for each printer, having the same name as the printer.

The windows LPR server applications you mentioned would probably work, but samba is your best option because it is compatible with standard windows networking and it does not cost anything.

Follow Stanhubble's directions to see if you already have samba installed. If you don't, there are many users on this forum who would be able to help you get it installed and working, myself included.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top