File:  [NetBSD Developer Wiki] / wikisrc / users / jruoho / clp-315w.mdwn
Revision 1.14: download - view: text, annotated - select for diffs
Mon Jun 13 12:27:43 2011 UTC (10 years, 3 months ago) by jruoho
Branches: MAIN
CVS tags: HEAD
Fix couple of errors.

    1: # Samsung CLP-315W on NetBSD
    2: 
    3: Samsung
    4: [CLP-315W](http://www.amazon.com/Samsung-CLP-315W-Color-Laser-Printer/dp/B001BXS45I)
    5: is a low-end color laser printer, featuring USB, Ethernet, and wireless
    6: access.  It works on NetBSD.  The configuration was relatively painless with
    7: the standard tools supported by NetBSD. There was no need for something as
    8: complex as [CUPS](http://www.cups.org/).
    9: 
   10: For initial configuration, I used a NetBSD host and standard [[!template
   11: id=man name="dhcpd" section="8"]].  The printer provides its own HTTP server
   12: from which all standard configuration options are available.  Also IEEE
   13: 802.11 worked with a NetBSD router.  But unfortunately, a local host is
   14: still required as the printer only speaks a non-standard format language.
   15: 
   16: The so-called
   17: [foomatic](http://www.linuxfoundation.org/collaborate/workgroups/openprinting/databasefoomatic)
   18: is a prerequisite. This is available from [[!template id=man name="pkgsrc"
   19: section="7"]]:
   20: 
   21: 	# cd /usr/pkgsrc/foomatic-filters
   22: 	# make install package clean
   23: 
   24: Samsung uses a special QPDL wire protocol, supported by
   25: [foo2qpdl](http://foo2qpdl.rkkda.com/). For installation, fetch the
   26: sources and compile:
   27: 
   28: 	$ cd /tmp
   29: 	$ ftp http://foo2zjs.rkkda.com/foo2zjs.tar.gz
   30: 	$ tar xvfz foo2zjs.tar.gz
   31: 	$ cd foo2zjs
   32: 	$ gmake
   33: 
   34: If you have problems with the compilation, check the `Makefile` for odd
   35: `CFLAGS` possibly not yet supported by the NetBSD's [[!template id=man
   36: name="cc" section="1"]].  After having the sources successfully compiled,
   37: the required files were organized to `/usr/local`. From the compiled
   38: sources only the following are required:
   39: 
   40: 	# mkdir -p /usr/local/bin
   41: 
   42: 	# cp foo2qpdl /usr/local/bin
   43: 	# cp foo2qpdl-wrapper /usr/local/bin
   44: 
   45: 	# cp foo2zjs /usr/local/bin
   46: 	# cp foo2zjs-pstops /usr/local/bin
   47: 
   48: Note the permissions:
   49: 
   50: 	# chown root:wheel /usr/local/bin/foo*
   51: 	# chmod 0555 /usr/local/bin/foo*
   52: 
   53: I used the following as the [PostScript printer
   54: description](http://en.wikipedia.org/wiki/PostScript_Printer_Description)
   55: (PPD) file. In order to avoid wasting the color toner cartridges, two
   56: separate files for monochrome and color setup were used:
   57: 
   58: 	# mkdir -p /usr/local/share
   59: 
   60: 	# cd /tmp/foo2zjs/PPD
   61: 	# cp Samsung-CLP-310.ppd /usr/local/share/samsung-mono.ppd
   62: 	# cp Samsung-CLP-310.ppd /usr/local/share/samsung-color.ppd
   63: 
   64: 	# chown root:wheel /usr/local/share/*
   65: 	# chmod 0444 /usr/local/share/samsung*
   66: 
   67: By default, the used PPD file does not use colors. This was solved by
   68: editing the `samsung-color.ppd` file:
   69: 
   70: 	# diff -ur Samsung-CLP-310.ppd /usr/local/share/samsung-color.ppd
   71: 
   72: 	--- Samsung-CLP-310.ppd 2011-03-08 09:01:45.000000000 +0200
   73: 	+++ samsung-color.ppd   2011-03-12 11:02:17.000000000 +0200
   74: 	@@ -98,7 +98,7 @@
   75: 	 *OpenUI *ColorMode/Color Mode: PickOne
   76: 	 *FoomaticRIPOption ColorMode: enum CmdLine A
   77: 	 *OrderDependency: 120 AnySetup *ColorMode
   78: 	-*DefaultColorMode: Monochrome
   79: 	+*DefaultColorMode: Color
   80: 	 *ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
   81: 	 *FoomaticRIPOptionSetting ColorMode=Color: "-c "
   82: 	 *ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting:
   83: 	 *ColorMode=Monochrome"
   84: 
   85: The following network setup was used: one host named `print.lan` was
   86: dedicated to forward the printing requests to the printer or `printer.lan`. 
   87: This way all hosts inside the LAN can easily use the printer. Two entries
   88: were required for the [[!template id=man name="printcap" section="5"]] file:
   89: 
   90: 	# Color (default; just 'lpr').
   91: 	#
   92: 	lp|rp:\
   93: 		:lp=:\
   94: 		:rp=lp:\
   95: 		:rm=printer.lan:\
   96: 		:lf=/var/log/lpd-errs:\
   97: 		:sd=/var/spool/output/lpd:\
   98: 		:af=/usr/local/share/samsung-color.ppd:\
   99: 		:if=/usr/pkg/bin/foomatic-rip:\
  100: 		:mx#0:
  101: 
  102: 	# Monochrome ('lpr -P lpm').  
  103: 	#
  104: 	lpm|rpm:\
  105: 		:lp=:\
  106: 		:rp=lp:\
  107: 		:rm=printer.lan:\
  108: 		:lf=/var/log/lpd-errs:\
  109: 		:sd=/var/spool/output/lpd:\
  110: 		:af=/usr/local/share/samsung-mono.ppd:\ 
  111: 		:if=/usr/pkg/bin/foomatic-rip:\
  112: 		:mx#0:
  113: 
  114: Thus, for color and monochrome output, respectively, one needs only:
  115: 
  116: 	lpr /etc/passwd
  117: 	lpr -P lpm /etc/passwd
  118: 
  119: Remote clients can access the `print.lan` host by using:
  120: 
  121: 	# We have a CNAME record for the printer host inside LAN.
  122: 	#
  123: 	lp|rp|remote printer:\
  124: 	        :lp=:\
  125: 	        :rp=lp:\
  126: 	        :rm=print.lan:\
  127: 	        :sd=/var/spool/output/lpd:\
  128: 	        :lf=/var/log/lpd-errs:
  129: 
  130: Finally, enable [[!template id=man name="lpd" section="8"]] in
  131: [[!template id=man name="rc.conf" section="5"]]:
  132: 
  133: 	lpd=YES
  134: 	lpd_flags="-r -n 2"
  135: 
  136: The output quality is relatively good. There are no visible differences
  137: compared to the output with Windows and Samsung's own drivers.

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb