1822320 Members
5638 Online
109642 Solutions
New Discussion юеВ

Serial Printer Setup?

 
Steven Krippner
New Member

Serial Printer Setup?

I've been tasked with setting up a backup label printer for our shipping department. I was able to locate one of our old Intermec printers that can do the job, but unfortunately it's only got a serial port.

I'd like to hang this printer off of one of our HP-UX boxes so that our manufacturing system can print to it without me having to find some kind of serial-to-ethernet converter to set up a print queue.

I have the printer set on the primary serial port (COM1) using the recommended serial cable, which, when connected to my laptop, works just fine. I've configured the printer with what I assume is UNIX's standard 96008N1 but it doesn't seem to work, so I have to assume there's a setting problem. Putting the printer into its debug mode (where sent characters will print with their corresponding ASCII value) yields '0's rather than the sent characters. Again, sounds like communications problem to me.

Now, I've never had to dabble with serial communication settings in UNIX much, so my knowledge is quite minimal. And unfortunately the internet is especially unhelpful, as it seems no one does serial printers anymore, and all of the other "serial+unix" documentation I find talks about setting up serial consoles, something I don't want or care about in this case.

So I was hoping someone could point out to me how to set up the serial port properly, as there seems to be much confusion on my part as to how to get this done. Once I'm talking to the printer properly using the /dev/tty0p0 device using echo, I think I can get the LP side of things set up.

So if anyone could give me a brain dead primer on how to configure a serial port under HP-UX, I'd be much obliged.
Thanks!
2 REPLIES 2
Bill Hassell
Honored Contributor

Re: Serial Printer Setup?

> what I assume is UNIX's standard 96008N1

HP-UX standard is 300 baud, odd parity, 2 stop bits. The problem is that using stty to set the comm values lasts only long enough to issue the stty command. Once the port is closed by stty, the default settings come back. Do something like this:

sleep 9999 < /dev/tty0p0 &
stty raw BBBB -parenb cs8 ixon -istrip clocal < /dev/tty0p0

Now you should be able to use ux2dos (required) to print to the printer as in:

ux2dos /etc/fstab > /dev/tty0p0

This will verify the connection. Like the PC, you must use a printer serial cqabloe and not a modem serial cable (which is incompatible). Then when the printer is working, just add the printer using sam and the "dumb" model script. After adding the printer, cd to the /etc/lp/interface directory and edit the printer's script -- uncomment the stty commands at thye top and bottom of the script.


Bill Hassell, sysadmin
Steven Krippner
New Member

Re: Serial Printer Setup?

Thanks Bill, your stty command helped me out.
It turns out that in my printer definition I originally set up (in /var/spool/lp/model, btw) I had neglected to remove the default "/dev/null" port description for the serial printer. So, had I actually read ALL of the script, I would have gotten it working from the get-go.

Thanks for your help!