SANE - Scanner Access Now Easy

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
SebasMiles
DD-WRT Novice


Joined: 03 Feb 2007
Posts: 26

PostPosted: Fri Aug 26, 2011 21:28    Post subject: SANE - Scanner Access Now Easy Reply with quote
What is it for?
SANE is a scanner server which allows you share your stand-alone scanner or your printer-combo scanner over the network.

All of this except for a couple of changes is taken from HERE so full credit goes to carterb and hes also the one maintaining the package for optware.

Note about editing in vi: If you have never used vi(file editor) before there are a few guides out there, but for this you just need to learn the following 3 commands:
i = Allows you to insert text in the file
esc = once youre done typing, this pulls you out of the insert mode.
:wq = This will save the file and quit vi.

IMPORTANT: FIRST CHECK TO MAKE SURE THAT YOUR SCANNER IS SUPPORTED HERE

DISCLOSURE: I got my scanner almost all ready, but I was having issues doing the test. The sharing and detection works but when scanning it fails, however this may well be isolated to my PIXMA MP450 Printer/Scanner and I don't have another scanner to test with. If someone else gets theirs to work please let me know.

1) This guide assumes you have Optware The Right Way installed and running properly.

2) Run the following commands through telnet. Some packages may already be installed.
Code:
ipkg-opt install libtiff
ipkg-opt install libjpeg
ipkg-opt install libieee1284


3)Now we install SANE
Code:
ipkg-opt install sane-backends


4.1) After installation we now have to configure it. First we need to grant access to what range of IP's will be able to access the scanner.
Code:
vi /opt/etc/sane.d/saned.conf

Then add the following at the end of the file:
Code:
192.168.1.0/24 #grant access to scanner from network 192.168.1.x

Save and Quit, of course you will need to adjust this if your domain is on a different range.

4.2) Next we edit the xinetd config file for sane
Code:
vi /opt/etc/xinetd.d/saned

Your file should be edited to look as follows:
Code:
service saned
{
type = UNLISTED
port = 6566
socket_type = stream
server = /opt/sbin/saned
protocol = tcp
user = root
group = root
wait = no
disable = no
}

Save and exit.

4.3) Plug in scanner and reboot router (can be done directly from the console typing "reboot")

To test if the scanner has been detected run the following first:
Code:
sane-find-scanner


In the output it should show something like this:
Code:
found USB scanner (vendor=0x04a9 [Canon], product=0x1713 [MP830]) at libusb:003:004


Then run this:

Code:
scanimage -L


The output should looks something like this:
Code:
device `pixma:04A91713_19E40D' is a CANON Canon PIXMA MP830 multi-function peripheral


If both outputs show up correctly, then the scanner should've been properly detected. To check if it scans properly you should try the following:

Code:
scanimage -T


It should go through the test and complete successfully.

To check if the network side is working you can try telnet into your router on port 6566. If it gives you a connection then its working, if it rejects the connection then there may be some problems with the xinetd side of it sharing it to the network.

Great...Now what?


This takes care of all the backend part. Now you need a way to connect to it.
SaneTwain: The best for windows I found is SaneTwain and it will integrate right into a 3rd party application like Adobe Acrobat instead of having to scan to file and then opening it to edit.
XSane:This is a more commonly used one but has certain requirements (like a bit of manual configuration and the fact that the folder MUST be set in C:\ for it to work). I have attached the file because it is hard to find and no longer listed in any of the mirrors in their website. The other downside is that it doesn't seem to interface directly with any 3rd party apps so you would need to save to a file each time. If you are on a linux machine, Xsane has what you need.
To configure in windows please remember to go into the following file and add your router IP at the end of the file:
Code:
C:\sane\etc\sane.d\net.conf

Then just go to the bin folder and run xsane.exe

Known issues:
Not everything is supported all the way, in particular some HP Scanner/Printer combos may need another package installed and others may need some slight modifications. Since it shouldn't vary on the way it has to be installed then please go directly to the original post.

Special thanks to wunderkind for providing a solution to a key problem and for frater (and all others that have helped) for creating the optware for newbies guide.



xsane-win32-0.991.zip
 Description:
XSane Win32 v0.991

Download
 Filename:  xsane-win32-0.991.zip
 Filesize:  9.77 MB
 Downloaded:  2413 Time(s)

Sponsor
newnews
DD-WRT User


Joined: 14 Feb 2010
Posts: 86

PostPosted: Tue Jan 03, 2012 5:43    Post subject: scanimage -T fails on my HP all-in-one officejet 6100 Reply with quote
Hi, SebasMiles:

I follow your instruction and suceeded until the step "scanimage -T". In the beginning, sane-find-scanner finds my scanner, but "scanimage -L" gives "no scanner identified". After I updated hplip to latest version 3.11-3a, the command "scanimage -L' finds "device `hpaio:/usb/OfficeJet_6100_Series?serial=MY3CGH60VX2R' is a Hewlett-Packard OfficeJet_6100_Series all-in-one". Then I use "scanimage -T" fails on "scanimage: open of device hpaio:/usb/OfficeJet_6100_Series?serial=MY3CGH60VX2R failed: Error during device I/O".

