Printing via USB Port
btillman99 at yahoo.com
Sat Feb 27 13:12:11 UTC 2010
--- On Fri, 2/26/10, Robert Bonomi <bonomi at mail.r-bonomi.com> wrote:
From: Robert Bonomi <bonomi at mail.r-bonomi.com>
Subject: Re: Printing via USB Port
To: btillman99 at yahoo.com
Date: Friday, February 26, 2010, 8:29 PM
> From owner-freebsd-questions at freebsd.org Fri Feb 26 18:20:29 2010
> Date: Fri, 26 Feb 2010 16:19:40 -0800 (PST)
> Cc: freebsd-questions at freebsd.org
> Subject: Re: Printing via USB Port
> > From: Warren Block <wblock at wonkity.com>
> > Subject: Re: Printing via USB Port
> > Date: Friday, February 26, 2010, 5:38 PM
> > On Fri, 26 Feb 2010, Bill Tillman wrote:
> > >
> > > Thanks again for your valuable input. I have set up lpd printing on my old
> > > FreeBSD server at least a dozen times and it became a simple routine to do
> > > with apsfilter.Let me see if I can place all my cards in one place and
> > > perhaps we can find the bug.
> > I think I found it. The HL-2040 is a GDI printer, aka winprinter (aka "oh no,
> > one of those", aka "I guess I didn't really want to print that after all").
> > It won't respond to PCL, unlike the one I looked up first, the HL-2060.
> > Based on http://beej.us/hl2040/:
> > % cd /usr/local/libexec
> > % cp ps2pcl ps2hl1250
> > Change the line in ps2hl1250 to:
> > /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=hl1250 -sOutputFile=- -
> > ^^^^^^
> > And change the if= line in the printcap to refer to ps2hl1250.
> > (And remember, buying winprinters just encourages them to make more.)
> > -Warren Block * Rapid City, South Dakota USA
> Once again many thanks, but that is one of the first things I tried. By
> checking ghostcript's drivers
> #gs -h | grep hl
> I found many drivers for the HL-12xx models. I have used this in my previous
> setup with my old parallel server. I actually tried what you suggested and it
> only worked when using the parallel cable, not the USB. For some reason the
> USB connection on this and any other FreeBSD server I connect to is DOA for
> printing. I run mouse and keyboard via USB. But these print jobs are lining
> up in the queue and just sit there no matter how many times I reconnect the
> printer, or reboot it or reboot the computer. And once again I'm seeing two
> instances of lpd running when I only launched it from the command-line once,
> no entry in /etc/rc.conf.
> BigDell# ps -ax | grep lpd
> 1311 ?? Is 0:00.00 lpd
> 1329 ?? IE 0:00.00 lpd
> BigDell# lpq
> no entries
> BigDell# lpc status all
> queuing is enabled
> printing is enabled
> no entries in spool area
> printer idle
> This just don't make sense and I hope when we find it it's something we can
> laugh about.
OK, it's time to try some _basics_. Can you throw data _directly_ at the
printer (i.e., *NOT* through lpr/lpd), and will it print?
You can't use a simple 'echo Hello, World! >/dev/lp' to find out, because its
a fscking 'winprinter'.
power everything down, connect the USB cable only, power up the printer first,
then the computer.
When it has come up, do you have a /dev/usb/lp0 device?
Have you created a symlink at /dev/lp that points to /dev/usb/lp0?
What happens if you do (as root) where 'testfile.ps' is a simple Postscript doc]:
# /usr/local/libexec/ps2hl1250 < testfile.ps >/dev/usb/lp0
# /usr/local/libexec/ps2hl1250 < testfile.ps >/dev/lp
For that matter, what does "find /dev -name '*lp*' -ls" show?
If any of the names show as symlinks, do an 'ls -l' on the symlink target.
I'm guessing that /dev/lp is a 'character device' node, pointing to the
parallel port; and when lpd tries tyo print to _that_ -- with only the USB
connection, -- it *doesn't*work* (for what is now an 'obvious' reason :)
Thanks for your reply. I hate to be such a noob about this but USB and FreeBSD don't ever seem to work right for me.
I tried the echo method
# echo Hello > /dev/lp
/dev/lp: Operation not supported.
So I then tried
# echo Hello > /dev/ulpt0
and I got an empty prompt until I pressed Ctrl+c to exit.
I disconnected everything except the keyboard which is PS2 and the monitor and rebooted the printer and computer allowing the printer to come up first. When I did a directory on the /dev/usb folder this is what shows up:
BigDell# ll /dev/usb/
crw------- 1 root operator 0, 72 Feb 27 07:40 0.1.0
crw------- 1 root operator 0, 76 Feb 27 07:40 0.1.1
crw------- 1 root operator 0, 94 Feb 27 02:40 0.2.0
crw------- 1 root operator 0, 96 Feb 27 02:40 0.2.1
crw------- 1 root operator 0, 97 Feb 27 02:40 0.2.2
crw------- 1 root operator 0, 87 Feb 27 02:40 0.3.0
crw------- 1 root operator 0, 89 Feb 27 02:40 0.3.1
crw------- 1 root operator 0, 100 Feb 27 02:40 0.3.2
crw------- 1 root operator 0, 74 Feb 27 07:40 1.1.0
crw------- 1 root operator 0, 77 Feb 27 07:40 1.1.1
I'm not so sure this is what we call a Windows printer. Maybe I'm off base there but by that if you mean it's not a real printer and relies on Windows to do most of it's work then I can't say. What I can say is that this printer worked perfect under FreeBSD with the parallel connection and a simple setup with apsfilter to use the HL-1250 drivers. And it did print a few things yesterday from the command line using the parallel connection. I sent some postscript files through the ifhp filter from the /usr/share/examples/printing/ folder and just changed the device from the DJ500 to HL1250.
BigDell# find /dev -name '*lp*' -ls
45 0 crw------- 1 root wheel 0, 45 Feb 27 07:40 /dev/lpt0
46 0 crw------- 1 root wheel 0, 46 Feb 27 07:40 /dev/lpt0.ctl
98 0 crw-r--r-- 1 root operator 0, 98 Feb 27 07:49 /dev/ulpt0
99 0 crw-r--r-- 1 root operator 0, 99 Feb 27 02:40 /dev/unlpt0
No symlinks found in this search.
BigDell# /usr/local/libexec/ifhp < /tmp/ntpdate.ps > /dev/lp
/dev/lp: Operation not supported.
BigDell# /usr/local/libexec/ifhp < /tmp/ntpdate.ps > /dev/ulpt0
This last one gives me an empty prompt waiting for more input I guess until I press Ctrl+c to exit.
I wonder how this would play out on a 7.2-STABLE machine. I have one handy and will test it out next. I've been told that USB was completely rebuilt from 7.x to 8.x.
More information about the freebsd-questions