打印机通过usb接口连接n1,ubuntu/armbian要安装usblp内核模块,查看本机是否有usblp模块:
modinfo usblp
filename: /lib/modules/4.18.7-aml-s9x/ , r 3xxD # h [ j F j/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.edu0 f 1 s (.cn/ubuntu-ports/ bionic main restricted universe mu) 1 / 2 Y B I %ltiver+ L V y 1 j r ese
# deb-src https://mirrors.t& n 6una./ubuntu-ports/ bionic main restrica I 9 0 l 5 qted uni) ] j $ - tverse multiverse
deb https://m. f 1irrors.tuna./ubuntu-ports/ bionic-updates main restricted universe multiver_ l @ l ) a =se
# deb-src httj G V O Aps:/n i h ^/mirrors.t, c Z ! W X 3una.tsingh8 j z 1 y /ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.tunb R k f B D ( da./| k ^ U subuntu-ports/ bionic-: ! G ! 6 * ? 5 Wbackports main8 G ( a _ t u restricted u~ z C ] I d 2 Fniverse multiverse
# deb-src httv ] O q ~ ? Aps://mirrors.tuna./8 a w c u s Qubuntu-ports/ bionic-backports main restricted universe multiverse
deb https://mirrors.tunz K X c e va./ubuntu-ports/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna./ubuntu-ports/ bionic-securiY W 1 (ty main restricted universe multiverse
然后安装配置cpus
a/ r X ) 5 ^pt update
apt install cups
修改为以下配置:
#这行很重要,是否将共享的打印机让本地网络发现,如使用airprint。
Browsing on
Listen 0.0.0.0:631
Order allow,deny
Allow all
Order allow,deny
Allow all
重启cups:
systemctl restart cups
syw D S o [ g Cstemctl restart cups-browsed
将打印机和n1连接,此时内核日志应该提示打印机U . s 5 s . r已连接:
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&interf) A / + A 1ace=1
查看支持的打印8 5 y [ r ; + &机驱动:
lpinfo -m
访问cupsj X T n $ ! web管理界面添加打印机,地址M y R j R n p:ip:631,配置很简单,详细步骤略过。
添加打印机后iphone应该就能通过airprint识别打印机了。
windows下可在控制面板下添加打印机,地址为ip:631/printers/namN i z 0 7 w qe
无打印机驱动的可添加打印机为raw模式,windows下连接共享的打印机选择相应的驱动也可打印:
lpadmin -p mg2400 -E -v parallel:/dev/usb/l& + ) $p0
遇到的一些问题:
1.开机启动时加载内核驱动失败,cups默认会加载lp/ppdev/parport_pc内核驱动,由于已使用usblp内核驱动,可将这些注释掉,/etc/modules-load.d/cups-filters.conf
2.通过cups打印时没反应,内核提示usba j ; y )lp0: removz D r : ned,打印机未正常工作,可将打印机连接至电脑查看具体原因。
更多参考:
//03/1136
/archives/08/742.html
https://ubuntufo) _ 0 } /@ | b + 0 * Ushowthread.php?t=2295559