[sane-devel] cannon p208 raspberian

Stan stan at analytica.biz
Sat Nov 28 11:22:10 UTC 2015


Hi Olaf,

thanks for your help.

here is where the official driver is installed

pi at raspberrypi ~ $ tree /opt/Canon/
/opt/Canon/
|-- etc
|   `-- sane.d
|       |-- canondr
|       |   `-- P208.conf
|       `-- canondr.conf
|-- lib
|   |-- canondr
|   |   |-- canondr_backendp208
|   |   `-- canondr_com_usb
|   `-- sane
|       |-- libsane-canondr.la
|       |-- libsane-canondr.so -> libsane-canondr.so.1.0.0
|       |-- libsane-canondr.so.1 -> libsane-canondr.so.1.0.0
|       `-- libsane-canondr.so.1.0.0
`-- share
     `-- doc
         `-- cndrvsane-p208-1.00
             |-- COPYING
             |-- LICENSE-p208-1.00E.txt
             |-- LICENSE-p208-1.00J.txt
             |-- README
             `-- README-p208-1.00.txt

my sane libs seems to be in
/usr/lib/arm-linux-gnueabihf/sane/

there were samo other canon drivers alread line canon_dr.

I created link there to official one canondr.

here's the canon part of the ls of the directory


-rw-r--r--  1 root root    981 Jan  2  2015 libsane-canon.la
lrwxrwxrwx  1 root root     23 Jan  2  2015 libsane-canon.so.1 -> 
libsane-canon.so.1.0.24
-rw-r--r--  1 root root  91680 Jan  2  2015 libsane-canon.so.1.0.24
-rw-r--r--  1 root root   1009 Jan  2  2015 libsane-canon630u.la
lrwxrwxrwx  1 root root     27 Jan  2  2015 libsane-canon630u.so.1 -> 
libsane-canon630u.so.1.0.24
-rw-r--r--  1 root root  63220 Jan  2  2015 libsane-canon630u.so.1.0.24
-rw-r--r--  1 root root   1002 Jan  2  2015 libsane-canon_dr.la
lrwxrwxrwx  1 root root     26 Jan  2  2015 libsane-canon_dr.so.1 -> 
libsane-canon_dr.so.1.0.24
-rw-r--r--  1 root root 136720 Jan  2  2015 libsane-canon_dr.so.1.0.24
-rw-r--r--  1 root root   1002 Jan  2  2015 libsane-canon_pp.la
lrwxrwxrwx  1 root root     26 Jan  2  2015 libsane-canon_pp.so.1 -> 
libsane-canon_pp.so.1.0.24
-rw-r--r--  1 root root  54736 Jan  2  2015 libsane-canon_pp.so.1.0.24
lrwxrwxrwx  1 root root     38 Nov 28 10:28 libsane-canondr.la -> 
/opt/Canon/lib/sane/libsane-canondr.la
-rwxr-xr-x  1 root root 132708 Nov 28 10:30 libsane-canondr.so
-rwxr-xr-x  1 root root 132708 Nov 28 10:30 libsane-canondr.so.1
lrwxrwxrwx  1 root root     44 Nov 28 10:29 libsane-canondr.so.1.0.0 -> 
/opt/Canon/lib/sane/libsane-canondr.so.1.0.0

in dll.conf it was already added (not by me) at the end of it

pi at raspberrypi ~ $ tail /etc/sane.d/dll.conf
teco2
teco3
#test
u12
umax
#umax_pp
umax1220u
v4l
xerox_mfp
canondr


also canondr.conf was copied to /etc/sane.d/

but not this one
-- sane.d
| |-- canondr
| | `-- P208.conf

not sure if it should or not

in the canondr.conf there was devide id with "c" so i added "e" one 
there as well as that is how it is reported by lsusb for me

pi at raspberrypi ~ $ cat /etc/sane.d/canondr.conf
option model P208
option type "sheetfed scanner"
option backend canondr_backendp208
usb 0x1083 0x164e
usb 0x1083 0x164c

I'm not sure if I should do something about this
|-- lib
| |-- canondr
| | |-- canondr_backendp208
| | `-- canondr_com_usb



running debug scanimage shows like it found the driver and loaded it 
just fine

SANE_DEBUG_CANON_DR=127 scanimage -L
[bjnp] create_broadcast_socket: bind socket to local address failed - 
Cannot assign requested address
[sanei_debug] Setting debug level of canon_dr to 127.
[canon_dr] sane_init: start
[canon_dr] sane_init: canon_dr backend 1.0.41, from sane-backends 1.0.24
[canon_dr] sane_init: finish

......

[dll] sane_get_devices
[dll] load: searching backend `canondr' in 
`/usr/lib/arm-linux-gnueabihf/sane:/usr/lib/sane'
[dll] load: trying to load 
`/usr/lib/arm-linux-gnueabihf/sane/libsane-canondr.so.1'
[dll] load: dlopen()ing 
`/usr/lib/arm-linux-gnueabihf/sane/libsane-canondr.so.1'
[dll] init: initializing backend `canondr'
[dll] init: backend `canondr' is version 1.0.1


Notice the sane verion sane-backends 1.0.24

this is version from repository.

I have downloaded and compiled verion 1.0.19 because driver says in 
installation instruction to download this one specifically.

How ever in installation instructions there is make but not make 
install, unless install or the driver installed sane backend somewhere.

but it is not used apparently

here's the driver installation instructions I have followed

