[sane-devel] Fwd: canon lide 110 - buttons - don't working :/

Wilhelm wilhelm.meier at fh-kl.de
Fri Nov 30 06:15:56 UTC 2012


Am 30.11.2012 02:27, schrieb Tobias Stoeber:
> Hi Roberto,
>
> Am 29.11.2012 19:44, schrieb Roberto Spadim:
>> i tryed some 'solutions' to use buttons on canon lide110 but no one
>> worked
>> i searched about sane-genesys and buttond but i couldn't make it work
>>
>> can anyone help me allowing this device to accept buttons and send me
>> information when should i start scanimage? maybe we need to add some
>> code but it's not a problem
>
> Well, I am using a Canon LiDE 200 scanner. Should work similar to your
> LiDE 110 ... Using it under Ubuntu 10.04 (well, yes it's old ;-) with
> scanbuttond 0.2.3.

Well, the old scanbuttond has the disadvantage, that it blocks other 
appliations from scanning at the same time it polls the buttons.

This is the reason for scanbd being:

http://sourceforge.net/projects/scanbd/

[
scanbd is a scanner button daemon. It polls the scanner buttons looking
for buttons pressed or function knob changes or other scanner events  as 
paper inserts / removals and at the same time allows
also scan-applications to access the scanners. If buttons are pressed,
etc., various actions can be submitted (scan, copy, email, ...) via 
action scripts. The function knob values are passed to the 
action-scripts as well. Scan actions are also signaled via dbus. This 
can be useful for foreign applications. Scans can also be triggered via 
dbus from foreign applications.
On platforms which support signaling of dynamic device insertion / 
removal (libudev, dbus, hal) scanbd supports this as well.
scanbd can use all sane-backends or some special backends from the (old) 
scanbuttond project.
Supported platforms: Linux, FreeBSD, NetBSD, OpenBSD
]

It normally uses the sane-backends, but can also use the old drivers 
from the scanbuttond (included into scanbd).

> Recompiled the stock Ubuntu scanbuttond package with some changes to
> backends/genesys.c to include the LiDE 200's usb id.
>
> ~~~ code coe changes ~~~
> #define NUM_SUPPORTED_USB_DEVICES 3
>
> static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
>          // vendor, product, num_buttons
>          { 0x04a9, 0x221c, 15 }, // CanoScan LiDE 60 (15 includes
> combined buttons - only 4 real buttons)
>          { 0x04a9, 0x1905, 15 }, // CanoScan LiDE 200 (15 includes
> combined buttons - only 4 real buttons)
>          { 0x04a9, 0x2213, 15 }  // CanoScan LiDE 35 (15 includes
> combined buttons - only 4 real buttons)
> };
>
> static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {

Please change the dimension also to 3 or use NUM_SUPPORTED_USB_DEVICES!


>          { "Canon", "CanoScan LiDE 60" },
>          { "Canon", "CanoScan LiDE 200" },
>          { "Canon", "CanoScan LiDE 35" }
> };
> ~~~ code changes ~~~
>
> So you have to change NUM_SUPPORTED_USB_DEVICES, and add lines for your
> scanner (name and usb id) to backends/genesys.c
>
>> for who don't know the device it's a canoscan lide 110 (sane-genesys)
>> it have four buttons
>> PDF, AUTO SCAN, COPY, EMAIL
>
> Well recognizes all four buttons. What you do with it then, depends on
> the actions you start from /etc/scanbuttond/buttonpressed.sh
>
> I've build my own solution from various sources and tried some things
> out. As there are only some examples, that come with the scanbuttond
> package.
>
> My "setup" is as follows:
>
>   - COPY scans a greyscale image and sents it to the default printer
> with lpr.
>
>   - SCAN just generates a jpeg file and places it in /tmp/scanned and
> display a little message with 'zenity' ;)
>
>   - PDF scans and generates a pdf file in /tmp/scanned, and opens the
> file with evince.
>
>   - EMAIL button generates a jpeg file and opens a new email with
> thunderbird, jpeg attached.
>
> One of my sources has been e.g.
>
> http://en.gentoo-wiki.com/wiki/Scanner_buttons_and_one-touch_scanning
>
> The basic idea of the /etc/scanbuttond/buttonpressed.sh script and using
> some single scripts for each action etc. is derived from there.
>
> In fact you can use "combined" buttons, i.e. pressing SCAN and PDF
> together generates a "button 5" event etc. I'm using that for some more
> scripts, that e.g. open the jpeg file with GIMP for editing.
>
> If you like, I can try to put thes pieces together with some sort of
> documentation. But just getting the "button pressed" events with
> scanbuttond is the easier part and quickly done ;-)
>
> Regards, Tobias
>


-- 
Wilhelm




More information about the sane-devel mailing list