Le 2019-12-15 20:39, Till Kamppeter a écrit :
It seems that one can also use the eSCL backend via USB, with the help
of the IPP-over-USB daemon ippusbxd (the backend is probably not
exactly IPP, ippusbxd is more to understand as an HTTP-over-USB
daemon).

Get ippusbxd from

https://github.com/OpenPrinting/ippusbxd

or install the "ippusbxd" package of your distribution.

Connect your device via USB. Depending on how your distribution is
configured it can happen that a CUPS queue for the printing part of
the device gets created, so you will not sacrifice printing to get
your scanner to work.

Check with "ps -aux | grep ippusbxd" whether ippusbxd is actually
running (an auto-created print queue can also be an HPLIP one if the
device is from HP).

If ippusbxd is not running, simply fire it up manually, if your device
is the only IPP-over-USB-capable printer connected to your machine you
do not even need command line arguments:

ippusbxd

The daemon outputs its port and its PID. The port is usually 60000.
Now use curl, wget, or a browser and access

http://localhost:60000/eSCL/ScannerCapabilities

Correct the port if yours is not 60000.

You get back the capabilities XML list of the eSCL scanning part of
your device. So it seems that eSCL scanning is possible through
ippusbxd.

Note that ippusbxd does not advertise this capability through DNS-SD.
The DNS-SD record of ippusbxd is completely artifical and is mainly
based on the USB (printer) device ID. I need to extend the record, but
I need a reliable way to find out via USB whether the device is only a
printer or has also a scanner built-in.

With a deeper look into the source code of HPLIP one can perhaps also
find a way to use eSCL via USB without ippusbxd but I do not recommend
it. With ippusbxd one gets both printing and scanning to work in a
driverless (driver = device-model-specific software and/or data)
manner, using the capability of the hardware to advertise itself and
to provide a full list of capabilities and having universal software
to do the job (cups-filters for printing and the eSCL SANE backend for
scanning).

See the output of

wget http://localhost:60000/eSCL/ScannerCapabilities

on my device below.
I tried "ippusbxd", I have a mistake. I'll dig into the idea because it would solve a lot of my scanner problems.

/usr/sbin/ippusbxd  -v 0x04a9 -m 0x1827
60002|1541|root@thierry-Lenovo-ideapad-700-15ISK:/home/thierry/arcanist# <1392766784>Error: Error registering TS3100 series as IPP printer (_ipp._tcp): -8 <1392766784>Error: Error registering web interface of TS3100 series (_http._tcp): -8
Thierry

   Till

----------

<?xml version="1.0" encoding="UTF-8"?>
<!---->
<scan:ScannerCapabilities
xmlns:scan="http://schemas.hp.com/imaging/escl/2011/05/03";
xmlns:pwg="http://www.pwg.org/schemas/2010/12/sm";
xmlns:dest="http://schemas.hp.com/imaging/destination/2011/06/06";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://schemas.hp.com/imaging/escl/2011/05/03
../../schemas/eSCL-1_92.xsd">
        <pwg:Version>2.0</pwg:Version>
        <pwg:MakeAndModel>xxxx</pwg:MakeAndModel>
        <pwg:SerialNumber>25</pwg:SerialNumber>
        <scan:Platen>
                <scan:PlatenInputCaps>
                        <scan:MinWidth>8</scan:MinWidth>
                        <scan:MaxWidth>2550</scan:MaxWidth>
                        <scan:MinHeight>8</scan:MinHeight>
                        <scan:MaxHeight>3508</scan:MaxHeight>
                        <scan:MaxScanRegions>1</scan:MaxScanRegions>
                        <scan:SettingProfiles>
                                <scan:SettingProfile>
                                        <scan:ColorModes>
                                                
<scan:ColorMode>Grayscale8</scan:ColorMode>
                                                
<scan:ColorMode>RGB24</scan:ColorMode>
                                        </scan:ColorModes>
                                        <scan:ContentTypes>
                                                
<pwg:ContentType>Photo</pwg:ContentType>
                                                
<pwg:ContentType>Text</pwg:ContentType>
                                                
<pwg:ContentType>TextAndPhoto</pwg:ContentType>
                                        </scan:ContentTypes>
                                        <scan:DocumentFormats>
                                                
<pwg:DocumentFormat>application/octet-stream</pwg:DocumentFormat>
                                                
<pwg:DocumentFormat>image/jpeg</pwg:DocumentFormat>
                                                
<pwg:DocumentFormat>application/pdf</pwg:DocumentFormat>
                                        </scan:DocumentFormats>
                                        <scan:SupportedResolutions>
                                                <scan:DiscreteResolutions>
                                                        
<scan:DiscreteResolution>
                                                                
<scan:XResolution>75</scan:XResolution>
                                                                
<scan:YResolution>75</scan:YResolution>
                                                        
</scan:DiscreteResolution>
                                                        
<scan:DiscreteResolution>
                                                                
<scan:XResolution>100</scan:XResolution>
                                                                
