WRT54G(S)

From Evolution-plugins
Jump to: navigation, search

WRT54G V2.2

Wrt54-v22.jpg

Opening WRT54G(S) for the first time

Openingwrt.jpg

Openwrt sd-card support compile

After a week or so I found the correct install procedure for openwrt. My guess is that the openwrt kernel is badly 'modded' / pached. In mmc.o case the request queue is throwed in the wrong area and kernel getsegfaulted. The openwrt install procedure:

Download:

http://downloads.openwrt.org/whiterussian/rc2/whiterussian_rc2.tar.bz2

unpack the tarball (if you previously did this step I recommend you to delete all files and unpack from the beginning).

after that go to openwrt directory do a make menuconfig and save the configuration (there's no need to change any menuconfig options at this step) , do a make. The compiler might throw an error about 'target_endian' that is defined statically, I suggest you edit the file and change static int target_endian..... -> int target_endian.... , and go on with the make. After build is complete, you can go to build_mipsel/linux dir and issue a make menuconfig there. GO to file systems -> Partition Types and Advanced partition selection and PC BIOS(MSDOS partition tables_ (usually they're already checked).

Now the important stuff , check DOSAT fs support and VFAT (Windows 95) fs support and MSDOS support !!! they all have to be compiled-in the kernel!!! otherwise it won't work. ( I suspect compiling in will enlarge the space kernel mallocs for the modules and request queue gets in the correct pointer address).

Flash the squash fs image to your box (the one about 1.5 Megs)

For the mmc.c part:

export CC=...path to openwrt...openwrt/staging_dir_mipsel/bin/mipsel- linux-uclibc-gccd 

issue a make. Copy mmc.o to your box and _HOPEFULLY_ will work. That's all.

Swap on a MMC partition on WRT54G v2.2

Running many applications from mmc partition an a wret54g, you will eventually run out of memory. When running in 00M situation linux kernel killer will start randomly killing application. In this situation it makes sense to implement a swap file on the mmc partition. Since SD/MMC cards are not so expensive these days (128M for $10), I rather prefer spending ten buck on a card than get my applications randomly killed. First we need swap utilities compiled into the box (mkswap and swaponoff). I recommend re-compilling busybox with mkswap, swaponoff options. Resulting Busybox binary can be copied into mmc partition and then we can symlink to our root those utilities:

   ln -s /mmc/bin/busybox /bin/mkswap
   ln -s /mmc/bin/busybox /bin/swapon
   ln -s /mmc/bin/busybox /bin/swapoff

This way you can add any busybox's options without interfering the original busybox on the wrt's flash. After that we can proceed to swap creeation:

   dd if=/dev/zero of=/mmc/SWAP count=20480 (about 10 megs)
   mkswap /mmc/SWAP
   swapon /mmc/SWAP

Remember to put swapon in the rc scripts to have the swap space activated after reboot.


SD-Card on WRT54G V2.2

GPIO 3,5 VDD and GND GPIO 4

1. CS - Chip Select for the SD card GPIO7

2. DI - Data in on the SD card GPIO5

3. VSS - Ground is a good thing GND

4. VDD - We need power of course. 3.3V will do the job 3.3v

5. CLK - The clock we generate for the SD card GPIO3

6. VSS2 - Another ground is also a good thing GND

7. DO - Data out from the SD card GPIO4

WRT54G v 2.2 serial mod (MAX232)

Max232.jpg

WL Command

Openwrt repositories

OpenWRT packages

  OpenWRT packages for AX25