Scanners: Difference between revisions

imported>Jiltq
m syntax + wording + parity with manual
GIMP support: Fix code example
 
(4 intermediate revisions by 4 users not shown)
Line 25: Line 25:
</syntaxhighlight>
</syntaxhighlight>


If you can only see scanners when running as root, try adding the user to the <tt>scanner</tt> or <tt>lp</tt> either using the configuration given above, or using the following code (beware, don't forget to logout/login after running this command):
If you can only see scanners when running as root, try adding the user to the <tt>scanner</tt> or <tt>lp</tt> groups, either using the method given above, or as follows (beware, don't forget to logout/login after running this command):
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
$ sudo usermod -a -G scanner,lp username
$ sudo usermod -a -G scanner,lp username
Line 31: Line 31:


==Supported backends==
==Supported backends==
See the [http://www.sane-project.org/sane-supported-devices.html Supported Devices] page to see if your scanner is supported. Some backends are proprietary and are not installed by default; see below. You may also be interested by "driverless" scanning (see below) if your scanner support the Apple AirScan and/or the Microsoft WSD, Apple maintains a list of compatible devices [https://support.apple.com/en-us/HT201311 here].
See the [http://www.sane-project.org/sane-supported-devices.html Supported Devices] page to check if your scanner is supported. Some backends are proprietary and are not installed by default; see below. You may also be interested in "driverless" scanning (see below) if your scanner supports Apple AirScan and/or Microsoft WSD.


===Driverless Apple AirScan and Microsoft WSD===
===Driverless Apple AirScan and Microsoft WSD===


A large number of printers now support "driverless" scanning. As explained [https://github.com/alexpevzner/sane-airscan on the sane-airscan backend project]:
A large number of printers now support "driverless" scanning. As explained [https://github.com/alexpevzner/sane-airscan at the sane-airscan backend project]:


<blockquote>
<blockquote>
Line 41: Line 41:


* Apple AirScan or AirPrint scanning (official protocol name is eSCL)
* Apple AirScan or AirPrint scanning (official protocol name is eSCL)
* Microsoft WSD, or WS-Scan (term WSD means "Web Services for Devices)
* Microsoft WSD, or WS-Scan (Web Services for Devices)


This backend implements both protocols, choosing automatically between them. It was successfully tested with many devices from '''Brother, Canon, Dell, Kyocera, Lexmark, Epson, HP, Panasonic, Ricoh, Samsung and Xerox''' both in WSD and eSCL modes.
This backend implements both protocols, choosing automatically between them. It was successfully tested with many devices from Brother, Canon, Dell, Kyocera, Lexmark, Epson, HP, Panasonic, Ricoh, Samsung and Xerox, both in WSD and eSCL modes.


For eSCL devices, Apple maintains a [https://support.apple.com/en-us/HT201311 '''comprehensive list of compatible devices'''], but please note, this list contains not only scanners and MFP, but pure printers as well.
For eSCL devices, Apple maintains a [https://support.apple.com/en-us/HT201311 comprehensive list of compatible devices]. This list has scanners, multifunction devices and pure printers.
</blockquote>
</blockquote>


To enable Apple AirScan/Microsoft WSD "driverless" scanning: use the <tt>sane-airscan</tt> drivers:
eSCL/Apple Airscan scanners should be found natively by the default escl backend. However, the <tt>sane-airscan</tt> third party backend is more actively maintained and you may have better luck using it:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
hardware.sane.extraBackends = [ pkgs.sane-airscan ];
hardware.sane.extraBackends = [ pkgs.sane-airscan ];
services.udev.packages = [ pkgs.sane-airscan ];
</syntaxhighlight>
</syntaxhighlight>


If the scanner is an USB scanner, also set the following option:
It can be that your scanner is found twice (once by <tt>escl</tt> and once by <tt>airscan</tt>, in this case disable <tt>escl</tt>:
<syntaxhighlight lang="nix">
hardware.sane.disabledDefaultBackends = [ "escl" ];
</syntaxhighlight>
 
To detect Microsoft WSD "driverless" scanning, also use the <tt>sane-airscan</tt> backend.
 
If the scanner is connected by USB, also set the following option:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
services.ipp-usb.enable=true;
services.ipp-usb.enable=true;
Line 124: Line 132:


<ol>
<ol>
<li>You need to install a special version of xsane, which you can enable by amending <tt>/etc/nixos/configuration.nix</tt> as follows:
<li>Enable GIMP support in xsane by editing <tt>/etc/nixos/configuration.nix.</tt> Remove <tt>pkgs.xsane</tt> from your package list, and use the following instead:


<syntaxhighlight lang="nix">{
<syntaxhighlight lang="nix">{
   ...
   #...
   nixpkgs.config.packageOverrides = pkgs: {
   environment.systemPackages = [
     xsaneGimp = pkgs.xsane.override { gimpSupport = true; };
     (pkgs.xsane.override { gimpSupport = true; })
   };
   ];
   ...
   #...
}</syntaxhighlight></li>
}</syntaxhighlight></li>
<li>Rebuild: <syntaxhighlight lang="console">$ sudo nixos-rebuild switch</syntaxhighlight></li>
<li>Rebuild: <syntaxhighlight lang="console">$ sudo nixos-rebuild switch</syntaxhighlight></li>
Line 140: Line 148:
==Network scanning==
==Network scanning==


If NixOs cannot find a scanner located on your network, you may be interested in adding in your <tt>configuration.nix</tt>:
If NixOS cannot find a scanner located on your network, you may be interested in adding in your <tt>configuration.nix</tt>:


<syntaxhighlight lang="nix">{
<syntaxhighlight lang="nix">{
Line 365: Line 373:
* [https://download.tuxfamily.org/xcfaudio/ Misc Agfa Snapscan] | [https://ipfs.io/ipfs/QmZJ2SfpfYUAS23TujhcdLpTox1SW3Dw3MoCej9GAfs4ya IPFS mirror]
* [https://download.tuxfamily.org/xcfaudio/ Misc Agfa Snapscan] | [https://ipfs.io/ipfs/QmZJ2SfpfYUAS23TujhcdLpTox1SW3Dw3MoCej9GAfs4ya IPFS mirror]


[[Category:Configuration]][[Category:Hardware]]
[[Category:Hardware]]