Printing to an HP Laserjet 1020 from FreeBSD 8 using CUPS and foo2zjs

This is an update to my post for FreeBSD 7. I’ve now upgraded to FreeBSD 8 and things are done a bit differently.

Custom Kernel

There’s no need to build a custom kernel any more since FreeBSD uses the ulpt device (as it always should have!). That device is built in to the GENERIC kernel and the device is correctly recognised at boot time. The remainder of this post is about changing to the new device name.

Build and install ports

This is the same as previously.

Set device permissions

The devfs.rules entry needs to use the new device name. It also needs to set the permission of some extra devices, otherwise CUPS won’t find the printer. Look in the output of dmesg for the USB entry that corresponds to the printer. Mine looks like:

ugen5.5: <Hewlett-Packard> at usbus5
ulpt0: <Hewlett-Packard HP LaserJet 1020, class 0/0, rev 2.00/1.00, addr 5> on usbus5

So the new devfs.rules entry is:

add path 'ulpt0' mode 0660 group cups
add path 'ugen5.5' mode 0660 group cups
add path 'usb/5.5.0' mode 0660 group cups

The rc.conf entry is the same as before.

Install firmware

The firmware needs to be sent to the new device name:

cat /usr/local/share/foo2zjs/firmware/sihp1020.dl > /dev/ulpt0

Likewise, /etc/devd.conf is changed to:

# Firmware download HP Laserjet 1020 printer
attach 100 {
match "vendor" "0x03f0";
match "product" "0x2b17";
action "cat /usr/local/share/foo2zjs/firmware/sihp1020.dl > /dev/$device-name";

Configure CUPS to use the printer

This is the same as before except the device URI is now “usb:/dev/ulpt0”.

, , , ,

  1. #1 by Alex on December 10, 2009 - 4:42 AM

    Thanks for sharing.
    Only one thing to add: you have to build cups-base with USB support, otherwise CUPS will not detect your printer.
    In /usr/ports/print/cups-base run ‘make config’ and check ‘LIBUSB’ option, then run ‘make install’ (or ‘make reinstall’).

  2. #2 by Troy on January 26, 2010 - 7:51 AM

    I am having trouble with the installation of the firmware after connecting. I am connecting a HP P1505 on FreeBSD 8

    cat /usr/local/share/foo2zjs/firmware/sihpP1505.dl > /dev/ulpt0

    This will upload the firmware correctly but I am having trouble figuring out the correct values for this printer to set devd.conf up

    Any help would be greatly appreciated

  3. #3 by Troy on January 26, 2010 - 8:45 AM

    Ok so I found the solution to my own problem.

    To find the values needed to setup devd.conf

    Run devd in debug mode
    devd -Dd

    This will output all of the neccessary info when you power on the printer.

(will not be published)