开始玩树莓派 - 将树莓派连接的USB打印机搞成打印服务器

当初为了省钱,买了个不支持无线的有线打印机,联想的LJ2205,黑白激光。
其实mac连接后,共享也没啥问题,不过用的时候mac要开机。

树莓派上先装cups相关的服务。

sudo apt-get install cups

装完执行sudo cupsctl --remote-any 允许远程访问

USB连接打印机。这个LJ2205有linux驱动,但是解压出的pdd文件没法用。找了些资料,说是联想的打印机都是Brother代工的,驱动大同小异。索性就用Brother的驱动试。

sudo apt-cache search printer-driver*可以查找下有哪些驱动,期中有个printer-driver-brlaser

于是装了这个sudo apt-get install printer-driver-brlaser

在Add printers时使用这个**Brother HL-L2300D, using brlaser v4 **,试了下测试页可以正常打出了。

前面试过其它打出的是空白的,一些坑就不细说了。
另外在访问https://*:631时,https在chrome下报错,可以在Safari下正常访问。

以下我也试了,iPhone手机和安卓手机,mac添加没问题,除了win10没试
To enable LPR support for Windows, we need to install the inet daemon:

apt-get install openbsd-inetd
Once installed, add the following line to the end of /etc/inetd.conf:

printer stream tcp nowait lp /usr/lib/cups/daemon/cups-lpd cups-lpd -o document-format=application/octet-stream

Restart inetd with:

systemctl restart openbsd-inetd

For AirPrint support, you must install avahi-daemon:

apt-get install --no-install-recommends avahi-daemon libnss-mdns

参考:
https://jtanx.github.io/2016/12/27/making-a-fast-rpi-print-server/