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.

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.

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.

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.

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

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.

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.

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.

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

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.