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

Unsupported device HP Color LaserJet Pro M283fdw #863

Closed hydrocontica closed 7 months ago

hydrocontica commented 7 months ago

Hello - I'm attempting to set this up as a container in Docker on Unraid (version 6.12.8), but as soon as I specify the printer IP as an environment variable (per the configuration instructions) it results in the container crashing and restarting rapidly until eventually the system kills it altogether. The container's log indicates that the issue is that the printer is an "unknown device", and with the container generating a 404 not found error after trying to initiate connection.

Device is a HP Color LaserJet MFP M283fdw, tested as working with scan to computer on a Windows PC (Windows 10), with firmware revision dated 2020-06-03. Note that I cannot update the firmware as HP removed scan to computer from this printer model with later revisions for some reason, however scan to computer does still work with the most recent version of HP software.

Here is my docker run (though no errors occur unless the IP address of the printer is specified, the container appears to start correctly otherwise but ofc is not detectable by the printer without that IP address being set):

docker run -d --name='node-hp-scan-to' --net='bridge' -e TZ="Europe/London" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Tower" -e HOST_CONTAINERNAME="node-hp-scan-to" -e 'IP'='192.168.0.108' -e 'PGID'='100' -e 'PUID'='99' -e 'UMASK'='022' -e 'PATTERN'='"scan"_dd.mm.yyyy_hh:MM:ss' -e 'RESOLUTION'='300' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.icon='https://i.ibb.co/SshKGrH/Colors-HP-Logo.jpg' -v '/mnt/user/Paperless/consume/':'/scan':'rw' -v '/mnt/user/Paperless/hp-temp/':'/temp':'rw' 'manuc66/node-hp-scan-to:latest'

And here are my logs (they repeat exactly 50 times once the container is started until the container is killed entirely):

Starting Using device ip: 192.168.0.108 IsDebug: true Target folder: /scan Temp folder: /tmp/scan-to-pcGNNlHa 0001 -> {"baseURL":"http://192.168.0.108","url":"/DevMgmt/DiscoveryTree.xml","method":"GET","responseType":"text"} 0001 <- {"status":200,"data":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ledm:DiscoveryTree xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:dd=\"http://www.hp.com/schemas/imaging/con/dictionaries/1.0/\" xmlns:ledm=\"http://www.hp.com/schemas/imaging/con/ledm/2007/09/21\" xsi:schemaLocation=\"http://www.hp.com/schemas/imaging/con/dictionaries/1.0/ dd/DataDictionaryMasterLEDM.xsd http://www.hp.com/schemas/imaging/con/ledm/2007/09/21 LEDM.xsd\">SVN-IPG-LEDM.29</dd:Revision></dd:Version>/DevMgmt/ConsumableConfigCap.xml</dd:ResourceURI>ledm:hpLedmConsumableConfigCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/consumableconfigcap/2007/11/19</dd:Revision></ledm:SupportedTree>/DevMgmt/ConsumableConfigDyn.xml</dd:ResourceURI>ledm:hpLedmConsumableConfigDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/consumableconfigdyn/2007/11/19</dd:Revision></ledm:SupportedTree>/DevMgmt/ConsumableConfigSecureManifest.xml</dd:ResourceURI>ledm:hpLedmConsumableConfigSecureManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedTree>/Supplies/HPSupplyMemory.xml</dd:ResourceURI>ledm:hpLedmHPSupplyMemory</dd:ResourceType>http://www.hp.com/schemas/imaging/hpsupplyMemory/2014/01/21</dd:Revision></ledm:SupportedTree>/Supplies/CartridgeHistory.xml</dd:ResourceURI>ledm:hpLedmCartridgeHistory</dd:ResourceType>http://www.hp.com/schemas/imaging/cartridgehistory/2013/12/16</dd:Revision></ledm:SupportedTree>/DevMgmt/ShopForSupplies.xml</dd:ResourceURI>ledm:hpLedmShopForSupplies</dd:ResourceType>http://www.hp.com/schemas/imaging/ljs/shopforsuppliesrequest/2007/11/07</dd:Revision></ledm:SupportedTree>/DevMgmt/InternalPrintDyn.xml</dd:ResourceURI>ledm:hpLedmInternalPrintDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/internalprintdyn/2008/03/21</dd:Revision></ledm:SupportedTree>/DevMgmt/InternalPrintCap.xml</dd:ResourceURI>ledm:hpLedmInternalPrintCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/internalprintcap/2008/03/21</dd:Revision></ledm:SupportedTree>/DevMgmt/MediaDyn.xml</dd:ResourceURI>ledm:hpLedmMediaDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/mediadyn/2009/05/21</dd:Revision></ledm:SupportedTree>/DevMgmt/MediaCap.xml</dd:ResourceURI>ledm:hpLedmMediaCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/mediacap/2009/05/21</dd:Revision></ledm:SupportedTree>/DevMgmt/MediaHandlingDyn.xml</dd:ResourceURI>ledm:hpLedmMediaHandlingDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/mediahandlingdyn/2007/11/21</dd:Revision></ledm:SupportedTree>/DevMgmt/MediaHandlingCap.xml</dd:ResourceURI>ledm:hpLedmMediaHandlingCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/mediahandlingcap/2009/06/25</dd:Revision></ledm:SupportedTree>/DevMgmt/MassStorageConfigDyn.xml</dd:ResourceURI>ledm:hpLedmMassStorageConfigDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/massstorageconfigdyn/2008/01/25</dd:Revision></ledm:SupportedTree>/DevMgmt/MassStorageConfigCap.xml</dd:ResourceURI>ledm:hpLedmMassStorageConfigCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/massstorageconfigcap/2009/01/12</dd:Revision></ledm:SupportedTree>/DevMgmt/PrintConfigDyn.xml</dd:ResourceURI>ledm:hpLedmPrintConfigDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/printconfigdyn/2009/05/06</dd:Revision></ledm:SupportedTree>/DevMgmt/PrintConfigCap.xml</dd:ResourceURI>ledm:hpLedmPrintConfigCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/printconfigcap/2009/05/06</dd:Revision></ledm:SupportedTree>/DevMgmt/ProductStatusDyn.xml</dd:ResourceURI>ledm:hpLedmProductStatusDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/productstatusdyn/2007/10/31</dd:Revision></ledm:SupportedTree>/DevMgmt/ProductStatusCap.xml</dd:ResourceURI>ledm:hpLedmProductStatusCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/productstatuscap/2007/10/31</dd:Revision></ledm:SupportedTree>/DevMgmt/ProductConfigDyn.xml</dd:ResourceURI>ledm:hpLedmProductConfigDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/productconfigdyn/2009/03/16</dd:Revision></ledm:SupportedTree>/DevMgmt/ProductConfigCap.xml</dd:ResourceURI>ledm:hpLedmProductConfigCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/productconfigcap/2009/03/16</dd:Revision></ledm:SupportedTree>/DevMgmt/ProductUsageDyn.xml</dd:ResourceURI>ledm:hpLedmProductUsageDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/productusagedyn/2007/12/11</dd:Revision></ledm:SupportedTree>/DevMgmt/ProductUsageCap.xml</dd:ResourceURI>ledm:hpLedmProductUsageCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/productusagecap/2007/12/11</dd:Revision></ledm:SupportedTree>/DevMgmt/ProductLogsDyn.xml</dd:ResourceURI>ledm:hpLedmProductLogsDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/productlogsdyn/2008/01/16</dd:Revision></ledm:SupportedTree>/DevMgmt/ProductLogsCap.xml</dd:ResourceURI>ledm:hpLedmProductLogsCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/productlogscap/2008/01/16</dd:Revision></ledm:SupportedTree>/DevMgmt/SecurityDyn.xml</dd:ResourceURI>ledm:hpLedmSecurityDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/securitydyn/2008/02/01</dd:Revision></ledm:SupportedTree>/DevMgmt/SecurityCap.xml</dd:ResourceURI>ledm:hpLedmSecurityCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/securitycap/2008/02/01</dd:Revision></ledm:SupportedTree>/EventMgmt/EventTable.xml</dd:ResourceURI>ledm:hpLedmEventTable</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/events/2007/09/16</dd:Revision></ledm:SupportedTree>/EventMgmt/EventCapabilities.xml</dd:ResourceURI>ledm:hpLedmEventCapabilities</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/events/2007/09/16</dd:Revision></ledm:SupportedTree>/EventMgmt/SubscriptionList.xml</dd:ResourceURI>ledm:hpLedmSubscriptionList</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/events/2007/09/16</dd:Revision></ledm:SupportedTree>/DevMgmt/IOConfigDyn.xml</dd:ResourceURI>ledm:hpLedmIoConfigDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/ioconfigdyn/2009/03/17</dd:Revision></ledm:SupportedTree>/DevMgmt/IOConfigCap.xml</dd:ResourceURI>ledm:hpLedmIoConfigCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/ioconfigcap/2009/03/17</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxPhoneBookCap.xml</dd:ResourceURI>ledm:hpLedmFaxPhoneBookCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxphonebookcap/2008/03/17</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxPhoneBookDyn.xml</dd:ResourceURI>ledm:hpLedmFaxPhoneBookDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxphonebookdyn/2008/03/17</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxActivityLogDyn.xml</dd:ResourceURI>ledm:hpLedmFaxActivityLogDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxactivitylogdyn/2008/01/25</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxActivityLogCap.xml</dd:ResourceURI>ledm:hpLedmFaxActivityLogCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxactivitylogcap/2008/01/25</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxBlockListDyn.xml</dd:ResourceURI>ledm:hpLedmFaxBlockListDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxblklistdyn/2008/04/03</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxBlockListCap.xml</dd:ResourceURI>ledm:hpLedmFaxBlockListCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxblklistcap/2008/04/03</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxConfigDyn.xml</dd:ResourceURI>ledm:hpLedmFaxConfigDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxconfigdyn/2009/03/03</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxConfigCap.xml</dd:ResourceURI>ledm:hpLedmFaxConfigCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxconfigcap/2009/03/03</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxUploadCap.xml</dd:ResourceURI>ledm:hpLedmFaxUploadCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxuploadcap/2008/08/12</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxUploadDyn.xml</dd:ResourceURI>ledm:hpLedmFaxUploadDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxuploaddyn/2008/07/01</dd:Revision></ledm:SupportedTree>/Jobs/Joblist/FaxUpload</dd:ResourceURI>ledm:hpLedmJobEvent</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/jobs/2009/04/30</dd:Revision></ledm:SupportedTree>/DevMgmt/FaxTestCap.xml</dd:ResourceURI>ledm:hpLedmFaxTestCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/faxtestcap/2009/03/16</dd:Revision></ledm:SupportedTree>/DevMgmt/NetAppsDyn.xml</dd:ResourceURI>ledm:hpLedmNetAppsDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/netappdyn/2009/06/24</dd:Revision></ledm:SupportedTree>/DevMgmt/NetAppsCap.xml</dd:ResourceURI>ledm:hpLedmNetAppsCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/netappcap/2009/06/24</dd:Revision></ledm:SupportedTree>/DevMgmt/CopyConfigCap.xml</dd:ResourceURI>ledm:hpLedmCopyConfigCap</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/cpcfgcap/2008/05/05</dd:Revision></ledm:SupportedTree>/DevMgmt/CopyConfigDyn.xml</dd:ResourceURI>ledm:hpLedmCopyConfigDyn</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/cpcfgdyn/2008/05/05</dd:Revision></ledm:SupportedTree>/Copy/CopyManifest.xml</ledm:ManifestURI>ledm:hpLedmCopyManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/Security/CertificateManifest.xml</ledm:ManifestURI>ledm:hpCertificateManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/DevMgmt/Folder/FolderServiceManifest.xml</ledm:ManifestURI>ledm:hpLedmFolderServiceManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/DevMgmt/Email/EmailServiceManifest.xml</ledm:ManifestURI>ledm:hpLedmEmailServiceManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/IoMgmt/IoMgmtManifest.xml</ledm:ManifestURI>ledm:hpLedmIoMgmt</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/FirmwareUpdate/FirmwareUpdateManifest.xml</ledm:ManifestURI>ledm:hpLedmFirmwareUpdateManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/EventMgmt/EventMgmtManifest.xml</ledm:ManifestURI>ledm:hpLedmEventMgmtManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/ePrint/ePrintManifest.xml</ledm:ManifestURI>ledm:hpePrintManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/CloudAppPlayer/CloudAppPlayerManifest.xml</ledm:ManifestURI>cloud:hpRestCloudAppPlayerManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/eFCL/eFclManifest.xml</ledm:ManifestURI>eFCL:eFclManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/eSCL/eSclManifest.xml</ledm:ManifestURI>eSCL:eSclManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/04</dd:Revision></ledm:SupportedIfc>/DevMgmt/NetAppsSecureManifest.xml</ledm:ManifestURI>ledm:hpLedmNetAppsSecureManifest</dd:ResourceType>http://www.hp.com/schemas/imaging/con/ledm/manifest/2009/03/24</dd:Revision></ledm:SupportedIfc>/ipp/print</dd:ResourceURI>pwg:hpIPPPrint</dd:ResourceType>http://www.pwg.org/ipp/2.0</dd:Revision></ledm:SupportedFeature></ledm:DiscoveryTree>","headers":{"cache-control":"no-cache, no-store, must-revalidate","server":"gSOAP/2.7","content-type":"text/xml; charset=utf-8","content-length":"15884","connection":"close"},"statusText":"OK"} Unknown device! Running iteration: 0 - errorCount: 0 0002 -> {"baseURL":"http://192.168.0.108","url":"/WalkupScan/WalkupScanDestinations","method":"GET","responseType":"text"} 0002 <- {"status":404,"data":"404 Not Found\r\n","headers":{"server":"Virata-EmWeb/R6_2_1","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","cache-control":"no-cache, no-store, must-revalidate","connection":"close","content-length":"15","content-type":"text/html"},"statusText":"Not Found"} AxiosError: Request failed with status code 404 at settle (/app/node_modules/axios/dist/node/axios.cjs:1967:12) at IncomingMessage.handleStreamEnd (/app/node_modules/axios/dist/node/axios.cjs:3066:11) at IncomingMessage.emit (node:events:529:35) at endReadableNT (node:internal/streams/readable:1400:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) at Axios.request (/app/node_modules/axios/dist/node/axios.cjs:3877:41) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async HPApi.callAxios (/app/HPApi.js:78:30) at async HPApi.getWalkupScanDestinations (/app/HPApi.js:146:26) at async registerWalkupScanDestination (/app/listening.js:71:36) at async waitScanEvent (/app/listening.js:94:23) at async listenCmd (/app/index.js:34:27) at async Command. (/app/index.js:214:9) at async Command.parseAsync (/app/node_modules/commander/lib/command.js:1015:5) at async main (/app/index.js:254:5) { code: 'ERR_BAD_REQUEST', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: Object [AxiosHeaders] { Accept: 'application/json, text/plain, /', 'Content-Type': undefined, 'User-Agent': 'axios/1.6.7', 'Accept-Encoding': 'gzip, compress, deflate, br' }, baseURL: 'http://192.168.0.108', url: '/WalkupScan/WalkupScanDestinations', method: 'get', responseType: 'text', data: undefined }, request: <ref 1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: null, _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 6, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular 1],

  [Symbol(kHandle)]: null,
  [Symbol(lastWriteQueueSize)]: 0,
  [Symbol(timeout)]: null,
  [Symbol(kBuffer)]: null,
  [Symbol(kBufferCb)]: null,
  [Symbol(kBufferGen)]: null,
  [Symbol(kCapture)]: false,
  [Symbol(kSetNoDelay)]: true,
  [Symbol(kSetKeepAlive)]: true,
  [Symbol(kSetKeepAliveInitialDelay)]: 60,
  [Symbol(kBytesRead)]: 248,
  [Symbol(kBytesWritten)]: 205
},
_header: 'GET /WalkupScan/WalkupScanDestinations HTTP/1.1\r\n' +
  'Accept: application/json, text/plain, */*\r\n' +
  'User-Agent: axios/1.6.7\r\n' +
  'Accept-Encoding: gzip, compress, deflate, br\r\n' +
  'Host: 192.168.0.108\r\n' +
  'Connection: close\r\n' +
  '\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: Agent {
  _events: [Object: null prototype],
  _eventsCount: 2,
  _maxListeners: undefined,
  defaultPort: 80,
  protocol: 'http:',
  options: [Object: null prototype],
  requests: [Object: null prototype] {},
  sockets: [Object: null prototype] {},
  freeSockets: [Object: null prototype] {},
  keepAliveMsecs: 1000,
  keepAlive: false,
  maxSockets: Infinity,
  maxFreeSockets: 256,
  scheduling: 'lifo',
  maxTotalSockets: Infinity,
  totalSocketCount: 0,
  [Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'GET',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/WalkupScan/WalkupScanDestinations',
_ended: true,
res: IncomingMessage {
  _readableState: [ReadableState],
  _events: [Object: null prototype],
  _eventsCount: 4,
  _maxListeners: undefined,
  socket: [Socket],
  httpVersionMajor: 1,
  httpVersionMinor: 1,
  httpVersion: '1.1',
  complete: true,
  rawHeaders: [Array],
  rawTrailers: [],
  joinDuplicateHeaders: undefined,
  aborted: false,
  upgrade: false,
  url: '',
  method: null,
  statusCode: 404,
  statusMessage: 'Not Found',
  client: [Socket],
  _consuming: false,
  _dumped: false,
  req: [Circular *1],
  responseUrl: 'http://192.168.0.108/WalkupScan/WalkupScanDestinations',
  redirects: [],
  [Symbol(kCapture)]: false,
  [Symbol(kHeaders)]: [Object],
  [Symbol(kHeadersCount)]: 14,
  [Symbol(kTrailers)]: null,
  [Symbol(kTrailersCount)]: 0
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: '192.168.0.108',
protocol: 'http:',
_redirectable: Writable {
  _writableState: [WritableState],
  _events: [Object: null prototype],
  _eventsCount: 3,
  _maxListeners: undefined,
  _options: [Object],
  _ended: true,
  _ending: true,
  _redirectCount: 0,
  _redirects: [],
  _requestBodyLength: 0,
  _requestBodyBuffers: [],
  _onNativeResponse: [Function (anonymous)],
  _currentRequest: [Circular *1],
  _currentUrl: 'http://192.168.0.108/WalkupScan/WalkupScanDestinations',
  [Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
  accept: [Array],
  'user-agent': [Array],
  'accept-encoding': [Array],
  host: [Array]
},
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 16384,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null

}, response: { status: 404, statusText: 'Not Found', headers: Object [AxiosHeaders] { server: 'Virata-EmWeb/R6_2_1', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'cache-control': 'no-cache, no-store, must-revalidate', connection: 'close', 'content-length': '15', 'content-type': 'text/html' }, config: { transitional: [Object], adapter: [Array], transformRequest: [Array], transformResponse: [Array], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: [Object], validateStatus: [Function: validateStatus], headers: [Object [AxiosHeaders]], baseURL: 'http://192.168.0.108', url: '/WalkupScan/WalkupScanDestinations', method: 'get', responseType: 'text', data: undefined }, request: <ref 1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: [Socket], _header: 'GET /WalkupScan/WalkupScanDestinations HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /*\r\n' + 'User-Agent: axios/1.6.7\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: 192.168.0.108\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/WalkupScan/WalkupScanDestinations', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: '192.168.0.108', protocol: 'http:', _redirectable: [Writable],

  [Symbol(kBytesWritten)]: 0,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(errored)]: null,
  [Symbol(kHighWaterMark)]: 16384,
  [Symbol(kRejectNonStandardBodyWrites)]: false,
  [Symbol(kUniqueHeaders)]: null
},
data: '404 Not Found\r\n'

} }