<scan:YResolution>100</scan:YResolution>
                                                        
</scan:DiscreteResolution>
                                                        
<scan:DiscreteResolution>
                                                                
<scan:XResolution>200</scan:XResolution>
                                                                
<scan:YResolution>200</scan:YResolution>
                                                        
</scan:DiscreteResolution>
                                                        
<scan:DiscreteResolution>
                                                                
<scan:XResolution>300</scan:XResolution>
                                                                
<scan:YResolution>300</scan:YResolution>
                                                        
</scan:DiscreteResolution>
                                                        
<scan:DiscreteResolution>
                                                                
<scan:XResolution>600</scan:XResolution>
                                                                
<scan:YResolution>600</scan:YResolution>
                                                        
</scan:DiscreteResolution>
                                                        
<scan:DiscreteResolution>
                                                                
<scan:XResolution>1200</scan:XResolution>
                                                                
<scan:YResolution>1200</scan:YResolution>
                                                        
</scan:DiscreteResolution>
                                                        
<scan:DiscreteResolution>
                                                                
<scan:XResolution>2400</scan:XResolution>
                                                                
<scan:YResolution>2400</scan:YResolution>
                                                        
</scan:DiscreteResolution>
                                                </scan:DiscreteResolutions>
                                        </scan:SupportedResolutions>
                                        <scan:ColorSpaces>
                                                
<scan:ColorSpace>YCC</scan:ColorSpace>
                                                
<scan:ColorSpace>RGB</scan:ColorSpace>
                                                
<scan:ColorSpace>sRGB</scan:ColorSpace>
                                        </scan:ColorSpaces>
                                </scan:SettingProfile>
                        </scan:SettingProfiles>
                        <scan:SupportedIntents>
                                <scan:Intent>Document</scan:Intent>
                                <scan:Intent>Photo</scan:Intent>
                                <scan:Intent>Preview</scan:Intent>
                                <scan:Intent>TextAndGraphic</scan:Intent>
                        </scan:SupportedIntents>
                        
<scan:MaxOpticalXResolution>2400</scan:MaxOpticalXResolution>
                        
<scan:MaxOpticalYResolution>2400</scan:MaxOpticalYResolution>
                        <scan:RiskyLeftMargin>34</scan:RiskyLeftMargin>
                        <scan:RiskyRightMargin>33</scan:RiskyRightMargin>
                        <scan:RiskyTopMargin>34</scan:RiskyTopMargin>
                        <scan:RiskyBottomMargin>46</scan:RiskyBottomMargin>
                </scan:PlatenInputCaps>
        </scan:Platen>
        <scan:BrightnessSupport>
                <scan:Min>0</scan:Min>
                <scan:Max>2000</scan:Max>
                <scan:Step>1</scan:Step>
        </scan:BrightnessSupport>
        <scan:ContrastSupport>
                <scan:Min>0</scan:Min>
                <scan:Max>2000</scan:Max>
                <scan:Step>1</scan:Step>
        </scan:ContrastSupport>
        <scan:HighlightSupport>
                <scan:Min>0</scan:Min>
                <scan:Max>255</scan:Max>
                <scan:Normal>179</scan:Normal>
                <scan:Step>1</scan:Step>
        </scan:HighlightSupport>
        <scan:ShadowSupport>
                <scan:Min>0</scan:Min>
                <scan:Max>255</scan:Max>
                <scan:Normal>25</scan:Normal>
                <scan:Step>1</scan:Step>
        </scan:ShadowSupport>
        <scan:SharpenSupport>
                <scan:Min>0</scan:Min>
                <scan:Max>255</scan:Max>
                <scan:Step>1</scan:Step>
        </scan:SharpenSupport>
        <scan:ThresholdSupport>
                <scan:Min>0</scan:Min>
                <scan:Max>255</scan:Max>
                <scan:Normal>128</scan:Normal>
                <scan:Step>1</scan:Step>
        </scan:ThresholdSupport>
</scan:ScannerCapabilities>





On 15/12/2019 15:54, Till Kamppeter wrote:
I didn't see any device managing Tiff, send me the capability file, I could add the support.
curl http://<ip>:<port>/eSCL/ScannerCapabilities
or
curl -k https://<ip>:<port>/eSCL/ScannerCapabilities


Below is the output of my HP DeskJet 2540, it seems to only support JPEG and PDF, so the backend should also support PDF (and if SANE does not support PDF, SANE needs either to get appropriately extended (preferred solution) or the backend should convert PDF to TIFF, which would not need a PDF interpreter as this PDF consists only of bitmaps).

Note that these outputs should not be collected and added to the backend as a database, but rather the backend should poll this from the scanner whenever it is called.

By the way, the output has PWG in it, so it seems that this eSCL scanning standard was developed by or in cooperation with the Printer Working Group.

    Till

----------
<!--  -->
<scan:ScannerCapabilities xmlns:scan="http://schemas.hp.com/imaging/escl/2011/05/03";
[...]

Reply via email to