USB on ASUS WL500GPV2

From DD-WRT Wiki

Revision as of 22:47, 20 October 2008 by Casanova99 (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

This short how to is intended to walk someone through configuring a 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. Ultimately it was a combination of guides and some trial and error. I figure if this guide helps anyone, it's worth keeping.

Firmware

Flash either the latest dd-wrt MEGA firmware or the eko-provided build that includes full USB support in a mini package. Why bother with a mini when we have 8MB flash? Well there are several advantages. The mini is a fraction of the size, yet provides probably 80% of the functionality of the Mega build. For this small sacrifice, you get a much more lean and efficient setup.

  • A nearly 5.0MB JFFS2 partition
  • Nearly 90% free memory on a fully configured system
  • Full USB support
  • Faster, leaner and more stable all around

download

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
    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 what SSH and 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 Settings
  4. Under Administration > Management:
    Enable JFFS2 Support
    Select Clean JFFS2
  5. Save Settings and then Reboot Router

Command Line Configuration

Now that the SSH Server is up, we will SSH into 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 again. While this may seem like a poor troubleshooting step, it has solved this problem every time I have encountered it

  • 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. While at first it makes sense to keep software off of the small flash partition internal to the router, there are several advantages to using the JFFS, assuming you have the space. For one, the JFFS2 partition always mounts. In testing, there are always random reboots where the USB drive does not present itself properly, etc. And if you are actually keeping binaries on there, your router will break and you will have to reboot, troubleshoot, etc. With this guide, we are adding about 400K to the JFFS2 partition and after today it will receive almost 0 writes. Save your SD cards and external hard disks for user data, swap space, or large packages like samba, python, cups, etc. But for something small and crucial like your print server, I recommend JFFS2 which will save you headaches in the end.

  • 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)


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