Wilhelm,
<br><br>
thank you for taking the time to look into these issues. Following your advise I had a look into the source code and tried to understand, what happens in case, when e.g. button 3 is pressed and compared the logs with the information by pressing e.g. button 4 (log file excerpt - see below).
<br><br>
The last common action for both button events is this logging information:
<pre> scanbd: button 4 has been pressed.</pre>respective<pre> scanbd: button 3 has been pressed.</pre>
The message has been generated in file scanbuttond_wrapper.c in line 519 (source version 1.4.2).
Next follows this if statement:
<pre>
if ((st->opts[si].from_value.num_value == st->opts[si].value.num_value) &&
(st->opts[si].to_value.num_value == value)) {
slog(SLOG_DEBUG, "value trigger: numerical");
st->triggered = true;
st->triggered_option = si;
// we need to trigger all waiting threads
if (pthread_cond_broadcast(&st->cv) < 0) {
slog(SLOG_ERROR, "pthread_cond_broadcats: this shouln't happen");
}
}
</pre>
Within the if statement the next logging message is generated and a new thread, where further action for script execution seems to be taken. The logging information is only printed for button 3! Obviously the if condition is false for button 4. I will try to debug this (I have no experience with debugging multi-threaded code), hoping to get closer to the problem, why no script is executed for button 1 and 4 - or do you already have an idea, what might be wrong?
<br><br>
Kind regards,<br>Rainer.
<br>
<h2>syslog excerpt</h2>
<h3>button 4 pressed</h3>
<pre>scanbd: polling thread for Perfection 1670 cancellation point
scanbd: polling device Perfection 1670
scanbd: ################ button 4 pressed ################
scanbd: option: 1
scanbd: scanbtnd_button_name (1)
scanbd: scanbtnd_button_name, backend: Snapscan USB
scanbd: checking option scan number 1 (0) for device Perfection 1670
scanbd: option: 3
scanbd: scanbtnd_button_name (3)
scanbd: scanbtnd_button_name, backend: Snapscan USB
scanbd: checking option email number 3 (1) for device Perfection 1670
scanbd: option: 2
scanbd: scanbtnd_button_name (2)
scanbd: scanbtnd_button_name, backend: Snapscan USB
scanbd: checking option copy number 2 (2) for device Perfection 1670
scanbd: option: 4
scanbd: scanbtnd_button_name (4)
scanbd: scanbtnd_button_name, backend: Snapscan USB
scanbd: checking option pdf number 4 (3) for device Perfection 1670
scanbd: button 4 has been pressed.
scanbd: Iteration on dbus call
scanbd: polling thread for Perfection 1670 cancellation point
scanbd: polling device Perfection 1670
...</pre>
<br>
<h3>button 3 pressed</h3>
<pre>scanbd: polling thread for Perfection 1670 cancellation point
scanbd: polling device Perfection 1670
scanbd: ################ button 3 pressed ################
scanbd: option: 1
scanbd: scanbtnd_button_name (1)
scanbd: scanbtnd_button_name, backend: Snapscan USB
scanbd: checking option scan number 1 (0) for device Perfection 1670
scanbd: option: 3
scanbd: scanbtnd_button_name (3)
scanbd: scanbtnd_button_name, backend: Snapscan USB
scanbd: checking option email number 3 (1) for device Perfection 1670
scanbd: button 3 has been pressed.
scanbd: value trigger: numerical
scanbd: trigger action for device Perfection 1670 with script scan.script
scanbd: setting env: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
scanbd: No PWD, setting env: PWD=/home/pi
scanbd: setting env: USER=root
scanbd: setting env: HOME=/root
scanbd: setting env: SCANBD_DEVICE=snapscan:libusb:001:004
scanbd: setting env: SCANBD_ACTION=email
scanbd: append string Perfection 1670 to signal scan_begin
scanbd: now sending signal scan_begin
scanbd: Iteration on dbus call
scanbd: append string PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin to signal trigger
scanbd: append string PWD=/home/pi to signal trigger
scanbd: append string USER=root to signal trigger
scanbd: append string HOME=/root to signal trigger
scanbd: append string SCANBD_DEVICE=snapscan:libusb:001:004 to signal trigger
scanbd: append string SCANBD_ACTION=email to signal trigger
scanbd: now sending signal trigger
scanbd: now flushing the dbus
scanbd: unref the signal
scanbd: using relative script path: scan.script, expanded to: /usr/local/etc/scanbd/scan.script
scanbd: waiting for child: /usr/local/etc/scanbd/scan.script
scanbd: exec for /usr/local/etc/scanbd/scan.script
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: Iteration on dbus call
scanbd: child /usr/local/etc/scanbd/scan.script exited with status: 0
scanbd: Iteration on dbus call
scanbd: append string Perfection 1670 to signal scan_end
scanbd: now sending signal scan_end
scanbd: reopen device Perfection 1670
scanbd: option: 2
scanbd: scanbtnd_button_name (2)
scanbd: scanbtnd_button_name, backend: Snapscan USB
scanbd: checking option copy number 2 (2) for device Perfection 1670
scanbd: option: 4
scanbd: scanbtnd_button_name (4)
scanbd: scanbtnd_button_name, backend: Snapscan USB
scanbd: checking option pdf number 4 (3) for device Perfection 1670
scanbd: polling thread for Perfection 1670 cancellation point
scanbd: polling device Perfection 1670
...</pre>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://sane.10972.n7.nabble.com/Raspbian-Jessie-scanbd-scripting-issue-tp19611p19620.html">Re: Raspbian Jessie - scanbd scripting issue</a><br/>
Sent from the <a href="http://sane.10972.n7.nabble.com/SANE-Dev-f3.html">SANE - Dev mailing list archive</a> at Nabble.com.<br/>