Orange PI 安装 CUPS 提供打印服务

使用 orangepizero3 做为打印服务开发板,集成到打印盒子中,用于适配不同的打印设备。

orangepi zero3 2GB 版本安装 Ubuntu 6.1内核版本的镜像
http://www.orangepi.cn/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-Zero-3.html

apt remove docker-ce -y
apt remove dnsmasq -y

rm -f /etc/apt/sources.list.d/docker.list

apt update
apt install libcupsimage2 libcupsimage2-dev libcups2 libcups2-dev -y
apt install cups -y

systemctl enable cups
systemctl start cups

安装好 CUPS 以后,进行 CUPS 配置,包括添加打印机,配置 PPD 文件。

其中,CUPS 如果要提供给其它机器访问,则需要设置为 `shared`。

# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn
PageLogFormat

# Specifies the maximum size of the log files before they are rotated.  The value "0" disables log rotation.
MaxLogSize 0

# Default error policy for printers
ErrorPolicy retry-job

# Only listen for connections from the local machine.
Listen 0.0.0.0:631
Listen /run/cups/cups.sock

# Show shared printers on the local network.
Browsing Yes
BrowseLocalProtocols dnssd

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Web interface setting...
WebInterface Yes

# Timeout after cupsd exits if idle (applied only if cupsd runs on-demand - with -l)
IdleExitTimeout 60

# Restrict access to the server...
<Location />
  Order allow,deny
  Allow all
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow all
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all
</Location>

# Restrict access to log files...
<Location /admin/log>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all
</Location
打印机使用的是 EPSON L8050
PPD 安装好以后位于 `/etc/cups/ppd/EPSON_L8050_Series.ppd`
过滤器程序的路径位于 `/opt/epson-inkjet-printer-escpr2/lib/cups/filter/epson-escpr-wrapper2`