Re: [sane-devel] help with getting scanbd and interactive scanner tools working together

2024-01-01 Thread Ron Young via sane-devel


Apologies, I sent the wrong notes for the saned only configuration 
notes, new files are attached.


Also, what doesn't work in the scanbd configuration is that the sane 
tools/gscan2pdf/simple-scan doesn't see the scanner.


-ron

On 1/1/24 15:02, Ron Young wrote:

Hi Everyone:

   I have been working on getting scanbd and sane working together on
   my x86 linuxmint 21.2 system with fujitsu snapscan ix500.

   How I want things to work is as follows:

   1) using scanbd, press the single start button on the ix500 scanner,
  the adf contents should be scanned in /var/spool/scan without any
  further action.

   2) Either as root or a normal user in the scanner group, using common
  tools (i.e. gscan2pdf, simple-scan, scanimage, etc)... scan the 
documents

  in the ix500.

   my current configuration works for either 1 or 2 but NOT at the same
   time. I would be very happy if I could do either of them as needed 
without

   having to change anything.

   I have attached two files that contain the detailed steps I used 
for each of the above configurations. sane-devel-saned is the 
configuration of saned without scanbd, and sane-devel-scanbd is the 
config with scanbd active.


   Of course they contain shell commands, that I cut and paste from my 
notes during testing, I don't run them directly as shell scripts.


Any help that you can give me would be appreciated!

-ron

#
# linuxmint 21.2 (mate desktop) - fujitsu snapscan ix500
#
# restore system status to a clean state for scanner testing sane only, no 
scanbd
# with this configuration, sane tools, gscan2pdf, and simple-scan work for both 
root and normal 
# users