I use "telnet router_ip:6566" with connection error. Checked service xinted is up running and the printer function of all-in-one is working fine.

Do you or any one have suggestion?

Thanks
newnews
DD-WRT User


Joined: 14 Feb 2010
Posts: 86

PostPosted: Tue Jan 03, 2012 17:54    Post subject: Reply with quote
Another finding is that xinetd only start "swat" and "p910nd" services, but not sane. When I was installing sane, I have the error message:

"Adding saned /etc/services...//opt/lib/ipkg/info/sane-backends.postinst: line 14: can't create /etc/services: Read-only file system";

and also the errors when installing hplip:

ipkg: extract_archive: /etc/cups/: Read-only file system
ipkg: /etc/cups/pstotiff.convs: No such file or directory
ipkg: /etc/cups/pstotiff.types: No such file or directory

I believe not all the components are installed and saned was not added to service. So the question is how to make /etc writable?
ediKG
DD-WRT Novice


Joined: 24 Feb 2012
Posts: 3

PostPosted: Fri Feb 24, 2012 17:37    Post subject: Reply with quote
Hello,

i use dd-wrt build 17990 NEWD2 with my WRT610N router. On this firmware i installed optware and also the packages p910nd for printer sharing and sane 1.0.22.
My printer/scanner is CANON MP500.

Now i can print successfully over my network. But i cannot get sane working. Can anybody help me?
Here is the output from sane-find-scanner
Code:
root@WRT610N:~# sane-find-scanner

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.
  # Also you need support for SCSI Generic (sg) in your operating system.
  # If using Linux, try "modprobe sg".

found USB scanner (vendor=0x04a9 [Canon], product=0x170c [MP500]) at libusb:002:022
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

