[sane-devel] [Scanbd] Set up for Canon PIXMA multifunction scanner - no button response

matt clark liquefry at gmail.com
Thu Oct 13 21:29:35 UTC 2016


Hi Rolf, the "buttons" section in the code shows this:

  Buttons:
    --button-update
        Update button state
    --button-1 <int> [0] [read-only]
        Button 1
    --button-2 <int> [0] [read-only]
        Button 2
    --original <int> [0] [read-only]
        Type of original to scan
    --target <int> [0] [read-only]
        Target operation type
    --scan-resolution <int> [0] [read-only]
        Scan resolution

None of the binary code you mentioned.  Does this mean there is no
sane support for the buttons?  Note that I had to use the command
SANE_CONFIG_DIR=/usr/local/etc/scanbd/sane.d SANE_DEBUG_PIXMA=11
scanimage -A to make it work.  I pushing both buttons, and sending it
via USB (yes it's connected) and the "localhost saned" option which is
I assume sending via network.

On Fri, Oct 14, 2016 at 7:16 AM, Rolf Bensch <rolf at bensch-online.de> wrote:
> Hi Matt,
>
> Have you tested that your scanner resp. the backend sends data @ a push
> button event?
>
> Please test on the console:
> (1) push any button
> (2) $ SANE_DEBUG_PIXMA=11 scanimage -A
> (3) check the response; I'm especially interested in following lines:
>
>   Buttons:
>     --button-update
>         Update button state
> [pixma] INTR T=1.343 len=32
> [pixma]  00000000:00 20 00 00 00 00 00 00  00 00 00 00 00 00 00 00
> [pixma]  00000010:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
> [pixma]
>     --button-1 <int> [1] [read-only]
>         Button 1
>     --button-2 <int> [0] [read-only]
>         Button 2
>     --original <int> [0] [read-only]
>         Type of original to scan
>     --target <int> [2] [read-only]
>         Target operation type
>     --scan-resolution <int> [0] [read-only]
>         Scan resolution
>
> Please repeat (1) ... (3) for all scan buttons.
>
> Maybe you need to test your scanner USB connected to the pc. I haven't
> tested push buttons wireless yet.
>
> If you don't get lines starting with [pixma], your scanner has no button
> support from SANE.
>
> If you get lines starting with [pixma] with more data as shown above (I
> have a different scanner) and without data output below at the
> parameters --button-1 ... --scan-resolution, what I suppose, then please
> send me your "Buttons:" logs and I'll fix the backend code.
>
> Hope this helps.
>
> Cheers,
> Rolf
>
> Am 13.10.2016 um 13:23 schrieb Wilhelm:
>> Oh, mixed the values ...
>>
>>          action btest {
>>                  filter = "^button.*"
>>                  numerical-trigger {
>>                          from-value = 0
>>                          to-value   = 1
>>                  }
>>                  desc   = "Scan to file"
>>                  script = "test.script"
>>          }
>>
>>
>> Am 13.10.2016 um 11:16 schrieb Wilhelm:
>>> Matt, you need something like this in your config:
>>>
>>>         action btest {
>>>                 filter = "^button.*"
>>>                 numerical-trigger {
>>>                         from-value = 1
>>>                         to-value   = 0
>>>                 }
>>>                 desc   = "Scan to file"
>>>                 script = "test.script"
>>>         }
>>>
>>> --
>>>  Wilhelm
>>>
>>> Am 13.10.2016 um 09:09 schrieb matt clark:
>>>> Thanks Wilhelm.  I had changed that while trying to debug the problem,
>>>> not sure why this would be a problem.  Have reverted to the
>>>> scanbd.conf from source, with modifications to sane.d directory and
>>>> comment out the unnecessary manufacturer scanner.d profiles.  revised
>>>> config is attached - apologies for the length of code.
>>>>
>>>> ---
>>>>
>>>> /*
>>>>  * $Id: scanbd.conf 213 2015-10-05 06:52:50Z wimalopaan $
>>>>  *
>>>>  *  scanbd - KMUX scanner button daemon
>>>>  *
>>>>  *  Copyright (C) 2008 - 2015  Wilhelm Meier (wilhelm.meier at fh-kl.de)
>>>>  *
>>>>  *  This program is free software; you can redistribute it and/or modify
>>>>  *  it under the terms of the GNU General Public License as published by
>>>>  *  the Free Software Foundation; either version 2 of the License, or
>>>>  *  (at your option) any later version.
>>>>  *
>>>>  *  This program is distributed in the hope that it will be useful,
>>>>  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>>  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>>>  *  GNU General Public License for more details.
>>>>  *
>>>>  *  You should have received a copy of the GNU General Public License
>>>>  *  along with this program; if not, write to the Free Software
>>>>  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
>>>> 02110-1301, USA.
>>>>  */
>>>>
>>>>
>>>> # global settings
>>>> global {
>>>>         # turn on debugging
>>>>
>>>>         # log to console
>>>>         debug   = true
>>>>
>>>>         # debug logging
>>>>         # 1=error, 2=warn, 3=info, 4-7=debug
>>>>         debug-level = 7
>>>>
>>>>         # drop priviliges to this user
>>>>         #=============================
>>>>         # Linux (most distributions use the saned user):
>>>>         # user    = saned
>>>>         # ArchLinux (ArchLinux doesn't have saned user)
>>>>         # user    = daemon
>>>>         # *BSD
>>>>         # user    = root
>>>>         user    = saned
>>>>
>>>>         # Group to be used
>>>>         #=================
>>>>         # Linux (most distributions use the lp group to access scanners)
>>>>         # group   = lp
>>>>         # ArchLinux (ArchLinux uses the scanner group)
>>>>         # group = scanner
>>>>         #
>>>>         # *BSD (no group lp here, use daemon instead)
>>>>         # group   = daemon # root
>>>>         #
>>>>         group   = lp
>>>>
>>>>         # the saned executable for manager-mode
>>>>         saned   = "/usr/sbin/saned"
>>>>         saned_opt  = {} # string-list
>>>> saned_env  = { "SANE_CONFIG_DIR=/etc/scanbd/sane.d" } # list of
>>>> environment vars for saned
>>>>
>>>>         # Scriptdir specifies where scanbd normally looks for scripts.
>>>>         # The scriptdir option can be defined as:
>>>>         #   - a path relative to the configuations (<path>/etc/scanbd) directory
>>>>         #   - an abosolute path
>>>>         # Examples:
>>>>         # scriptdir = scripts
>>>>         # sets scriptdir to <path>/etc/scanbd/scripts.
>>>>         # scriptdir = /some/path
>>>>         # sets scriptdir to the specified absolute path
>>>>         # Default scriptdir is <path>/etc/scanbd, this is normally appropriate
>>>> scriptdir = /etc/scanbd/scripts
>>>>
>>>>         # Scripts to execute upon device insertion/removal.
>>>>         # It can be necessary to load firmware into the device when it is first
>>>>         # inserted. For example, scanbuttond backend does not know how to load
>>>>         # scanner firmware, and it can be rectified by making a custom script.
>>>>         # A simple command like "scanimage -L" in an example insert.script
>>>>         # invokes saned and it loads the appropriate firmware if necessary.
>>>>         # These scripts receive environmental variables named in the
>>>> "environment" subsection:
>>>>         # SCANBD_DEVICE - device name (fixed string "dbus device" for
>>>> dbus notification)
>>>>         # SCANBD_ACTION - "insert" or "remove", so one script can be used.
>>>>         # device_insert_script = "insert.script"
>>>>         # device_remove_script =
>>>>
>>>>         # scanbuttond_backends_dir sets the path where scanbd looks
>>>> for the scanbuttond backends
>>>> # It can be defined as relative path, starting from the scanbd config
>>>> directory or
>>>>         # as an absolute path
>>>>         # Default is <libdir>/scanbd/scanbutond/backends
>>>>         # Example
>>>> # scanbuttond_backends_dir = "/usr/local/lib/scanbd/scanbuttond/backends"
>>>>
>>>>         # poll timeout in [ms]
>>>>         # (for polling the devices)
>>>>         timeout = 500
>>>>
>>>>         pidfile = "/var/run/scanbd.pid"
>>>>
>>>>         # env-vars for the scripts
>>>>         environment {
>>>>                 # pass the device label as below in this env-var
>>>>                 device = "SCANBD_DEVICE"
>>>>                 # pass the action label as below in this env-var
>>>>                 action = "SCANBD_ACTION"
>>>>         }
>>>>
>>>>         # function definitions
>>>>         # values of the options are simply passed via env-vars
>>>>
>>>>         function function_knob {
>>>>                 filter = "^message.*"
>>>>                 desc   = "The value of the function knob / wheel / selector"
>>>>                 env    = "SCANBD_FUNCTION"
>>>>         }
>>>>         function function_mode {
>>>>                 filter = "^mode.*"
>>>>                 desc   = "Color mode"
>>>>                 env    = "SCANBD_FUNCTION_MODE"
>>>>         }
>>>>
>>>>         multiple_actions = true # allow multiple actions per option
>>>> (up to the total amount of options)
>>>>
>>>>         # action definitions
>>>>         # if the filter matches and the value changes
>>>>         # from from-value to to-value,
>>>>         # <script> is executed
>>>>         # <script> is the full pathname (do not include any parameters)
>>>>         # if parameters are needed, write a script
>>>>
>>>>         # since we can have only at most one action for each option,
>>>> the action-script
>>>>         # can use the function definition (see above) to distinguish
>>>> different tasks
>>>>         # (e.g. use the env-var SCANBD_FUNCTION defined above)
>>>>
>>>>         action scan {
>>>>                 filter = "^scan.*"
>>>>                 numerical-trigger {
>>>>                         from-value = 1
>>>>                         to-value   = 0
>>>>                 }
>>>>                 desc   = "Scan to file"
>>>>                 # script must be an relative path starting from
>>>> scriptdir (see above),
>>>>                 # or an absolute pathname.
>>>>                 # It must contain the path to the action script
>>>> without arguments
>>>>                 # Absolute path example: script = "/some/path/foo.script
>>>>                 script = "test.script"
>>>>         }
>>>>         action email {
>>>>                 filter = "^email$"
>>>>                 string-trigger {
>>>>                         from-value  = ""
>>>>                         to-value    = "^email.*"
>>>>                 }
>>>>                 desc   = "Scan to email"
>>>>                 # script must be an relative path starting from
>>>> scriptdir (see above),
>>>>                 # or an absolute pathname.
>>>>                 # It must contain the path to the action script
>>>> without arguments
>>>>                 # Absolute path example: script = "/some/path/foo.script
>>>>                 script = "test.script"
>>>>         }
>>>>         action copy {
>>>>                 filter = "^copy$"
>>>>                 string-trigger {
>>>>                         from-value  = ""
>>>>                         to-value    = "^copy.*"
>>>>                 }
>>>>                 desc   = "Copy to printer"
>>>>                 # script must be an relative path starting from
>>>> scriptdir (see above),
>>>>                 # or an absolute pathname.
>>>>                 # It must contain the path to the action script
>>>> without arguments
>>>>                 # Absolute path example: script = "/some/path/foo.script
>>>>                 script = "test.script"
>>>>         }
>>>>         action preview {
>>>>                 filter = "^preview$"
>>>>                 numerical-trigger {
>>>>                         from-value = 1
>>>>                         to-value   = 0
>>>>                 }
>>>>                 desc   = "Preview"
>>>>                 # script must be an relative path starting from
>>>> scriptdir (see above),
>>>>                 # or an absolute pathname.
>>>>                 # It must contain the path to the action script
>>>> without arguments
>>>>                 # Absolute path example: script = "/some/path/foo.script
>>>>                 script = "test.script"
>>>>         }
>>>>         action globaltest {
>>>>                 filter = "^message.*"
>>>>                 desc   = "Test (print all env vars)"
>>>>                 # script must be an relative path starting from
>>>> scriptdir (see above),
>>>>                 # or an absolute pathname.
>>>>                 # It must contain the path to the action script
>>>> without arguments
>>>>                 # Absolute path example: script = "/some/path/foo.script
>>>>                 script = "test.script"
>>>>         }
>>>> }
>>>>
>>>> # include
>>>> # include another file at this point. This may only occur outside
>>>> general and devices blocks.
>>>> # an include statement may be relative to the direcory where
>>>> scanbd.conf is located or absolute
>>>> # include("scanner.d/myscanner.conf")
>>>> # include("/my/long/path/myscanner.conf")
>>>>
>>>> # devices
>>>> # each device can have actions and functions, you can disable not
>>>> relevant devices
>>>> #include(scanner.d/avision.conf)
>>>> #include(scanner.d/fujitsu.conf)
>>>> #include(scanner.d/hp.conf)
>>>> include(scanner.d/pixma.conf)
>>>> #include(scanner.d/snapscan.conf)
>>>> #include(scanner.d/canon.conf)
>>>>
>>>>
>>>> On Thu, Oct 13, 2016 at 4:10 PM, Wilhelm <wilhelm.meier at fh-kl.de> wrote:
>>>>> Looking at your log file it seems that action "globaltest" isn't
>>>>> installed. There may be 2 reasons for this:
>>>>>
>>>>> 1) the regex doenst't match
>>>>>
>>>>> 2) there is no trigger definition for the action
>>>>>
>>>>> HtH
>>>
>>
>
>



More information about the sane-devel mailing list