USB on ASUS WL500GPV2

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 15:02, 22 October 2008 (edit)
Casanova99 (Talk | contribs)
m (Initial Prep)
← Previous diff
Revision as of 15:03, 22 October 2008 (edit) (undo)
Casanova99 (Talk | contribs)
m (Initial Prep)
Next diff →
Line 27: Line 27:
#:'''Enable JFFS2 Support''' #:'''Enable JFFS2 Support'''
#:'''Clean JFFS2''' #:'''Clean JFFS2'''
-#Save Settings and then Reboot Router+#Save & then Apply Settings
 +#Reboot Router
= Command Line Configuration = = Command Line Configuration =

Revision as of 15:03, 22 October 2008

Contents

Introduction

This short how to is intended to walk someone through configuring a basic USB printer and a USB storage device on their ASUS WL-500G Premium V2 router. While there are great USB how to articles on the dd-wrt wiki and even some specific to this router, I found that no single guide worked for me. I basically wanted what the ASUS firmware was giving me -- simple USB printer support and simple USB flash drive access, but with more stability than the ASUS firmware. I found that even the most recent 3.x firmware required a hard reboot every couple days, which is unacceptable.

So if that sounds similar to your situation, please following the steps below.

Firmware

I highly recommend a fresh firmware flash and a clearing of the NVRAM, starting with a clean slate will provide the least chance of bugs or quirks. Flash your router with either the latest DD-WRT Mega firmware or the eko DD-WRT release that includes full USB support in a mini firmware package. Why bother with a mini when this router has 8MB flash? Well, there are several advantages. The mini is a fraction of the size, yet provides the vast majority of the functionality of the larger builds. For this small sacrifice, you get a much more lean and efficient setup, including...

  • A nearly 5.0MB JFFS2 partition
  • Nearly 90% free system memory on a fully configured system
  • Full USB support, easily enabled from the web GUI (just like Mega)
  • Faster, leaner (Most subjective, but it is a tiny image)

Firmware Download Links

dd-wrt.v24-101037_NEWD_mini_usb.bin

dd-wrt.v24_mega_generic.bin

Initial Prep

  1. Complete your standard WAN, LAN, DHCP configuration so that your router has working Internet access
    Note: This guide will not explain these details, since they are very well documented elsewhere
  2. Under Services, enable:
    Secure Shell (SSHd)
    Telnet (optional, select this if you have no idea how to connect to an SSH server)
    All USB modules (Core USB support, UHCI, OHCI, USB 2.0, USB Storage, ext2/ext3, FAT, USB Printing)
  3. Save & then Apply Settings
  4. Under Administration > Management:
    Enable JFFS2 Support
    Clean JFFS2
  5. Save & then Apply Settings
  6. Reboot Router

Command Line Configuration

Now that we have JFFS2 and command line access via SSH, lets connect to the router and perform the core of the configuration

  • SSH to your router's internal IP address, by default this is the 192.168.1.1 address and login with the web admin credentials (default is root/admin)
    alternatively, if you enabled Telnet you can connect via the Windows built-in telnet client
  • verify that the JFFS2 partition is mounted
root@DD-WRT:/jffs# mount | grep -i jffs
/dev/mtdblock/4 on /jffs type jffs2 (rw)
  • Update the ipkg package list
ipkg update

The last line of the output should be similar to this

Updated list of available packages in /jffs/usr/lib/ipkg/lists/backports

Note: If you get ipkg update errors, reboot the router once more and try the ipkg update command again. Believe it or not, this was required every time and always fixed the problem

  • Install the Print Server package to your JFFS2 partition
ipkg -d root install p910nd

Note: Many guides recommend installing your ipkg software to a Samba mount, USB flash/hard disk, SD card or some other place aside from JFFS2. This is of course your choice, and may seem the logical one, but there are several advantages to using the JFFS2 partition. For one, the JFFS2 partition always mounts. In testing, there is a small but significant chance that the external storage device is not detected. And if you are actually keeping binaries, services, startup scripts, etc. on there then your router functionality will occasionally suffer and require active administrative troubleshooting. The steps here will only take up 400K of the JFFS2 partition and regular usage of it is almost all reads since there is no logging or print spooling to storage.

  • Verify that the Print Server package installed in the correct location
root@DD-WRT:/# ls -l /jffs/usr/sbin/
-rwxr-xr-x    1 root     root         8563 Mar 26  2006 p910nd
  • Verify that dd-wrt sees your printer
root@DD-WRT:/# ls -l /dev/usb
crw-rw----    1 root     root     180,   0 Jan  1 00:00 lp0
root@DD-WRT:/#

Note: lp0 means line printer 0 was properly detected by the dd-wrt Linux kernel. So far, so good.

  • Set the Print Server to start automatically on boot
mkdir -p /jffs/etc/config
echo "/jffs/usr/sbin/p910nd –b –f /dev/usb/lp0 0" >  /jffs/etc/config/usb.startup
chmod +x /jffs/etc/config/usb.startup

Note: The contents of usb.startup will be executed automatically at boot, there is nothing you have to do to enable this, other than create the file and give it execute permissions (shown above)

  • Reboot the Router

Note: Before rebooting the router, unmount the jffs partition (umount /jffs) to make sure all changes have been committed to flash.

Verify the Print Server is Running

  • SSH to the router
  • See if Print Server process is running
root@DD-WRT:/mnt# ps | grep p91
596 root       348 S    /jffs/usr/sbin/p9100d -b -f /dev/usb/lp0 0

and...

root@DD-WRT:/mnt# netstat -an | grep 910
tcp        0      0 0.0.0.0:9100            0.0.0.0:*               LISTEN

Configure the Printer from a Windows/Linux Client

    • From Windows, go to Control Panel, Printers, Add Printer
    • Choose Local, create new port Standard TCP/IP Port
    • Set Device Type to TCP/IP
    • For Hostname or IP field, set to router IP
    • On Vista, do not query printer for driver
    • On next screen, click custom
    • Manually select the printer from list or select Have Disk to add a new printer driver
    • Note: On Vista, many newer HP Deskjet printers can be set to HP Deskjet 990c since no Vista drivers are available from HP.

WIP - will be finishing up in the next 24 - 72 hours