manuc66 / node-hp-scan-to

Allow to send scan from device to computer for some HP All-in-One Printers - Scan to computer
https://manuc66.github.io/node-hp-scan-to/
MIT License
155 stars 23 forks source link

Two sided scanning not working #461

Closed autumnwalker closed 2 years ago

autumnwalker commented 2 years ago

Unclear if this is something with the software or something with the printer.

When I attempt to do a two sided scan via "scan to" using the ADF it only scans one side.

When I attempt using software on the computer it does the double sided scan as expected.

manuc66 commented 2 years ago

Hi @autumnwalker

How do you proceed to have two side via the computer ?

Can you provide:

Thanks

manuc66 commented 2 years ago

From the technical point of view the dual side can be enabled in the job with this: https://github.com/Distrotech/hplip/blob/master/scan/sane/bb_ledm.c#L890=

Can you also send the content of this ressource http:///Scan/ScanCaps ?

autumnwalker commented 2 years ago

Hey @manuc66, details below for scanning from computer:

your printer model - HP OfficeJet Pro 6978 the process - open scan app (native MacOS or HP Smart) and initiate scan from the machine. Document loaded in ADF on the printer. application used - MacOS Printers & Scanners OR HP Smart application screenshot - https://imgur.com/a/jZaYoWY device picture screen (if any involved) - N/A a network capture (to see the xml job that is sent) - what do you recommend for this?

autumnwalker commented 2 years ago

Export of /scan/scancaps is here: https://pastebin.com/6bFTAXLZ

manuc66 commented 2 years ago

@autumnwalker Thank you very much for the information provided

With the export of /scan/scancaps I can see where the capability is advertised and with hplip code I see what kind of job need to be sent.

I'm wondering if there is no device screen to choose that option in the process of sending scan to computer, it would then be by default for ALL scan, I don't think that's what you want.

A workarround could be that there would be two destination entry, the second one beeing for 2 side, but it would only make sens for Adf.

I don't have a device with such capability so that's even more difficult to understand how it works

What do you think ?

autumnwalker commented 2 years ago

There is a device screen and it does have a two-sided toggle, but it doesn't result in a two sided scan when toggled and scanning to this app (hp-scan-to).

The toggle for two sided only activates when ADF is loaded, otherwise it is gray'd out.

Photo of screen: https://imgur.com/a/rAmwM10

I don't have a windows box around to test the OEM HP app for scan to, but it used to work (years ago) when I first got this printer.

autumnwalker commented 2 years ago

A workarround could be that there would be two destination entry, the second one beeing for 2 side, but it would only make sens for Adf.

I don't have a device with such capability so that's even more difficult to understand how it works

What do you think ?

I think the dual destinations would be a good workaround!

manuc66 commented 2 years ago

As there is a device screen I would rather prefer to implement the feature accordingly.

Could you activate the actual debug log? there is hope that this toggle state is already in the received payload.

manuc66 commented 2 years ago

I think I got it in this issue #325:

GET /WalkupScanToComp/WalkupScanToCompDestinations/1c881fde-c4a0-1f08-822f-a01d48c5c091 HTTP/1.1
HOST: 192.168.1.30:8080

HTTP/1.1 200 OK
Server: HP HTTP Server; HP Officejet 6700 - CN583A; Serial Number: CN46SDS08605RQ; Margarita_premium_pendiag_mp2 Built:Thu Mar 12, 2020 06:17:28AM {MPM5CN2011AR, ASIC id 0x003a0008}
Content-Type: text/xml
Content-Length: 1008
Cache-Control: must-revalidate, max-age=0
Pragma: no-cache

<?xml version="1.0" encoding="UTF-8"?>
<!---->
<wus:WalkupScanToCompDestination xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28 WalkupScanToComp.xsd" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:dd3="http://www.hp.com/schemas/imaging/con/dictionaries/2009/04/06" xmlns:scantype="http://www.hp.com/schemas/imaging/con/ledm/scantype/2008/03/17" xmlns:wus="http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <dd:ResourceURI>/WalkupScanToComp/WalkupScanToCompDestinations/1c881fde-c4a0-1f08-822f-a01d48c5c091</dd:ResourceURI>
    <dd:Name>FIXE</dd:Name>
    <dd3:Hostname>FIXE</dd3:Hostname>
    <wus:LinkType>Network</wus:LinkType>
    <wus:WalkupScanToCompSettings>
        <scantype:ScanSettings>
            <dd:ScanPlexMode>Simplex</dd:ScanPlexMode>
        </scantype:ScanSettings>
        <wus:Shortcut>SavePDF</wus:Shortcut>
    </wus:WalkupScanToCompSettings>
