Tutorial: Adding a Covox device to your Linksys WRT54G
Have you ever dreamt of having a cheap toilet radio that is able to stream mp3 music from the internet? Are you eager to push your Linksys WRT54G even further? Then this tutorial is for you. We will explore how to build a small Covox device that can be mounted inside the router and output 8 bit 11 KHz sound to a set of speakers.
Take a look here to get an idea of what we are trying to accomplish!
To summarize we will add a small Covox device to the serial port found on JP1 of the Linksys router. Since a Covox needs an 8-bit parallel output we will be using a PIC16 to convert the serial data into a parallel stream.
What you need
- A PIC16f628 and a programmer
- A soldering iron and a bit of tin solder (and a little bit of soldering skills)
- A selection of resistors to build the Covox
How to proceed
First we need to put together the Covox device
- Do this and that and that
In order to play some music you can actually just upload a file with 8 bit samples (unsigned) in 11 KHz and cat this directly to /dev/tts/0. However the main goal was to be able to stream internet radio to the toilet and for this libmad is a bit more approriate.
Please note that the drivers for the LCD and the SD Reader has been written strictly for the v2 of the Linksys router.
- wrtplay-0.1.tar.gz - source code for a player that can stream mp3 based internet radio stations. As default it will play Slay Radio, but with the option -h you can specify any radio station you please. You will be needing libmad in order to compile this.
- wrtplay-0.1-bin.tar.gz - binary version of wrtplay including needed libs.
- fb-lcd.c - Framebuffer for the Nokia 3310 LCD.
- fb-lcd-patch - Framebuffer for the Nokia 3310 LCD but made as patch to OpenWRT (remember CONFIG_FB in your kernel)
- mmc.c - Block device driver for the SD Reader.