1833758 Members
2335 Online
110063 Solutions
New Discussion

Re: Direct Printing

 
LucianoCarvalho
Respected Contributor

Direct Printing

Hi guys,

I have configured on HP-UX 11.23 (RX 2660) printers Epson FX2190 for printing direct to mux port using cat.
The inittab looks like this:

pr4:3:respawn:/usr/sbin/getty -h tty5a4 9600

The printer is working, but when printing large files, the printer is lefting some blank pages.

Any idea?
7 REPLIES 7
Eric SAUBIGNAC
Honored Contributor

Re: Direct Printing

Bonjour Luciano,


I have not been working with serial printer for while ... Let us see if I remember some things

Instead of managing tty settings through inittab/getty I would do it at the "cat" level :

- getty will send a login welcome to your printer.
- unless you modify gettydefs you can't have a fine tuning of tty settings
- definitions in gettydefs are more designed for terminal (input/output devices) than for printers (output only devices)
- some doubts about flushing buffers at end of cat
- "9600" is a rotating definition that could be changed in "300".

So you could disable entry pr4 in inittab then write a littke script or a function in this way, like a dumb model :

____________________
MyCat ()

{
stty raw 9600 -parenb cs8 ixon -istrip clocal <&1 2>/dev/null
cat "$1" 2>&1
echo "\014\c" # Form Feed if needed
stty raw 9600 -parenb cs8 ixon -istrip clocal <&1 2>/dev/null # ensure buffer is flushed
}

MyCat $MyFile >/dev/tty5a4
____________________

Regards

Eric
LucianoCarvalho
Respected Contributor

Re: Direct Printing

Thanks for your repply Eric I'll test the script.
Just to complement, we have done some tests and seems that the printer is getting a full buffer but HP-UX continues sending to the printer.

One of tests we've made, the printer begins printing, but at page 20 it prints a blank page and after that continues printing page 32.

Best Regards
Eric SAUBIGNAC
Honored Contributor

Re: Direct Printing

Sounds like flow control problem. You can ajust these parameters in the previous script (man stty)

Also, check parameters at printer side : hardware, xon/xoff, none ? On Mux side, I don't remember, you could also have parameters to adjust.

If you can't solve your problem at flowcontrol level, you can also try to lower the speed, that is HP-UX will transmit characters at a lower speed than output capacity of the printer.

Found on google that FX 2190 can write at 680 cps with 12 cpi characters. 680 cps means 5440 bit/s. So you can make a test with a lower speed : 4800 in place of 9600. I guess that if you lower the speed you will have to do it too at printer/mux side

Regards

Eric
Tim Nelson
Honored Contributor

Re: Direct Printing

I would not have thought to use getty to support a serial based printer port.

What about just using lp with -v/dev/tty5a4 ?

You will still need to configure the speed and hand shake but at least you have a spooler to control it ?

Bill Hassell
Honored Contributor

Re: Direct Printing

You must first configure the printer. EVERY printer has different defaults and your problem is with flow control, that is, the computer is sending data too fast to the printer. Typically, you would configure the printer to use XON/XOFF pacing. If the printer cannot do this, then you'll have a *lot* of additional issues to resolve for hardware handshake including the proper cable, a mux panel that supports hardware handshake and read the man pages for stty and termiox.

For XON/XOFF, use stty, not getty. getty expects that anything coming back from the printer is a request to login and will schedule the login program pointed to the printer, thus messing up the print job.

The lp spooler is designed to talk to serial printers such as the Epson. Just add the printer using the model script called "dumb". Then print files using lp rather than cat.

If you really want to use cat, you must first set the printer to use XON/XOFF pacing, then set the MUX port speed before printing. But stty simply opens the port, sets the speed then closes the port. Then the port drops back to 300 baud, the default speed. You must keep the port open all during the cat command. The easiest (but cimbersome) way is to start the sleep command in the background specifying the serial port as input:

# nohup sleep 40000 < /dev/tty5a4 &

Now the port is open for 40,000 seconds or about 11 hours and any stty setting will 'stick' during that period. Now set the baud rate, parity, stop bits and xon/xoff handshake:

# stty 9600 cs8 -istrip clocal ixon < /dev/tty5a4

and check the port speed to make sure it has been set correctly:

# stty < /dev/tty5a4

Now you can cat a file to the printer and it should not get any buffer overruns.


Bill Hassell, sysadmin
Anne Makino
Advisor

Re: Direct Printing

Hi guys,
I work with Luciano and I would like to update some info.
The inittab looks like this:

im2:3:respawn:/etc/impsrl < /dev/tty4a2 > /dev/tty4a2

/etc/impsrl
stty 9600 opost onlcr parenb -parodd cs7 ixon ixoff -ixany -istrip clocal tab3
sleep 100000000

The printer is working, but when printing large files (eg: 1-92 pages), the printer is printing page 1-20 and skip some pages (21-49) and going to page number 50-92

Best Regards,
Bill Hassell
Honored Contributor

Re: Direct Printing

The skipped pages are due to handshyake problems. You must configure the printer to send XOFF when it cannot accept more data. This isn't happening so data is being to the printer when it cannot accept any more and it is dropped.


Bill Hassell, sysadmin