WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Sane/Scanner/Brother DCP  (Read 4299 times)

Offline gregg_a_g

  • Newbie
  • *
  • Posts: 28
Sane/Scanner/Brother DCP
« on: August 12, 2011, 07:05:08 AM »

*******
NB, I moved this from the "Extensions Category" since it wasn't getting any response.
I thought I had miscategorized the post. 
***********


Started using TC about 2 weeks ago.  Great!  I plan to use a small mini-ITX box as a central
server.  I have NFS running well and am trying to install SANE and a Brother DCP-7020 printer/scanner.  Brother has .deb and .rpm files for Linux drivers.  I used "ar" from base
to extract the files from the .deb archive.  There are a couple of setup scripts and the
expected backend libraries.

Installed sane-backends no problem.  I don't quite understand the architecture of TC.  After
installing sane-backends I see there is a /usr/local/etc/sane.d/dll.conf (which is a link to
/tmp/tcloop/...).  This file is "read-only".  I can't "edit" this file, but I can "replace" the link
by "sudo cp myfile /usr/local/etc/sane.d/dll.conf", where "myfile" contains only the line
"brother2".  Also, I can create /etc/sane.d and place a dll.conf in that directory.  So I want
to understand the "precedence" or the right place to put dll.conf.  Will /etc/sane.d/dll.conf
supersede the /usr/local/etc/sane.d/dll.conf?

When I used sane-find-scanner I can "see" the DCP-7020 (right bus, etc).  When I try
to scan (scanimage -L or xsane) the scanner can't be found.  I put the Brother drivers in
/usr/lib, /usr/bin, etc.

Am I on the right track?  Or do I need to "install" some of the libraries and dll.conf into another
directory?

Thanks for any help!

******************************

UPDATE-

I still don't understand when "/etc/..." will take precedence over "/usr/local/etc..." but here's
what I have done for now, and what gives a satisfactory solution. 

1) Install sane-backends
2) Install xsane
3) Use "ar" to extract files from Brother "brscan2" .deb archive.
4) The archive has the following files/structure:

     /usr
         /lib
              libbrscandec2.so.1.0.0
              libbrcolm.so.1.0.0
              libbrscandec2.so.1 -> libbrscandec2.so.1.0.0 (soft link)
              libbrscandec2.so -> libbrscandec2.so.1 (soft link)
              libbrcolm.so.1 -> libbrcolm.so.1.0.0 (soft link)
              libbrcolm.so -> libbrcolm.so.1 (soft link)
              /sane
                 libsane-brother.so.1.0.7
                 libsane-brother.so.1 -> libsane-brother.so.1.0.7 (soft link)
                 libsane-brother.so -> libsane-brother.so.1 (soft link)

          /bin
               brsaneconfig
 
          /local
               /Brother
                    /sane
                     Brsane.ini
                     few more files related to using with "net and saned"
                       /GrayCmData
                          several directories (appear to be related to color mgmt, maybe not required)


5) After quite a bit of "google", trial and error experimentation, I ended up with the following:
   
   a) Copy /usr/lib/libbr* (from archive) to /usr/lib
   b) Copy /usr/lib/sane/libsane-br* (from archive) to /usr/local/lib/sane
   c) Copy /usr/local/Brother/sane/Brsane.ini (from archive) to /usr/local/Brother/sane/Brsane.ini
   d) cp /usr/local/etc/sane.d/dll.conf to /tmp/mydll.conf
   e) edit mydll.conf and add "brother2" at end
   f) cp /tmp/mydll.conf to /usr/local/etc/sane.d/dll.conf
 

6) Run scanimage -L and everything looks good!  xsane also works as expected and
produces a good scan


I'm not sure if the "GrayCmData" files are required or not.  I'll experiment some more
and see if I can find out if they are used for color management or something.

*****************************

In order to automate, I created an "extension", dcp-7020.tcz with the file structure
in 5) above.  I edited bootlocal.sh and added a line "setup-dcp-7020.sh" which
deletes "/usr/local/etc/sane.d/dll.conf" and then "echo brother2 > dll.conf" to recreate
the dll.conf file.  Since /usr/local/etc/sane.d/dll.conf is a "soft link" to a "read only" file, I couldn't figure out how to "edit" the file - so I deleted and recreated.

I tried making a /etc/sane.d/dll.conf, but I never could get it to work.  It seemed like the
/usr/local/etc/sane.d/dll.conf was getting used instead.  If anyone can explain that behaviour
to me I would appreciate it.  I don't quite get the "heirarchy".  Also, I don't quite understand
why I had to put some of the Brother files in /usr/lib and some in /usr/local/lib, but
apparently that was the key to getting things to work.

Hope this helps someone else...   :D
     
         

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Sane/Scanner/Brother DCP
« Reply #1 on: April 18, 2012, 01:55:54 AM »
I used search for "sane" and found this. Old chain, sorry for this up, but this seems to be common problem on TC.

I have encountered same kind of problems with Samsung UnifiedLinuxDriver, first with CUPS and now with SANE installation.

I think there is some kind of bug on SANE with installation directories. If SANE documents are update, recommended installation point are "/usr" for distro SANE and "/usr/local" for normal user. TC SANE is istalled on "usr/local" , which is probably correct on this case (not stable yet).

Unfortunatelly something goes wrong, SANE libraries are not found correctly. Problem might be that SANE uses variables for default directories and those variables must set on compiling.

If so, there is three choises to fix this bug:

a) Manually try-error to find correct libraries installation points
b) Compile SANE with "/usr" installation point (default libraries match probably easier)
c) Compile SANE with "/usr/local" installation point and set variables correctly

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: Sane/Scanner/Brother DCP
« Reply #2 on: April 18, 2012, 03:51:39 AM »
Unfortunatelly something goes wrong, SANE libraries are not found correctly.

sane is working fine for me with an hp scanner - could you paste the error messages you get about the libs not being found.

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Sane/Scanner/Brother DCP
« Reply #3 on: April 19, 2012, 08:08:45 AM »
Sorry, I don't have not much info because sane is badly documented and "testing facilities are not implemented" as they say.
"sane-find-scanner" founds scanner, "scanimage -L" dosn't find scanner, that's all information I have.

Symptoms are very alike gregg_a_g has experienced, I will try to fix that same way, lets see what will happen.

Edit: I use xerox_mfp driver (NOT UnifiedLinuxDriver) for SANE, which is documented to work with this device. Another suspected is udev-rules misfunction, but I'm not sure, if only saned needs that. That default-lib variable issue is mentioned on SANE-project man-page documentation.
« Last Edit: April 19, 2012, 08:36:05 AM by Yleisajattelija »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: Sane/Scanner/Brother DCP
« Reply #4 on: April 19, 2012, 08:40:18 AM »
"sane-find-scanner" founds scanner, "scanimage -L" dosn't find scanner, that's all information I have.

Could you post the output from these two commands.

Offline Yleisajattelija

  • Full Member
  • ***
  • Posts: 192
Re: Sane/Scanner/Brother DCP
« Reply #5 on: April 19, 2012, 08:41:45 AM »
Ok, when I get on the machine tonight.