I think the scanner is properly recognized.
Here is the output of scanimage -L
Code:
root@WRT610N:~# scanimage -L
device `pixma:04A9170C_11D3CB' is a CANON Canon PIXMA MP500 multi-function peripheral
... but it takes a while until the response is there, don't know if this is usual or not.

Here is the output of scanimage -T
Code:
root@WRT610N:~# scanimage -T
scanimage: scanning image of size 638x877 pixels at 24 bits/pixel
scanimage: acquiring RGB frame, 8 bits/sample
scanimage: reading one scanline, 1914 bytes...  FAIL Error: Error during device I/O
The scanner itself do the scanning but my router don't receive any data from the scanner.
Does anybody has an idea, what is wrong? I've searched in this forum and on the web. There are lots of people which have the same problem, but i didn't find any workarounds or solutions for this problem. Because of that I'm asking here for support.
SebasMiles
DD-WRT Novice


Joined: 03 Feb 2007
Posts: 26

PostPosted: Sun Feb 26, 2012 9:44    Post subject: Reply with quote
ediKG, I had the same issue. I was hopping that someone with better skills would be able to reply with an idea of what happened but no such luck. I left the guide behind in case someone else wanted to try.
Evostar
DD-WRT Novice


Joined: 25 Mar 2012
Posts: 6

PostPosted: Sun Mar 25, 2012 21:43    Post subject: Reply with quote
Hello!

I had exactly the same problem and tried several solutions but i think i found a "fix" now...

You have to replace libusb_0.1.12-2_mipsel with libusb_0.1.12-1_mipsel or atleast the .so file of libusb in /opt/lib.
After doing so scanning with my Pixma Mp610 works now..



libusb-0.1.so.4.4.rar
 Description:

Download
 Filename:  libusb-0.1.so.4.4.rar
 Filesize:  8.81 KB
 Downloaded:  1650 Time(s)


libusb_0.1.12-1_mipsel.rar
 Description:
the ipk file inside can be extracted with winrar

Download
 Filename:  libusb_0.1.12-1_mipsel.rar
 Filesize:  10.39 KB
 Downloaded:  1615 Time(s)

JoeyG1973
DD-WRT Novice


Joined: 12 Jun 2012
Posts: 18

PostPosted: Mon Jun 18, 2012 12:35    Post subject: HP PSC 1610 Reply with quote
I have an HP PSC 1610. I have optware installed. I followed the directions on this page and even installed hplip.

I can see the scanner with sane-find-scanner:


root@DD-WRT:~# sane-find-scanner

# sane-find-scanner will now attempt to detect your scanner. If the
# result is different from what you expected, first make sure your
# scanner is powered up and properly connected to your computer.

# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a kernel SCSI driver for your SCSI adapter.
# Also you need support for SCSI Generic (sg) in your operating system.
# If using Linux, try "modprobe sg".

found USB scanner (vendor=0x03f0 [HP], product=0x4811 [PSC 1600 series]) at libusb:001:004
# Your USB scanner was (probably) detected. It may or may not be supported by
# SANE. Try scanimage -L and read the backend's manpage.

# Not checking for parallel port scanners.

# Most Scanners connected to the parallel port or other proprietary ports
# can't be detected by this program.

However scanimage -L reports:

No 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).


Anybody have any idea what is going wrong here?
madi123
DD-WRT User


Joined: 04 Mar 2008
Posts: 124

PostPosted: Sat Oct 27, 2012 11:25    Post subject: The latest sane-backends Reply with quote
If everyone is interested in latest SANE backends attached is a git version I cross-compiled for DD WRT. With 1.0.22 backends I was frequently experiencing the FAIL Error: Error during device I/O error. With this version and few tweaks to PIXMA driver my Canon MF 3240 finally worked. It also may support new scanners.

Tips: Unzip before installing. Follow the 1st post. Edit ipkg.conf to disable download from repository. Edit /opt/etc/sane.d/saned.conf again.



sane-backends_git20121025-1_mipsel.zip
 Description:

Download
 Filename:  sane-backends_git20121025-1_mipsel.zip
 Filesize:  3.45 MB
 Downloaded:  1549 Time(s)

mbwd
DD-WRT Novice


Joined: 13 Feb 2009
Posts: 31

PostPosted: Sun Nov 04, 2012 1:19    Post subject: Can't get SANE to run on DD-WRT Reply with quote
I thought this was going to work, but after getting optware up and following the SANE instructions, my problem is that I can identify the scanner using "sane-find-scanner" -- but when I try to "scanimage -L", I get:

Quote:
No 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).


The best I can decipher, its because there is no way to add "saned 6566/tcp # SANE network scanner daemon" after "# Local Services" in the /etc/services file. So I don't think SANE is running at all. And I'm not sure if its because my build doesn't support it (DD-WRT v24-sp2 (04/07/12) big - build 18946M NEWD-2 K2.6 Eko).

Can someone please let me know if you know how to get around this issue?

Alternatively, mad123, can you give a little more detail on how to install your backend?

Thanks!


NOTE::

If it helps, here is the output from the "xinetd -d" command:

Quote:
12/11/3@17:24:36: DEBUG: 4625 {handle_includedir} Reading included configuration file: /opt/etc/xinetd.d/p910nd [file=/opt/etc/xinetd.conf] [line=15]
12/11/3@17:24:37: DEBUG: 4625 {handle_includedir} Reading included configuration file: /opt/etc/xinetd.d/saned [file=/opt/etc/xinetd.d/saned] [line=12]
12/11/3@17:24:37: DEBUG: 4625 {handle_includedir} Reading included configuration file: /opt/etc/xinetd.d/swat [file=/opt/etc/xinetd.d/swat] [line=12]
12/11/3@17:24:37: DEBUG: 4625 {handle_includedir} Reading included configuration file: /opt/etc/xinetd.d/vsftpd [file=/opt/etc/xinetd.d/vsftpd] [line=11]
12/11/3@17:24:37: DEBUG: 4625 {remove_disabled_services} removing laserjet
12/11/3@17:24:37: DEBUG: 4625 {remove_disabled_services} removing ftp
Service defaults
Instances = 60
CPS = max conn:25 wait:30
Bind = All addresses.
Only from: localhost(HOST) 10.0.0.0/255.0.0.0(NET) 172.16.0.0/255.240.0.0(NET) 192.168.0.0/255.255.0.0(NET)
No access: No blocked sites
Logging to syslog. Facility = authpriv, level = info
Log_on_success flags = HOST PID
Log_on_failure flags = HOST

Service configuration: saned
id = saned
flags = IPv4
type = UNLISTED
socket_type = stream
Protocol (name,number) = (tcp,6)
port = 6566
wait = no
user = 0
group = 0
Groups = no
PER_SOURCE = -1
Bind = All addresses.
Server = /opt/sbin/saned
Server argv = saned
Only from: localhost(HOST) 10.0.0.0/255.0.0.0(NET) 172.16.0.0/255.240.0.0(NET) 192.168.0.0/255.255.0.0(NET)
No access: No blocked sites
Logging to syslog. Facility = authpriv, level = info
Log_on_success flags = HOST PID
Log_on_failure flags = HOST

Service configuration: swat
id = swat
flags = IPv4
socket_type = stream
Protocol (name,number) = (tcp,6)
port = 901
wait = no
user = 0
Groups = no
PER_SOURCE = -1
Bind = All addresses.
Server = /opt/sbin/swat
Server argv = swat
Only from: localhost(HOST) 192.168.0.0/255.255.0.0(NET)
No access: No blocked sites
Logging to syslog. Facility = authpriv, level = info
Log_on_success flags = HOST PID
Log_on_failure flags = HOST USERID

12/11/3@17:24:37: DEBUG: 4625 {cnf_start_services} Started service: saned
12/11/3@17:24:37: DEBUG: 4625 {cnf_start_services} Started service: swat
12/11/3@17:24:37: DEBUG: 4625 {cnf_start_services} mask_max = 7, services_started = 2
12/11/3@17:24:37: NOTICE: 4625 {main} xinetd Version 2.3.14 started with no options compiled in.
12/11/3@17:24:37: NOTICE: 4625 {main} Started working: 2 available services
12/11/3@17:24:37: DEBUG: 4625 {main_loop} active_services =
2
mbwd
DD-WRT Novice


Joined: 13 Feb 2009
Posts: 31

PostPosted: Sun Nov 04, 2012 2:37    Post subject: SOLVED Reply with quote
So I figured this out. I needed to follow post #174 here http://wl500g.info/showthread.php?21162-How-To-Sane-Scanner-Server-with-XSane-Frontend/page12 to download and install "xerox_mfp_wl500.tar.bz2."

First, I downloaded the linked file
Second, I moved the file to the /tmp folder using the "scp" command in my Mac's terminal: /Users/USERNAME/Desktop/xerox_mfp_wl500.tar.bz2 root@10.0.1.5:/tmp
Finally, I just followed the instructions:

Quote:
cd /tmp
tar jxf xerox_mfp_wl500.tar.bz2
./install


That was it. Hope this helps someone.
yutoon
DD-WRT User


Joined: 15 Jul 2010
Posts: 60

PostPosted: Tue Aug 13, 2013 22:03    Post subject: Brother Scanners: NO! Reply with quote
To save time for any who want this to work for a Brother scanner: Forget it!

The word is that Brother has released only part of the source, not enough to build a package with. There is hope for the future (but not much).

Time to dump Brother and pick up a brand that fully supports open-source.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum