Closed burnbabyburn closed 1 year ago
Hi @burnbabyburn,
could you please show me trace, created by airscan-discover -t
, will be saved as airscan-discover-zeroconf.log
and sane-airscan
protocol trace? Console output is not detailed enough to deal with this kind of problems.
airscan-discover -t
to eliminate possible errors due to my setup, i moved the MFP to the same net as the host. Here is the logfile . As the printer itself does not publish any ipp it seems to be ignored by the scan. The printers ip is not listed in the logfile Host scanning: 192.168.1.234 Printer: 192.168.1.233 OdroidN2 publishing ipp for printer: 192.168.1.10
WSD discovery doesn't depend on IPP. It uses IPP announces only for hinting in the fast discovery mode: if all devices, known via DNS-SD, also known via WSDD, we can finish scan quickly. In a full mode that airscan-discover -t
uses, this optimization is not used.
I see, the printer doesn't respond to discovery probes at all. I wonder, how the HP proprietary driver discovers it.
And show me sane-airscan
trace in the manual configuration mode too. May be, detailed error response will put some insight to the root cause of the scanning problem (which looks separate from the discovery problem).
Did a clean ubuntu 20.04 LTS install. Captured the hp-setup
traffic. Discovery tries via MDNS. My printer does not respond to that, even on Windows :)
So i set ip to manual. HPLIP seems to ask via snmp for oid 1.3.6.1.4.1.11.2.3.9.1.1.7 if ip is defined manually. The printer responds with its capabilities. They seem to exchange some magic packets and configure the fax device in the end. hp-setup capture. Than the printer answers to MDNS.
And show me sane-airscan trace in the manual configuration mode too. May be, detailed error response will put some insight to the root cause of the scanning problem (which looks separate from the discovery problem).
grep ^[^#] /etc/sane.d/airscan.conf
[devices]
"HP" = http://192.168.1.233:8289 , WSD
[options]
discovery = enable
model = network
protocol = manual
[debug]
trace = /tmp/trace
enable = true
hexdump = true
[blacklist]
here is the envelope an hp scan is sending. The req failing with HTTP 400 from airscan in the log trace, looks quite different.
ubuntu@ubuntu-VirtualBox:~$ curl --verbose --data @req 192.168.1.233:8289/StableWSDiscoveryEndpoint/schemas-xmlsoap-org_ws_2005_04_discovery
* Trying 192.168.1.233:8289...
* Connected to 192.168.1.233 (192.168.1.233) port 8289 (#0)
> POST /StableWSDiscoveryEndpoint/schemas-xmlsoap-org_ws_2005_04_discovery HTTP/1.1
> Host: 192.168.1.233:8289
> User-Agent: gSOAP/2.7
> Content-Type: application/soap+xml; charset=utf-8
> Transfer-Encoding: chunked
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 202 ACCEPTED
< Server: gSOAP/2.7
< Content-Type: application/soap+xml; charset=utf-8
< Transfer-Encoding: chunked
< Connection: close
<
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wscn="http://tempuri.org/wscn.xsd"><SOAP-ENV:Body><wscn:ScanElements><ScannerConfiguration><DeviceSettings><FormatSupported xsi:type="SOAP-ENC:Array" SOAP-ENC:itemType="wscn:ScanDocumentFormat" SOAP-ENC:arraySize="2"><item>jfif</item><item>hpraw</item></FormatSupported><QualityFactorSupported>false</QualityFactorSupported><ContentSupported xsi:type="SOAP-ENC:Array" SOAP-ENC:itemType="wscn:ContentType" SOAP-ENC:arraySize="1"><item>Auto</item></ContentSupported><DocumentSizeAutoDetectSupported>false</DocumentSizeAutoDetectSupported><FeederCapacity>50</FeederCapacity><DuplexRotation>180</DuplexRotation><Rotation>0</Rotation></DeviceSettings><Platen><ColorSupported xsi:type="SOAP-ENC:Array" SOAP-ENC:itemType="wscn:ColorEntryType" SOAP-ENC:arraySize="4"><item>BlackandWhite1</item><item>GrayScale8</item><item>RGB24</item><item>RGB48</item></ColorSupported><PlatenMinimumSize><Width>1920</Width><Height>1920</Height></PlatenMinimumSize><PlatenMaximumSize><Width>8500</Width><Height>11690</Height></PlatenMaximumSize><PlatenOpticalResolution><Width>1200</Width><Height>1200</Height></PlatenOpticalResolution><FlatbedSupported>true</FlatbedSupported></Platen><ADF><ADFSupported>true</ADFSupported><ADFSupportsDuplex>true</ADFSupportsDuplex><ADFMinimumSize><Width>1920</Width><Height>1920</Height></ADFMinimumSize><ADFMaximumSize><Width>8500</Width><Height>15000</Height></ADFMaximumSize><ADFOpticalResolution><Width>300</Width><Height>300</Height></ADFOpticalResolution></ADF></ScannerConfiguration><ScannerStatus><ScannerCurrentTime>2018-07-25T01:53:39Z</ScannerCurrentTime><ScannerState>Idle</ScannerState><ScannerStateReason>None</ScannerStateReason><ScanToStatus><PaperInADF>false</PaperInADF><ScanToAvailable>false</ScanToAvailable></ScanToStatus></ScannerStatus>* Closing connection 0
<ScannerInfo><ModelNumber>CB532A</ModelNumber></ScannerInfo></wscn:ScanElements></SOAP-ENV:Body></SOAP-ENV:Envelope>
ubuntu@ubuntu-VirtualBox:~$ cat req
<?xml
version="1.0"
encoding="UTF-8"
?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wscn="http://tempuri.org/wscn.xsd">
<SOAP-ENV:Body>
<wscn:GetScannerElements>
</wscn:GetScannerElements>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
returns scanner capabilities. create a scanjob with jobsettings
ubuntu@ubuntu-VirtualBox:~$ cat req2
<?xml
version="1.0"
encoding="UTF-8"
?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wscn="http://tempuri.org/wscn.xsd">
<SOAP-ENV:Body>
<wscn:CreateScanJobRequest>
<ScanIdentifier>
</ScanIdentifier>
<ScanTicket>
<JobDescription>
</JobDescription>
<DocumentParameters>
<Format>
jfif
</Format>
<CompressionQualityFactor>
0
</CompressionQualityFactor>
<ImagesToTransfer>
0
</ImagesToTransfer>
<InputSource>
Platen
</InputSource>
<ContentType>
Auto
</ContentType>
<InputSize>
<InputMediaSize>
<Width>
8499
</Width>
<Height>
11689
</Height>
</InputMediaSize>
<DocumentSizeAutoDetect>
false
</DocumentSizeAutoDetect>
</InputSize>
<Exposure>
<AutoExposure>
false
</AutoExposure>
<ExposureSettings>
<Contrast>
0
</Contrast>
<Brightness>
0
</Brightness>
</ExposureSettings>
</Exposure>
<MediaSides>
<MediaFront>
<ScanRegion>
<ScanRegionXOffset>
0
</ScanRegionXOffset>
<ScanRegionYOffset>
0
</ScanRegionYOffset>
<ScanRegionWidth>
8499
</ScanRegionWidth>
<ScanRegionHeight>
11689
</ScanRegionHeight>
</ScanRegion>
<ColorProcessing>
GrayScale8
</ColorProcessing>
<Resolution>
<Width>
300
</Width>
<Height>
300
</Height>
</Resolution>
</MediaFront>
</MediaSides>
</DocumentParameters>
<RetrieveImageTimeout>
300
</RetrieveImageTimeout>
<ScanManufacturingParameters>
<DisableImageProcessing>
false
</DisableImageProcessing>
</ScanManufacturingParameters>
</ScanTicket>
</wscn:CreateScanJobRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
returning empty job token and scanjobid
<SOAP-ENV:Body><wscn:CreateScanJobResponseType><JobId>3</JobId><JobToken> </JobToken>
And retrieve the image
ubuntu@ubuntu-VirtualBox:~$ cat req3
<?xml
version="1.0"
encoding="UTF-8"
?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wscn="http://tempuri.org/wscn.xsd">
<SOAP-ENV:Body>
<wscn:RetrieveImageRequest>
<JobId>
3
</JobId>
<JobToken>
</JobToken>
<DocumentDescription>
</DocumentDescription>
</wscn:RetrieveImageRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
printer scans
This is some different protocol. Looks similar to WSD, but it is not WSD.
I currently don't have my personal resources to implement this protocol in the sane-airscan
by myself, and I don't have a hardware to test implementation.
If you can code in C, you can consider implementing it by yourself (with my help, of course) and contributing to the sane-airscan
. It is not as hard to do, as it sounds.
And if you will consider to try, this is better to contribute to the https://github.com/alexpevzner/sane-airscan-unstable
This is development branch of the sane-airscan
, for my convenience managed as a separate repository. Currently there is a very small difference between these branches, and I synchronize them time to time. But all big changes I prefer to appear in the unstable branch first.
TBH my last C code is 10yrs old now. But i can try though. It would help a lot if you could pinpoint me to the relevant files i need to look at :)
Looking (very) roughly at your codebase, mainly airscan-wsd.c => Seems like the XMLNS is a lil bit different to standard WSD (wsa vs wscn or SOAP:Envelope vs SOAP-ENV:Envelope)
The protocol communication seems rather simple (maybe a MS-BSSRR flavor?)
The discovery part, well i didn't even want to try that as even the native HP tools fail on that. Only thing that would come to my mind would be a snmp scan for the OIDs from my last posts. And if the device/serial is in a list of known non standard WSD sane-airscan tries another method.
Issue here can now be considered on-hold as my printer does not speak native WSD/eSCL. Maybe you could add it to the readme on your next push. Atleast we know more now!
€ Ubuntu 20.04 LTS also needs package universal-ctags
for TAGS build target
Yes, it really looks like MS-BSSRR dialect.
First thing to do is to choose a protocol name (probably, BSSRR). Add appropriate constant to the ID_PROTO enum. Add it to the id_name_table
table in the airscan-id.c
file. Add protocol handler constructor prototype, similar to proto_handler_escl_new
or proto_handler_wsd_new
to the airscan.h
. Add handling of the newly added protocol to the proto_handler_new
function in the airscan.h
Then create a new protocol handler. eSCL and WSD handlers are airscan-escl,c
and airscan-wsd.c
, respecyively. I suggest to start from airscan-wsd.c
, because protocol is quite similar to WSD. But still want a separate protocol handler rather that a special mode of the WSD handler, as protocols are different enough.
It should be enough for manually-configured device.
Once we well have it all implemented, we may look how to add discovery.
€ Ubuntu 20.04 LTS also needs package
universal-ctags
for TAGS build target
I can confirm this.
Firstly, thank you, this lib definitely helped me fix the printer setup on my Ubuntu but when compiling I got the message:
make: ctags: Command not found
Please add in the Readme file that Ubuntu, Debian and similar have the additional dependency:
apt-get install universal-ctags
Thanks again
Looks like this issue is not relevant anymore...
Hi, hope this is the right place for this prob.
My MFP needs the proprietary HP-binary-plugin (e.g. hplip-3.22.4-plugin.run) to work correctly. I am using a network setup. (
Printer: 192.168.1.233 on localnet and 10.0.0.29 on different network, sane-airscan: 192.168.1.234, IPP_Service_Host: 192.168.1.10
) the printers http service pages shows an WS-Discovery Service so we should have a WSD up and running. But it seems to not register in MDNS/WSSD/ZEROCONF and so sane-airscanis not able to detect it. I tested my normal setup with an avahi-reflector and also moved the printer to the same network segment as sane-airscan. It made no difference.while tcpdumping a
hpaio://
scan (scanimage --test --verbose --progress
) i was able to see the WSD XML the printer reported:And i was able to forge a curl post for wsdiscovery - So sane-airscan stuff should work
avahi (thx to reflector) lists the printer on localnet and different net
airscan-discover -d
But sane-airscan does not auto detect :/
logfile airscan-discover -d (valid 3weeks) pcap success scanning hpaio (valid 2weeks) Hint: Pcap of a Windows scan with the HP software also uses same proto/service etc...
€ Manual adding the printer:
/etc/sane.d/airscan.conf
export SANE_DEBUG_DLL=255 && scanimage -d 'airscan:w0:HP MFP M277dw Scanner'