rokkonet

PC・Androidソフトウェア・アプリの開発・使い方に関するメモ

Arch系のManjaro Linuxへのブラザープリンター&スキャナーDCP-J562Nインストール

2022 Oct. 01.
2021 Nov. 25.
2021 May 04.
2021 May 02.

印刷は、下記の「印刷機能インストール」をせずとも、「デスクトップのメニュー --> システム --> 印刷の管理」 から、cups設定でrootユーザーでログインして設定できた。(2021 Nov. 21)

ドライバには何も指定せずとも日本語印刷された。


印刷機能インストール

参照元
Arch LinuxでBrother製プリンターを使う | クロの思考ノート

パッケージインストール
# pacman -S rpmextract
# pacman -S cups ghostscript gsfonts cups-pdf poppler a2ps
# systemctl enable --now cups.service


プリンタドライバーダウンロード

ブラザーの下記ホームページから
dcpj562ncupswrapper-1.0.0-0.i386.rpmとdcpj562nlpr-1.0.0-0.i386.rpmをダウンロードし、任意のディレクトリ(ここでは~/tmp/とする)に置く。
https://support.brother.co.jp/j/b/downloadlist.aspx?c=jp&lang=ja&prod=dcpj562n&os=127

ドライバーの取得・修正
$ cd tmp/
$ rpmextract.sh dcpj562ncupswrapper-1.0.0-0.i386.rpm
$ rpmextract.sh dcpj562nlpr-1.0.0-0.i386.rpm

~/tmp/opt/brother/Printers/dcpj562n/cupswrapper/cupswrapperdcpj562n を次のように編集する。

--- cupswrapperdcpj562n-original 2015-05-19 08:57:23.000000000 +0900
+++ cupswrapperdcpj562n 2021-05-02 23:47:31.056018421 +0900
@@ -47,21 +47,25 @@
   rm -f /usr/lib64/cups/filter/brother_lpdwrapper_${printer_model}
   rm -f /opt/brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1
 #  rm -f /usr/local/Brother/${device_model}/${printer_model}/cupswrapper/brcupsconfpt1
-if [  -e /etc/init.d/cups ]; then
-   /etc/init.d/cups restart
-elif [  -e /etc/init.d/cupsys ]; then
-   /etc/init.d/cupsys restart
-fi
+# if [  -e /etc/init.d/cups ]; then
+#    /etc/init.d/cups restart
+# elif [  -e /etc/init.d/cupsys ]; then
+#    /etc/init.d/cupsys restart
+# fi
+#systemctl restart org.cups.cupsd.service
+systemctl restart cups.service
 #  /etc/init.d/cups restart
   exit 0
 fi
 if [ "$1" = "-r" ]; then
   lpadmin -x ${printer_name}
-if [  -e /etc/init.d/cups ]; then
-   /etc/init.d/cups restart
-elif [  -e /etc/init.d/cupsys ]; then
-   /etc/init.d/cupsys restart
-fi
+# if [  -e /etc/init.d/cups ]; then
+#    /etc/init.d/cups restart
+# elif [  -e /etc/init.d/cupsys ]; then
+#    /etc/init.d/cupsys restart
+# fi
+#systemctl restart org.cups.cupsd.service
+systemctl restart cups.service
 #  /etc/init.d/cups restart
   exit 0
 fi
@@ -296,11 +300,14 @@
 fi
 
 
-if [  -e /etc/init.d/cups ]; then
-   /etc/init.d/cups restart
-elif [  -e /etc/init.d/cupsys ]; then
-   /etc/init.d/cupsys restart
-fi
+# if [  -e /etc/init.d/cups ]; then
+#    /etc/init.d/cups restart
+# elif [  -e /etc/init.d/cupsys ]; then
+#    /etc/init.d/cupsys restart
+# fi
+# systemctl restart org.cups.cupsd.service
+systemctl restart cups.service
+
 
 sleep 2s


ドライバーインストール
$ sudo cp -r ~/tmp/opt/* /opt/
$ sudo cp -r ~/tmp/usr/bin/* /usr/bin/
$ sudo /opt/brother/Printers/dcpj562n/cupswrapper/cupswrapperdcpj562n


プリンター登録

Webブラウザhttp://localhost:631/にアクセスし、管理 -> プリンター -> プリンターの追加
途中で認証を求められたら、ユーザーはrootとし、パスワードはrootユーザーのパスワードとする。

(設定状況)
説明: Brother DCP-J562N
場所: Living
プリンタードライバー: DCP-J562N - IPP Everywhere (カラー, 両面可)
接続: dnssd://Brother%20DCP-J562N._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-606dc719b036
デフォルト設定: バナー=none, none 用紙サイズ=iso_a4_210x297mm 両面指定=one-sided

スキャナー機能インストール

出典
SANE/スキャナー別の問題 - ArchWiki

ブラザー純正Linuxドライバー(本記事ではこのドライバーを利用せず、AURのbrscan4だけで利用できている)

ソフトウェアダウンロード | DCP-J562N | 日本 | ブラザー

ポート開放

上記ブラザーページに書かれていたので実行した。

# ufw enable
# ufw allow proto udp from MY.LAN.ADDRESS.0/24 to any port 54925
# ufw allow proto tcp from MY.LAN.ADDRESS.0/24 to any port 54921
# ufw reload

AURからパッケージbrscan4をインストール

yayをrootユーザーで利用してはいけないので、以下は間違い

# yay -Syu
# yay -S brscan4

以下のとおり、一般ユーザーでインストールする
$ yay -Syu
$ yay -S brscan4

スキャナーの登録

# /opt/brother/scanner/brscan4/brsaneconfig4 -a name=SCANNER_DCP-J562N model=DCP-J562N ip=MY.SCANNER.IP.ADDRESS

/opt/brotherディレクトリの属性が755となっていないと一般ユーザーで利用できない。

  • 確認
$ scanimage --list-devices
device `brother4:net1;dev0' is a Brother SCANNER_DCP-J562N DCP-J562N
device `escl:http://MY.SCANNER.IP.ADDRESS:80' is a Brother DCP-J562N adf scanner

スキャンソフトインストール

xsaneとかskanliteとかをインストールする。(skanliteをインストールした)

スキャン実行

$ skanlite -d 'brother4:net1;dev0'
$ skanlite -d `escl:http://MY.SCANNER.IP.ADDRESS:80'    ## 「不正な引数」エラーで利用できず