A host-based printer like HP-LaserJet 1020 needs to download a firmware every time when boot up or else it won’t print. These printers works fine when connect to Windows that has drivers install. For Linux, foo2zjs may help upload the firmware to printer by USB hotplug daemon.
It is very hard to make host-based printers work with networked print server appliance as the printer won’t work without firmware. Most print server appliance don’t have firmware ready or it won’t upload the firmware to printer.
Some print server like D-Link DPR 1061 claims to work with host based printer but it is a different story. A software (PS-Link or PS-Wizard) is required to deploy on workstations in network to act as USB redirector to send firmware to printer. This isn’t a favor solution as it increase deployment effort on workstation.
This topic use TP-Link 1043ND wireless router as hardware device to act as printer server alternative to those branded printer server in market. The TP-Link 1043ND is patched with Gargoyle WRT (backed by OpenWrt). A small printer daemon p910nd is installed in the device to serve as printer server for network.
Here are some brief steps to install and configure:
- Find a low cost router that has few RJ45 network sockets (usually 4 LAN port + 1 WAN port) and USB port
- Patch the device with OpenWrt or Gargoyle Wrt
- Install p910nd daemon
- Download Printer Firmware
- Configure USB hotplug daemon to send firmware to printer
- Add a printer device in Windows / Linux workstation that print to Standard TCP/IP port (e.g.: Port 9100)
Print Server Device: TP-Link 1043ND
In this article, A gigabit wireless router: TP-Link 1043ND is used as example. The router has 4 LAN + 1 WAN ports and a USB port mainly for flash drive. We will make the USB port work with USB host based printer.
Printer: HP Laser Jet 1020
HP laser jet 1020 is a USB host based printer that is not friendly to many network print server in the market.
Patch with Gargoyle WRT
Download suitable flash firmware for TP-Link 1043ND from Gargoyle. Follow instruction to patch the device. After finish patching, do some simple configuration:
- Set the root access password
- Set IP address for the device (e.g.: 192.168.1.1)
- Enable SSH access to the device (e.g.: port 22)
- Try using SSH console like Putty to access the device
Install software on device
- SSH into device. e.g.: ssh 192.168.1.1
- Enter “root” as username and supply with password
- Update OpenWRT software packages:
root@Gargoyle:~# opkg update
- Install Kernel modules for USB Printer support:
root@Gargoyle:~# opkg install kmod-usb-printer
- Install printer server:
root@Gargoyle:~# opkg install p910nd
Configure Printer Server: P910nd
Enable p910nd daemon that sustain for device fresh booting:
root@Gargoyle:~# /etc/init.d/p910nd enable
- Start p910nd daemon for current session
root@Gargoyle:~# /etc/init.d/p910nd start
- Download a suitable printer firmware (e.g.: http://oleg.wl500g.info/hplj/)
root@Gargoyle:~# wget -o /usr/lib/sihp1020.dl http://oleg.wl500g.info/hpl j/sihp1020.dl
root@Gargoyle:~# ls -al1 /usr/lib/si* -rw-r--r-- 1 126151 Nov 12 16:31 /usr/lib/sihp1020.dl
- Create a USB hotplug script file (/etc/hotplug.d/20-hpjl1020) for printer HP1020:
root@Gargoyle:~# cat /etc/hotplug.d/usb/20-hplj1020 #!/bin/sh FIRMWARE="/usr/lib/sihp1020.dl" DEVICE=/dev/lp0 LOGFILE=/var/log/hp if [ "$PRODUCT" = "3f0/2b17/100" -a "$ACTION" = "add" ] then for i in $(seq 30); do if [ -c $DEVICE ]; then echo "$(date) : Sending firmware to printer." > $LOGFILE cat $FIRMWARE > $DEVICE echo "$(date) : done." >> $LOGFILE exit fi sleep 1 done fi
- You may adjust parameters in the script file to suit you environment.
- Product ID: “3f0/2b17/100” is the printer ID for my HP Laser Jet 1020. Change it to suitable ID for the printer you attempt to connect. You may attempt to grep the printer ID by patching the script file to output printer id to a log file.
Test Printer Firmware
- Plug printer USB cable to device and check log file:
root@Gargoyle:~# cat /var/log/hp
- The log file consist some information that is useful for troubleshooting
- Power off both printer and device
- Power on both printer and device
- Check log file again to make sure firmware may send to printer properly
Print from Windows
- Logon to Windows workstation and add a local printer:
- Create a new Standard TCP/IP port for the printer:
- Enter IP Address for the printer: e.g.: 192.168.1.1
- Specify additional information for the connection:
- Choose “Raw” protocol and set port number. e.g.: 9100
- Pick a suitable printer driver:
- You may try to print a test page to the printer.
- p910nd Printer Server. URL: http://wiki.openwrt.org/doc/howto/p910nd.server