I don’t understand why sometimes my Brother DS-620 scanner is well recognized by scanimage -L
and sometimes not.
I’m on NixOS 20.03 ande I added this in a /etc/nixos/scanner.nix :
{ config, lib, pkgs, ... } : {
hardware.sane = {
enable = true;
dsseries.enable = true;
};
# Allow unfree software for libsane-dsseries only
nixpkgs.config.allowUnfreePredicate = (pkg: builtins.elem (builtins.parseDrvName pkg.pname).name
[
"libsane-dsseries"
]);
}
And I load it this way, in /etc/nixos/configuration.nix
:
{ config, pkgs, ... } : {
imports = [
./hardware-configuration.nix
./scanner.nix
];
As I told, sometimes I plug my scanner in, and everything is working like a charm. I even wrote some Python scripts to automate some scanning tasks…
But most of the time, it doesn’t work.
What I can tell, is that /dev/sg1
is well created and deleted when I plug in or out my scanner. Also, /dev/sg0
is already taken by my webcam but it’s also the case when scanimage is working.
What surprised me is that even if I’m logged as root, I get this :
# sane-find-scanner -vvv
This is sane-find-scanner from sane-backends 1.0.30
# sane-find-scanner will now attempt to detect your scanner. If the
# result is different from what you expected, first make sure your
# scanner is powered up and properly connected to your computer.
searching for SCSI scanners:
checking /dev/scanner... failed to open (Invalid argument)
checking /dev/sg0... failed to open (Invalid argument)
checking /dev/sg1... failed to open (Invalid argument)
…
(failed to open /dev/sg1 whereas I’m root !?)
But, still as root, I can get this :
# scanimage -L
device `v4l:/dev/video0' is a Noname Integrated Camera: Integrated C virtual device
device `dsseries:usb:0x04F9:0x60E0' is a BROTHER DS-620 sheetfed scanner
Also, as root, scanimage -d 'dsseries:usb:0x04F9:0x60E0' > test.pnm
is working
I insist on the fact that sometimes I can do it as a simple user and sometimes not, even if I didn’t changed my configuration.nix
and/or rebuilt my system. And I have no clue about what this problem is related to.
Is there someone here, experimented with Sane ? I guess I’m not the only one who could face this issue :S
Is there a dump command I may run when it’s working and when it’s not to compare the both two ?