打印机通过usb接口连接n1,ubuntu/armbian要安装usblp内核模块,查看本机是否有usblp模块:
modinfo usblp
filename: /lib/modules/4.18.7-aml-s9xxx/kernel/drivers/usb/class/usblp.ko
license: GPL
description: USB Printer Device Class driver
如果没有需编译内核usblp模块,可参考:https://www.haiyun.me/archives/1266.html
系统软件源使用所有,不然很多打印机驱动没有:
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
然后安装配置cpus
apt update
apt install cups
修改为以下配置:
#这行很重要,是否将共享的打印机让本地网络发现,如使用airprint。
Browsing on
Listen 0.0.0.0:631
<Location />
Order allow,deny
Allow all
</Location>
<Location /admin>
Order allow,deny
Allow all
</Location>
重启cups:
systemctl restart cups
systemctl restart cups-browsed
将打印机和n1连接,此时内核日志应该提示打印机已连接:
dmesg|tail -n 1
usblp 1-1:1.1: usblp0: USB Bidirectional printer dev 8 if 1 alt 0 proto 2 vid 0x04A9 pid 0x176C
cups有此打印机驱动也正常识别了:
lpinfo -v
network ipp
direct usb://Canon/MG2400%20series?serial=988776&interface=1
查看支持的打印机驱动:
lpinfo -m
访问cups web管理界面添加打印机,地址:ip:631,配置很简单,详细步骤略过。
添加打印机后iphone应该就能通过airprint识别打印机了。
windows下可在控制面板下添加打印机,地址为ip:631/printers/name
无打印机驱动的可添加打印机为raw模式,windows下连接共享的打印机选择相应的驱动也可打印:
lpadmin -p mg2400 -E -v parallel:/dev/usb/lp0
遇到的一些问题:
1.开机启动时加载内核驱动失败,cups默认会加载lp/ppdev/parport_pc内核驱动,由于已使用usblp内核驱动,可将这些注释掉,/etc/modules-load.d/cups-filters.conf
2.通过cups打印时没反应,内核提示usblp0: removed,打印机未正常工作,可将打印机连接至电脑查看具体原因。
更多参考:
http://www.winotmk.com/2017/03/1136
https://www.ncnynl.com/archives/201608/742.html
https://ubuntuforums.org/showthread.php?t=2295559
标签:none