Wednesday, October 29, 2008

Linux: Install HP LaserJet 1020 on CUPS

First, I thought all printers configure on CUPS as local raw printer should works for windows workstation as long as I use correct printer driver to render the printing image.  The CUPS will just re-route the raw printing image received to the printer.

I have follow this rule to configure two other printers: Panasonic KX-1121 dot matrix printer and Samsung ML-1450 Laser Jet Printer.  Both works flawlessly for years.

I receive a HP LaserJet 1020 printer last night and try to configure it for CUPS.  The printer has only one USB port.  I plug the printer to the Linux machine's USB port and CUPS detect the printer well.  I then install the latest HP LaserJet 1020 printer downloaded from HP web site and configure the printer as usual.  I send a test page to printer.  CUPS receive the printing image and report print job completed successfully but the printer doesn't print anything.  The printer doesn't feed the paper.

I thought it was printer's problem.  To re-confirm the problem again, I attach the printer to my Windows Vista machine directly.  It print perfectly.

I found some interesting things with HP LaserJet 1020 after Google for solutions.

It is a Host-Based Printer

As defined by HP:

The host-based software uses the computer's resources to process print commands and rasterizing data, taking advantage of the computer's memory and processing power. Host-Based printing is a cost-effective printing technology that enables printers to utilize the processing power and memory resources of the PC (or the Host). In comparison, PDL-based printers use the processor and memory resources of the printer.

It utilize the power and resources of PC to render the printing images.  It print much faster than those PDL printer since newer computers process at much faster speeds than most PDL printers processors.

The disadvantages of Host-Based Printers is it no longer accept ASCII text directly from computer as all print images are generated by host operating system's print engine.

This however, is a good news as it reduce the manufacturing cost of the printer.  It also doesn't seems to be a problem for my RAW printer for CUPS service.

It always requires firmware download else it won't print

The printer is one of the cost-reduced HP printers that requires a firmware download before it will operate.  It means every time you switch on the printer, you need to send the firmware image to printer first before you start feeding the printing images.  The HP LJ1020 doesn't has a flash ROM to persist the firmware permanently.  This is the main reason why the printer works well when attach to windows vista machine but not Linux machine.  The HP LJ1010 printer drivers for windows OS take care of the firmware uploading well.

You may only get the N series of HP 1000 printers that has flash ROM equipped for firmware.  For example, HP LaserJet 1020n printer.

Solution: foo2zjs

I only need foo2zjs to upload the firmware to printer when the HP LJ1020 first attach to my Linux box.

  1. Logon to root account.
  2. Download foo2zjs tarball:

    $ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
  3. Untar it:

    $ tar zxf foo2zjs.tar.gz
  4. Configure foo2zjs:

    $ cd foo2zjs
    $ make

  5. Download HP LaserJet 1020 firmware file:

    $ ./getweb 1020
  6. Install driver, foomatic XML files, and extra files:

    $ make install
  7. Configure hotplug

    $ make install-hotplug
  8. Configure CUPS:

    $ make cups
  9. You may need to switch off and on the HP LJ 1020 printer to activate hot plug upload the firmware.
  10. To check if firmware uploaded:

    $ usb_printerid /dev/usb/lp1
    GET_DEVICE_ID string:
    MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;CLS:PRINTER;DES:HP LaserJet 1020;FWVER:20050309;

    If you see a string "FWVER:xxxxxxx". it means the firmware has uploaded successfully.

You may now start feeding the raw printing images from your windows workstation to HP Laser Jet 1020.

4 comments:

betoromom said...

Excelente tu manual.
Lo seguí al pie de la letra y comenzó a funcionar mi hp laserjet 1020.
Lo de más será pan comido.

Gracias por contribuir.

jozefk said...

I have foo2zjs installed. I can ping the IP of windows machine from where the printer is shared. I just don't know how to correctly add the printer in CUPS, it seems.
Any idea? Suggestion?
Thanks

Best,
Jozsef

Chau Chee Yang said...

To jozefk: Use a web browser and surf to http://your-ip:631/ to access the CUPS web management. You may need to check your cups server's firewall setting too.

Steve said...

Nice. This helped me alot, especially now that hplip no longer works. Awesome