Scanner: udev bus/dev numbers not consistent

I need some udev expertise to assist me. The solution might be simple to one
who understands it.

My Canon scanner/printer died, and I decided on a scanner/laserprinter. My
problem is not in printing–that works–it is with scanning.

I am using Byzantium on a Librem 13 and all packages are up-to-date. (Scanning
and printing work on Debian 12 “out-of-the-box.”)

Unfortunately, I had to install the scanner driver package from the
manufacturer; otherwise, I get an “out of memory” message when invoking
scanimage. This package added ‘brother4’ to /etc/sane.d/dll.conf and a rule
script to /etc/udev/rules.d.

The udev problem is that there is a mismatch with the bus/device numbers. The
following is heavily snipped:

 <host>:~$ lsusb
 Bus 001 Device 002: ID 04f9:0429 Brother Industries, Ltd HL-L2395DW series

 <host>:~$ sane-find-scanner
 found USB scanner (vendor=0x04f9 [Brother], product=0x0429 [HL-L2395DW series]) at libusb:001:002

Permissions are ok:

 <host>:~$ getfacl /dev/bus/usb/*/*
 # file: dev/bus/usb/001/002
 # owner: root
 # group: lp
 user::rw-
 user:wayne:rw-
 group::rw-
 group:scanner:rw-
 mask::rw-
 other::r--

Here is where the change occurs. I go from bus1:dev2 to bus2:dev2. As near
as I can tell from the outputs of the commands, the latter does not exist!

 <host>:~$ scanimage --list-devices
 device `brother4:bus2;dev2' is a Brother HL-L2395DW USB scanner
 device `escl:http://127.0.0.1:60000' is a Brother HL-L2395DW series (USB) flatbed scanner

 <host>:~$ scanimage > test.prm
 Output format is not set, using pnm as a default.
 scanimage: open of device brother4:bus2;dev2 failed: Invalid argument

I do not know where the rules get this information.

Using simple-scan, it finds the correct device as the scanner, but it fails too
when actually scanning.

My Debian 12 system works–it is my old laptop–so I can scan things there.
But, it is painful to use two systems. It might work when I move to Crimson,
but I am not sure I want to do that yet.

2 Likes