Annotation of wikisrc/users/jruoho/clp-315w.mdwn, revision 1.13

1.1       jruoho      1: # Samsung CLP-315W on NetBSD
                      2: 
1.2       jruoho      3: Samsung
                      4: [CLP-315W](http://www.amazon.com/Samsung-CLP-315W-Color-Laser-Printer/dp/B001BXS45I)
1.3       jruoho      5: is a low-end color laser printer, featuring USB, Ethernet, and wireless
1.11      jruoho      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/).
1.3       jruoho      9: 
1.5       jruoho     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.
1.4       jruoho     15: 
                     16: The so-called
                     17: [foomatic](http://www.linuxfoundation.org/collaborate/workgroups/openprinting/databasefoomatic)
1.5       jruoho     18: is a prerequisite. This is available from [[!template id=man name="pkgsrc"
1.4       jruoho     19: section="7"]]:
                     20: 
1.5       jruoho     21:        # cd /usr/pkgsrc/foomatic-filters
                     22:        # make install package clean
1.4       jruoho     23: 
1.3       jruoho     24: Samsung uses a special QPDL wire protocol, supported by
1.5       jruoho     25: [foo2qpdl](http://foo2qpdl.rkkda.com/). For installation, fetch the
                     26: sources and compile:
1.3       jruoho     27: 
1.6       jruoho     28:        $ cd /tmp
1.5       jruoho     29:        $ ftp http://foo2zjs.rkkda.com/foo2zjs.tar.gz
1.10      jruoho     30:        # tar xvfz foo2zjs.tar.gz
1.6       jruoho     31:        $ cd foo2zjs
1.5       jruoho     32:        $ gmake
1.4       jruoho     33: 
1.7       jruoho     34: If you have problems with the compilation, check the `Makefile` for odd
1.8       jruoho     35: `CFLAGS` possibly not yet supported by the NetBSD's [[!template id=man
1.10      jruoho     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
1.4       jruoho     41: 
1.6       jruoho     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: 
1.8       jruoho     48: Note the permissions:
1.6       jruoho     49: 
                     50:        # chown root:wheel /usr/local/bin/foo*
                     51:        # chmod 0555 /usr/local/bin/foo*
                     52: 
1.9       jruoho     53: I used the following as the [PostScript printer
                     54: description](http://en.wikipedia.org/wiki/PostScript_Printer_Description)
1.10      jruoho     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
1.9       jruoho     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:\
1.13    ! jruoho     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:\
1.9       jruoho     99:                :if=/usr/pkg/bin/foomatic-rip:\
1.13    ! jruoho    100:                :mx#0:
1.9       jruoho    101: 
                    102:        # Monochrome ('lpr -P lpm').  
                    103:        #
                    104:        lpm|rpm:\
1.13    ! jruoho    105:                :lp=:\
        !           106:                :rp=lp:\
        !           107:                :rm=printer.lan:\
1.9       jruoho    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: 
1.12      jruoho    114: Thus, for color and monochrome output, respectively, one needs only:
                    115: 
1.13    ! jruoho    116:        lpr /etc/passwd
1.12      jruoho    117:        lpr -P /etc/passwd
                    118: 
1.13    ! jruoho    119: Remote clients can access the `print.lan` host by using:
1.10      jruoho    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: 
1.9       jruoho    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: 
1.10      jruoho    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