I'm aware that using macvlan and specifying the printer's name is an alternative configuration method, but unfortunately macvlan was removed from recent versions of Unraid. My suspicion is that there is an incompatibility between Unraid's new Docker networking approach and node-hp-scan-to, but I'm not sure of the exact culprit.

manuc66 commented 7 months ago

Hi,

The reason it fails is that your printer is not supported because there is no WalkupScanToCompManifestURI or WalkupScanManifestURI in the DiscoveryTree. That's why you can also read Unknown device! (see https://github.com/manuc66/node-hp-scan-to/blob/043466417ed3e198c5e0d338e718d17c005a3054/src/readDeviceCapabilities.ts#L31)

These allow the application to register a computer as a target.

I don't know how the - Scan to Computer - feature works on this device. Without a complete record of the communication under Windows using the original hp software with the device, it's impossible to do the retro-engineering to make this device work in this project.

hydrocontica commented 7 months ago

Ah I see, thanks for the explanation. I've been researching this myself since I made this post and I found some threads on HP's support forum from customer service reps which (vaguely) mention that "scan to computer" was removed from some MFP models due to bugs. I guess it was easier to just deprecate the function entirely and push people to use "scan to network path" instead. Annoying considering these printers are also stuck on SMB v1!

Is there a way I could record the communication between the printer and Windows? I'd be happy to provide more info if it would help diagnose the problem and extend functionality to any other printers similarly afflicted.

manuc66 commented 7 months ago

I used wireshark to capture the network traffic while interacting with the application and the device and I've been able to understand what were happening : https://github.com/manuc66/node-hp-scan-to/blob/043466417ed3e198c5e0d338e718d17c005a3054/protocol_doc/HP%20Officejet%206500%20E710n-z.md

Hopefully the trafic was in clear text not http with that printer so it was a bit easier. If you are facing https traffic you may try to use this kind of technique : https://briannalaird.com/tutorials/decrypt-https-traffic-in-wireshark-on-a-windows-machine