7

利用 cups 通过网络使用 Samsung SCX-4650 4x21S Series 打印机

 3 years ago
source link: https://blog.lilydjwg.me/2013/8/6/printing-with-a-samsung-scx-4650-4x21s-series-printer-over-network-with-cups.40245.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

利用 cups 通过网络使用 Samsung SCX-4650 4x21S Series 打印机

本文来自依云's Blog,转载请注明。

首先去官网下个 Unified Linux Drivers(ULD)包,里边有我们需要的 .ppd 文件以及一个 cups filter。splix 和 gutenprint 包里有不少 ppd 文件,但是没有我要的这个型号的。此 ppd 文件中引用了一个名叫 rastertospl 的 cups filter,而 splix 里只有 rastertoqspl,不知道能不能用。我还是用官方给的好了。

安装 cups 并启动之:

systemctl start cups

在那个包里找到自己机器架构的 rastertospl 以及 libscmssc.so 文件,前者扔到/usr/lib/cups/filter目录下,后者扔到/usr/lib下即可。

访问 http://localhost:631/admin ,勾选右边的「Share printers connected to this system」,这样 cups 才能找到网络打印机。点「Change Settings」后会请求用户名和密码。使用 root 及相应的密码登录即可。然后就可以「Find New Printers」了。找到之后就知道打印机的 IP 地址了。(其实用 ULD 包里那个smfpnetdiscovery程序也是可以的。)然后访问 http://打印机IP:631/ 在协议里找到了它的 IPP 协议地址:ipp://打印机IP/ipp/printer。cups 默认给出的是socket://,不知道那是干什么的。忘了添加时能不能修改了,不能的话就待会再修改连接地址好了。然后填名字描述什么的,下边会向你要 ppd 文件,或者从系统已有列表里选。从下载回来的 ULD 包里找到那个Samsung_SCX-4650_4x21S_Series.ppd文件扔给它就好。配置完毕就可以用啦啦。

其实挺简单的。不过初次配置时遇到了点麻烦:

出现了两次 filter failed 错误。第一次的日志(位于/var/log/cups/error_log)是:

PID 20744 (/usr/lib/cups/filter/gstoraster) stopped with status 13.

gstoraster 是 ghostscript 包里的。通过 strace 和源码得知它退出是因为子进程 gs 在向标准输出写转换好的 raster 格式数据时出现了 SIGPIPE。Google 许久未果,最后按某帖里的建议把打印机删掉再重新添加就好了……

第二次是 rastertospl 退出 1。(rastertospl 没找到那个错误很明显就不算啦。)这个通过 strace 发现它在一些路径寻找libscmssc.so文件。在 ULD 里找到这个库并扔到它会去找的目录下就好了。

最后贴一下通过 strace 抓到的那些 cups filter 的命令行调用参数:

PPD=/etc/cups/ppd/Samsung_SCX-4650_4x21S_Series.ppd strace /usr/lib/cups/filter/rastertospl 4 lilydjwg doc.pdf 1 "InputSlot=Auto noJCLSkipBlankPages Quality=600dpi number-up=1 MediaType=None TonerSaveMode=Standard JCLDarkness=NORMAL PageSize=A4 EdgeControl=Fine job-uuid=urn:uuid:570129b0-1656-3f8d-5c8d-0edc9322c11f job-originating-host-name=localhost time-at-creation=1375697623 time-at-processing=1375701265" doc.raster > doc.spl

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK