sane-airscan -- Linux support of Apple AirScan (eSCL) compatible document scanners
If you are a lucky owner of scanner or MFP which works via network with Apple devices, I have a good news for you: now your scanner works with Linux as well!
In theory, this backend should work with any scanner that supports the eSCL protocol (unofficially known as AirScan or AirPrint scanning). In practice, it was tested on several devices from Canon, Kyocera and HP, and this list constantly grows, though slowly, so feedback regarding other devices is very welcomed.
Apple maintains a comprehensive list of compatible devices, but please note, this list contains not only scanners and MFP, but pure printers as well.
To use this backend, you don't need to install ScanGear from Canon, HPLIP from HP or some other proprietary software from hardware vendor. This backend works directly with your device and doesn't depend on a 3rd party closed source components.
- Scan from platen and ADF, in duplex and simplex modes, multi-page scan from ADF supported as well
- Scan in color and gray scale modes
- Reasonably low memory footprint, achieved by on demand decompression of image received from scanner
- The cancel operation is as fast as possible, depending on your hardware
- Automatic discovery and configuration of the hardware
- Manual configuration is also possible, in case zeroconf doesn't work (i.e., computer and scanner are connected to the different subnets)
- Both IPv4 and IPv6 are supported
Any eSCL capable scanner expected to work, but only few of them were actually tested.
Sane-airscan was tested and found to work with the following scanners:
- Canon D570
- Canon TS 6151
- EPSON WF-7710
- HP Color Laserjet MFP m178-m181
- HP Color LaserJet MFP M281fdw
- HP DeskJet 2540
- HP ENVY 4500
- HP LaserJet Pro M28w
- HP Officejet Pro 6970
- HP OfficeJet Pro 6978
- HP OfficeJet Pro 8730
- Kyocera ECOSYS M2040dn
If you have success with a scanner not included into this list, please let me know.
Installation from pre-build binaries
Thanks to openSUSE Build Service, I can provide pre-built packages for many popular Linux distros.
Currently, the following distros are supported "officially" (i.e., by me): Debian (9.0 and 10), Fedora (29, 30 and 31), openSUSE (Leap and Tumbleweed), Ubuntu (16.04, 18.04, 19.04 and 19.10). There are also some "3rd party" repos, currently for Arch Linux.
To install a pre-build package, follow the link, where you will find packages and very detailed installation instructions.
I strongly recommend you to choose "Add repository and install manually" option rather that "Grab binary packages directly", because it will enable automatic updates of the sane-airscan package.
If your distro is not listed, see Installation from sources section below.
Thomas Kiss firstname.lastname@example.org maintains package for Arch Linux:
Ubuntu packages usually work on Mint, but Ubuntu version needs to be chosen carefully.
The following table represents my approximation of Mint vs Ubuntu versions compatibility:
|Linux Mint version||Use Ubuntu package:|
The table may be inaccurate and incomplete. I would appreciate Mint community feedback to correct it.
Installation from sources
Install required libraries - Fedora and similar
As root, execute the following commands:
dnf install gcc git make pkgconf-pkg-config dnf install avahi-devel avahi-glib-devel dnf install glib2-devel libsoup-devel libxml2-devel dnf install libjpeg-turbo-devel sane-backends-devel
Install required libraries - Ubuntu, Debian and similar
As root, execute the following commands:
apt-get install libavahi-client-dev libavahi-glib-dev apt-get install gcc git make pkg-config apt-get install libglib2.0-dev libsoup2.4-dev libxml2-dev apt-get install libjpeg-dev libsane-dev
Download, build and install sane-airscan
git clone https://github.com/alexpevzner/sane-airscan.git cd sane-airscan make make install
To report a bug, please create a new GitHub issue
To create a helpful bug report, please perform the following steps:
- Enable protocol trace in the sane-airscan, by adding the following entries into the configuration file:
[debug] trace = ~/airscan/trace ; Path to directory where trace files will be saved
You may use an arbitrary directory path, assuming you have enough rights to create and write this directory. The directory will be created automatically.
Reproduce the problem. Please, don't use any confidential documents when problem is being reproduces, as their content will be visible to others.
Explain the problem carefully
In the directory you've specified as the trace parameter, you will find two files. Assuming you are using program xsane and your device name is "Kyocera MFP Scanner", file names will be "xsane-Kyocera-MFP-Scanner.log" and "xsane-Kyocera-MFP-Scanner.tar". Please, attach both of these files to the new issue.
The eSCL protocol is not documented, but this is simple protocol, based on HTTP and XML, easy for reverse engineering. There are many Internet resources around, related to this protocol, and among others I want to note the following links:
- kno10/python-scan-eSCL - a tiny Python script, able to scan from eSCL-compatible scanners
- SimulPiscator/AirSane - this project solves the reverse problem, converting any SANE-compatible scanner into eSCL server. Author claims that it is compatible with Mopria and Apple clients
- markosjal/AirScan-eSCL.txt - document, describing eSCL protocol, based on reverse engineering. Not complete and not always accurate, but gives the good introduction