zero\’s blog

hard to say everything

Posts Tagged ‘hplj1020

HP LJ 1020 hotplug on Asus WL-500gP v2

with 3 comments

Most of you who have the Hewlett Packard LaserJet 1020 know that it is a GDI printer. Because of this it needs the sihp1020 driver loaded from the computer that is the printer connected to (all the “work” is done by the software instead of the hardware; so don’t wonder why is this printer a cheap one).

If this printer is connected directly to a computer (running MS Windows, Linux or Mac OS X or other Unix-like OS), there should be no problem to use this hardware. But if your HP LJ 1020 is connected to a router via USB, the things become a little complicated.

I own an Asus WL-500gP v2 router. I bought it because of the 2 USB ports.

The biggest problem to use this printer over a USB router is how to load the sihp1020.dl driver.

The easiest way is over ssh:
- connect to the router over ssh and load it with: cat /path/to/the/sihp1020.dl > /dev/usb/lp0 (my sihp1020.dl is stored on an USB pen).

But that is not practical. If you power off the printer, you will have to load the driver again after you power it on.

Finally I found a way how to load the driver automatically after the printer is powered on. It is done with hotplug.

First, hotplug works with the X-Wrt firmware (I think it works with OpenWrt, too, but I’m using X-Wrt).

Download the brcm-2.4 firmware image for WL-500gp v2 and flash it (how to do that please search on Google).

After you did that make a new hotplug script (/etc/hotplug.d/usb/hplj1020):

#!/bin/sh
FIRMWARE=”/mnt/sihp1020.dl”
if [ "$PRODUCT" = "3f0/2b17/100" ]
then
if [ "$ACTION" = "add" ]
then
sleep 10
echo “`date` : Sending firmware to printer. I hope!” >> /tmp/hp1020.log
cat $FIRMWARE > /dev/usb/lp0
echo “`date` : done.” >> /tmp/hp1020.log
echo “`date` : waited 10 seconds” >> /tmp/hp1020.log

fi
fi

This script is from here, but I modified it a little.

So the firmware load should work now.

This script should also work with HP LJ 1000/1005/1018/1022, BUT NOTE:
check your $PRODUCT id first. How to do that, read here (under HowTo run HP LaserJet 1018/1020/1022 on OpenWRT Kamikaze 7.06).

To check the id, run:
lsusb -v (install it with opkg) (Note: make sure that usbfs is mounted).

My lsusb -l:
HP LJ 1020 (# lsusb -v)

Update (16.7.2009):
You can also use a Tomato mod on this router. You can get it from here.
I’m using the tomato-1.25-ND-USB-8632-vpn3.3.rar firmware because of VPN. And an important notice: Tomato’s user interface is snappier than X-Wrt’s and this could be a plus for using this Tomato mod. Here is how to set up the hotplug.

Written by thezerox

May 24, 2009 at 13:10

Follow

Get every new post delivered to your Inbox.