OpenPrinting / ps-printer-app

PostScript Printer Application
Apache License 2.0
36 stars 13 forks source link

Cannot add HP LaserJet 4000 from web interface #3

Closed userhasaname closed 3 years ago

userhasaname commented 3 years ago

I cannot add an HP LaserJet 4000 printer connected by network from the web interface, although I can add it using the general HP Postscript ppd. (I am using the application installed as a snap in a virtual machine running Ubuntu 20.04.2 LTS using libvirt manager.)

Here are the steps I went through:

  1. I deleted all ps-printer-app printers from the command line and then rebooted. (I wasn't able to delete them from the web interface.)
  2. I went to localhost:8000 in Firefox clicking through the error message about authentication.
  3. Clicked add printers and entered Test as name of printer, selected network printer as device (only option), entered IP address as 192.168.1.40, and selected auto-detect driver.
  4. This returned "Unable to use that driver."
  5. Tried to install the printer again using the same settings but selecting "HP laserjet 4000 series (en)" instead of auto-detect.
  6. Got "Secure Connection Failed" webpage from Firefox, pressed "Try Again" button in bottom right corner, and then clicked to "resend" the info.
  7. This returned "Invalid form submission."
  8. Tried again with HP POSTSCRIPT LASERJET DEVICES (en)
  9. This added the printer without any errors and I could print a test page from the application.
  10. Rebooted the virtual machine and the printer was added automatically to CUPS. (Note I'm not using your Snap for CUPS, just whatever is installed in Ubuntu.)
  11. Printed a test page from CUPS. It was fine but also contained an additional page with (I think) a PostScript error message about typecheck and idiv. (LaserJet 4000 is PostScript Level 2.)
  12. Earlier, I was also able to add the printer with the generic postscript ppd, but that is not reflected in the attached logs. I had a similar issue with an error message after printing the test page from CUPS in Ubuntu.
  13. I was also unable to add the printer by manually adding the ppd file from hplip. This isn't reflected in the logs either though.
  14. I can try adding the printer from the command line, but would need to know the exact format of the command to use, particularly what to put for the driver.

I ran the following commands from a different computer where I had the printer installed through CUPS.

lpinfo -l -v

Relevant portion: Device: uri = socket://192.168.1.40:9100 class = network info = HP LaserJet 4000 Series make-and-model = HP LaserJet 4000 Series device-id = MANUFACTURER:Hewlett-Packard;COMMAND SET:PJL,MLC,PCL,PCLXL,POSTSCRIPT;MODEL:HP LaserJet 4000 Series;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard LaserJet 4000 Series location =

/usr/lib/cups/backend/snmp 192.168.1.40 INFO: Using default SNMP Community public network socket://192.168.1.40:9100 "HP LaserJet 4000 Series" "HP LaserJet 4000 Series" "MANUFACTURER:Hewlett-Packard;COMMAND SET:PJL,MLC,PCL,PCLXL,POSTSCRIPT;MODEL:HP LaserJet 4000 Series;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard LaserJet 4000 Series" ""

Here is the similar info from the ppd contained in hplip (downloaded from SourceForge): % Product Version Information Product: "(HP LaserJet 4000 Series)" Product: "(Hewlett-Packard HP LaserJet 4000 Series)" ModelName: "HP LaserJet 4000 Series" ShortNickName: "HP LaserJet 4000 Series" 1284DeviceID: "MFG:Hewlett-Packard;MDL:hp laserjet 4000 series;" NickName: "HP LaserJet 4000 Series Postscript (recommended)" PSVersion: "(2014.108) 1" *Manufacturer: "HP"

ps-printer-app.log.txt ps-printer-app.state.txt

tillkamppeter commented 3 years ago

If you have problems with the web interface, please make sure the Snap is the latest version. For this run

sudo snap refresh --edge ps-printer-app

There was a problem in the build process of the Snap which I have corrected yesterday.

tillkamppeter commented 3 years ago

I have done first investigation and my result up to now is that the Printer Application crashes on some of the PPD files, where the LaserJet 4000 is one of them. Most PPD files (I tested Ricoh,Toshiba, Brother, Generic, HP OfficeJet Pro 8730, ...) work though. I try to find out now what causes the crash.

tillkamppeter commented 3 years ago

It is a little typo in margin calculation, fixes both HP LaserJet 4000 and HP LaserJet 2300 (probably all PPD files work now, at least page margins will not cause a problem any more).

I am committing this soon and this will trigger an update in the Snap Store. If your system does not auto-update by this, run

sudo snap refresh --edge ps-printer-app

and then all should work for you, both with manual selection of the model or with auto-selection and also both by command line and by web interface.

tillkamppeter commented 3 years ago

Fixed in commit 23080d50f.

Snap Store is rebuilding.

Thank you very much for your bug report.