Port-alpha archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Configuring Serial Printer - DEC 3000 Model 700 / NetBSD V4.0

First off, let me just say that the LPD code is a rather horrible nightmare of mediocrity and totally missing functionality when it comes to error detection, reporting, and handling.

There are a bunch of flat-out bugs too, esp. with handling state with drivers, IIRC.

I've got a set of patches from way back that try to address some of the problems. I've only ever used my hacked version to print over parallel and network ports. (I haven't used a serial printer since the SysV days on a 3b2) I could post some working sources and see if they help any if you're interested..... Someday I should try moving my changes forward to current code again to see what's still necessary.

But specifically:

On 6-Dec-2008, at 4:23 PM, Micheal H. McCabe wrote:

# cu -s 9600 -l /dev/ttyB0

Characters typed on the console are transmitted to the printer. I believe that this confirms that the port, cable, and printer are all functional.

Yup, if it prints what you type then all is well at that level -- or at least almost...

Now things get a little weird...

#lptest 75 5 > /dev/ttyB0

Does absolutely nothing.

I don't think that should even work without a wrapper setting proper tty modes....

Something like this might work, with the dots replaced by all the necessary mode flags:

        ( stty .....; lptest 75 5 ) < /dev/ttyB0 > /dev/ttyB0

(the trick here is that the subshell must have its stdout _and_ stdin connected to the tty so that the stty command will set the necessary flags and then the lptest command will use the same file descriptor to write to the tty, otherwise the tty will be closed between commands and the flags set by stty will revert to the defaults before the lptest command reopens the tty; stdin is needed because that's what stty operates on by default)

# cat Test.Substances > /dev/ttyB0

Tries to print the file, it generates the "stairstep" effect that an lp filter should correct. When the printer buffer gets full, everything stops.
Subsequent output is lost.

Similarly this won't necessarily work properly without setting the proper tty modes on the port connected to the printer.

In particular you're certainly missing XON/XOFF or some other form of flow control working properly, though this could be a problem on either the port's settings or the printer, or both.

Again, following the instructions in the NetBSD guide, I setup my printcap
file as follows:

#       $NetBSD: printcap,v 1.13 2006/10/08 15:28:49 elad Exp $
#       from: @(#)printcap      8.1 (Berkeley) 6/9/93

lp|local line printer:\

This entry is based on the "decwriter over a tty line" entry. I understand that some tty flags may have to be set or cleared to allow operation without full modem control. I've experimented with a number of settings without
any success, so those entries are currently removed.

The directory has been created and chmod'd as follows:

# cd /var/spool/lpd

According to your printcap that should be:  /var/spool/output/lpd

                                        Greg A. Woods; Planix, Inc.

Attachment: PGP.sig
Description: This is a digitally signed message part

Home | Main Index | Thread Index | Old Index