Printers

CupsWindows
CupsMacOSX

I have a HP LaserJet 1020.

CUPS url: http://server:631/printers/LaserJet-1020

To make this printer work you will need the foo2jzs driver (http://foo2zjs.rkkda.com/).

You might have trouble installing the printer, in this case see the email below:
test

------------------



Subject: suggested fix for install-hotplug for ubuntu
From: Michael Salcher
Date: Sun, 02 Apr 2006 01:18:22 +1000
To: rickr@mn.rr.com

Hi Rick

I'm using your foo2zjs driver under Ubuntu Breezy (x86) to print to a HP
LaserJet 1020. I had a problem when running "make install-hotplug": it
kept on aborting early with an error code. I checked the "hplj1000"
script and found that using "ed" to insert some lines into
/etc/hotplug/usb.usermap did not work for me. "ed" kept on returning
question marks, meaning that it did not understand the command. So I
modified "hplj1000" (see attachment) and the installation process is now
working flawlessly on my system.
I thought this might be a problem for other people as well and they
could benefit from this little tweak.

One more thing: when using gnome-cups-manager to select the printer
driver, I was asked to supply a PPD file. I found a PPD file with the
name of my printer in the PPD folder of the installation directory and
gnome-cups-manager accepted that file. I just thought it might be a good
idea to let the user know that they need to select such a file in the
PPD folder when using gnome-cups-manager.

Thanks for the driver.
Keep up the good work!

cheers
Michael Salcher



#!/bin/sh

# hplj1000:
# hplj1005:
# hplj1020:
#
# Hotplug script for HP1000/1005 USB laser printers. The model number
# that this script deals with is determined from the script name.
#
# Used to download firmware automatically into the printer when it
# is powered up or plugged into the USB port.
#
# Also, run this script once with the magic argument "install-usermap"
# to create the proper entry in the /etc/hotplug/usb.usermap file.
#
# The inspiration fo this script is from:
# Oscar Santacreu. Alicante-Spain (2002)
# Mike Morgan (2004)
#

# udev calls us twice on FC4! Just want /dev/usb/lp
case "$DEVNAME" in
/dev/usb/usb*) exit;;
esac

PROGNAME="$0"

#
# Set $DEV to, e.g. /dev/usb/lp0, to force the device you want
# Else, leave it null to automatically detect the device
#
DEV=/dev/usb/lp0
DEV=""

#
# Directory to find downloadable HP firmware files sihpMMMM.dl
#
FWDIR=/usr/share/foo2zjs/firmware

#
# Program used to determine USB id information
#
USBID=/bin/usb_printerid

#
# Figure out how to log our messages
#
if [ -t 1 ]; then
# Running from a tty...
log() {
echo "$PROGNAME: $@"
}
elif [ -x /usr/bin/logger ]; then
# Have logger...
log() {
logger -t "$PROGNAME" -- "$@"
}
else
# No logger...
log() {
echo "$PROGNAME: $@" >> /var/log/messages
}
fi

# Figure out the model number from the name of this script
#
case "$0" in
*1000)
MODEL=1000
USB1=0x03f0 #Vendor
USB2=0x0517 #Model
;;
*1005)
MODEL=1005
USB1=0x03f0 #Vendor
USB2=0x1317 #Model
;;
*1020)
MODEL=1020
USB1=0x03f0 #Vendor
USB2=0x2b17 #Model
;;
*)
log "Only HP LaserJet 1000, 1005, and 1020 are supported"
exit
;;
esac

#
# The special command line argument "install-usermap" will install
# the proper entry into the /etc/hotplug/usb.usermap file
#
case "$1" in
install-usermap)
if [ "$USB2" != "" ]; then
if [ -w /etc/hotplug/usb.usermap ]; then
USERMAP=/etc/hotplug/usb.usermap
elif [ -d /etc/hotplug/usb/ ]; then
USERMAP=/etc/hotplug/usb/foo2zjs.usermap
if [ ! -s $USERMAP ]; then
echo > $USERMAP
fi
else
log "No /etc/hotplug usermap!"
exit
fi

echo "g/^hplj$MODEL/d" >> $USERMAP
echo "\$a" >> $USERMAP
echo "hplj$MODEL 0x0003 $USB1 $USB2 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000" >> $USERMAP
echo "" >> $USERMAP
else
log "I don't know the USB info for this model yet. Please run"
log "usb_printerid on the usb device and send the output to:"
log "rickr@mn.rr.com"
fi
exit
;;
esac

#
# Procedure to load a single device with firmware
#
load1() {
_dev="$1"
fw="$FWDIR/sihp$MODEL.dl"
if [ ! -f "$fw" ]; then
log "Missing HP LaserJet $MODEL firmware file $fw"
log "...read foo2zjs installation instructions and run ./getweb $MODEL"
return 1
fi

log "loading HP LaserJet $MODEL firmware $fw to $_dev ..."
# There is a timeout problem with udev and FC4, so spin it off.
(
if cat $fw > $_dev; then
log "... download successful."
else
log "... download failed."
fi
) &
return 0
}

#
# OK, now download firmware to any printers that need it
#
if [ "$DEV" != "" ]; then
#
# force downloading to a specific device
#
load1 "$DEV"
elif [ -x $USBID ]; then
#
# Sniff around for printers that need a firmware download
#
usblps=`find /dev/usb -name lp*`" "`find /dev -name usblp*`
for dev in $usblps; do
status=`$USBID $dev 2>/dev/null | grep -y "hp LaserJet $MODEL"`
if [ "$status" != "" ]; then
# This is a LaserJet 100x
chmod 0666 $dev
status=`$USBID $dev | grep 'FWVER'`
if [ "$status" = "" ]; then
# Firmware is not yet loaded
load1 "$dev"
else
log "HP LaserJet $MODEL firmware already loaded into $dev"
fi
fi
done
else
log "HP LaserJet $MODEL firmware was not downloaded..."
log "...couldn't find $USBID and DEV is not set"
fi