利用树莓派把普通打印机变成网络打印机方法
1. 安装并设置打印机服务器CUPS
在树莓派上安装:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install cups
sudo usermod -a -G lpadmin pi
sudo cupsctl --remote-any
sudo systemctl restart cups
在 CUPS 中设置打印机通过Web界面来完成。https://pi31.local:631/
2. 安装并设置SAMBA服务器
在树莓派上安装SAMBA,为了在Windows下可使用打印服务。
sudo apt-get install samba
sudo nano /etc/samba/smb.conf
smb.conf文件最后添加如下内容:
#CUPS printing.
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = yes
read only = yes
create mask = 0700
#Windows clients look for this share name as a source of downloadable
#printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = no
guest ok = no
** 启动SAMBA:
sudo systemctl restart smbd **
3. 以https://pi31.local 用https访问pi31添加打印机,并共享打印机。
4.windows下安装mDNS
为了在windows下可以直接使用pi31.local形式,需要安装Bonjour Print Services (Windows), 而苹果产品默认已经安装了mDNS。