|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Problem with printing [solved]
I'm running 4.4 stable and trying to setup my printer (HP DeskJet 870C).
I installed LPRng and then for more filtering, installed apsfilter. Apsfilter printed a nice test page, but now if I try to print with either lpr or in mutt (using lpr), I get absolutely nothing. Checking with lpc or lpq, I see "Can't open /dev/lpt0 Permission denied" and under lpq part of the line reads "Errors...too many errors". Code:
ls -l /dev/lpt* has: crw------- 1 root wheel 16, 0 Apr 11 22:39 /dev/lpt0 crw------- 1 root wheel 16, 1 Mar 7 20:43 /dev/lpt1 crw------- 1 root wheel 16, 2 Mar 7 20:43 /dev/lpt2 Code:
# APS1_BEGIN:printer1 # - don't delete start label for apsfilter printer1 # - no other printer defines between BEGIN and END LABEL lp|pcl3/unspec;r=300x300;q=medium;c=gray;p=letter;m=auto:\ :lp=/dev/lpt0:\ :if=/etc/apsfilter/basedir/bin/apsfilter:\ :sd=/var/spool/lpd/lp:\ :lf=/var/spool/lpd/lp/log:\ :af=/var/spool/lpd/lp/acct:\ :mx#0:\ :sh: # APS1_END - don't delete this Any ideas what is wrong or what I'm missing? Thanks Last edited by Carpetsmoker; 15th April 2009 at 05:39 PM. Reason: Please use [code][/code] tags for system output, configuration, etc. |
|
||||
Quote:
LPD in the base is completely sufficient for a home user including light network printing. LPRng is based on the same LPD protocol but it was used in 90s for enterprise level printing. It is obsolete. Presently, CUPS with all its weaknesses is de facto standard for enterprise printing. The only new thing that CUPS brings is that supports IPP (Internet Printing Protocol) besides LPD. On the another hand CUPS is very, very complicated peace of software which is extremely hard to trouble shoot. Very good. Apsfilter is excellent text filter. It does two things. Lets you edit printcap using GUI script. Secondly, it magically guess what kind of files you are sending to printer and pass them to appropriate post script filter before sending them to driver. For instance if you send PDF file it passes the file through pdf2ps and then sends PostScript file to printer if the printer is capable of speaking PostScript language or to Ghostscript driver which filters PostScript documents to the low level printer language understandable to your printer (very commonly PCL printer command language). Quote:
add yourself to daemon group as in Code:
more /etc/group daemon:*:1: daemon,oko Code:
chgrp daemon /dev/lpt0 Code:
chmod 0664 /dev/lpt0 Code:
ls -l /dev/lpt0 crw-rw-r-- 1 root daemon 16, 0 Apr 11 18:13 /dev/lpt0 Quote:
Code:
# cd /var/spool/lpd # mkdir lp # chown daemon:daemon lp # chmod 770 lp You could use Magicfilter on FreeBSD to achieve the same functionality. Magicfilter is not ported to OpenBSD. I personally recommend Foomatic filter presently over apsfilter since it apsfilter is little bit stale project and the only advantage it offers is that has that "GUI" script. Code:
# $OpenBSD: printcap,v 1.4 2003/03/28 21:32:30 jmc Exp $ lp|Lj4L|HP Lj4L:\ :lp=/dev/lpt0:\ :af=/etc/foomatic/HP-LaserJet_4L-ljet4.ppd:\ :if=/usr/local/bin/foomatic-rip:\ :sh:sd=/var/spool/output:\ :lf=/var/log/lpd-errs: Photosmart|HP|HP Photosmart 5250:\ :lp=/dev/ulpt0:\ :af=/etc/foomatic/HP-PhotoSmart_C5200.ppd:\ :if=/usr/local/bin/foomatic-rip:\ :sh:sd=/var/spool/output:\ :lf=/var/log/lpd-errs: Code:
lp|local|HP:\ :lp=/dev/lpt0:\ :sd=/var/spool/output:\ :lf=/var/log/lpd-errs: :sh:mx#0:if=/usr/local/libexec/lpfilter-ps: and looks like this Code:
#!/bin/sh # Treat LF as CR+LF printf "\033&k2G" || exit 2 # Print the postscript file /usr/local/bin/gs -dSAFER -dBATCH -dQUIET -dNOPAUSE -q -sDEVICE=ljet4 \ -sOutputFile=- -sPAPERSIZE=letter - && exit 0 exit 2 with a4 if you live outside of US. Finally a few comments about LPRng. It was abandoned by its creator Patrick Powell in 2005 after 20 years of development and picked by somebody else in 2006. It is much harder to use than CUPS for enterprise printing in its present form on OpenBSD since GUI interface LPRngTool for LPRng has never been ported to OpenBSD. There is a special filter IFHP Filter written for LPRng which has never been ported to OpenBSD. It was unmaintained for a long time. I know that LPRng does not require IFHP so you should be able to use foomatic-filter( http://enc.com.au/docs/lprngfoo.html ) . Unfortunately foomatic-configure currently cannot handle printcap files in the lprng style. As lprng can use BSD style printcaps this is not much of a problem, as long as the GUI based print manager lprngtool is not used. On the bright side I just noticed that LPRng web-site has been updated and that the the new version LPRng-3.8.33 has been released March 17th. Hopefully, LPRng can kick some CUPS ass. Last edited by Oko; 13th April 2009 at 02:41 AM. |
|
|||
Thank-you very much for all the info.
My printer is just a pcl home printer. Nothing business, commercial, etc, and I thought LPRng was "newer" and the native LPD. I am not good at creating my own /etc/printcap, so thought/assumed LPRng and/or apsfilter would help me getting the printer working with OpenBSD, and I do not want to use cups It's starting to get late here, so I may just read your post a few times and "chew" on it till tomorrow after work. Or perhaps if I think I do what you wrote, try it tonight. Either way, I'll be back with what I've done and how it went ASAP. Thanks again. I really appreciate it. |
|
|||
I can now print
About to head to work, but I changed everything but my printcap to test the printer. It works with mutt and with "lpr somefile". I'll get to my printcap after work. Again, thanks for your help. btw- I also have an HPLJ4L connected to another machine. |
|
|||
Since 4.5 will be out in 2 1/2 weeks, I'll start with a new system and impliment what you wrote Oko.
For now, with the printer working and all the programs installed, I'll just leave well enough alone lest I mess things up again Thanks again. |
|
|||
Oko, I have a new 4.5 installed and followed your directions and so far everything works!
Thank-you so much for your post. Now that I've edited my /etc/printcap file a few times, it is getting easier to understand No more booting into other system(s) to print something. |
|
||||
The hard part of UNIX printing, is finding a decent printer in your price range ;-)
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
Need to buy a nice postscript printer.
Some time ago I bought a new Brother HL1440, and then was given the DJ870Cxi and a HP4JL. Guess those will last for quite some time since they are just used for home stuff. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Poster printing program | map7 | FreeBSD Ports and Packages | 3 | 7th November 2010 07:41 PM |
Boot problem. Geometry problem? | gulanito | FreeBSD Installation and Upgrading | 0 | 3rd July 2009 03:03 AM |
Newbie-friendly "printing in OpenBSD" guide wanted | Shagbag | OpenBSD Packages and Ports | 5 | 7th July 2008 09:26 PM |