Scanner

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 09:48, 26 January 2007 by Bauldrick (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This article Based on work by Myno, andre, mindbender, downlalaway, Thorongil, frontalot, and TcT. Originally by downlalaway at Linkstationwiki.org
This is a basic run through of USB devices connecting for Debian on an PPC LinkStation. The USB hard drive is USB 2.0 at 3Mb/s (on a laptop HD). NB. This was based on using the original kernel #990 conversion of the LS 1 and not the Freelink project. It has been updated for use with Freelink 1.11 but requires run-throughs by others to check. USB and hotplug was/is a little flakey on 2.4 kernels in recognising devices. A reboot while the device is in should make things work. The 2.6 debian kernel is highly recommended if hot-swapping of usb devices might occur.


Scanner Setup

For scanner I originally used xsane -this can test if your scanner actually works. Confident people might go straight to sane.

apt-get install xsane  

It worked and found the scanner first time through a vnc link as root -before I did ./MAKEDEV or mknod etc. If xsane works this is a good start.

There is a good way of networking your scanner -this is pretty impossible in windows except with a corporate commercial program I saw. You need to install sane on the LS as per:

apt-get install sane sane-utils 

I used versions 1.0.15-10, a newer version is now current. sane-utils sets up a 'saned' user and group which are the safe ways to access instead of root as xsane used. Best to check this is in /etc/group.

The main difficulty is giving your scanner access to non-root. There's a number of tricks depending on hardware (mine an Epson CX3200 printer/scanner). This is how I (downlalaway) did it: As root do scanimage -L this should find a scanner - if not reboot and reboot/replug scanner. Hopefully a found scanner is id'd and uses libusb. Try as a non-root user - it probably won't find it yet.

Note: the following script was unnnecessary when using udev on 2.6.16 experimetning on a debian Linksys NSLU2, and is expected to be the same with udev on a linkststation.

So to get non-root access to the scanner I had to add a small script to automatically give the scanner group as 'scanner' -details from: http://www.freecolormanagement.com/sane/libusb.html And the relevant section: Save the script as /etc/hotplug/usb/epson_scanner and make it executable.


#!/bin/bash

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
        chown root "${DEVICE}"
        chgrp scanner "${DEVICE}"
        chmod 660 "${DEVICE}"
fi

Check in /etc/group there's a group 'scanner' and add any usernames you want access and the saned user.

scanner:x:102:root,username,saned

Reboot the scanner and LS to update group list. Now we need to log in as saned and check saned access. As root type:

linkstation#su -s /bin/sh - saned 
saned@linkstation$scanimage -L    

This should find your scanner again if its all worked -try some rebooting/repluggin first if not and check root still finds it. So it works for non-root locally now to get networked follow the advice at: http://penguin-breeder.org/sane/saned/

The steps are: ->1. Setup up inetd (or xinetd) with /etc/inetd.conf to start saned on a request ->2. Check /etc/services (should be default ok) ->3. Set inetd to start at boot (Webmin..system..bootup and shutdown.. tick the inetd entry and press button to start on boot)

To access from a Windows box use sanetwain (its great!):

http://sanetwain.ozuzo.net/ 

It will allow Twain integration easily into any windows programs including work etc as though it were directly connected (NB check your firewalls to allow access). You may have to delete the Devices line in the C:\Windows\sanetwain.ini file before connecting. I don't know a good solution yet, but it is caused by sanetwain recording the last good libusb connection number, but it changes the next time the scanner is turned on. You could also use XSane (for Win or Linux) and other Linux derivatives -Kooka etc.

Enjoy and please carefully comment if it doesn't work or changes needed.

Originally by downlalaway and edited by frontalot, Myno, andre, mindbender, downlalaway, Thorongil and TcT from linkstationwiki.org