Raspberry Pi OS (32-bit) with desktop CUPS Server
今回はRaspberry Pi4にプリンタを接続、ローカルのネットワークプリンタ(CUPS Server)として設定してみます。
プリンタは相変わらずの激安プリンタCanon iP2700を接続、Pi4から印刷そしてローカルのマシンはRaspberry Pi3,Windows(ASUS X200MA)からの印刷を試してみたいと思います。
Canon iP2700
iP2700も旧品番となってしまいました。
$ lsusb Bus 001 Device 003: ID 04a9:10d3 Canon, Inc.
CUPS
# apt install cups
cupsを設定するためにユーザーをlpadminに加えます。
$ sudo gpasswd -a pi lpadmin ユーザ pi をグループ lpadmin に追加 $ id pi uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),105(input),109(netdev),999(spi),998(i2c),997(gpio),121(lpadmin)
Pi4のwebブラウザからアクセス
http://localhost:631/
外部からアクセスする時は
hostname:631
ipaddress:631
プリンターが追加されて待機中の画面になります。
メンテナンスからテストページの印刷ができます。
CUPS 設定ツール system-config-printer
CUPSの状態はsystem-config-printerからもみれます。
# apt install system-config-printer
vncserver上では制約があります。
プロパティはダブルクリックすると現れます。
デバイスURl: usb://Canon/iP2700%20series?serial=39AE02
製造元とモデル: Canon iP2700 series – CUPS+Gutenprint v5.3.1
ここまでPi4からは印刷可能ですが外部のマシンからは印刷できません。
ネットワークプリンター
外部のマシンから印刷を許可するためにcupsd.confを編集します。
16行目 Listen localhost:631
デフォルトはローカルホストからのみ印刷を受ける設定になっています。
Port 631とすることで外部からもListenします。
その他 Location のアクセス設定がありますが取り敢えず4箇所とも許可しました。
/etc/cups/cupsd.conf (変更箇所)
# Only listen for connections from the local machine. Port 631 Listen /run/cups/cups.sock # Restrict access to the server... <Location /> Order allow,deny Allow @Local </Location> # Restrict access to the admin pages... <Location /admin> Order allow,deny Allow @Local </Location> # Restrict access to configuration files... <Location /admin/conf> AuthType Default Require user @SYSTEM Order allow,deny Allow @Local </Location> # Restrict access to log files... <Location /admin/log> AuthType Default Require user @SYSTEM Order allow,deny Allow @Local </Location>
cups再スタート
# systemctl restart cups
cupsクライアント
クライアント側も同様にcupsとsystem-config-printerをインストール
# apt install cups system-config-printer # gpasswd -a pi lpadmin
Pi3からsystem-config-printerを起動するとプリンターが見えています。(印刷可能)
デバイスURl: implicitclass://Canon_iP2700_series_pi4/
製造元とモデル: Remote printer: Canon iP2700 series – CUPS+Gutenprint v5.3.1
cupsを新規にインストールするとcupsのバックエンドで動いている何かが自動でimplicitclassを設定するようです。
プリンターを削除したり既存のsystem-config-printerから新たに追加する場合はimplicitclassは見当たらない(設定できない?)
ロックを解除してADD
ネットワークプリンターを検索。
自動で検出しているDNS-SD経由のプリンターはRemote printerとして認識してくれません。
ホスト名にホストネームかIPアドレスを入れてFind
OSによって表示は多少違いますがRaspberryではRemote printerとして表示(認識)してないとネットワークプリンターには接続できないようです。
WindowsではCanonのドライバーを入れた記憶があります。
あとはBonjour Print Servicesをインストール、実行することですぐつながるはずです。
Pi4-プリンター間は2m位離れているのでUSB延長ケーブルでつないでいます。
これまではPi1BをCUPSサーバーにしていたのですがWindowsからの印刷速度は早いのですがRaspberryからは遅い。やはりメーカー製ドライバーの違いでしょうか!
Pi4では馬力があるせいかずいぶん改善しました。
[…] Raspberry Pi OS (32-bit) with desktop CUPS Server […]