rm -rf /etc/scanbd/*
apt-get purge -y scanbd sane libsane-common libsane1 sane-airscan sane-utils 
simple-scan gscan2pdf
apt-get install -y sane libsane-common libsane1 sane-airscan sane-utils 
simple-scan gscan2pdf

#
# configure sane for network and local scanner access
#

cat >/etc/sane.d/dll.conf << EOF
net
fujitsu
EOF

cat > /etc/sane.d/net.conf < /etc/udev/rules.d/40-scanner.rules << EOF
SUBSSTEMS=="usb", ATTRS{idVendor}="04c5". ATTRS{idProduct}=="132b", 
ENV{libsane_matched}="yes", GROUP="scanner"
EOF

sudo /etc/init.d/udev restart
systemctl daemon-reload
#
# linuxmint 21.2 (mate desktop) - fujitsu snapscan ix500
#
#restore system status to a clean state for scanner testing sane with scanbd
# with this configuration, currently, sane tools, gscan2pdf, and simple-scan 
doesn't work for
# interactive root and normal users. BUT it does work if the button is pushed 
through scanbd
#

rm -rf /etc/scanbd/*
apt-get purge -y scanbd sane libsane-common libsane1 sane-airscan sane-utils 
simple-scan gscan2pdf
apt-get install -y scanbd sane libsane-common libsane1 sane-airscan sane-utils 
simple-scan gscan2pdf

#
# create a separate network sane scanner in addition to a local scanner
#

mkdir /etc/scanbd/sane.d
cp -r /etc/sane.d/* /etc/scanbd/sane.d/

#
# Modify /etc/sane.d/dll.conf so that it includes only the "net" directive and 
the local scanner (for
#  simple-scan and other utilities)saned

cat > /etc/sane.d/saned.conf << EOF
192.168.0.0/16
127.0.0.0/8
EOF

cat >/etc/sane.d/dll.conf << EOF
net
fujitsu
EOF

cat > /etc/sane.d/net.conf <

scan_dir=/var/spool/scan
datetime=`date +%F_%H%M%S`
filename="scan-$datetime"
send_to=em...@address.com

case "$SCANBD_ACTION" in
 pdf)
  logger -t "scanbd: $0" "$SCANBD_ACTION - scanning and converting to ps"
  scanimage -d "$SCANBD_DEVICE" --mode Color --resolution 150 --depth 16 |
   convert -density 150 - "$scan_dir/$filename.ps"
  logger -t "scanbd: $0" "$SCANBD_ACTION - converting ps to pdf"
  ps2pdf  -sPAPERSIZE=a4 "$scan_dir/$filename.ps" "$scan_dir/$filename.pdf"
  rm "$scan_dir/$filename.ps"
  ;;
 scan)
  scanimage -d "$SCANBD_DEVICE" --resolution 300 --mode Gray --format=tiff > "$\
scan_dir/$filename.tiff"
  ;;
 copy)
  logger -t "scanbd: $0" "$SCANBD_ACTION - scanning"
  scanimage -d "$SCANBD_DEVICE" --resolution 300 --depth 16--format=tiff > "$sc\
an_dir/$filename.tiff"
# | convert -density 300 - $scan_dir/$filename.ps
  logger -t "scanbd: $0" "$SCANBD_ACTION - printing"
  lp "$scan_dir/$filename.tiff"
  rm "$scan_dir/$filename.tiff"
  ;;
email)
  logger -t "scanbd: $0" "$SCANBD_ACTION - scanning and converting to ps"
  scanimage -d "$SCANBD_DEVICE" --mode Color --resolution 150 --depth 16 |
   convert -density 150 - "$scan_dir/$filename.ps"
  logger -t "scanbd: $0" "$SCANBD_ACTION - converting ps to pdf"
  ps2pdf  -sPAPERSIZE=a4 "$scan_dir/$filename.ps" "$scan_dir/$filename.pdf"
  logger -t "scanbd: $0" "$SCANBD_ACTION - sending pdf"
  (cat <" -s "Document $filename" "$send_to"
  rm "$scan_dir/$filename.ps"
  rm "$scan_dir/$filename.pdf"
  ;;
*)
  logger -t "scanbd: $0" "Unhandled action request."
  ;;
esac

exit 0
EOF
chmod 755 /etc/scanbd/scripts/scan.sh

#
# enable/disable udev rules for testing
#

# enable start
cat > /etc/udev/rules.d/40-scanner.rules << EOF
SUBSSTEMS=="usb", ATTRS{idVendor}="04c5". 

[sane-devel] help with getting scanbd and interactive scanner tools working together

2024-01-01 Thread Ron Young via sane-devel

Hi Everyone:

   I have been working on getting scanbd and sane working together on
   my x86 linuxmint 21.2 system with fujitsu snapscan ix500.

   How I want things to work is as follows:

   1) using scanbd, press the single start button on the ix500 scanner,
  the adf contents should be scanned in /var/spool/scan without any
  further action.

   2) Either as root or a normal user in the scanner group, using common
  tools (i.e. gscan2pdf, simple-scan, scanimage, etc)... scan the 
documents

  in the ix500.

   my current configuration works for either 1 or 2 but NOT at the same
   time. I would be very happy if I could do either of them as needed 
without

   having to change anything.

   I have attached two files that contain the detailed steps I used for 
each of the above configurations. sane-devel-saned is the configuration 
of saned without scanbd, and sane-devel-scanbd is the config with scanbd 
active.


   Of course they contain shell commands, that I cut and paste from my 
notes during testing, I don't run them directly as shell scripts.


Any help that you can give me would be appreciated!

-ron

#
# linuxmint 21.2 (mate desktop) - fujitsu snapscan ix500
#
#restore system status to a clean state for scanner testing sane with scanbd
# with this configuration, currently, sane tools, gscan2pdf, and simple-scan 
doesn't work for
# interactive root and normal users. BUT it does work if the button is pushed 
through scanbd
#

rm -rf /etc/scanbd/*
apt-get purge -y scanbd sane libsane-common libsane1 sane-airscan sane-utils 
simple-scan gscan2pdf
apt-get install -y scanbd sane libsane-common libsane1 sane-airscan sane-utils 
simple-scan gscan2pdf

#
# create a separate network sane scanner in addition to a local scanner
#

mkdir /etc/scanbd/sane.d
cp -r /etc/sane.d/* /etc/scanbd/sane.d/

#
# Modify /etc/sane.d/dll.conf so that it includes only the "net" directive and 
the local scanner (for
#  simple-scan and other utilities)saned

cat > /etc/sane.d/saned.conf << EOF
192.168.0.0/16
127.0.0.0/8
EOF

cat >/etc/sane.d/dll.conf << EOF
net
fujitsu
EOF

cat > /etc/sane.d/net.conf <

scan_dir=/var/spool/scan
datetime=`date +%F_%H%M%S`
filename="scan-$datetime"
send_to=em...@address.com

case "$SCANBD_ACTION" in
 pdf)
  logger -t "scanbd: $0" "$SCANBD_ACTION - scanning and converting to ps"
  scanimage -d "$SCANBD_DEVICE" --mode Color --resolution 150 --depth 16 |
   convert -density 150 - "$scan_dir/$filename.ps"
  logger -t "scanbd: $0" "$SCANBD_ACTION - converting ps to pdf"
  ps2pdf  -sPAPERSIZE=a4 "$scan_dir/$filename.ps" "$scan_dir/$filename.pdf"
  rm "$scan_dir/$filename.ps"
  ;;
 scan)
  scanimage -d "$SCANBD_DEVICE" --resolution 300 --mode Gray --format=tiff > "$\
scan_dir/$filename.tiff"
  ;;
 copy)
  logger -t "scanbd: $0" "$SCANBD_ACTION - scanning"
  scanimage -d "$SCANBD_DEVICE" --resolution 300 --depth 16--format=tiff > "$sc\
an_dir/$filename.tiff"
# | convert -density 300 - $scan_dir/$filename.ps
  logger -t "scanbd: $0" "$SCANBD_ACTION - printing"
  lp "$scan_dir/$filename.tiff"
  rm "$scan_dir/$filename.tiff"
  ;;
email)
  logger -t "scanbd: $0" "$SCANBD_ACTION - scanning and converting to ps"
  scanimage -d "$SCANBD_DEVICE" --mode Color --resolution 150 --depth 16 |
   convert -density 150 - "$scan_dir/$filename.ps"
  logger -t "scanbd: $0" "$SCANBD_ACTION - converting ps to pdf"
  ps2pdf  -sPAPERSIZE=a4 "$scan_dir/$filename.ps" "$scan_dir/$filename.pdf"
  logger -t "scanbd: $0" "$SCANBD_ACTION - sending pdf"
  (cat <" -s "Document $filename" "$send_to"
  rm "$scan_dir/$filename.ps"
  rm "$scan_dir/$filename.pdf"
  ;;
*)
  logger -t "scanbd: $0" "Unhandled action request."
  ;;
esac

exit 0
EOF
chmod 755 /etc/scanbd/scripts/scan.sh

#
# enable/disable udev rules for testing
#

# enable start
cat > /etc/udev/rules.d/40-scanner.rules << EOF
SUBSSTEMS=="usb", ATTRS{idVendor}="04c5". ATTRS{idProduct}=="132b", 
ENV{libsane_matched}="yes", GROUP="scanner"
EOF
# enable end

# disable start
cat > /etc/udev/rules.d/40-scanner.rules << EOF
# Fujitsu SnapScan ix500

SUBSSTEMS=="usb", ATTRS{idVendor}="04c5". ATTRS{idProduct}=="132b",
ENV{libsane_matched}="yes", GROUP="scanner",
ENV{ID_VENDOR_ID}=="04c5", ENV{ID_MODEL_ID}=="132b", ACTION=="add",
RUN+="/usr/sbin/service inetutils-inetd start",
RUN+="/usr/bin/scanimage -L", RUN+="/usr/sbin/service scanbd start"
ENV{ID_VENDOR_ID}=="04c5", ENV{ID_MODEL_ID}=="132b", ACTION=="remove",
RUN+="/usr/sbin/service scanbd stop", RUN+="/usr/sbin/service
inetutils-inetd stop"
EOF
#disable end
  
sudo /etc/init.d/udev restart

systemctl stop scanbm.socket
systemctl disable scanbm.socket
systemctl daemon-reload
systemctl unmask scanbd
systemctl enable scanbd
systemctl restart scanbd

#
# linuxmint 21.2 (mate desktop) - fujitsu snapscan ix500
#
#restore system status to a clean state for scanner testing sane with scanbd
# with this configuration, currently, sane tools, gscan2pdf, and simple-scan 
doesn't work for
# 

Re: [sane-devel] Help needed diagnosing strange failure to scan with Samsung SCX-4500W

2023-10-01 Thread Ralph Little
Hi,

On Sun, Oct 1, 2023 at 4:56 AM ValdikSS via sane-devel <
sane-devel@alioth-lists.debian.net> wrote:

> On 07.05.2013 00:12, Mike Cloaked wrote:
> > I have a strange scanner failure to try to resolve, and I am hoping that
> > an expert on this list may be able to help me fix the problem.
> >
> > I have a Samsung SCX-4500W multifunction printer that is plugged in to
> > the usb port of my main machine running arch linux x86_64.  The printer
> > part works fine with the Splix driver, but the scanner fails to work.
> >
> > When I unplug the device and plug it into a laptop running arch linux,
> > it works fine. On a second laptop also running arch linux the scanner
> > functions also work fine (xsane). However plugging the same device back
> > in to my main desktop the scanner fails to work.
> >
> >
> > scanimage -L works the first time I issue the command but then
> > subsequently fails:
> >
> > scanimage -L
> > device `xerox_mfp:libusb:001:006' is a Samsung Samsung SCX-4500W Series
> > multi-function peripheral
> >
> > scanimage -L
> >
> > No scanners were identified.
>
> Hello. I know this issue is 10 years old, but I fixed it.
> It seems that this device has some bugs in USB stack implementation. I
> have SCX-4521F with the same issue, it works for me on one laptop with
> USB3 port (and only after explicit port reset!) but not on another with
> USB2.
>
> It seems that the device hangs if ENDPOINT HALT CLEAR is performed on
> its out endpoint, which is explicitly sent by the backend.
> If this command is not sent, the device works reliably.
>
> https://gitlab.com/sane-project/backends/-/issues/706
>
> Another workaround is to send CLEAR_TT_BUFFER command to the hub (which
> USB3 stack already does).
>

So, according to commentary in the libusb forum, we have had advice that
calling usb_clear_halt() when there is no error condition can leads to all
sorts of issues and is not recommended. If we were to remove this in the
xerox_mfp backend (which would fix the support of this device), are there
any users out there that could test with other supported devices?

It is possible that it was added in the first place to deal with some
problematic devices. Having said that, it might also have been added as a
"reset the device to make sure there are no problems", and doesn't actually
solve any real world devices. I know that a couple of the other backends do
the same thing.

Please let me know if there are any users who would be prepared to test
this change!

I have not heard anything from the backend maintainer for a couple of years
so I'm not sure if he is still active,

Cheers,
Ralph


Re: [sane-devel] Help needed diagnosing strange failure to scan with Samsung SCX-4500W

2023-10-01 Thread ValdikSS via sane-devel

On 07.05.2013 00:12, Mike Cloaked wrote:
I have a strange scanner failure to try to resolve, and I am hoping that 
an expert on this list may be able to help me fix the problem.


I have a Samsung SCX-4500W multifunction printer that is plugged in to 
the usb port of my main machine running arch linux x86_64.  The printer 
part works fine with the Splix driver, but the scanner fails to work.


When I unplug the device and plug it into a laptop running arch linux, 
it works fine. On a second laptop also running arch linux the scanner 
functions also work fine (xsane). However plugging the same device back 
in to my main desktop the scanner fails to work.



scanimage -L works the first time I issue the command but then 
subsequently fails:


scanimage -L
device `xerox_mfp:libusb:001:006' is a Samsung Samsung SCX-4500W Series 
multi-function peripheral


scanimage -L

No scanners were identified.


Hello. I know this issue is 10 years old, but I fixed it.
It seems that this device has some bugs in USB stack implementation. I 
have SCX-4521F with the same issue, it works for me on one laptop with 
USB3 port (and only after explicit port reset!) but not on another with 
USB2.


It seems that the device hangs if ENDPOINT HALT CLEAR is performed on 
its out endpoint, which is explicitly sent by the backend.

If this command is not sent, the device works reliably.

https://gitlab.com/sane-project/backends/-/issues/706

Another workaround is to send CLEAR_TT_BUFFER command to the hub (which 
USB3 stack already does).




OpenPGP_signature
Description: OpenPGP digital signature


[sane-devel] Help with using Avahi for saned

2022-11-27 Thread John Scott
Hi,

I'm having a hard time using saned with Avahi and would appreciate some
help. I'm running saned on a machine we'll refer to as T450, and to
publish it over Avahi/Zeroconf/Bonjour/what-cha-ma-call-it I'm running
the following command (of course, I'll make this permanent later in a
configuration file):

$ avahi-publish-service "saned" _sane-port._tcp 6566

From inspecting the source code (since this seems to be poorly
documented at the moment), it seems like saned has support for
publishing its presence on its own, including setting the TXT
information appropriately. If anyone knows how to do this, please inform
me, but I don't think it's the cause of my issues below. (Again, by
inspecting the source code, I determined that the net backend doesn't
use the TXT information for anything right now.)

On my other machine, M93z (the client), it is able to connect to saned
and successfully scan when the hostname is specified. As you can see
from this command output, it seems to be picking up on Avahi, but for
some odd reason finding no scanners when we rely on Avahi alone:

john@M93z:~$ SANE_DEBUG_NET=128 scanimage -vvL
[10:04:15.929012] [sanei_debug] Setting debug level of net to 128.
[10:04:15.929101] [net] sane_init: authorize != null, version_code != null
[10:04:15.929123] [net] sane_init: SANE net backend version 1.0.14 
(AF-indep+IPv6) from sane-backends 1.1.1-debian
[10:04:15.929194] [net] sane_init: Client has little endian byte order
[10:04:15.929263] [net] sane_init: searching for config file
[10:04:15.929346] [net] sane_init: done reading config
[10:04:15.929397] [net] sane_init: evaluating environment variable 
SANE_NET_HOSTS
[10:04:15.929444] [net] sane_init: evaluating environment variable 
SANE_NET_TIMEOUT
[10:04:15.936456] [net] sane_init: done
[10:04:15.936644] [net] sane_get_devices: local_only = 0
[10:04:15.936691] [net] sane_get_devices: finished (0 devices)
[10:04:15.947171] [net] net_avahi_browse_callback: NEW: service 'saned' of type 
'_sane-port._tcp' in domain 'local'
[10:04:15.947532] [net] net_avahi_browse_callback: NEW: service 'saned' of type 
'_sane-port._tcp' in domain 'local'
[10:04:15.947846] [net] net_avahi_browse_callback: CACHE_EXHAUSTED
[10:04:15.947864] [net] net_avahi_resolve_callback: service 'saned' of type 
'_sane-port._tcp' in domain 'local':
[10:04:15.947879] [net] T450.local:6566 (fdf3:2fad:e98f::cfb)
TXT=
cookie is 0
is_local: 0
our_own: 0
wide_area: 0
multicast: 1
cached: 1
[10:04:15.947892] [net] add_device: adding backend T450.local
[10:04:15.949433] [net] add_device: backend T450.local added
[10:04:15.949820] [net] net_avahi_resolve_callback: service 'saned' of type 
'_sane-port._tcp' in domain 'local':
[10:04:15.949835] [net] T450.local:6566 (192.168.10.150)
TXT=
cookie is 0
is_local: 0
our_own: 0
wide_area: 0
multicast: 1
cached: 1
[10:04:15.949849] [net] add_device: adding backend T450.local
[10:04:15.949856] [net] add_device: already in list
[10:04:16.949156] [net] net_avahi_browse_callback: ALL_FOR_NOW

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).
Calling sane_exit
[10:04:16.960050] [net] sane_exit: exiting
[10:04:16.960112] [net] net_avahi_cleanup: stopping thread
[10:04:16.961437] [net] net_avahi_cleanup: done
[10:04:16.961465] [net] sane_exit: closing dev 0x7f1978002050, ctl=-1
[10:04:16.961494] [net] sane_exit: finished.
scanimage: finished

If you look at the third-to-last line, it looks like it's closing a
device even though it claimed to find none! Anywho, SANE does find the
scanners when I manually specify the server:

john@M93z:~$ SANE_NET_HOSTS=T450.local scanimage -L
device `net:T450.local:fujitsu:ScanSnap S1500:157926' is a FUJITSU ScanSnap 
S1500 scanner
device `net:T450.local:escl:ScanSnap S1500:157926' is a FUJITSU ScanSnap S1500 
scanner
device `net:T450.local:canon_lide70:libusb:002:042' is a CANON CanoScan LiDE 70 
flatbed scanner

I'm running Debian Bookworm (testing) which I'm pretty sure has the
latest SANE. I'm running saned in care of systemd (as opposed to inetd).
I've added sane to the scanner group and am unsure with how to proceed.

Any advice would be appreciated.

Thanks for making SANE great!

Sincerely,
John

P.S. Some of you might ask why I'm bothering with Avahi when I clearly
know the server hostname and could just hard-code it. That's because I
want the scanners to be accessible to other devices as they come in to
the network, such as if I have guests come over, or so I can scan easily
from my smartphone.


signature.asc
Description: This is a digitally signed message part


Re: [sane-devel] Help with using Avahi for saned

2022-11-27 Thread John Scott
Something strange is happening. scanimage and sane-find-scanner report
that no devices are found when using solely Avahi, and so does Simple
Scan, but if you're patient with Simple Scan, even after it reports
finding no devices, it pulls through and eventually detects them!

Unfortunately I use scanimage more frequently than Simple Scan, so this
issue is still relevant. It seems like SANE reports no devices found,
and then somehow keeps searching for them asyncronously, and perhaps
scanimage and sane-find-scanner are not patient enough.


signature.asc
Description: This is a digitally signed message part


Re: [sane-devel] Help decoding Minolta Dimage Scan Dual II USB protocol

2022-11-23 Thread Giovanni Cappellotto
>
> Sure, generate a  diag log and send it to us. We might be able to figure
> out what is going on. I would certainly look at the forking issue and try
> the fix that was suggested in the link I provided. From what I gather,
> process forking is like kryptonite to libusb. Threading is a better option.
>

I uploaded the USBSnoop log here:
https://gist.github.com/potomak/38daeff7f6b5e9858621ae4f8760beab

The session includes a setup phase and scanning the first frame in the 6
frames holder.
I used the highest resolution available for scanning B (negative) films.
I stopped the session before the scan was complete because the log was
growing too big.

If you need more information or if I need to capture more logs just let me
know!


Re: [sane-devel] Help decoding Minolta Dimage Scan Dual II USB protocol

2022-11-23 Thread Ralph Little
Hi,

On Wed, Nov 23, 2022 at 10:18 AM Giovanni Cappellotto 
wrote:

> You’re right, I was using avision.
>
> Thanks for the suggestion, I guess I could try that.
>
> Last time I was hacking the avision backed, I remember the source code had
> a lot of additional complexity because it was supporting tens of different
> scanners. Supposedly some changes for supporting a particular scanner broke
> the support for Minolta Dimage.
>
> I’m wondering if you have docs or other resources I can use to reverse
> engineer the scanner protocol from the logs I can collect from the original
> windows driver.
>

I believe that there are some Avision protocol docs around but IIRC they
are held by folks under NDA so probably no help there. From what I have
been able to gather, Avision themselves did have a hand in the making the
avision backend, but I doubt that they would be interested in helping out
there now.

>
> For instance I think I identified 3 different endpoints looking at the
> sniffer logs, but I’m not sure their meaning. 0x01 seems some kind of
> command endpoint, 0x83 receives and sends a lot of information, 0x82
> receives and responds with zeroes and seems like an endpoint used to
> complete a command.
>
> Maybe I can share the full log I collected and get help to recreate a
> backend specific for Minolta Dimage?
>
> Sure, generate a  diag log and send it to us. We might be able to figure
out what is going on. I would certainly look at the forking issue and try
the fix that was suggested in the link I provided. From what I gather,
process forking is like kryptonite to libusb. Threading is a better option.

Cheers,
Ralph


Re: [sane-devel] Help decoding Minolta Dimage Scan Dual II USB protocol

2022-11-23 Thread Giovanni Cappellotto
You’re right, I was using avision.

Thanks for the suggestion, I guess I could try that.

Last time I was hacking the avision backed, I remember the source code had
a lot of additional complexity because it was supporting tens of different
scanners. Supposedly some changes for supporting a particular scanner broke
the support for Minolta Dimage.

I’m wondering if you have docs or other resources I can use to reverse
engineer the scanner protocol from the logs I can collect from the original
windows driver.

For instance I think I identified 3 different endpoints looking at the
sniffer logs, but I’m not sure their meaning. 0x01 seems some kind of
command endpoint, 0x83 receives and sends a lot of information, 0x82
receives and responds with zeroes and seems like an endpoint used to
complete a command.

Maybe I can share the full log I collected and get help to recreate a
backend specific for Minolta Dimage?

On Wed, Nov 23, 2022 at 12:40 PM Ralph Little  wrote:

> Hi,
>
> On Wed, Nov 23, 2022 at 6:31 AM Giovanni Cappellotto 
> wrote:
>
>> Hello,
>>
>> In 2017 I used sane on Mac OS X to scan films using a Minolta Dimage Scan
>> Dual II. When I used sane again in 2020 it didn't work anymore. I tried to
>> contribute to the project to fix the backend for my scanner. I was able to
>> successfully scan a single frame at a time, but I lacked the knowledge to
>> completely fix the issue.
>>
>
> If you are using SANE then there are currently some issues when scanning
> via USB on MacOS related to forking + libusb. Hopefully we can sort this
> out soon.
>
> When you successfully scanned in 2017, you would most likely have been
> using the avision backend since this is an avision device.
> You could try again with SANE and generate some diagnostic output and send
> that to us by setting SANE_DEBUG_AVISION=10 environment variable.
>
> If it is related to the fork/libusb issue, you could try the fix that
> someone suggested here:
> https://gitlab.com/sane-project/backends/-/issues/153#note_117613
>
> Cheers,
> Ralph
>
>


Re: [sane-devel] Help decoding Minolta Dimage Scan Dual II USB protocol

2022-11-23 Thread Ralph Little
Hi,

On Wed, Nov 23, 2022 at 6:31 AM Giovanni Cappellotto 
wrote:

> Hello,
>
> In 2017 I used sane on Mac OS X to scan films using a Minolta Dimage Scan
> Dual II. When I used sane again in 2020 it didn't work anymore. I tried to
> contribute to the project to fix the backend for my scanner. I was able to
> successfully scan a single frame at a time, but I lacked the knowledge to
> completely fix the issue.
>

If you are using SANE then there are currently some issues when scanning
via USB on MacOS related to forking + libusb. Hopefully we can sort this
out soon.

When you successfully scanned in 2017, you would most likely have been
using the avision backend since this is an avision device.
You could try again with SANE and generate some diagnostic output and send
that to us by setting SANE_DEBUG_AVISION=10 environment variable.

If it is related to the fork/libusb issue, you could try the fix that
someone suggested here:
https://gitlab.com/sane-project/backends/-/issues/153#note_117613

Cheers,
Ralph


[sane-devel] Help decoding Minolta Dimage Scan Dual II USB protocol

2022-11-23 Thread Giovanni Cappellotto
Hello,

In 2017 I used sane on Mac OS X to scan films using a Minolta Dimage Scan
Dual II. When I used sane again in 2020 it didn't work anymore. I tried to
contribute to the project to fix the backend for my scanner. I was able to
successfully scan a single frame at a time, but I lacked the knowledge to
completely fix the issue.

I ended up buying an old windows laptop that I'm using to interface with
the scanner. The scanner works fine with its original windows driver.

I wanted to hack a Python script to scan films using Minolta Dimage Scan
Dual II from a linux or mac PC, so I sniffed a scanning session using
usbsnoop.

Now I have a log of a scanning session, but I'm not sure how to read it.

Can you help me decode the protocol of this scanner from the usbsnoop log
please?

Excerpt:

[17011 ms] UsbSnoop - DispatchAny(acff6610) : IRP_MJ_INTERNAL_DEVICE_CONTROL
[17011 ms] UsbSnoop - MyDispatchInternalIOCTL(acff7e80) : fdo=84d616a8,
Irp=8547f5e8, IRQL=0
[17011 ms]  >>>  URB 5 going down  >>>
-- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
  PipeHandle   = 86d52634 [endpoint 0x0001]
  TransferFlags= 0002 (USBD_TRANSFER_DIRECTION_OUT,
USBD_SHORT_TRANSFER_OK)
  TransferBufferLength = 000a
  TransferBuffer   = 
  TransferBufferMDL= 862f2ca0
: 28 00 60 00 0a 0d 00 00 10 00
  UrbLink  = 
[17013 ms] UsbSnoop - MyInternalIOCTLCompletion(acff7db0) : fido=856662b8,
Irp=8547f5e8, Context=85ac8310, IRQL=2
[17013 ms]  <<<  URB 5 coming back  <<<
-- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
  PipeHandle   = 86d52634 [endpoint 0x0001]
  TransferFlags= 0002 (USBD_TRANSFER_DIRECTION_OUT,
USBD_SHORT_TRANSFER_OK)
  TransferBufferLength = 000a
  TransferBuffer   = 
  TransferBufferMDL= 862f2ca0
  UrbLink  = 
[17015 ms] UsbSnoop - DispatchAny(acff6610) : IRP_MJ_INTERNAL_DEVICE_CONTROL
[17015 ms] UsbSnoop - MyDispatchInternalIOCTL(acff7e80) : fdo=84d616a8,
Irp=8547f5e8, IRQL=0
[17015 ms]  >>>  URB 6 going down  >>>
-- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
  PipeHandle   = 86d52674 [endpoint 0x0083]
  TransferFlags= 0002 (USBD_TRANSFER_DIRECTION_OUT,
USBD_SHORT_TRANSFER_OK)
  TransferBufferLength = 0040
  TransferBuffer   = 84d7d548
  TransferBufferMDL= 
: 00 00 00 00 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f
0010: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f
0020: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f
0030: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f
  UrbLink  = 
[17017 ms] UsbSnoop - MyInternalIOCTLCompletion(acff7db0) : fido=856662b8,
Irp=8547f5e8, Context=859bb540, IRQL=2
[17017 ms]  <<<  URB 6 coming back  <<<
-- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
  PipeHandle   = 86d52674 [endpoint 0x0083]
  TransferFlags= 0003 (USBD_TRANSFER_DIRECTION_IN,
USBD_SHORT_TRANSFER_OK)
  TransferBufferLength = 0010
  TransferBuffer   = 84d7d548
  TransferBufferMDL= 84af1370
: 0a d2 01 1e 01 1f 00 00 00 00 ff 00 ff 00 ff 00
  UrbLink  = 
[17017 ms] UsbSnoop - DispatchAny(acff6610) : IRP_MJ_INTERNAL_DEVICE_CONTROL
[17017 ms] UsbSnoop - MyDispatchInternalIOCTL(acff7e80) : fdo=84d616a8,
Irp=8547f5e8, IRQL=0
[17017 ms]  >>>  URB 7 going down  >>>
-- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
  PipeHandle   = 86d52654 [endpoint 0x0082]
  TransferFlags= 0002 (USBD_TRANSFER_DIRECTION_OUT,
USBD_SHORT_TRANSFER_OK)
  TransferBufferLength = 0008
  TransferBuffer   = 84b203c0
  TransferBufferMDL= 
: 00 00 00 00 00 00 00 00
  UrbLink  = 
[17021 ms] UsbSnoop - MyInternalIOCTLCompletion(acff7db0) : fido=856662b8,
Irp=8547f5e8, Context=862f23b0, IRQL=2
[17021 ms]  <<<  URB 7 coming back  <<<
-- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
  PipeHandle   = 86d52654 [endpoint 0x0082]
  TransferFlags= 0003 (USBD_TRANSFER_DIRECTION_IN,
USBD_SHORT_TRANSFER_OK)
  TransferBufferLength = 0001
  TransferBuffer   = 84b203c0
  TransferBufferMDL= 862f2ca0
: 00
  UrbLink  = 


Re: [sane-devel] help configuring

2021-02-10 Thread Matt Zagrabelny via sane-devel
Hi!

On Wed, Feb 10, 2021 at 1:08 PM Jürgen Mellinger <
juergen.mellin...@t-online.de> wrote:

> Hi,
>
> due to a bug in an older version of the libsane package (which is the
> current one if you are on Debian),
>

I am running Debian. Sid to be precise. Here is the version of SANE i just
installed:

$ apt policy libsane1
libsane1:
  Installed: 1.0.31-4
  Candidate: 1.0.31-4
  Version table:
 *** 1.0.31-4 500
500 http://deb.debian.org/debian sid/main amd64 Packages
100 /var/lib/dpkg/status

I looked up the bug report [0] and it said it was resolved back at version
1.0.29.

So, that seems curious.

permissions on usb scanners are not set correctly.
> A fix/workaround is described here:
>
> https://linux.debian.bugs.dist.narkive.com/NIqXopxb/bug-918358-libsane-amd64-missing-permissions-for-scanner-group-on-usb-device#post2
>
>
Ahh. Thank you for the hint!

The setfacl gets run a few times (different udev events and such) - there
are some errors due to DEVNAME not being set in the environment. I've
modified the rule accordingly so that the setfacl only gets run once:

# cat /etc/udev/rules.d/70-scanner.rules
ACTION=="add" \
ENV{DEVNAME}=="?*" \
ENV{libsane_matched}=="yes" \
RUN+="/usr/bin/setfacl -m g:scanner:rw $env{DEVNAME}"

Debian is also migrating (IIRC) to a usr-merged environment, so I changed
the path for setfacl.

All seems to be working now.

Thank you again for the help!

-m

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918358


Re: [sane-devel] help configuring

2021-02-10 Thread Jürgen Mellinger
Hi,

due to a bug in an older version of the libsane package (which is the current 
one if you are on Debian),
permissions on usb scanners are not set correctly.
A fix/workaround is described here:
https://linux.debian.bugs.dist.narkive.com/NIqXopxb/bug-918358-libsane-amd64-missing-permissions-for-scanner-group-on-usb-device#post2

HTH,
Juergen

> Am 10.02.2021 um 19:16 schrieb Matt Zagrabelny via sane-devel 
> :
> 
> Greetings SANE,
> 
> I purchased a Canon LiDE 400 scanner and it arrived today.
> 
> I've run:
> 
> $ scanimage -L
> No scanners were identified.
> [...]
> 
> but:
> 
> $ sudo scanimage -L
> device `pixma:04A91912_4590E4' is a CANON CanoScan LiDE 400 multi-function 
> peripheral
> 
> $ sudo scanimage > /tmp/test.pnm
> 
> works as expected.
> 
> What is the proper way to configure sane so that things like:
> 
> scanimage
> xsane
> 
> work without elevated privileges?
> 
> Thanks for the help!
> 
> -m
> 
> 




[sane-devel] help configuring

2021-02-10 Thread Matt Zagrabelny via sane-devel
Greetings SANE,

I purchased a Canon LiDE 400 scanner and it arrived today.

I've run:

$ scanimage -L
No scanners were identified.
[...]

but:

$ sudo scanimage -L
device `pixma:04A91912_4590E4' is a CANON CanoScan LiDE 400 multi-function
peripheral

$ sudo scanimage > /tmp/test.pnm

works as expected.

What is the proper way to configure sane so that things like:

scanimage
xsane

work without elevated privileges?

Thanks for the help!

-m


[sane-devel] Help configuring Sane for Mojave

2020-08-03 Thread Lizzy
Hi all,
I'm not an experienced user.  I installed Sane in 2015 when I was using El 
Capitan and I could easily use scanimage from the terminal which was good 
enough for me.  I've just upgraded to Mojave 5 years later and 
sane-find-scanner finds nothing and scanimage -L finds nothing, even as root.  
I can't remember how I set it up back in 2015 and I can't find any help online. 
 Can anyone here help me please?
I checked it was all working in El Capitan right before upgrading and I've just 
checked it with a Pi 4 and it worked immediately - about 2 minutes from 
starting to download Sane to scanning an image, no problem at all.  So nothing 
needs to be configured in Raspbian.  I'm not sure what needs to be done in 
Mojave, if anything.
Kind regards,
Lizzy.


Re: [sane-devel] HELP: How do I get off this mail list?

2020-03-19 Thread Yuri Chornoivan
четвер, 19 березня 2020 р. 15:33:13 EET Craig Orput написано:
> How do I get removed from this mail list?
> 
> Thanks

Just use this page:

https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/sane-devel

Best regards,
Yuri

[sane-devel] HELP: How do I get off this mail list? Re: Canon ImageCLASS MF743cdw

2020-03-19 Thread Craig Orput
How do I get removed from this mail list?

Thanks


[sane-devel] Help needed in development of RPC client

2020-03-15 Thread Eugenio Tampieri via sane-devel
Good morning,
I’m developing a SANE client that uses the RPC over TCP to communicate with the 
server. I have already developed some functions and they work. However, my 
implementation of SANE_NET_CONTROL_OPTION is broken and I can’t tell why.

https://github.com/eutampieri/SwiftSANE/blob/49f464e5328de10744348d246dea90f3c9d98ec8/Sources/SANEScan/SANEScan.swift#L116
 

 Here is the function that doesn’t work. The function writes to the socket the 
following message, which I’m sending base64 encoded: 
BQACAAIEAAoZmQ==.  However I’m receiving an empty 
response.

Is the request that I’m making to the server wrong? Is this the expected 
behavior? Could you give me more informations regarding the option number?

Thanks in advance,

Eugenio Tampieri

smime.p7s
Description: S/MIME cryptographic signature


Re: [sane-devel] Help

2020-01-26 Thread m. allan noah
Thomas was subscribed using a different email address, which I have
removed from sane-devel.

allan

On Sun, Jan 26, 2020 at 6:03 AM Thomas Escher  wrote:
>
> Hi Olaf,
>
> yes indeed, but however it does not work for me. I think, actually I'm still 
> getting the issue-mails.
>
> Can you please disable my subscription completely?
>
> Thanks, Tom
>
>
>
> Von meinem Samsung Galaxy Smartphone gesendet.
>
>
>
>  Ursprüngliche Nachricht 
> Von: Olaf Meeuwissen 
> Datum: 26.01.20 10:01 (GMT+01:00)
> An: Thomas Escher 
> Cc: sane-devel@alioth-lists.debian.net
> Betreff: Re: [sane-devel] Help
>
> Hi Thomas,
>
> Thomas Escher writes:
>
> > Help, please remove me from All subscriptions.
> > Thanks
>
> Have you tried any of the unsubscribe instructions you quoted below?
>
> > [... snip ...]
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/sane-devel
> > or, via email, send a message with subject or body 'help' to
> > sane-devel-requ...@alioth-lists.debian.net
> >
> > You can reach the person managing the list at
> > sane-devel-ow...@alioth-lists.debian.net
> >
> > [...snip...]
>
> Hope this helps,
> --
> Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
>  GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
>  Support Free Softwarehttps://my.fsf.org/donate
>  Join the Free Software Foundation  https://my.fsf.org/join



-- 
"well, I stand up next to a mountain- and I chop it down with the edge
of my hand"



Re: [sane-devel] Help

2020-01-26 Thread Thomas Escher




Hi Olaf, 


yes indeed, but however it does not work for me. I think, actually I'm still getting the issue-mails.


Can you please disable my subscription completely? 


Thanks, Tom







Von meinem Samsung Galaxy Smartphone gesendet.







 Ursprüngliche Nachricht 
Von: Olaf Meeuwissen  
Datum: 26.01.20 10:01 (GMT+01:00) 
An: Thomas Escher  
Cc: sane-devel@alioth-lists.debian.net 
Betreff: Re: [sane-devel] Help 




Hi Thomas,

Thomas Escher writes:

> Help, please remove me from All subscriptions.
> Thanks

Have you tried any of the unsubscribe instructions you quoted below?

> [... snip ...]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/sane-devel
> or, via email, send a message with subject or body 'help' to
> sane-devel-requ...@alioth-lists.debian.net
>
> You can reach the person managing the list at
> sane-devel-ow...@alioth-lists.debian.net
>
> [...snip...]

Hope this helps,
--
Olaf Meeuwissen, LPIC-2    FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Software    
https://my.fsf.org/donate
 Join the Free Software Foundation  
https://my.fsf.org/join







Re: [sane-devel] Help

2020-01-26 Thread Olaf Meeuwissen
Hi Thomas,

Thomas Escher writes:

> Help, please remove me from All subscriptions.
> Thanks

Have you tried any of the unsubscribe instructions you quoted below?

> [... snip ...]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/sane-devel
> or, via email, send a message with subject or body 'help' to
> sane-devel-requ...@alioth-lists.debian.net
>
> You can reach the person managing the list at
> sane-devel-ow...@alioth-lists.debian.net
>
> [...snip...]

Hope this helps,
--
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Softwarehttps://my.fsf.org/donate
 Join the Free Software Foundation  https://my.fsf.org/join



[sane-devel] Help

2020-01-24 Thread Thomas Escher




Help, please remove me from All subscriptions.
Thanks







Von meinem Samsung Galaxy Smartphone gesendet.







 Ursprüngliche Nachricht 
Von: sane-devel-requ...@alioth-lists.debian.net 
Datum: 24.01.20 11:25 (GMT+01:00) 
An: sane-devel@alioth-lists.debian.net 
Betreff: sane-devel Digest, Vol 175, Issue 31 




Send sane-devel mailing list submissions to
    sane-devel@alioth-lists.debian.net

To subscribe or unsubscribe via the World Wide Web, visit
    
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/sane-devel
or, via email, send a message with subject or body 'help' to
    sane-devel-requ...@alioth-lists.debian.net

You can reach the person managing the list at
    sane-devel-ow...@alioth-lists.debian.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of sane-devel digest..."


Today's Topics:

   1.  Error during save: broken pipe (Lou DeGenaro)
   2. Re:  Error during save: broken pipe (Jörn-Ingo Weigert)
   3. Re:  Error during save: broken pipe (Lou DeGenaro)


--

Message: 1
Date: Thu, 23 Jan 2020 20:38:32 -0500
From: Lou DeGenaro 
To: sane-devel@alioth-lists.debian.net
Subject: [sane-devel] Error during save: broken pipe
Message-ID:
    
Content-Type: text/plain; charset="utf-8"

Just upgraded from Ubuntu 16.04 to 18.04.  Have networked Brother J6945
all-in-one that was working perfectly on 16.04.  At 18.04 I can print, but
get the subject message when I try to scan. Please advise.
-- next part --
An HTML attachment was scrubbed...
URL: 
-- next part --
A non-text attachment was scrubbed...
Name: Screenshot from 2020-01-23 20-37-37.png
Type: image/png
Size: 9077 bytes
Desc: not available
URL: 

--

Message: 2
Date: Fri, 24 Jan 2020 03:23:04 +0100
From: Jörn-Ingo Weigert 
To: Lou DeGenaro ,  Sane Development
    
Subject: Re: [sane-devel] Error during save: broken pipe
Message-ID:
    
Content-Type: text/plain; charset="utf-8"

Hi it would be nice when you provide:

The Frontend-Programm (XSane, simplescan, etc) you used, which produced
this error.

Provide the version of sane-backends you currently using.

afaik, Ubuntu 18.04 delivers a 1.0.27 experimental version.

If you use your Scanner on a USB3 port, please try to use a USB2 port
first, as their are still known issues with USB3.

Kind regards,

Ingo Weigert
Try to use a more recent version from Rolf Bensch, he provide a repository
on launchpad for Ubuntu users.

Kind regards,



Lou DeGenaro  schrieb am Fr., 24. Jan. 2020, 03:03:

> Just upgraded from Ubuntu 16.04 to 18.04.  Have networked Brother J6945
> all-in-one that was working perfectly on 16.04.  At 18.04 I can print, but
> get the subject message when I try to scan. Please advise.
>
-- next part --
An HTML attachment was scrubbed...
URL: 

--

Message: 3
Date: Fri, 24 Jan 2020 05:24:25 -0500
From: Lou DeGenaro 
To: Jörn-Ingo Weigert , Sane Development
    
Subject: Re: [sane-devel] Error during save: broken pipe
Message-ID:
    
Content-Type: text/plain; charset="utf-8"

Thx for the help.  I re-installed the drivers as you suggested, but this
did not help.  However, my (dumb) mistake with respect to "Printing on
stdin" was that I was selecting "COPY" instead of "SAVE" in Xsane window.
All is well now.

On Thu, Jan 23, 2020 at 10:13 PM Jörn-Ingo Weigert 
wrote:

> I kindly ask you to answer to the sane-devel list, instead of me.
>
> Rolf Bensch is on the list too and can you help on your issue better than
> me.
>
> But removing a printer as you mentioned doesn't mean, not being able to
> scan. Those are different things. Your problems rely somewhere else. For
> example the place where sane-backends are stored.
>
> I would simply deinstall any vendor related driver packages and install
> from the vendor the ones designed for Ubuntu 18.04 and follow their install
> instructions.
>
> I hope I could give you some hints.
>
> Ingo Weigert
>
> Lou DeGenaro  schrieb am Fr., 24. Jan. 2020,
> 03:37:
>
>> I'm on shaky ground here and don't understand all the moving parts.  I'm
>> using Xsane and CUPS, and the all-in-one is wireless.
>>
>> I found that I had 3 printers defined , so I removed 2 of them and and
>> left with:
>>
>> root@HAL9000:/etc/default# lpstat -p -d
>> printer MFCJ6945DW is idle.  enabled since Thu 23 Jan 2020 09:11:38 PM EST
>> system default destination: MFCJ6945DW
>>
>> When I scan now, I no longer get the above error.  I get a printed copy
>> with a pop-up window