My OpenWRT applications

Warning - this is an early beta version

Hardware

ASUS WL-500G Deluxe (200mips, 4MB flash, 32MB RAM, 2 external USB ports, etc, etc.). For more info see http://wiki.openwrt.org/TableOfHardware. Cost: about 100USD.

Software

OpenWRT WhiteRussian RC4. You can read more about OpenWRT here. And Here is my OpenWRT package repository. Sources are available.

Application: sound server (polypaudio)

Additional hardware:

USB audio card. I'm using one that I've assembled myself, using PCM2702 chip (thanks to Texas Instruments for providing a free sample) and this design. I've tested USB VoIP headset too, and it worked as well.

Additional software

Kernel audio modules build for 2.4.30 kernel (OpenWRT WhiteRussian RC4), and following packages: libusb, alsa-utils, libltdl, polypaudio.

HowTo

Just load kernel modules from /etc/modules.d/72-snd-usb-audio, in following order:
soundcore
snd-page-alloc
snd
snd-rawmidi
snd-hwdep
snd-timer
snd-pcm
snd-mixer-oss
snd-pcm-oss
snd-usb-lib
snd-usb-audio
and then run polypaudio server in daemon mode, listening on tcp socket using native as well as esound protocol.

This way I can play MP3s and watch movies on my notebook PC, using my old aplituner and 4 speakers instead of notebook's built-in speaker, with no cables lying around (notebook is using wifi connection).

Photos

Amplituner Asus WL500g USB audio card

Application: sound server (EsounD)

EsounD server uses about 2/3 less of system resources than polypaudio. It isn't as flexible or powerful, but works fine for me. It worked without OSS emulation (polypaudio didn't).

Additional hardware

as in previus sound server application

Additional software

Kernel audio modules build for 2.4.30 kernel (OpenWRT WhiteRussian RC4), and following packages: audiofile, esound-alsa

HowTo

Load kernel modules from /etc/modules.d/72-snd-usb-audio, in following order:
soundcore
snd-page-alloc
snd
snd-rawmidi
snd-hwdep
snd-timer
snd-pcm
snd-usb-lib
snd-usb-audio
Edit esd options in /etc/esd.conf:
auto_spawn=0
default_options=-nobeeps -as 2 -public -tcp
You may also add "-promiscuous -bind <your-LAN-ip>" to options. Then run esd in background (esd &).

Update: I've compiled esound 0.2.38 for kamikaze 8.09 rc1 (with new uClibc). You can find it here. I didn't bother to make a package - somehow I can't get the grip of the new buildroot. Just untar the archive and move files to respective directories. Make sure you have libaudiofile installed (and all necessary kmod-* packages to get sound support).

Application: console server

Additional hardware:

Up to 8 PL2303-based USB<->RS232 cables, one or two USB 4-port bus-powered hubs, RS232 external modem.

Additional software:

Kernel usb-serial and usb-pl2303 modules (you can get them from this repository: http://users.bigpond.net.au/flett/ipkg), mgetty, conserver, tinylogin.

HowTo

Plug in all USB cables and reboot. Now connect modem to one of them, and find out which one is it ;) /proc/tty/driver/usb-serial may be helpful. Then edit /etc/inittab and enter:
::respawn:/usr/sbin/mgetty usb/tts/<deviceon>
Then edit /etc/conserver.cf and configure all your serial ports, using following template:
default * {
        logfile /var/log/console-&;
	logfilemax 512k;
        timestamp 1hab;
        master localhost;
        rw *;
}

console 0 { type device; device /dev/usb/tts/0; parity none; baud 9600; }
console 1 { type device; device /dev/usb/tts/1; parity none; baud 9600; }
console 2 { type device; device /dev/usb/tts/2; parity none; baud 9600; }

access * {
        trusted 127.0.0.1;
}

config * {
	daemonmode yes;
}
Run conserver, and you're all set. Use "console <device_no>" to connect to a serial port.

Application: scanner server (SANE)

Additional hardware

SANE-compatible USB scanner

Additional software

sane-backends, libusb, libgcc, libpthreads, xinetd

HowTo

Install sane-backends. Attach your scanner and check if SANE can find it:
scanimage -L
You should get something like this:
root@OpenWrt:~# scanimage -L
device `hp:libusb:001:004' is a Hewlett-Packard ScanJet 63x0C flatbed scanner
root@OpenWrt:~#
Edit /etc/sane.d/<your_backend>.conf if neccessary. Edit /etc/sane.d/saned.conf and add "+" to allow all IP addresses to use scanner. Add line:
sane-port       6566/tcp
to /etc/services. Create /etc/xinetd.d/sane:
service sane-port
{           
  socket_type = stream
  server = /usr/sbin/saned
  protocol = tcp
  user = root
  group = root
  wait = no     
  disable = no  
}           
Start xinetd: /etc/init.d/xinetd start. You can now connect to saned using XSane or any other SANE frontend.

Application: use USB keyboard/mouse to run commands

Control your scanner/printer/soundcard/camera/anything with usb mouse or keyboard.

Additional hardware

USB HID device (like usb keyboard, mouse, devices with buttons)

Additional software

kmod-input, cmdpad

HowTo

Install kernel modules related to "input" subsystem. You can find modules compiled for Kamikaze 8.09rc1 here. Create /etc/modules.d/90-input:
input
hid     
evdev   
Load modules in this order. Connect your USB device. Look into /dev/input/ directory and check for event* files (event0, event1 etc.). Each of these corresponds to some part of some input device. Now run:
cmdpad --device /dev/input/eventX --verbose
Try pressing keys on your device, and notice the PRESS/RELEASE events and key codes showing up:
cmdpad - version 0.0.3 - Copyright (C) 2002-2003 Alessandro Fausto
Input driver version is 1.0.0
Input device ID: bus 0x3 vendor 0x46d product 0xc526 version 0x500
Input device name: Logitech USB Receiver
no command found for key 272, event PRESS
no command found for key 272, event RELEASE
no command found for key 273, event PRESS
no command found for key 273, event RELEASE
...
Write down codes for keys you're interested in. Now edit /etc/cmdpad.conf, set device= line, so it points to your device. Look at the example commands in the config file, and add your own or modify the existing ones. Use P for PRESS even, R for RELEASE event, H for HOLD event (if your device supports hold events).