树莓派搭建无线打印机(PC和安卓可用)

树莓派搭建无线打印机

材料

  • 树莓派3b+
  • EPSON l3118 打印机

1.安装cups

sudo apt-get update 
sudo apt-get install cups 

备份配置文件
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bak

修改配置文件:

sudo nano /etc/cups/cupsd.conf
将“Listen localhost:631”修改为“Listen 0.0.0.0:631”
将# Restrict access to the server…到# Restrict access to log files…
部分替换成

# Restrict access to the server…

Order allow,deny
Allow all

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

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

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

ctrl+x退出 y保存 回车

然后

将pi用户 加入到 lpadmin,pi成为管理员用户
sudo usermod –a -G lpadmin pi

允许远程访问

sudo cupsctl –remote-any

重启

sudo reboot

2.下载打印机驱动

到EPSON官网下载驱动:

http://download.ebz.epson.net/dsc/search/01/search/searchModule

搜索
在这里插入图片描述

下载适合树莓派的驱动

在这里插入图片描述

下载到deb树莓派

安装驱动:
sudo dpkg -i --force-all xxx.deb

3.配置cups

浏览器输入http://树莓派IP:631/admin

点击"Add printer" 添加打印机

使用root用户和密码登录

选择打印机型号, 一路continue

添加打印机时注意选中“Share This printer”

4.PC添加打印机

打开控制面板 > 设备和打印机 > 鼠标右键 > 添加设备和打印机

搜索并添加

然后鼠标右键设为默认打印机

就可以打印了

5.安卓添加打印机

到应用商店下载“Mopria print”

(亲测oppo和小米应用商店有,华为没有,没有的要到网上或其它商店下)

安装后打开可以看到打印机

到文件管理打开图片选择发送或分享找到“Mopria print”

然后左上角选择打印机

最后点那个绿色的打印图标就可以了

附:

cups相关命令

启动服务:sudo service cups start

停止服务:sudo service cups stop

配置文件路径:/etc/cups/cupsd.conf /etc/cups/cupsd.conf

发布了28 篇原创文章 · 获赞 23 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_44823747/article/details/104629446
今日推荐