LinksysSDCard
From The-Mesh
Contents |
Installing an SD card to a Linksys WRT54GL
So your after more space on your Linksys? well who isn't!, all the credit goes to http://kiel.kool.dk/ and OpenWRT website for all the wealth of information they all have provided.
What is needed
Soldering iron with some soldering skill
some thin wire
SD card (max 2gig; we tested with 256meg)
SD card reader board (unless you solder the card)
Linksys WRT54GL V1 and V1.1
Extra parts
We picked up some extra things from jaycar for this like the sd card reader for about $3.45 for a box of 10 (CAT. NO. PS0024 from jaycar.com.au)
we also grabbed a bag of hookup wire for a few dollars for an assortment of coloured wire to use, which is again all at jaycar.
Starting off
| Click-for-larger-image |
| Description | GPIO |
|---|---|
| Pin 1 - CS, Chip select | GPIO 7 |
| Pin 2 - DI, Data in | GPIO2 |
| Pin 3 - VSS, Ground | GND |
| Pin 4 - VDD, 3.3v | 3.3v |
| Pin 5 - CLK, Clock | GPIO3 |
| Pin 6 - VSS2, Ground | GND |
| Pin 7 - DO, Data out | GPIO4 |
Solder points
First things first, I would suggest downloading the GPIO program from OpenWRT, the package contains a compiled version of GPIO program and the source code to compile it your self if need be, the package is located at: http://downloads.openwrt.org/utils/gpio.tar.gz
If you downloaded and installed the GPIO and installed to /bin/ you can now check all your points with a multimeter to see if the GPIO is turning on and off, you can run a script that will turn it on and off: I did this with a small command I found on the OpenWRT website.
while true; do gpio enable 2; sleep 1; gpio disable25; sleep 1; done
You will need to solder some small wires to each point and attach them to the correct pin on the SD/MMC card. The first 2 solder points are located at the front near the Cisco button.
The 3rd and 4th solder points are located underneath the the board under the Cisco switch and on the bottom of the DMZ LED.
The 5th and 6th solder points are located near the JP2.
After these wires are all soldered on and checked for connectivity, we need to match them to the correct pin on the SD/MMC card.
Follow the table at the top of the page to match the GPIO to the pins on the back of the SD/MMC holder or card.
Pin 6 is a ground as well (on the sd card holder), I found it easier to make a very short bridge wire and bridge it over to pin 2 (on the sd card holder) which is also needs to be a ground.
Installing the driver
After that is all done, its time to get the driver for the SD/MMC mod on your Linksys, I have found one of the easiest ways to get the mmc and all the correct settings is to install freifunk-sdcard and freifunk-sdinit, as the package freifunk-sdcard is for the original sdcard mod after this is install we will need to overwrite the module it installs.
To install the packages make sure you have the freifunk source added to your ipkg.conf.
src freifunk http://styx.commando.de/sven-ola/ipkg/packages
after thats been added to your /etc/ipkg.conf run ipkg update after that runs with no problems you can install the packages mentioned with:
ipkg install freifunk-sdcard freifunk-sdinit
note: the mmc.o that freifunk provides doesn't work with the WRT54GL SD mod but it gives us everything else, but the following shows how and where to put the one made for WRT54GL to get this mod working
after the packages are installed we can move on to installing the correct driver for the SD card on the WRT54GL.
There are two ways to get this done, you can either download the driver for OpenWRT RC5 based firmwares, or you can build the driver your self which is much more fun.
Option A
The first way we will go through downloading the module. You can grab the binary from here[1]
Option B
Now the second way is compiling the module which is pretty easy if you have Linux, but if you are using windows it involves slightly more steps and will involve you having Linux in a VMware session, the steps of creating a build environment for OpenWRT found here[2] for a windows user, otherwise if you have a normal Linux install the steps are the same as the above but which can be found here[3] as well.
You will need to grab a copy of the Makefile which can be found here[4], and a copy of the mmc.c source file, which can be found here[5].
After you have the files you will need to edit the make file to point the required sections at your installed build environment, change the following CC and Include sections to match your own setup, here is an example of the Makefile
TARGET := mmc
WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes -fno-strict-aliasing -mips32
INCLUDE := -isystem /home/themesh/openwrtbuild/whiterussian/build_mipsel/linux/include
CFLAGS := -O2 -DMODULE -D__KERNEL__ .html${WARN} ${INCLUDE} -fno-pic -mno-abicalls -mlong-calls
CC := /home/themesh/openwrtbuild/whiterussian/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc
${TARGET}.o: ${TARGET}.c
After that is done a quick command of make should spit out a file called mmc.o keep this file as you will need to upload it to your linksys.
Finishing off
After you have downloaded or compiled the module and installed the freifunk packages, you can now overwrite the module freifunk installed as its for the original mod of the sd card for the linksys.
You will need to copy the file over how ever you see fit to the folder /lib/modules/2.4.30/ and over write the old mmc.o (this mmc.o was installed from the freifunk packages we installed earlier and is the file that doesn't work for the WRT54GL Sd mod)
You can now reboot the router with the command reboot.
All finished, now what?
After you have everything running fine what can you do now? Well you can use it to install more packages on to the linksys and OpenWRT have a good guide on how to do this.
http://wiki.openwrt.org/PackagesOnExternalMediaHowTo
If you are having problems with configuration in OpenWrt and X-Wrt firmware you can go to: http://www.digitalincursion.net/wrt54gl.html
Links
http://wiki.openwrt.org/OpenWrtDocs/Customizing/Hardware/MMC
http://www.digitalincursion.net/wrt54gl.html
http://www.frontiernet.net/~beakmyn/OpenWRT%20Kimset%20Server.htm