UPDATE 2020: ESCL support was added to SANE Backends 1.0.29 release last month. With SANE 1.0.29 you should have much easier access to much more functionality than with this prototype!
This prototype project is hence now obsolete.
This is a hack, but it works for my Canon PIXMA TS5050 printer (identifies as "TS5000 Series", so I supposed other TS5xxx will work, too), and supposedly works for many other new printers because of the very generic protocol. Others have reported success with
This is also known as "Apple AirScan".
I couldn't find any actual documentation for this protocol, so I mostly used this blog post by David Poole.
Fortunately, eSCL is a very simple HTTP-based protocol:
-
find the printer by zeroconf/avahi/bonjour
-
query the printer capabilities (an XML file)
-
send XML scan settings by HTTP POST, get a redirect to a new location
-
start the scan by loading the data from the new location.
It's fairly easy to do all this in 100 lines of Python.
Sorry, I only use Linux. These instructions should work on Debian and Ubuntu.
I used the zeroconf
and lxml
python libraries; and Python 2.
apt-get install python-zeroconf python-lxml
Then scan with
python scan.py <file.jpg> <resolution>
It will currently default to using the maximum resolution, which may take a while. Therefore, you may want to use 300 or 600 dpi.
Of course it would be nice to have a pretty GUI.
This is currently only a tiny prototype, to allow you to test if your scanner works, and make it easy to fiddle with it.
On the long run, it would be best to add an eSCL driver to SANE!