类别:想哪写哪 / 日期:2024-12-20 / 浏览:2613 / 评论:0

    前几天在咸鱼买了3个机顶盒,两个s905l3a的打算刷armbian玩。另一个s905l3的带遥控器,刷安卓9当电视机顶盒。

armbian装cups当打印服务器,给家里的HP 1007增加无线打印功能。以前为了给孩子打印1,2张作业,还得开电脑,现在直接手机打印更方便。

机顶盒到手是贵州移动的系统,也许是网络的原因,卡开机界面。

    所以

一、先刷个安卓9

        需要用到:①双公头USB线。②s905短接器。③Amlogic_USB_Burning_Tool线刷软件。④ZNDS上找的已root线刷包。⑤win系统电脑。⑥机顶盒。

  1. 机顶盒HDMI口插上短接器,接近电源的USB口上USB线,线的另一端查到电脑上。机顶盒不要通电。

  2. 电脑上安装Amlogic_USB_Burning_Tool,安装好后进入软件,左上角“文件”导入线刷包,点击“开始”。

  3. 给机顶盒通电,Amlogic_USB_Burning_Tool会显示刷机进度。完成后给机顶盒断电拔下来。

  4. ps:因去年刷过这个机顶盒,当时是开盖在主板上短接的,上次刷完给内存卡刷了个emuelec,然后吃灰了。这次依旧这么操作,刷机时总卡1%或者3%,有可能短接点记错了,所以拼多多上买个短接器方便快捷。

二、刷入armbian

        需要用到:①4G以上U盘一个,②amlogic-s9xxx-armbian,③显示器,④USB键盘,⑤Rufus,⑥win系统电脑,⑦外置系统启动器APK,⑧刷好安卓9的机顶盒

        1.机顶盒连接显示器,开机,安装外置系统启动器APK,(好多rom都自带了)

        2.在电脑上下载amlogic-s9xxx-armbian,插入U盘,用Rufus把armbian写入U盘。

        3.把U盘和键盘插入机顶盒,从外置系统启动器重启机顶盒,会直接进入u盘内armbian系统,

        4.运行 下列命令写入EMMC

armbian-install

        ps:我写入EMMC时报错failed to pertition internal emmc using [parted],需要编辑meson-g12a-s905l3a-e900v22c.dtb文件。

1.安装依赖
apt-get update
apt-get install -y device-tree-compiler
2.接下来反编译命令(使用 dtb 文件生成 dts 源码)
cd /boot/dtb/amlogic/
dtc -I dtb -O dts -o meson-g12a-s905l3a-e900v22c.dts meson-g12a-s905l3a-e900v22c.dtb
3.打开转换成功的meson-g12a-s905l3a-e900v22c.dts搜索max-frequency找到mmc开头的把默认值改为0x5f5e100

        修改时间

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

        参考:https://www.bilibili.com/video/BV1HT41147wp/

                  https://post.smzdm.com/p/apmpnqx9/  

                  https://www.jianshu.com/p/dbaed2fba3d1

                  https://github.com/ophub/amlogic-s9xxx-armbian/releases

                  https://www.right.com.cn/FORUM/forum.php?mod=viewthread&tid=4105643&page=1&simpletype=no

三、安装cups

        需要用到:①已刷好armbian的机顶盒、②打印机、③电脑、④ssh工具

        1.机顶盒不再需要显示器,通过网线把机顶盒接入电脑同一个局域网即可。打印机USB线插到机顶盒上,给机顶盒通电。

        2.电脑进入路由器管理界面,查看机顶盒的IP地址,通过ssh工具(我使用的finalshell和Mobaxterm)登入机顶盒,用root登入。

        3.安装 CUPS,运行下列命令

apt install cups

        4.修改 CUPS 配置文件 /etc/cups/cupsd.conf

nano /etc/cups/cupsd.conf
将 Listen 修改为 0.0.0.0:631
将 Browsing 修改为 Yes
对应位置加上 Allow all
# Only listen for connections from the local machine.
Listen localhost:631 // [!code --]
Listen 0.0.0.0:631 // [!code ++]
Listen /run/cups/cups.sock 
# Show shared printers on the local network.
Browsing Off // [!code --]
Browsing Yes // [!code ++]
BrowseLocalProtocols dnssd
# Restrict access to the server...
  Order allow,deny
  Allow all // [!code ++]
# Restrict access to the admin pages...
  Order allow,deny
  Allow all // [!code ++]
# Restrict access to configuration files...
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all // [!code ++]
# Restrict access to log files...
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all // [!code ++]

        5.安装驱动

HP驱动:
apt-get install hplip -y
爱普生驱动:
apt-get install printer-driver-gutenprint
兄弟驱动:
apt-get install printer-driver-brlaser

        6.安装 Avahi,有了它之后,我们通过电脑或者手机添加打印机的时候,可以直接搜索到打印,不需要手动添加。

apt-get install avahi-daemon avahi-utils
sudo apt-get -y install avahi-daemon avahi-discoverlibnss-mdns
sudo service avahi-daemon restart

        7.重启 CUPS

systemctl restart cups

        8.在电脑和手机上添加打印机

        以上参考:https://post.smzdm.com/p/al87mx08/ 

                         https://www.cnblogs.com/modys/p/17701772.html 

                         https://post.smzdm.com/p/alpz07r0/


        ps:以上步骤全部操作完后,我测试打印机报错:"Filter failed",打印机是HP_LaserJet_Professional_M1136,然后换了1008还是报这个错,我一度怀疑cups配置有问题。通过搜索,发现有可能是hplip的原因,运行以下命令解决

sudo hp-plugin

        参考https://www.zhihu.com/tardis/bd/art/457045615 

               https://post.smzdm.com/p/alpz07r0/

        ps2:执行sudo命令时报错“sudo:/usr/bin/sudo 必须属于用户 ID 0(的用户)并且设置 setuid 位”,通过搜索解决。

chmod 4755 /usr/bin/sudo 
chmod 755 /usr
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
chown root:root /usr/lib/sudo/sudoers.so
chmod 4755 /usr/lib/sudo/sudoers.so
pkexec chown root:root /etc/sudoers /etc/sudoers.d -R
chown root:root /etc/sudoers 
chmod 440 /etc/sudoers

        参考:https://www.cnblogs.com/chxwkx/p/10686864.html 

                  https://huaweicloud.csdn.net/654cb9b78c4ad05cd82ab022.html 

                  https://blog.csdn.net/qq_38883889/article/details/109674073

                  https://blog.csdn.net/wtlll/article/details/119059267 

                  https://zhuanlan.zhihu.com/p/641048906

        ps3:我发现个bug,不知道是不是我的个例,cups服务器里添加多个打印机,安卓手机打印时,选择打印机后打印总出错,去IP:631后台看任务,发现执行打印任务的打印机并不是手机选择的打印机。在后台把打印机删除到只剩一个,用手机打印就没有问题了。

        

版权声明 : 本文使用「署名-非商业性使用-禁止演绎 4.0 国际」创作共享协议,转载或使用请遵守署名协议。

评论区

发表评论 / 取消回复

必填

选填

选填

◎欢迎讨论,请在这里发表您的看法及观点。

热门文章

«    2025年2月    »
12
3456789
10111213141516
17181920212223
2425262728

最新留言

标签列表