× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Re: Duo: Sharing a scanner using Sane

smh1
Aspirant

Duo: Sharing a scanner using Sane

I've just set up my Duo to provide shared access to an Epson Perfection 1650 scanner using Sane. Previously the scanner was connected to my daughter's PC which was off or in use whenever anyone wanted to scan or copy a document. Now any of out PCs (Windows and Linux) can access the scanner via the network.

This is so useful that I'm surprised there are no other references to it on the forum - but I'm new here so perhaps I've been looking in the wrong places?

I'd be happy to provide more details if anyone is interested.
Message 1 of 13
rozroz
Aspirant

Re: Duo: Sharing a scanner using Sane

Hi. It is interesting.
Can you provide more instructions ?
Thanks In advvance
Message 2 of 13
smh1
Aspirant

Re: Duo: Sharing a scanner using Sane

SANE (http://www.sane-project.org/) - Scanner Access Now Easy - is a Linux-based solution for interfacing with document scanners, which includes provision for sharing a scanner via the network. An additional package - SaneTwain (http://sanetwain.ozuzo.net/) provides the means for PCs running Windows to use the scanner. It does this by bridging between the SANE and TWAIN ( http://www.twain.org/ ) APIs.

Requirements

  1. Backup important data from your ReadyNAS before you start!

  2. The EnableRootSSH and APT plugins must be installed: http://www.readynas.com/?page_id=94

  3. PuTTY if you're connecting from a Windows PC: http://www.putty.org/


  4. Step 1 - Install sane-utils
    I found a HowTo guide that gave most of the basic info: http://www.linux.com/feature/57798. It's probably worth reading this and the SANE Documentation before you begin.


    1. You did back up all the important data from your ReadyNAS didn't you? If not, do it now

    2. Connect to the ReadyNAS using PuTTY or ssh and log in.
      (These notes assume you've logging in with a non-root account and use sudo when necessary).

    3. Install the sane-utils package:

      sudo apt-get update
      sudo apt-get install sane-utils

    4. Plug the scanner into one of the ReadyNAS USB ports and turn it on, then type:

      $sudo scanimage -L

      Your scanner should be recognised and you'll see something like this (Perfection 1650 and GT-8200 are different names for the same device):

      device `epson:libusb:002:004' is a Epson GT-8200 flatbed scanner


    5. Step 2 - Sort out permissions
      At this stage, only root will be able to access the scanner. To fix this you must set up hotplug to recognise a usb scanner when it's plugged in and adjust the permissions.


      1. Download the sane backend source sane-backends-1.0.19.tar.gz, and extract the libusbscanner script from the tools/hotplug folder.
        libusbscanner must be copied into /etc/hotplug/usb - a gotcha here is that /etc/hotplug has no read access for non-root users so this must be done as root. libusbscanner must be made executable:
        chmod a+x libusbscanner


      2. The other component needed is a file called libsane.usermap, which is not included in the source package. This file contains details about recognised devices. I found enough references to it on the web to figure out how to create my own in /etc/hotplug/usb. The file I created looks like this:


        # Epson Perfection 1650
        libusbscanner 0x0003 0x04b8 0x0110 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000

        0x048 and 0x0110 are the vendor and product IDs for the Epson scanner, which you can find for your scanner using the sane-find-scanner command. I’ve no idea what the other fields mean - all the examples I found had them set to 0 as above.

        You can create the file in-place using nano or vi, or create it on a ReadyNAS share using another machine and then copy it into place (as root, remember):

        cd /etc/hotplug/usb
        cp /c/MyShare/libsane.usermap .

      3. A user called saned will have been created when sane-utils was installed. Add this user to the scanners group with:

        sudo usermod -G scanner saned


      4. Step 3 - Run the saned daemon
        To get network access to the scanner you have to set the saned daemon running


        1. Add this line to /etc/inetd.conf

          sane stream tcp nowait saned.saned /usr/sbin/saned saned

          The gotcha here is to ensure that the first item in the command (the port - sane in this case) matches the relevant entry in /etc/services:

          sane 6566/tcp # SANE network scanner daemon

        2. Edit /etc/sane.d/saned.conf to include a list of the host names or IP addresses that will be able to access the scanner. The default file includes some helpful comments about what's needed. The simplest way to include all the machines on your local network is just to add the subnet mask. For my home network with IP addresses of the form 192.168.0.* I just added:
          192.168.0.1/24

        3. restart inetd

          sudo /etc/init.d/inetd restart


        4. Step 4 - Configure Clients
          That's all the server (ReadyNAS) work done - now you just have to set up the client machines that will access the scanner. SANE refers to scanning applications as Frontends and you can find a list of them at http://www.sane-project.org/sane-frontends.html.


          • For Windows machines, install SaneTwain (http://sanetwain.ozuzo.net/). The documentation is pretty clear: all you really need to do is to tell scanimage the IP address of your ReadyNAS.
            I was not able to get the Epson SmartPanel software supplied with the scanner to recognise SaneTwain, but applications like MS Word talk it OK, and scanimage is fine for printing scans or daving them to file.

          • For Linux clients you must install sane-utils and a SANE Frontend. I found that on my Asus eee running EasyPeasy (Ubuntu-eee) sane-utils and XSane were already installed and worked fine.
Message 3 of 13
smh1
Aspirant

Re: Duo: Sharing a scanner using Sane

The recent update to RAIDiator 4.1.5 stopped sane working, because it updated inetd.conf

Repeating steps 3.1 and 3.3 will get it going again.
Message 4 of 13
hanko_panko
Aspirant

Re: Duo: Sharing a scanner using Sane

Very hard stuff for beginners!

I would cetrtainly like to share my Scanner over my NAS and would like Netgear to add this functionality.

Netgear, are u working on that?
Message 5 of 13
mdgm-ntgr
NETGEAR Employee Retired

Re: Duo: Sharing a scanner using Sane

hanko panko wrote:
Very hard stuff for beginners!

I would cetrtainly like to share my Scanner over my NAS and would like Netgear to add this functionality.

Netgear, are u working on that?


I don't think NetGear's likely to add this kind of functionality, but I could be wrong. You could request a Community Add-on and maybe if there's enough interest super-poussin may have a go at making one?

Edit: should have searched. See post below by the_scotsman for link to add-on.
Message 6 of 13
the_scotsman1
Aspirant

Re: Duo: Sharing a scanner using Sane

Message 7 of 13
Maxx20
Aspirant

Re: Duo: Sharing a scanner using Sane

Hey,

I followed all the steps above and I can scan from the command line in the terminal session. The Sane / Twain app just reports the scanner as busy all the time though? If anyone has any hints that would be good.

I'm not keen on buying the add-on as I expect it'll probably do the same as my current setup.

Any hints much appreciated.
Message 8 of 13
Maxx20
Aspirant

Re: Duo: Sharing a scanner using Sane

For reference, my issue was down to the saned user not having permissions set correctly on the USB device. Steps to fix as follows:

(from the terminal, as root) run scanimage -L
Result will be along the lines of: device `niash:libusb:002:002' is a Hewlett-Packard ScanJet 3300C flatbed scanner - the two numbers after libusb are important
Find the USB directory at /proc/bus/usb/
The scanner device access depends on the saned user being able to access the locations within the folder structure corresponding to those two numbers above
In my case the numbers were 002:002, so the folder structure was /proc/bus/usb/002/002

To grant access I followed advice from here: http://penguin-breeder.org/sane/saned/
In my case I typed the following:
$ chown root:saned /proc/bus/usb/002 && chmod g+rw /proc/bus/usb/002
$ chown root:saned /proc/bus/usb/002/002 && chmod g+rw /proc/bus/usb/002/002

Sadly I'm no Linux genius so beyond understanding that I assigned an owner and added group permissions, I can't claim I fully understand the consequences beyond scanning of making these changes. In my defence, my ReadyNAS is only used on a home network and no-one else has access, my risks are minimal.

Hopefully this is helpful to someone 🙂
Message 9 of 13
p4v3u
Aspirant

Re: Duo: Sharing a scanner using Sane

did anyone try this addon (sane-backends) with HP PSC 2210?
regards
Message 10 of 13
thegadgetfreak
Aspirant

Re: Duo: Sharing a scanner using Sane

SANETwain reports that I dont have access to the resource... I have done everything you mentioned and a lots more toooo...

Anyone else who got this to work?

PS: I have a ReadyNAS Pro 4.

I also followed the instructions of maxx20, but still am unsuccessful.

UPDATE: It worked after I set permission/rule for the scanner
Message 11 of 13
p4v3u
Aspirant

Re: Duo: Sharing a scanner using Sane

I have brother dcp-115c device else. Will it work with sane-backends better than HP devices?

Regards
Message 12 of 13
God_Future
Aspirant

Re: Duo: Sharing a scanner using Sane

Hi everyone,
I administrate a friends little office and installed ReadyNAS as central storage device. Due to the fact that there are more than one machine needing a scanner, I installed Sane Backends to ReadyNAS Duo. Worked out for the first time.
But, since I updated Readynas early 2011, SaneFrontends stopped working: "No divice Found". I already tried the hint of smh:

"The recent update to RAIDiator 4.1.5 stopped sane working, because it updated inetd.conf
Repeating steps 3.1 and 3.3 will get it going again."...without success.

The owner of the company is very upset about this issue. I tried all the year to solve, I dont know what to do anymore. Is anyone out there who can help me (e.g. with instructions)?

Thank you,
Future

*Edit* I get an error message while trying to connect with Sane Frontend 0.991:
"Failed to open 'net: xxx.xxx.xxx.xxx:genesys:libusb:001:004': Error during device I/O."
Message 13 of 13
Top Contributors
Discussion stats
  • 12 replies
  • 6267 views
  • 0 kudos
  • 9 in conversation
Announcements