DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 20th February 2009
da1 da1 is offline
Fdisk Soldier
 
Join Date: Feb 2009
Location: Berlin, DE
Posts: 49
Default Freebsd and Brother HL-2032 laser printer

hell-o ppl

I have been struggling for some time now with a Brother HL-2032 laser printer. tryed cups, afsfilter, but eventualy failed.
So I'm trying a diferent approach to the situation but need some help.

First of all, when I plug in the printer (usb) BSD "sees" it as ulpt0 in dev with rootperator own and 644 privileges (thats rw-r-r). Now first of all my printcap file has a single line like so:
Code:
brother|hl-2032:rm=da1.ro:rp=brother
that was leftover by cups. Now, assuming that's corect, should't
Code:
echo "whatever" >> /dev/ulpt0
print something? It just returns fine the prompt (meaning all worked well). Also tryed echo to unlpt0, but same efect.
On Windows the printer works fine but, I have a small network setup here and would benefit from the printer being conected to the bsd box, as it acts as a NAS, firewall, gateway and some other devilish things.
Reply With Quote
  #2   (View Single Post)  
Old 23rd February 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

Does the HL-2032 appear in the driver directory of apsfilter ( /etc/apsfilter/basedir/driver) ?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 23rd February 2009
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

Quote:
Originally Posted by J65nko View Post
Does the HL-2032 appear in the driver directory of apsfilter ( /etc/apsfilter/basedir/driver) ?
No it is not going to show up. But you are on the right track. Most of those
cheap Laser printers produced by Brother are supported by Ghostscript
drivers hl1240 and hl1250. I could not find HL-2032 printer listed on the
Linux printers data base but I found that HL-2030 is supported by by hl1240
driver. He needs to make sure that has the latest version of Ghostscript since there was a bug in Ghostscript and one of these drivers was accidentally removed from
the package.

Code:
gs -h
Will list you the list of drivers in the Ghostscript package installed on your computer.

I didn't want to get involve into discussion as I got sick as soon as I read that he replaced LPD with CUPS. I suspect that he probably didn't replace LPD commands with CUPS commands. I just do not want to think about CUPS unless it is necessary for enterprise printing.

Long story short if you have nerves you can help him.
The easiest way is as you said to use apsfilter and select particular
device driver which I told you. The other way would be to use the script
that comes with Ghostscript to create input filter and then to edit printcap
file with a location of it.

This would be helpful reading

http://www.freebsd.org/doc/en_US.ISO...d.html#AEN1106


The reason that he didn't get anything by sending things with echo is probably that he didn't replace lpr from LPD with lpr from cups which is
unnecessary to begin with. Secondly he needs to do testing with

Code:
lptest >/dev/ulpt0
which will work only if his printer can print ASCII code out of box.
That is very likely as those cheap Brothers are actually good printers.

Last edited by Oko; 24th February 2009 at 01:12 AM.
Reply With Quote
  #4   (View Single Post)  
Old 26th February 2009
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Default

openprinting.org recommends the hl1240 driver. It seems, from the listings of possibles, though, that they support a version of hp's PCL, so your options are good.
openprinting.org (which used to be linuxprinting.org) is always a good first stop to find out about getting printers to work, even if you don't use their foomatic system.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
  #5   (View Single Post)  
Old 11th March 2009
da1 da1 is offline
Fdisk Soldier
 
Join Date: Feb 2009
Location: Berlin, DE
Posts: 49
Default

Quote:
Originally Posted by J65nko View Post
Does the HL-2032 appear in the driver directory of apsfilter ( /etc/apsfilter/basedir/driver) ?
well no, but 2030 family is suported by hl1240 and that actually appears to exist. So does hl1250.

Also openprinting.org had a PPD file for hl1024 wich I downloaded and used with cups, all went ok, test pages printed out ok, but after a reboot of the bsd box nothing worked and I had to retrace my steps, reproduce the errors I thought I made.... etc; long story short it doesn't work anymore.


Quote:
Originally Posted by Oko View Post
He needs to make sure that has the latest version of Ghostscript
I have installed GhostScript8-nox11.

Code:
gs -h
yup, hl1240 and hl1250 appear to be in the list


Quote:
The easiest way is as you said to use apsfilter and select particular
device driver which I told you.
Acting uppon this I installed GS8 and apsfilter 7 (latest versions of these 2 apps). Now, when i run SETUP script for apsfilter it tells me it found GS8 and that I should upgrade to at least version 6 and gives me a choice to continue, but must install GS7 first, or exit. will look into this later. Am simply laying out where I stand with this problem of mine.


Quote:
The other way would be to use the script
that comes with Ghostscript to create input filter and then to edit printcap
file with a location of it.
maybe....


Quote:
This would be helpful reading

http://www.freebsd.org/doc/en_US.ISO...d.html#AEN1106
yup, will start reading it again, as will I do with all of the printing pages of the manual...again


Quote:
The reason that he didn't get anything by sending things with echo is probably that he didn't replace lpr from LPD with lpr from cups which is
unnecessary to begin with.
aha, your right, didn't do that...

Quote:
Secondly he needs to do testing with

