1

I have a Brother DCP-7065DN multifunction printer (including a scanner). This is connected to my computer via an Ethernet cable. I'm running Debian jessie (8.3).

I'm in the process of doing some debugging related to a gscan2pdf bug. To this end, I turned off the Brother. To my surprise, scanimage -L still detects the scanner. How is this possible?

scanimage -L
device `brother4:net1;dev1' is a Brother Scanner DCP-7065DN
device `brother4:net1;dev0' is a Brother DCP-7065DN DCP-7065DN

scanimage works even if SANED is shut down. Does anyone know how scanimage -L works?

Olivier
  • 155
Faheem Mitha
  • 35,108

2 Answers2

1

Essentially it works by looking at the hardware attached to your computer (does not work for remote devices). In particular, it looks at the SCSI and USB devices, walking through a list of the backend modules (which are shared objects, one per device), to see which ones give a good match.

scanimage calls sane_get_devices, which is sequentially connected to each of the backend modules. In turn, those (depending on the backend) look at the device itself as well as the configuration file (to get hints).

Further reading:

Thomas Dickey
  • 76,765
  • Thanks for the answer. So, this "looking" works even if the device is switched off? I don't understand how. Doesn't it require some kind of response from the device to know what it is? I thought the way it worked is that the device responded to a "query". – Faheem Mitha Mar 17 '16 at 09:00
  • Apparently it's not that simple - so I provided links to explore that aspect. – Thomas Dickey Mar 17 '16 at 09:02
1

USB devices can be bus-powered, self-powered, or both. I don't know about the Brother DCP-7065DN specifically, but maybe the scanner still identifies itself when plugged in, even though it doesn't have enough power to operate. My 3D printer is like that---the controller is essentially a glorified Arduino board and happily powers up and responds to commands as soon as you connect USB, even if there's no power going to the heater or to the motors.

Also, even many self-powered devices (including most PCs nowadays) have a "soft off" mode: When you press the power button, these devices don't completely shut down but instead they go into a low-power "standby" mode. If you're not physically unplugging the printer or flipping a physical switch connected directly to the power supply, I'd guess that this might be what's happening.

dlitz
  • 123