实战玩客云刷armbian及共享打印机教程
背景:家里打印机HP M132a不支持无线打印,每次打印都要开笔记本连接打印机太繁琐,尤其是手机里的资料还要先发到笔记本再进行打印,如何将打印机变为无线或共享出去,翻看网上资料,发现可以将打印机插入路由器的usb口再进行一系列的设置,但自家路由器没有usb口,这个方案不可行,后来看到可以将玩客云刷机后连接打印机,将打印机共享出去,拼多多玩客云大概价格50包邮,在承受范围内,开搞。
准备工作:玩客云1台,电脑1台(最好是台式机),十字螺丝刀,镊子一把,双公头USB线1根(如果电脑带type-c口,也可以使用USB转type-c的线,比如手机数据线)。
一、刷入armbian系统: 下载USB Burning Tool
建议版本2.1.6.8,自行百度下载或去恩山论坛下载。
下载armbian镜像
https://github.com/hzyitc/armbian-onecloud/releases,下载带burn.img的,我下载的是Armbian_23.02.0-trunk_Onecloud_bullseye_edge_6.1.0.burn.img。
安装USB Burning Tool加载img镜像
中间会弹出libusb-win32安装窗,点击完成,安装成功后重启,打开usb_burn_tool,点击文件——>导入烧录包,选择上一步的.img文件,右侧擦除flash、擦除bootloader默认是勾选状态不用动他,点击开始。
![](https://www.0419af.com/wp-content/uploads/2023/02/1675218664-46a309f1022ff0c.png)
玩客云拆机
如果玩客云不是原版系统,那就不需要拆机了,在刷机时长按reset键就可以,如果是原版没有刷过的,必须拆机短接。拆机时用翘板(我只有一字螺丝刀)插入SD孔位往上翘,如果撬不动那就插入后左右滑动将双面胶破坏掉,最终将上面薄薄的板子取下来,然后拧掉6颗螺丝就可以将主板拿出来了。
![](https://www.0419af.com/wp-content/uploads/2023/02/1675218666-46a309f1022ff0c.png)
短接针脚
分两个版本,不用担心短接错,新版没有老板的2个短接点,我的是V1.3按照新版短接正面的左4右5针脚,老板短接中间的2个,见下图,短接可以使用金属镊子或回形针、金属线缆等各种工具。
刷机
将双公头usb线连接电脑与玩客云靠近HDMI的usb口,然后在保持短接的状态下给玩客云通电,等看到USB Burning Tool有进度后松开短接工具,进度到100% 烧录成功后,先点击停止再拔USB线。
提示:1)建议使用台式机,我最开始是使用的我的机械革命笔记本,短接状态玩客云加电后笔记本立马断电,连续试了2次都这样,使用台式机就没问题。2)对于不好操作的人,可以使用智能插座比如小米智能插座,先倒计时1分钟或定时到1分钟后,快到1分钟时短接,到时间后插座自动加电。
二、玩客云设置IP、root密码、apt源
大多数参考https://zhuanlan.zhihu.com/p/551470592及http://www.8fe.com/jiaocheng/5810.html
玩客云IP、密码、时区
玩客云加电,连接网线、显示器、键盘,开机过程中就会提示你键盘布局、时区、设置IP地址(要与路由器同一网段,建议使用路由器不分配的IP,比如路由器分配192.168.1.100-200,那么设置1.20)、输入root密码、创建新用户。看其他帖子有默认是192.168.1.110,root,1234的,也有自动获取后IP后,用户名root,密码1234的,我直接接显示器按照开机流程一步步设置,没测试过其他方法。
附:设置IP方法,可以使用armbian-config图形化设置,也可以下面方法设置:
nano /etc/network/interfaces
然后添加下面字段,然后Ctrl+O回车,然后Ctrl+X,然后systemctl restart network重启网络,ping 192.168.1.1,ping www.qq.com都能通那就没问题了。
auto eth0allow-hotplug eth0iface eth0 inet staticaddress 192.168.1.20netmask 255.255.255.0gateway 192.168.1.1dns-nameservers192.168.1.1 设置apt源 nano /etc/apt/sources.list
删光后复制下面这些,Ctrl+O回车,Ctrl+X,再执行apt update。
deb https://mirrors.ustc.edu.cn/debian stretch main contrib non-free#deb-src http://httpredir.debian.org/debian stretch main contrib non-free deb https://mirrors.ustc.edu.cn/debian stretch-updates main contrib non-free#deb-src http://httpredir.debian.org/debian stretch-updates main contrib non-free deb https://mirrors.ustc.edu.cn/debian stretch-backports main contrib non-free#deb-src http://httpredir.debian.org/debian stretch-backports main contrib non-free deb https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free#deb-src http://security.debian.org/ stretch/updates main contrib non-free #163镜像站 deb http://mirrors.163.com/debian/ buster main non-free contribdeb http://mirrors.163.com/debian/ buster-updates main non-free contribdeb http://mirrors.163.com/debian/ buster-backports main non-free contribdeb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib deb-src http://mirrors.163.com/debian/ buster main non-free contribdeb-src http://mirrors.163.com/debian/ buster-updates main non-free contribdeb-src http://mirrors.163.com/debian/ buster-backports main non-free contribdeb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib#华为云镜像站 deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-freedeb https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-freedeb https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-freedeb https://mirrors.huaweicloud.com/debian-security/ buster/updates main contrib non-free deb-src https://mirrors.huaweicloud.com/debian/ buster main contrib non-freedeb-src https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-freedeb-src https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free #腾讯云镜像站 deb http://mirrors.cloud.tencent.com/debian/ buster main non-free contribdeb http://mirrors.cloud.tencent.com/debian-security buster/updates maindeb http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contribdeb http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib deb-src http://mirrors.cloud.tencent.com/debian-security buster/updates maindeb-src http://mirrors.cloud.tencent.com/debian/ buster main non-free contribdeb-src http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contribdeb-src http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib#中科大镜像站 deb https://mirrors.ustc.edu.cn/debian/ buster main contrib non-freedeb https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-freedeb https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-freedeb https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian/ buster main contrib non-freedeb-src https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-freedeb-src https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-freedeb-src https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free#阿里云镜像站 deb http://mirrors.aliyun.com/debian/ buster main non-free contribdeb http://mirrors.aliyun.com/debian-security buster/updates maindeb http://mirrors.aliyun.com/debian/ buster-updates main non-free contribdeb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib deb-src http://mirrors.aliyun.com/debian-security buster/updates maindeb-src http://mirrors.aliyun.com/debian/ buster main non-free contribdeb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contribdeb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib#清华大学镜像站 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-freedeb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-freedeb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-freedeb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free#兰州大学镜像站 deb http://mirror.lzu.edu.cn/debian stable main contrib non-freedeb http://mirror.lzu.edu.cn/debian stable-updates main contrib non-freedeb http://mirror.lzu.edu.cn/debian/ buster-backports main contrib non-freedeb http://mirror.lzu.edu.cn/debian-security/ buster/updates main contrib non-free deb-src http://mirror.lzu.edu.cn/debian stable main contrib non-freedeb-src http://mirror.lzu.edu.cn/debian stable-updates main contrib non-freedeb-src http://mirror.lzu.edu.cn/debian/ buster-backports main contrib non-freedeb-src http://mirror.lzu.edu.cn/debian-security/ buster/updates main contrib non-free#上海交大镜像站 deb https://mirror.sjtu.edu.cn/debian/ buster main contrib non-freedeb https://mirror.sjtu.edu.cn/debian/ buster-updates main contrib non-freedeb https://mirror.sjtu.edu.cn/debian/ buster-backports main contrib non-freedeb https://mirror.sjtu.edu.cn/debian-security/ buster/updates main contrib non-free deb-src https://mirror.sjtu.edu.cn/debian/ buster-updates main contrib non-freedeb-src https://mirror.sjtu.edu.cn/debian/ buster-backports main contrib non-freedeb-src https://mirror.sjtu.edu.cn/debian/ buster main contrib non-freedeb-src https://mirror.sjtu.edu.cn/debian-security/ buster/updates main contrib non-free 三、、Cups相关 1、安装并配置cups apt-get install cups –ynano /etc/cpus/cupsd.conf
将【localhost:631】改成【0.0.0.0:631】,将【Browsing off】改成【Browsing on】,同时在三个上面添加【Allow all】,(中括号不用写入)如下图:
然后systemctl restart cups重启打印服务。
2、cpus web管理界面添加打印机 1)根据打印机厂家提前安装打印机驱动(也可以在后面add printer没有对应型号后再安装): #爱普生打印机用下面这一行命令apt install printer-driver-escpr@惠普打印机用下面这一行命令apt install hplip#兄弟打印机用下面这一行命令apt install printer-driver-brlaser#重启打印服务systemctl restart cups 2)添加打印机:
同网段笔记本电脑浏览器输入http://玩客云IP:631,比如http://192.168.1.20:631,点击administration,输入账号密码,然后add printer,选择打印机型号后点击Continue,勾选Share This Printer,点击Continue。建议打印机共享名不要设置的太长,比如改为M132。
3)打印测试页
点击导航栏【Printers】进入打印机详细页面,选择【Print Test Page】打印测试页,如果能正常打印,玩客云与打印机连接正常,Cups服务正常。
3、配置自动发现打印机
执行
apt install avahi-daemon –ysystemctl restart cupssystemctl restart avahi-daemon
尝试手机、笔记本是否能自动发现打印机。
安卓手机选中要打印的图片、文件,选择共享——>打印,会自动搜索打印机;电脑通过控制面板添加打印机——自动搜索。
若无效,再执行
apt -y install avahi-daemon avahi-discover libnss-mdnsystemctl restart avahi-daemon
再设置开机自启服务:
systemctl enable cupssystemctl enable avahi-daemon
我当时装完后2个服务的状态默认是开机自启的,通过systemctl status cups或avahi-daemon可以查看运行状态。
四、测试
笔记本、手机跟玩客云使用同一个路由器,然后自动查找打印机,找到后打印即可,如果找不到,尝试笔记本手动添加打印机,若依然无法添加,排查网络、Cups服务、配置及自动发现服务。