Code:
lptest >/dev/ulpt0
well, that doesn't work just yet, but I espect it to be normal as I have not configured a darn thing, just installed GS and apsfilter.

Quote:
which will work only if his printer can print ASCII code out of box.
That is very likely as those cheap Brothers are actually good printers.
well, good or bad it has never failed me fo far


Thanks for all of your answers, and sorry it took me so long to answer but for some reason I received no mail that someone posted in this thread.
Now that it's morning it's time for me to go to bed, and sleep the day off. Will start reading and testing stuff latter this day and will keep you posted.
Reply With Quote
  #6   (View Single Post)  
Old 12th March 2009
queenorych queenorych is offline
New User
 
Join Date: Mar 2009
Posts: 1
Default

I have a Brother 5240 and just use the HP PCL support with gs.

My printcap says:
lp|brother:\
:lp=:rm=192.168.1.2\
:rp=L1:sd=/var/spool/brother:\
:lf=/var/log/lpd-errs:\
:sh:\
:if=/usr/local/bin/lppsfilter:

and my /usr/local/bin/lppsfilter has:
/usr/local/bin/gs -q -dNOPAUSE -sDEVICE=pxlmono -sOutputFile=- -

postscript printer works great. I never bothered to get asci working, as I never use it personally. There are pleanty of examples on how to setup another ascii printer or use some detection method.

don't forget to create the spool directory.

I love my brother printer. The best $50 I've spent in a while!
Reply With Quote
  #7   (View Single Post)  
Old 12th March 2009
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

Quote:
Originally Posted by queenorych View Post

My printcap says:
lp|brother:\
:lp=:rm=192.168.1.2\
:rp=L1:sd=/var/spool/brother:\
:lf=/var/log/lpd-errs:\
:sh:\
:if=/usr/local/bin/lppsfilter:

and my /usr/local/bin/lppsfilter has:
/usr/local/bin/gs -q -dNOPAUSE -sDEVICE=pxlmono -sOutputFile=- -
I never bothered to get asci working, as I never use it personally.
That is the easiest way to do it although in your case I think your printer even speaks Post Script. Check one more time. Lots of Brother HL printers from series 5000 and above are full Post Script printers.

Now back to your Post Script filter. Actually to be precise it should be something like this.
Code:
#!/bin/sh
# Treat LF as CR+LF
printf "\033&k2G" || exit 2
# Print the postscript file
/usr/pkg/bin/gs -dSAFER -dBATCH -dQUIET -dNOPAUSE -q -sDEVICE=cdj550 \
-sOutputFile=- -sPAPERSIZE=a4 - && exit 0
exit 2
Just change the device driver cdj550 with your driver and the paper size a4 with letter if you live in U.S.A. The above script should have permission 0775. It must be executable by daemon and user from the daemon group.
Printcap as you said should look like
Code:
ps|Ghostscript driver:\
        :lp=/dev/lpa0:sd=/var/spool/lpd/ps:lf=/var/log/lpd-errs:\
        :mx#0:sh:if=/usr/local/libexec/lpfilter-ps:
Note that mx#0 is very important because post script files are usually huge. You correctly pointed out the importance of spooling directory with correct permissions. The above is described in NetBSD printer documentation. BSDs come with built in ASCII filter which is described in FreeBSD handbook. You do not need it. a2ps (filter) or enscript will convert ASCII to PostScript and you are good to go. I like very much what you did.
As I mentioned in one of my earlier messages Ghostscript comes which the script which can help you generate above filter. FreeBSD documentation (corporate guide chapter 8th talks about it).

I think you can use above also with hplip drivers and Guthenprint. It is just enough to substitute hpijs as a device name. I never used Guthenprint so I would not know if it works with it but I think it should. The only "problem" with the described approach is that if you send let say dvi or pdf file printer will remain mute.

Thus we come to the concept of text filters. Examples are apsfileter (with which I am very familiar) and magicfilter (not even ported to OpenBSD which I use). These filters are doing one more thing to you. They are able to recognize file type sent to the printer and convert it to post script file before sending to the driver. The converters are as you could expect. a2ps for ASCII. dvips for dvi to ps and pdf2ps for pdf to ps. Image Magic and in particular its command line utility convert is also very useful for various image files.


And speaking of warning of apsfilter regarding the Ghostscript version. Ignore it. It is actually little stale project so apsfilter see new versions of Ghostscript as outdated. So some Perl scripts which make apsfilter need to be updated but other than that apsfilter is ROCK solid. As I said I have no experience with magic filter which is hard coded in C.

Last edited by Oko; 14th March 2009 at 03:27 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printer dont take rights mururoa FreeBSD General 3 5th October 2009 12:54 PM
FBSD 7.1 and Canon LBP-660 Printer Calderon FreeBSD General 8 4th May 2009 07:04 AM
Printer setup question JMJ_coder NetBSD General 12 6th November 2008 12:04 AM
IP Printer Setup kjemison FreeBSD General 4 2nd June 2008 02:35 PM
Cups + USB-Printer nihonto OpenBSD Packages and Ports 3 21st May 2008 07:49 PM


All times are GMT. The time now is 04:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick