USB on Kamikaze

From Crashcourse Wiki

Jump to: navigation, search

This page will shortly have information on how to configure USB on your WL500GP for things like USB drives and so on. Until then, here are a number of links into the OpenWrt wiki (and elsewhere) that should be helpful.

Contents

USB Devices on the WL500g Premium

Installation, configuration and testing done using Kamikaze devlopment version (bleeding edge, r10760).

All USB devices require the installation of the kmod-usb-core kernel module. For development versions of the operating firmware, packages are most easily accessed by copying the ~/openwrt/bin/packages directory from the git build tree to a USB key and mounting it on the router. Initial configuration can also be achieved by moving required packages to the router with scp. From a directory containing the relevant packages, the ipkg command can be used in direct mode:

root@OpenWrt:# ipkg install kmod-usb-core*

Version 1.1 USB controllers are one of two varieties, UHCI or OHCI. Installing both modules covers all V1.1 devices:

ipkg install kmod-usb-uhci*
ipkg install kmod-usb-ohci*

Version 2.0 USB devices require the usb2 kernel module:

ipkg install kmod-usb2*

USB Storage on the WL500g Premium HOWTO

USB storage on the WL500gP in OpenWRT requires the usb-storage module. This module has a dependency of the scsi-core module which must be taken care of manually when using ipkg in direct mode:

ipkg install kmod-scsi-core*
ipkg install kmod-usb-storage*

Standard Linux filesystem capability (ext2/3):

ipkg install kmod-fs-ext2*
ipkg install kmod-fs-ext3*

Basic MS filesystem (msdos) and long filename capability (vfat) for default USB flash drive configurations:

ipkg install kmod-nls-base*
ipkg install kmod-fs-msdos*
ipkg install kmod-fs-vfat*

Further NLS modules may be required to mount filesystems containing filenames with non-English characters:

kmod-nls-cp1250 (Central and Eastern European MS Windows)

kmod-nls-cp437 (Extended ASCII DOS)

kmod-nls-cp850 (Western European DOS)

kmod-nls-iso8859-1 (Latin #1 ISO)

kmod-nls-iso8859-15 (Latin #9 ISO - includes Euro symbol)

kmod-nls-iso8859-2 (Latin #2 ISO)

kmod-nls-koi8r (Russian)

kmod-nls-utf8 (Unicode standard character set)

File Transfer Performance from USB Storage

So what is the transfer capability of a WL500gP router acting as a fileserver?

ftp network connection:

	USB2 drive->(hub*)->WL500gP->100mbit network->laptop
			*Same stats with/out the hub


laptop command line:

ftp> get ThomasVHS.mpg
local: ThomasVHS.mpg remote: ThomasVHS.mpg
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for ThomasVHS.mpg (3026878464 bytes).
226 File send OK.
3026878464 bytes received in 1218.19 secs (2426.5 kB/s)


top on router during the transfer:

Mem: 28824K used, 1104K free, 0K shrd, 228K buff, 21188K cached
CPU:   0% usr  32% sys   0% nice   0% idle   0% io   3% irq  63% softirq
 PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
4772     1 root     R     2076   7%  95% vsftpd
3592     2 root     RW<      0   0%   3% [usb-storage]

The router is waiting on the disk I/O (softirq and sys CPU usage) and is transferring as efficiently as possible.


The router can move files off an attached USB2 hard drive at 2.37 MiB/s. The same drive directly connected to the laptop shows a 20.6MiB/s transfer rate. Clearly the router is not saturating the 100Mb/s ethernet link (>10Mib/s) nor the USB port bandwidth. The transfer rate is bound by the router hardware, most notably the CPU. Note that reported transfer speeds for the stock firmware are around 1.8MiB/s, so the Kamikaze (bleeding edge, r10760) firmware shows a distinct performance improvement.

USB Audio on the WL500g Premium HOWTO

ipkg install kmod-sound-core*
ipkg install kmod-usb-audio*
ipkg install alsa-lib*
ipkg install libncurses* 
ipkg install libpthread* 
ipkg install alsa-utils*
reboot


There are several options for USB soundcards. The Creative Audigy 2 NX USB sound card was used in this example.

By default, ALSA mutes sound devices. Use alsamixer to unmute and adjust volume of the sound card.


Madplayer can be used as a command-line client for playback of audio from local or web-based sources. Installation has several dependencies:

ipkg install zlib*
ipkg install libid3tag*
ipkg install libmad*
ipkg install madplay*

Testing:

# wget -O - http://www.mobiuseng.com/Kermit/Songs/Rainbow.mp3 | madplay -

Serving USB Printers on the WL500g Premium HOWTO

Printer sharing with OpenWRT is covered in: [[1]]. It uses the lightweight p910nd pass-through print server.

For the WL500g Premium, printer sharing requires the following packages to be installed:

ipkg install kmod-usb-printer*
ipkg install p910nd*

The configuration file for the print server is found in at /etc/config/p910nd. An example which works for a pair of Lexmark laser printers at ports 9100 and 9101 is:

config p910nd
	option device        "/dev/lp0"
	option port           0
	option bidirectional  1
				
config p910nd
	option device        "/dev/lp1"
	option port           1
	option bidirectional  1				 

Configuration of clients is straightforward:

From ubuntu, printer configuration uses a device URI of:

socket://192.168.254.111:9100

for a WL500gP at 192.168.254.111. Be sure to make a rule for forwarding port 9100 for print connections to the router from the WAN side.

Personal tools