</wus:WalkupScanToCompDestination>
manuc66 commented 2 years ago

@autumnwalker can you try the attempt in PR #465 ?

autumnwalker commented 2 years ago

@autumnwalker can you try the attempt in PR #465 ?

hmm - how do I try that branch (?) I'm just running in Docker via Unraid.

manuc66 commented 2 years ago

@autumnwalker I've now published docker build for dev branch too

docker run -e CMDLINE=-D manuc66/node-hp-scan-to:feature_adf_duplex_461

You have to take into account your parameter, but don't remove the -e CMDLINE=-D because it enables debug logs

autumnwalker commented 2 years ago

Thank you! Pulled down the feature version and the container will start, but exits.

0100 -> {"baseURL":"http://192.168.2.107","url":"/WalkupScanToComp/WalkupScanToCompDestinations","method":"GET","responseType":"text"} 0100 <- {"status":200,"data":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!---->\r\n<wus:WalkupScanToCompDestinations xsi:schemaLocation=\"http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28 ../../schemas/WalkupScanToComp.xsd\" xmlns:wus=\"http://www.hp.com/schemas/imaging/con/ledm/walkupscan/2010/09/28\" xmlns:dd=\"http://www.hp.com/schemas/imaging/con/dictionaries/1.0/\" xmlns:dd3=\"http://www.hp.com/schemas/imaging/con/dictionaries/2009/04/06\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n\t\r\n\t\t/WalkupScanToComp/WalkupScanToCompDestinations/229e4159-bca6-1f22-bc90-98e7f4398609</dd:ResourceURI>\r\n\t\tpaperless-ngx</dd:Name>\r\n\t\tpaperless-ngx</dd3:Hostname>\r\n\t\tNetwork</wus:LinkType>\r\n\t</wus:WalkupScanToCompDestination>\r\n\t\r\n\t\t/WalkupScanToComp/WalkupScanToCompDestinations/229de9c5-bb30-1f22-9981-98e7f4398609</dd:ResourceURI>\r\n\t\t2ac205156c90</dd:Name>\r\n\t\t2ac205156c90</dd3:Hostname>\r\n\t\tNetwork</wus:LinkType>\r\n\t</wus:WalkupScanToCompDestination>\r\n\t\r\n\t\t/WalkupScanToComp/WalkupScanToCompDestinations/229db22a-ba43-1f22-bb08-98e7f4398609</dd:ResourceURI>\r\n\t\t8841c32605c3</dd:Name>\r\n\t\t8841c32605c3</dd3:Hostname>\r\n\t\tNetwork</wus:LinkType>\r\n\t</wus:WalkupScanToCompDestination>\r\n\t\r\n\t\t/WalkupScanToComp/WalkupScanToCompDestinations/229d90d2-b9b5-1f22-93db-98e7f4398609</dd:ResourceURI>\r\n\t\tdabdc527a864</dd:Name>\r\n\t\tdabdc527a864</dd3:Hostname>\r\n\t\tNetwork</wus:LinkType>\r\n\t</wus:WalkupScanToCompDestination>\r\n</wus:WalkupScanToCompDestinations>\r\n","headers":{"server":"HP HTTP Server; HP OfficeJet Pro 6970 - T0F29A; Serial Number: TH682321PN; Built:Mon Dec 13, 2021 12:23:47PM {MCP2CN2151AR}","content-type":"text/xml","transfer-encoding":"chunked","cache-control":"must-revalidate, max-age=0","pragma":"no-cache"},"statusText":"OK"}

TypeError: Cannot read properties of undefined (reading 'dd:Name') at WalkupScanToCompDestination.get (/app/WalkupScanToCompDestination.js:9:64) at /app/index.js:143:104 at Array.map () at /app/index.js:143:76 at step (/app/index.js:35:23) at Object.next (/app/index.js:16:53) at fulfilled (/app/index.js:7:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) TypeError: Cannot read properties of undefined (reading 'dd:Name') at WalkupScanToCompDestination.get (/app/WalkupScanToCompDestination.js:9:64) at /app/index.js:143:104 at Array.map () at /app/index.js:143:76 at step (/app/index.js:35:23) at Object.next (/app/index.js:16:53) at fulfilled (/app/index.js:7:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

manuc66 commented 2 years ago

@autumnwalker Can you drop the downloaded image and try again ?

autumnwalker commented 2 years ago

This appears to be working! I successfully got both sides of a duplex ADF scan. Thank you!

I have a new enhancement idea now - will open a new ticket.