« 実家詣で第2弾 | メイン | ヤフオクで棚ぼた »
2007年01月09日
MP500@Linux again (incl scanner) |
不調で西洋人。
夕刻よりMP500@Linux再開。前回はこちら
Linux(FedoreCore5)へはドライバをインストール済み。
Samba経由による共有作戦を考えていたが、CUPS経由に方針変更。
1.CUPSアクセス権の設定
/etc/cups/cupsd.conf を以下のように設定して、管理画面とプリンタの共有を内部のネットワークに対して許可。既存のcupsd.confは 念のためバックアップをとっておくといいだろう。
MaxLogSize 0 # Show troubleshooting information in error_log. LogLevel info Printcap /etc/printcap <Location /admin> AuthType Basic AuthClass System Order Deny,Allow Deny From All Allow From 127.0.0.1 Allow From 192.168.0.0/24 </Location> <Location /> Order Deny,Allow Deny From All Allow From 127.0.0.1 Allow From 192.168.0.0/24 </Location> #Listen 127.0.0.1:631 Port 631
2.rawデータをスルーさせる(RAW モードを ON)
Windows の印刷データを素通しして印刷するように、CUPS ドライバを設定。
/etc/cups/mime.convsの後方の
application/octet-stream application/vnd.cups-raw 0 -
の先頭コメント(#)をとる。
/etc/cups/mime.typesの後方の
application/octet-stream
の先頭コメント(#)をとる。
3.CUPS再起動
/etc/init.d/cupsd restart
4.Linuxにてプリンタを登録
http://[サーバIP]:631/
名前は何でもよいが、Canon_MP500 という名前で登録した。
5.テストプリント(Linux local)
6.Windowsにてプリンタ追加
「インターネット上または自宅/会社のネットワーク上のプリンタに接続する」を選び、URL:には、
http://[サーバIP]:631/printers/[4.で登録したプリンタの名前]
と入力。(http://192.168.0.X:631/printers/Canon_MP500)
プリンタドライバはWindows用のものを使う
7.テストプリント(Windowsから)
成功を祈る。
スキャナも使えるようになるかもしれないらしい。
SANE(SANE - Scanner Access Now Easy) を入手。
http://www.sane-project.org/
$tar zxf sane-backends-1.0.18.tar.gz $cd sane-backends-1.0.18 $./configure $make #make install$tar zxf sane-frontends-1.0.14.tar.gz
$cd sane-frontends-1.0.14
$./configure
$make
#make install
MP500等、CANON Pixus(Pixma)シリーズの場合は、別途ドライバがいるようだ。
http://home.arcor.de/wittawat/pixma/
$tar zxf mp150-0.12.2.tar.gz $cd mp150-0.12.2 $make #make install Please connect and turn on your scanner! I will try to detect it. Please wait until your scanner is ready, then press return... [準備ができたらENTER]Connected scanner(s):
1: Canon PIXMA MP500 (SN:04A9170C_41DC7B)I'm about to do a test scan. Please put a magazine or photo in the scanner.
The image will be saved in /tmp/pixmascan.pnm, log file in /tmp/pixmascan.log.
Proceed? [YES/no]
[準備ができたらENTER]
Executing: ./scan -x 10 -y 15 -w 51 -h 25 -1 -d 10 -W /tmp/pixmascan.pnm 2> /tmp/pixmascan.log
Connected scanner(s):
1: Canon PIXMA MP500 (SN:04A9170C_41DC7B)
Scan mode: color
DPI: 75x75
Offset: (30,44) = (1.02cm, 1.49cm)
Dimension: 151x74 = 5.11cm x 2.51cm
Size: 33 kiB (uncompressed, raw)
Source: Flatbed
Scanning...
100% done (33744 bytes written)
Ok, the driver seems to work with your scanner.
Please check /tmp/pixmascan.pnm if it shows a small picture.Install the stand-alone program in '/usr/local/bin'? [YES/no]
[ENTER]
The stand-alone programm was successfully installed at
/usr/local/bin/pixmascanSANE backend directory: /usr/local/lib/sane
SANE dll.conf: /usr/local/etc/sane.d/dll.conf
Installing the SANE backend...
libsane-pixma.so.1 already exists in /usr/local/lib/sane.
Overwrite? [yes/NO] yesBasic installation completed.
NOTE: You probably need to set the permission of the device node in
/dev/bus/usb or /proc/bus/usb. See the manual of your OS.
For Linux, see http://www.sane-project.org/README.linuxNow, I will test the SANE backend. Continue? [YES/no]
[ENTER]
Executing: scanimage > /tmp/scanimage.pnm 2> /tmp/scanimage.log
Please check /tmp/scanimage.pnm and /tmp/scanimage.log
/tmp/pixmascan.log,/tmp/pixmascan.pnm,/tmp/scanimage.pnm および /tmp/scanimage.logファイルが できていた。
拡張子pnmファイルはスキャンした画像ファイルのようだ。PNM とは PPM(Portable Pix Map), PGM(Portable Gray Map), PBM(Portable Bit Map)をまとめて言う時に使い、それぞれ、フルカラー、グレースケールのモノクロ、2値画像を扱う形式らしい。
テキストエディタで開いてみた。
P6
# SANE data follows
638 877
255
鸙・鳰・・ⅰ澈ⅱ・鴣・・・淼ⅲ鉋ⅰ溿・淲・・澈ⅰⅴ…
と、テキストデータが並ぶ。16進数が続くようだ。非圧縮ということか。
ヘッダのP6はPPM(Portable Pix Map)形式を意味し、フォーマットは以下の通り。
1行目 P6
2行目 画像の縦サイズ 画像の横サイズ
3行目 量子化レベルの最大値
4行目〜 (0,0)のRed値, (0,0)のGreen値, (0,0)のBlue値, (1,0)のRed値,...
#で始まる行はコメントか?
とりあえずppmファイルをPaintShopPro8で開いてみた。お!見えた見えた!
# scanimage -L device `pixma:04A9170C_41DC7B' is a CANON Canon PIXMA MP500 multi-function peripheral
さっきは認識しなかったが、pixmaドライバを入れたら認識した。
linuxにおけるスキャンの方法はシンプルで、
scanimage > 出力先ファイル名(拡張子pnm/ppm/pgm)
と入力するだけである。
しかしrootユーザではスキャンできるものの、一般ユーザではスキャンできず、
$ scanimage -LNo scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).
どうするか調べたところ、デバイスを調べて(scanimage -Lでわかる)、
ごにょごにょ
とすればよさそうだ。
次に、Linuxにつながったスキャナに、ネットワーク越しにWindowsからスキャンできるよう、Windowsクライアントをインストール。
その前にLinux側でsane のデーモン、saned を xinit.d から呼び出すように設定。
# cat /etc/services | grep 6566
sane-port 6566/tcp # SANE Control Port
sane-port 6566/udp # SANE Control Port#/etc/xinetd.d/sane
(以下の内容を記述)
service sane
{
port = 6566
socket_type = stream
server = /usr/sbin/saned
user = root
wait = no
disable = no
}
C ドライブのルート直下の sane ディレクトリ にファイル(xsane-win32-0.991.zip)を展開
C:\sane\etc\sane.d\net.conf に接続先サーバの IP アドレスを書く
C:\sane\bin\xsane.exe を起動
続きはまた今度w

2025:
投稿者 onsenfan [ Linuxサーバ, PC・インターネット ] : 2007年01月09日 23:17
この記事が役に立った/おもしろいと思ったら、ワンクリックで応援お願いします
トラックバック
このエントリーのトラックバックURL:
https://blog.odorokutamegoro.com/mt-tb.cgi/1740_3711535688646