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 13th July 2015
rarebird rarebird is offline
Port Guard
 
Join Date: Jun 2015
Posts: 15
Default Printing problems with Canon PIXMA iP4600

I have never set up printers or printed on a UNIX system before. Yesterday I decided it was about time I learned so I grabbed my Canon PIXMA iP4600 USB ink jet printer and plugged it in my OpenBSD 5.7 machine.
I followed the instructions laid out by Oko in this thread: http://daemonforums.org/showthread.php?t=8710
but I had no easy luck.

For now, I want to be able to print text, pdf and ps files on my USB printer attached to a desktop machine using the LPD framework.

Here are the things I did:

Code:
# dmesg | grep ulpt0
ulpt0 at uhub1 port 2 configuration 1 interface 0 "Canon iP4600 series" rev 2.00/1.07 addr 2
ulpt0: using bi-directional mode
Set the permissions on the printer device:
Code:
# chmod daemon:daemon /dev/ulpt0
crw-rw-rw-  1 daemon  daemon     64,   0 Jul 12 18:39 ulpt0
According to OpenPrinting my device needs gutenprint drivers, so add those and bring in some filters too:
Code:
# pkg_add gutenprint
# pkg_add a2ps
Enable lpd(8):
Code:
# echo 'lpd_flags=""' >> rc.conf.local
Add the printer to printcap(5):
Code:
# vi /etc/printcap
lp|Canon-iP4600|Canon-PIXMA-iP4600:\
        :sh=:\
        :lp=/dev/ulpt0:\
        :if=/etc/foomatic/direct/printconv.sh:\
        :sd=/var/spool/output/Canon-iP4600:\
        :lf=/var/log/lpd-errs:
Leave a blank line at the end of the printcap(5) (according to Absolute OpenBSD, Ch. 16) and restart the computer or run:
Code:
# /etc/rc.d/lpd restart
after making any changes to the printcap(5).

Code:
# mkdir /var/spool/output/Canon-iP4600
# chown daemon:daemon /var/spool/output/Canon-iP4600
# mkdir -p /etc/foomatic/direct/ 
# cd /etc/foomatic/direct/
Find the printer model name and available drivers:
Code:
# foomatic-ppdfile -P Canon-PIXMA-iP4600
Canon PIXMA-iP4600 Id='Canon-PIXMA-iP4600' Driver='No Default Driver' CompatibleDrivers='gutenprint gutenprint-ijs-simplified.5.2 gutenprint-ijs.5.2 '
Canon iP4600-series Id='Canon-iP4600-series' Driver='No Default Driver' CompatibleDrivers='gutenprint-ijs-simplified.5.2 gutenprint-ijs.5.2 '
Generate all possible PPD files for the printer:
Code:
# cd /etc/foomatic/direct/
# foomatic-ppdfile -p Canon-PIXMA-iP4600 -d gutenprint-ijs.5.2 > Canon-PIXMA-iP4600-ijs.ppd
# foomatic-ppdfile -p Canon-PIXMA-iP4600 -d gutenprint-ijs-simplified.5.2 > Canon-PIXMA-iP4600-ijs-simplified.ppd
# foomatic-ppdfile -p Canon-iP4600-series -d gutenprint-ijs.5.2 > Canon-iP4600-series-ijs.ppd
# foomatic-ppdfile -p Canon-iP4600-series -d gutenprint-ijs-simplified.5.2 > Canon-iP4600-series-ijs-simplified.ppd
Create the input filter specified by the if= printcap(5) field:
Code:
# vi printconv.sh
#!/bin/sh

/usr/local/bin/a2ps -BRq --columns=1 -o - | \
        /usr/local/bin/foomatic-rip -P Canon-PIXMA-iP4600-ijs-simplified --ppd \
        /etc/foomatic/direct/Canon-PIXMA-iP4600-ijs-simplified.ppd

# chmod +x printconv.sh

Code:
# lpr text.txt
The printer does not flinch except IIRC lpd(8) restarting the device and leaving:
Code:
ulpt0 detached
ulpt0 at uhub1
port 2 configuration 1 interface 0 "Canon iP4600 series" rev 2.00/1.07 addr 2
ulpt0: using bi-directional mode
at the console.


Code:
# cat /var/log/lpd-errs
See attachment 1.
According to lpd-errs I am doing just fine:
Code:
# tail -3 /var/log/lpd-errs
INFO: ijsgutenprint Ready to print.
DEBUG: ijsgutenprint: printed total 3314115 bytes
DEBUG: ijsgutenprint: server exiting with status 0
I have no idea what all the DEBUG messages in this file mean but first one grabs my attention:

Code:
# head /var/log/lpd-errs
[date] [hostname] lpd[10001]: restarted
DEBUG: Color Manager: Invalid printer name.
'CM Color Calibration' Mode in SPOOLER-LESS: Off
[stdin (plain): 2 pages on 2 sheets]
[Total: 2 pages on 2 sheets] sent to the standard output
[7 lines wrapped]
GPL Ghostscript 9.07 (2013-02-14)
Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
DEBUG: ijsgutenprint: about to start
...
I have to note that I tried using all 4 different PPD files and it made no difference.

I have a huge hole in my knowledge of printing and simply don't know where to start checking for problems.

If I understood the above procedure correctly, when I invoke lpr(1) it invokes the input filter script which turns whatever it gets to PostScript via a2ps(1) which passes it on to foomatic-rip(1) which in turn somehow translates it to my printer's language using the gutenprint ijs drivers.

It is not really complicated but since it isn't working for me I am starting to consider this cool new CUPS thingy they got going over there at Apple.

P.S. Yeah, I'll get the PostScript printer, no need to tell me it is the easy way out!
Attached Files
File Type: txt lpd-errs.txt (51.6 KB, 97 views)

Last edited by rarebird; 13th July 2015 at 11:47 PM.
Reply With Quote
Reply


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
LPD printing Oko Guides 28 10th May 2020 12:01 AM
BSD on a Canon DSLR rather than a Toaster ADJ NetBSD Installation and Upgrading 6 12th April 2015 03:29 AM
has anyone successfully gotten an HP or Canon scanner to work w/OpenBSD? tetrodozombie OpenBSD General 3 7th September 2010 04:42 AM
FBSD 7.1 and Canon LBP-660 Printer Calderon FreeBSD General 8 4th May 2009 07:04 AM
FreeBSD + Canon ImageRunner problem anomie FreeBSD General 2 12th August 2008 10:25 PM


All times are GMT. The time now is 08:37 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