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 ConnectedCharacters 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/ttyB0Tries 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 printcapfile 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:\ :sh:lp=/dev/ttyB0:br#9600:tr=\f:of=/usr/libexec/lpr/lpfilter\ :sd=/var/spool/output/lpd:lf=/var/log/lpd-errs: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 withoutany 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. <woods%planix.ca@localhost>
Description: This is a digitally signed message part