DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

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

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th April 2009
unicyclist unicyclist is offline
Real Name: Mike
Fdisk Soldier
 
Join Date: May 2008
Location: Alaska
Posts: 63
Default 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
Here is the only uncommented portion of /etc/printcap (which I also copied to /etc/LPRng):

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
Apsfilter and FreeBSD worked fine with this printer.

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.
Reply With Quote
  #2   (View Single Post)  
Old 13th April 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 unicyclist View Post
I'm running 4.4 stable and trying to setup my printer (HP DeskJet 870C).
I installed LPRng
Why did you install LPRng spooling system? Are you going to run printer printer server with 500 printers and 30 different user groups?
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.

Quote:
Originally Posted by unicyclist View Post
and then for more filtering, installed apsfilter.
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:
Originally Posted by unicyclist View Post
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
If you were using native LPD which I strongly advise you to do you will
add yourself to daemon group as in

Code:
more /etc/group
daemon:*:1: daemon,oko
Then change the group for /dev/lpt0 if that is device node where the printer is connected.

Code:
chgrp daemon /dev/lpt0
Then edit permission to

Code:
chmod 0664 /dev/lpt0
So finally it will look something like

Code:
 ls -l /dev/lpt0
crw-rw-r--  1 root  daemon   16,   0 Apr 11 18:13 /dev/lpt0


Quote:
Originally Posted by unicyclist View Post
# APS1_BEGINrinter1
# - 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
Make sure also you have correct permissions on spool/lpd

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:
If you promise yourself not to send anything to your printer but PostScript files you can get a way with the following printcap

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:
Where lpfilter-ps is my home made PostScript filter (script) which must have permission 0775
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
Replace ljet4 with the name of the driver for your printer and papersize
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.
Reply With Quote
  #3   (View Single Post)  
Old 13th April 2009
unicyclist unicyclist is offline
Real Name: Mike
Fdisk Soldier
 
Join Date: May 2008
Location: Alaska
Posts: 63
Default

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.
Reply With Quote
  #4   (View Single Post)  
Old 13th April 2009
unicyclist unicyclist is offline
Real Name: Mike
Fdisk Soldier
 
Join Date: May 2008
Location: Alaska
Posts: 63
Default

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.
Reply With Quote
  #5   (View Single Post)  
Old 14th April 2009
unicyclist unicyclist is offline
Real Name: Mike
Fdisk Soldier
 
Join Date: May 2008
Location: Alaska
Posts: 63
Default

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.
Reply With Quote
  #6   (View Single Post)  
Old 1st May 2009
unicyclist unicyclist is offline
Real Name: Mike
Fdisk Soldier
 
Join Date: May 2008
Location: Alaska
Posts: 63
Default

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.
Reply With Quote
  #7   (View Single Post)  
Old 1st May 2009
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

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''.
Reply With Quote
  #8   (View Single Post)  
Old 1st May 2009
unicyclist unicyclist is offline
Real Name: Mike
Fdisk Soldier
 
Join Date: May 2008
Location: Alaska
Posts: 63
Default

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.
Reply With Quote
  #9   (View Single Post)  
Old 1st May 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 unicyclist View Post
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.
I am afraid I will be repeating myself but here is the small list.

Lexmark 120n (entry level Monochrome) around $70. Better go for entry level group work E320 and similar. You can get them for around $100.
Brother 5240 (Group work Monochrome) I found in my local Office Max open box for $105. Really very, very good printer. DeLL 1710n (re-branded Lexmark) you can get used on Ebay with really low page count for around $65. We had them at the University of Arizona. We printed at least 10 000 pages per printer per month.

Any HP mid and high level Laser Monochrome will speak Post Script. Stay a way from cheap HP LJ 1005-1010. They are peace of junk. The old once LJ6, LJ5 are really, really good. Those are the best printers ever made.

Any Lexmark laser printer speaks Post Script. Anything Brother HL 5000 and above. Stay away from 2000 series.

I have wonderful experience with Xerox color Laser Printers. Unfortunately they retail for over $1000.
For home users I like HP 1500 series color Laser. You can get them starting at $200. One could argue that for occasional color printing inkjets are more economical. I had HP Office Jet R65 and OfficeJet R80. They have HUGE
cartridges that you can refill in Walgreens for $10. They are really best inkjets I have ever seen as long as you can find one in decent condition on Craigslist.



I hope you are not using other OS for scanning because OpenBSD rocks as a scanner server.
I have couple of Epson flat bad scanners. They are really, really good even if you are professional photographer let alone you need them for office documents. HPs are so so.

I would not take anything made by Canon. (printers,scanners you name it).
That is just junk.

Last edited by Oko; 1st May 2009 at 07:19 PM.
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
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


All times are GMT. The time now is 05:06 PM.


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