pi at raspberrypi ~/cndrvsane-p208-1.00-3 $ cat INSTALL
To build and install Scanner driver module:
   Please put sane-backends-1.0.19.tar.gz in the place same as top-level 
directory.


  $ tar -xzvf sane-backends-1.0.19.tar.gz
  $ tar -xzvf cndrvsane-p208-{Version}.tar.gz
  $ cd sane-backends-1.0.19
  $ ./configure --prefix=/usr --sysconfdir=/etc
  $ make
  Change the top-level directory of this pakage source trees.
  $ cd ../cndrvsane-p208-{Version}
  $ autoreconf -i
  $ ./configure --prefix=/opt/Canon --docdir=/usr/share
  $ make
  $ make install


Appendix:

         * You can also set the following path.
            --prefix
                 /opt/Canon                           : default ... 
/usr/local

            --docdir
                 /usr/share                           : default ... 
/usr/local



Just for reference I have downloaded driver here

http://www.canon-europe.com/support/consumer_products/products/scanners/others/imageformula_p-208.aspx?type=drivers&language=EN&os=MAC%20OS%20X

but it seems like it is on CD comming with scanner. Didn't take that one 
as Macbooks don't have cd drive anymore ;o)


So, I'm still missing something.

Thanks

Stan



On 27/11/15 10:49 AM, Olaf Meeuwissen wrote:
> Hi Stan,
>
> Sorry for the late reply.  I meant to follow-up earlier.
>
> Stan writes:
>
>> Hi,
>>
>> does anyone have an experience with using sane on rasperian OS?
>
> Not me.
>
>> I have found officil linux driver for cannon P-208 scanner.
>
> You may want to mention where so others can find it too.
>
>> Followed installation instruction and compiled module with specific Sane
>> backend sane-backends-1.0.19
>
> 1.0.19?  That's ancient, but not necessarily problematic.
>
>> but it did not helped anything.
>>
>> Most strange is that sane-find-scanner reports as scanner network
>> devices but not the real scanner.
>
> Please note that sane-find-scanner is mostly just a heuristic.  It
> hasn't got much attention in the last, oh, four years.
>
> I had a peek at the source code basically reports *any* USB device with
> a vendor specific class as a scanner.  While many USB scanners *are* in
> fact devices in the vendor specific class, the reverse is of course not
> necessarily true.
>
>> What to do with this?
>
> I wouldn't care too much about the results of sane-find-scanner.
>
>> [...]
>> pi at raspberrypi ~ $ sudo scanimage -L
>> [bjnp] create_broadcast_socket: bind socket to local address failed -
>> Cannot assign requested address
>>
>> 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).
>> pi at raspberrypi ~ $
>
> As you have installed the "official driver", one would assume the above
> would find your scanner.  It doesn't.  Often this is due to the driver
> getting installed in a place where scanimage won't find it.  Assuming
> that rasperian is like most Linux distributions, the "drivers" are very
> likely installed in /usr/lib/sane/ or /usr/lib/*/sane/ (where the * is
> shorthand for an architecture/OS specific name, on my system that would
> be x86_64-linux-gnu).
>
> If your "official driver" is installed in any of these places, you may
> need to add it to dll.conf (normally installed in /etc/sane.d/) to solve
> your problem.
>
> If your "official driver" ended up getting installed some other place,
> e.g. /usr/local/lib/sane/, you can:
>   - add symbolic links from /usr/lib/sane/ to the installed location, or
>   - set and export LD_LIBRARY_PATH to include the directory your driver
>     was installed to
> You still may have to add it to dll.conf before things work, though.
>
>> On 22/11/15 2:58 PM, Stan wrote:
>>> [...]
>>> I have also found that product id is slightly different for my device to
>>> the one in cannon config, for my device it reports "e" at the end
>>> instead of "c"
>>> [...]
>>> so I added line with my product id to  /etc/sane.d/canon_dr.conf
>>> # P-208
>>> usb 0x1083 0x164c
>>> usb 0x1083 0x164e
>
> If the canon_dr backend supports your scanner that should to the trick.
> But, seeing that you had to add them, we don't know yet whether the
> canon_dr backend actually does.
>
>>> not sure for what this exatly is but I have also created
>>> /lib/udev/rules.d/40-libsane.rules
>
> # These are used to set device access permissions.  You will need to
> # replug your scanner to make sure the permissions are updated.
>
>>> with
>>> # Canon P208
>>> ATTRS{idVendor}=="1083", ATTRS{idProduct}=="164e",
>>> ENV{libsane_matched}="yes"
>>>
>>> # Canon P208
>>> ATTRS{idVendor}=="1083", ATTRS{idProduct}=="164c",
>>> ENV{libsane_matched}="yes"
>
> Assuming you followed the pattern of the installed libsane.rules, that
> should do.
>
>>> Not sure what else to check.
>
> You might want to try running scanimage so that it produces debugging
> output.  Maybe that will give other people a clue.  To do so for the
> canon_dr backend
>
>    SANE_DEBUG_CANON_DR=127 scanimage -L
>
> For the "official driver" all I can do is guess.  I would try something
> like for the canon_dr backend but with the CANON_DR part replaced by the
> driver name in ALLCAPS (or check the source code for a hint to turn on
> debugging).
>
> By the way, to check if scanimage finds your "official driver", you can
> use
>
>    SANE_DEBUG_DLL=5 scanimage -L
>
> # Bigger numbers normally mean more debugging output.
>
> Hope this helps,
>



More information about the sane-devel mailing list