From owner-freebsd-questions@FreeBSD.ORG Sat Feb 27 18:49:48 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BBD6106566C for ; Sat, 27 Feb 2010 18:49:47 +0000 (UTC) (envelope-from btillman99@yahoo.com) Received: from web36507.mail.mud.yahoo.com (web36507.mail.mud.yahoo.com [209.191.85.7]) by mx1.freebsd.org (Postfix) with SMTP id 52F698FC08 for ; Sat, 27 Feb 2010 18:49:46 +0000 (UTC) Received: (qmail 65069 invoked by uid 60001); 27 Feb 2010 18:49:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1267296584; bh=cPBFe9wZ1/rPwYtjq2kpLREnxlvG6KstqaGFQp5Vsms=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=T63ONF9unp/on9GXTszbT2slZsfPBffaqzP1ER2vFAf4kvdS1n5EDe77p9hwizFPoW+Co6D3b0Zzc+63l0a0jCQpwg2RcpnR/5gT03Rmr0Q/lBrIDjC3hxseIQNUnF/ABcCf2HynzwGjDfLSDqpOKm+aJp48mmZK8v5/fM7i0IQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=GY7yf8Vc2aDGJ1dggcr+8Fu+1TdtNZsGxUviOe/sTEhj9LUfn0n+oqNfbir4WFl4YhF4B6z0/dUr+EtscFNhlLBMYGPo0aoT4CKhI0cd04HVbuJYgSwiuIIkKU/0IsKTLp0BT+1dzT8C+Zz8iw+Lj4hqklpkPNEjZWZ57uSKEZY=; Message-ID: <198039.64951.qm@web36507.mail.mud.yahoo.com> X-YMail-OSG: UQ2lHEUVM1m9EcecsET_hIcENvjLD7B3Cdq_9GE6tnndai__nqsEK34pihlHFPl0ILaXgUXexJ3cd97BZu1Bmr8bPUW9xpceKTvSzHtTQ5YDAvefe6uK8QuMsfvmWppRYK0t6HeylzUG6izrNmEqg_K8bLoxxawejYuKDok8tRtl.Fv8mbz63Vkp8WYcqx5gXGyQJDQDrJkf3DTcLDz.z8XPOXVuyYO.WgFdiowIIbqgqhexyoQxvp13wFZ.4iGoctL9eDZB0_B4kKTNwz_gDL0r0MsqxeNAD0lROtBo39nysdw3tbik.Khg Received: from [98.242.237.166] by web36507.mail.mud.yahoo.com via HTTP; Sat, 27 Feb 2010 10:49:44 PST X-Mailer: YahooMailClassic/9.2.12 YahooMailWebService/0.8.100.260964 Date: Sat, 27 Feb 2010 10:49:44 -0800 (PST) From: Bill Tillman To: Robert Bonomi MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: RESOLVED: Printing via USB Port X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2010 18:49:49 -0000 --- On Fri, 2/26/10, Robert Bonomi wrote: From: Robert Bonomi Subject: Re: Printing via USB Port To: btillman99@yahoo.com Date: Friday, February 26, 2010, 8:29 PM > From owner-freebsd-questions@freebsd.org=A0 Fri Feb 26 18:20:29 2010 > Date: Fri, 26 Feb 2010 16:19:40 -0800 (PST) > Cc: freebsd-questions@freebsd.org > Subject: Re: Printing via USB Port > > > > > > From: Warren Block > > Subject: Re: Printing via USB Port > > Date: Friday, February 26, 2010, 5:38 PM > > > > On Fri, 26 Feb 2010, Bill Tillman wrote: > > >=20 > > > Thanks again for your valuable input. I have set up lpd printing on m= y old=20 > > > FreeBSD server at least a dozen times and it became a simple routine = to do=20 > > > with apsfilter.Let me see if I can place all my cards in one place an= d=20 > > > 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 al= l"). > > It won't respond to PCL, unlike the one I looked up first, the HL-2060. > > > > Based on http://beej.us/hl2040/: > > > >=A0 % cd /usr/local/libexec > >=A0 % cp ps2pcl ps2hl1250 > > > > Change the line in ps2hl1250 to: > > > > /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=3Dhl1250 -sOutputFile= =3D- - > >=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0=A0=A0^^^^^^ > > And change the if=3D 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 > > Warren, > > Once again many thanks, but that is one of the first things I tried. By= =20 > checking ghostcript's drivers > > #gs -h | grep hl > > I found many drivers for the HL-12xx models. I have used this in my previ= ous=20 > setup with my old parallel server. I actually tried what you suggested an= d it > only worked when using the parallel cable, not the USB. For some reason t= he=20 > USB connection on this and any other FreeBSD server I connect to is DOA f= or > printing. I run mouse and keyboard via USB. But these print jobs are lini= ng=20 > up in the queue and just sit there no matter how many times I reconnect t= he=20 > printer, or reboot it or reboot the computer. And once again I'm seeing t= wo=20 > instances of lpd running when I only launched it from the command-line on= ce, > 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 > lp: >=A0 queuing is enabled >=A0 printing is enabled >=A0 no entries in spool area >=A0 printer idle > > BigDell# > > This just don't make sense and I hope when we find it it's something we c= an >=A0 laugh about. > OK, it's time to try some _basics_.=A0=A0=A0Can you throw data _directly_ a= t the printer (i.e., *NOT* through lpr/lpd), and will it print? You can't use a simple=A0 'echo Hello, World! >/dev/lp' to find out, becaus= e its=20 a fscking 'winprinter'. power everything down, connect the USB cable only, power up the printer fir= st, 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]: =A0 =A0 # /usr/local/libexec/ps2hl1250 < testfile.ps >/dev/usb/lp0 how about:=20 =A0 =A0 # /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=20 parallel port; and when lpd tries tyo print to _that_ -- with only the USB connection, --=A0 it *doesn't*work* (for what is now an 'obvious' reason :) =A0 Okay guys this is finally working. I found the answer here: =A0 http://forums.freebsd.org/showthread.php?p=3D64508 =A0 This didn't come up in my other searches. This morning I put in "freebsd hl= 2040 usb" into my yahoo search and this came up. =A0 Seems this guy got it to work by using unlpt0 not ulpt0. I had tried this b= efore and was using the ifhp filter but that didn't work. So I did this wit= h /etc/printcap: =A0 lp|HL2040|Brother HL-2040:\ =A0=A0=A0=A0=A0=A0=A0 :lp=3D/dev/unlpt0:\ =A0=A0=A0=A0=A0=A0=A0 :af=3D/home/bill/hl1250.ppd:\ =A0=A0=A0=A0=A0=A0=A0 :if=3D/usr/local/bin/foomatic-rip:\ =A0=A0=A0=A0=A0=A0=A0 :lf=3D/var/log/lpd/hl2040.log:\ =A0=A0=A0=A0=A0=A0=A0 :sh:sd=3D/var/spool/lpd/laser: I got the hl1250.ppd file from openprinting.org. I edited the file like the= poster said to do to be sure the gs program was pointed to by it's complet= e pathname. I then installed the foomatic-filter port because the foomatic-= rip program was not on this machine. I also made myself a member of the dea= mon group like this post said, but I don't think this will actually be requ= ired.=20 =A0 I'm in another room doing most of this by ssh to the FreeBSD box with the p= rinter in another part of the house. I ran a postscript file through this a= nd thought I heard the printer ejecting pages down the hall. To my surprise= there were=A0four perfectly formatted pages sitting in the=A0output bin wa= iting for me. =A0 I setup one of the IBM Postscript printers on one of=A0my Windows clients= =A0and pointed it to the lpr port on the FreeBSD server. Then I=A0sent it a= test page and all is well.=A0Now I have=A0got this bitch working=A0and=A0c= an thow the old server and the parallel cable into the closet. =A0 Thanks for everyone's help. Wish this hadn't been so cryptic, but then agai= n this is why my friends who run Linux are always laughing their ass off at= me. =A0=0A=0A=0A