seydx / homebridge-printer

Homebridge plugin for ipp (AirPrint) capable printer
MIT License
42 stars 4 forks source link

Error: Received unexpected response status 401 from the printer. #3

Closed solbadguy2010 closed 3 years ago

solbadguy2010 commented 3 years ago

My third printer give me this error:

[14/01/2021, 14:07:48] [PrinterPlatform] Canon Selphy CP1300: An error occured during getting state [14/01/2021, 14:07:48] [PrinterPlatform] Error: Received unexpected response status 401 from the printer. at ClientRequest. (/usr/local/lib/node_modules/homebridge-printer/node_modules/@sealsystems/ipp/lib/request.js:85:12) at Object.onceWrapper (events.js:422:26) at ClientRequest.emit (events.js:315:20) at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:641:27) at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17) at Socket.socketOnData (_http_client.js:509:22) at Socket.emit (events.js:315:20) at addChunk (internal/streams/readable.js:309:12) at readableAddChunk (internal/streams/readable.js:284:9) at Socket.Readable.push (internal/streams/readable.js:223:10) at TCP.onStreamRead (internal/stream_base_commons.js:188:23)

solbadguy2010 commented 3 years ago

Changes to this after some time:

[14/01/2021, 14:09:03] [PrinterPlatform] Canon Selphy CP1300: An error occured during getting state [14/01/2021, 14:09:03] [PrinterPlatform] Error: getaddrinfo ENOTFOUND cp1300bb6ab8.local at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'cp1300bb6ab8.local' }

solbadguy2010 commented 3 years ago

Here is the corresponding config:

{ "name": "PrinterPlatform", "printer": [ { "name": "HP Laserjet M277dw", "address": "http://M277dw.local./hp/device/info_config_AirPrint.html?tab=Networking&menu=AirPrintStatus", "manufacturer": "Hewlett-Packard", "model": "Color LaserJet MFP M277dw", "serialNumber": "VNB8J4W31P" }, { "name": "Canon Selphy CP1300", "address": "http://CP1300bb6ab8.local:8008/index.html", "manufacturer": "Canon", "model": "Selphy CP1300", "serialNumber": "8907000868" } ], "platform": "PrinterPlatform" }

fototeddy commented 3 years ago

what happens when you try to open http://CP1300bb6ab8.local:8008/index.html in your Webbrowser? has that website a usermanagment? or did you just have typo in the port and it needs to be :8080 instead of :8008?

does the plugin show the printing status of your HP printer as well? because the Webadresse there also seems to be not the ipp interface of your printer

solbadguy2010 commented 3 years ago

Hey, thank you for your help. I simply use the URL the Discovery DNS-SD Browser App shows me. When i try to open it i am asked for a passwort that i do not have.

The HP printer is working. I use it to activate the lights in my office if i print in the evebing. URL is also from the App.

8CD5B8AD-0BBF-4C86-826F-325B4E63C30F

solbadguy2010 commented 3 years ago

Tried a little bit around. If i use Port 631 instead of 8008 i get a website. Sadly the plugin still give me errors:

C2425A81-7F24-43BF-A4A6-641AD0FB9FCB

solbadguy2010 commented 3 years ago

This is the error message. Homebridge is crashing afterwards.

[29/01/2021, 07:48:16] Error: NotEnoughData at read (/usr/local/lib/node_modules/homebridge-printer/node_modules/@sealsystems/ipp/lib/parser.js:61:13) at readAttr (/usr/local/lib/node_modules/homebridge-printer/node_modules/@sealsystems/ipp/lib/parser.js:200:18) at readGroup (/usr/local/lib/node_modules/homebridge-printer/node_modules/@sealsystems/ipp/lib/parser.js:223:7) at readGroups (/usr/local/lib/node_modules/homebridge-printer/node_modules/@sealsystems/ipp/lib/parser.js:234:7) at parser (/usr/local/lib/node_modules/homebridge-printer/node_modules/@sealsystems/ipp/lib/parser.js:305:3) at IncomingMessage. (/usr/local/lib/node_modules/homebridge-printer/node_modules/@sealsystems/ipp/lib/request.js:19:22) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)

fototeddy commented 3 years ago

There seems to ne something wrong with the ipp Adress or Service of your printer.

Try ipp://url:631 without Index

or Maybe the websites tells you More about the ipp Adress under Network settings

fototeddy commented 3 years ago

Try this for ipp

ipp://CP1300bb6ab8.local:631/ipp/print

or ipp://10.0.1.85:631/ipp/print if your network is Unsing static leases or static ips

solbadguy2010 commented 3 years ago

ipp://10.0.1.85:631/ipp/print is working! Thank you again!