Asus WL-500W

N mode wireless is not functional at this time (Connections are at 54 Mbit/s).

!!!Disclaimer!!! I am in no way responsible for the safety of you, your router, or your computer. These instructions worked for me. They may not for you. If they don't you may end up with a $100 paperweight, and that's your problem not mine. That said… these should in all reality not cause any dangers, and if you brick your router you can most likely flash back to regular asus firmware and try again. That's a hint BTW…go download a regular copy of the asus firmware esp. If you are relying on this router for internet!

Stock Firmware

1. Download the Broadcom 2.4 image:

I recommend using the snapshot from x-wrt. (Seems to fix this bug when using a USB disk)

http://downloads.x-wrt.org/xwrt/kamikaze/snapshots/brcm-2.4/openwrt-brcm-2.4-squashfs.trx

You can also use the stable 7.09 release from either OpenWRT or X-Wrt but you'll have to do step 2.

http://downloads.openwrt.org/kamikaze/7.09/brcm-2.4/openwrt-brcm-2.4-squashfs.trx

http://downloads.x-wrt.org/xwrt/kamikaze/7.09/brcm-2.4/openwrt-brcm-2.4-squashfs.trx

Connect to the router with a ethernet cable (on LAN port 2, 3 or 4 if using 7.09 as port1 is only properly configured in the snapshot). Tftp the new image to the router: Unplug router, replug it back in while holding in the black reset button. Wait for a slowly blinking power light before releasing the black reset button. The remainder of the TFTP process is described here: OpenWrtViaTftp.

2. Update the network settings

config switch eth0
   option vlan0    "0 1 2 3 4 5u"
config interface loopback
   option ifname   "lo"
   option proto    static
   option ipaddr   127.0.0.1
   option netmask  255.0.0.0
config interface lan
   option type     bridge
   option ifname   "eth0 wl0"
   option proto    static
   option ipaddr   192.168.1.1
   option netmask  255.255.255.0
config interface wan
   option ifname   "eth1"
   option proto    dhcp

reboot

3. Connect the WAN port to the internet and use ipkg to install the memo wireless driver

ipkg update
ipkg install kmod-brcm-wl-mimo

4. Edit the wireless file and enable wireless

vi /etc/config/wireless

Basic wireless file example:

config "wifi-device" "wl0"
        option "type" "broadcom"
        option "channel" "5"
        option "disabled" "0"
config "wifi-iface"
        option "device" "wl0"
        option network  'lan'
        option ssid     'OpenWRT'
        option mode     'ap'
        option encryption       'none'
        option hidden   '0'
        option isolate  '0'
        option bgscan   '0'
        option wds      '0'

reboot

5. Make a kamikaze, drink, enjoy.

Building from Source

1. On the local computer install the needed base packages:

sudo aptitude install build-essential gawk binutils flex bison autoconf gettext texinfo sharutils subversion libncurses5-dev ncurses-term zlib1g-dev unzip

(I use ubuntu fiesty, if you use another distro that doesn't use apt-get or aptitude…you're on your own to figure out the command).

2.

  • Checkout the source for Kamikaze and the packages:

cd ~
svn co https://svn.openwrt.org/openwrt/trunk/ kamikaze
svn co https://svn.openwrt.org/openwrt/packages packages
ln -s packages/*/* kamikaze/package/

  • Optional step - Include the web interface packages (Webif²). These still have many problems so use at your own risk.

cd ~/kamikaze/package
svn co http://svn.berlios.de/svnroot/repos/xwrt/trunk/package/webif/

  • Bring up the configuration menu screen:

cd ~/kamikaze
make package/symlinks
make menuconfig

3. On your own for a little… choose the packages you want. Make sure you also set:

  • Target System > Broadcom 2.4
  • Target Profile > Asus wl-500g Premium
  • Target Images > squashfs and jffs2
  • Kernel modules > Proprietary BCM43xx-WiFi-driver > include the kmod-brcm-wl-mimo module
  • Administration > select the webif package if you choose to check it out above
  • Or, if you don't want to be bothered, download this attachment:config_file and copy it to:

~/kamikaze/.config

4. Make

make

Get some food, come back in 10min-1hr. Anything error out? If not continue on…if so, well, fix it.

5.

cd build_dir/mipsel
cp -rp root-brcm-2.4 /tmp/root
cd /tmp/root/etc/config/
vi network

You can of course substitute your favourite text editor for vi. The network file is new and will be empty. Make it look like this:

config switch eth0
   option vlan0    "0 1 2 3 4 5u"
config interface loopback
   option ifname   "lo"
   option proto    static
   option ipaddr   127.0.0.1
   option netmask  255.0.0.0
config interface lan
   option type     bridge
   option ifname   "eth0 wl0"
   option proto    static
   option ipaddr   192.168.1.1
   option netmask  255.255.255.0
config interface wan
   option ifname   "eth1"
   option proto    dhcp

cd ../../lib/wifi
vi broadcom.sh

There is a line way down. You need to change it to be:

channel ${channel:-5}

instead of:

${channel:+channel $channel}

6. Phewww if you're still with me and never compiled a openwrt image I salute you. Now time to make that new image and the squashfs

cd ~/kamikaze
staging_dir/host/bin/mksquashfs-lzma /tmp/root /tmp/squashfs -nopad -noappend -root-owned -le
staging_dir/host/bin/trx  -o ~/wl500w-openwrt.trx \
                -f build_dir/linux-brcm-2.4/loader.gz \
                -f build_dir/linux-brcm-2.4/vmlinux.lzma -a 1024 \
                -f /tmp/squashfs

If all is well in the world (ie you didn't make any typos) you should now have a new custom made wl500w image sitting in your home directory waiting for you.

7. Tftp the new image to the router: Unplug router, replug it back in while holding in the black reset button. Wait for a slowly blinking power light before releasing the black reset button. The remainder of the TFTP process is described here: OpenWrtViaTftp.

On first install from a stock Asus firmware or to erase all configuration settings, run:

# mtd -r erase $(cat /proc/mtd | sed -n -e 's/^\([^:]*\):.*"rootfs_data"/\1/p' )

8. Make a kamikaze, drink, enjoy.

Shell script to automate the above procedure - unattended builds from svn repository

Script can be downloaded from http://marjancinober.googlepages.com/wl500-index.htm. Tested on Ubuntu fiesty, kamikaze svn revisions 7880, 7910, 8199, 8221, 8241, 8343. The only manual intervention was to find a couple of source packages as they were not available on their default servers or servers were down, and saving them in local disk cache kamikaze_dl directory for current compile and latter reuse. Script holds local bzip2-d image of the latest SVN and a copy of package sources on a local disk to minimize network traffic. Almost full config compile takes 2h45min on DELL Latitude 820 2Gb ram, with downloads in local disk cache.

If you get in trouble it might be good to know that I (cinober) personally managed to reflash the original ASUS firmware and checked that it replies to pings again.

On first boot run

# mtd -r erase $(cat /proc/mtd | sed -n -e 's/^\([^:]*\):.*"rootfs_data"/\1/p' )

Command reboots the router after filesystem gets erased. After that set root password as described to enable ssh.The image is now working for cinober and Smint. Thanks Smith for his latest "mtd erase" contribution.

FAQ

About the Network Interfaces:

WL-500W from linux point of view has three interfaces, eth0, eth1, eth2 where:

  • eth0 - internally connected to port 5 of the switch
  • eth1 - WAN interface
  • eth2 - Wi-Fi interface

You should configure the switch to have no VLANs, but current Kamikaze version unable to do this. Thus, you must configure the switch to have all ports untagged and placed to same VLAN (VLAN0 for instance). See NetworkInterfaces and KamikazeConfiguration for more detailed network configuration information.

Why must a 2.4 Kernel be used?

There's an option in the Kamikaze to use proprietary broadcom wl driver (and utilities). This option is only available with 2.4.x kernel, because only binaries compiled for a 2.4 kernel for broadcom wl driver are available. So you MUST use a 2.4.x kernel to be able to use the broadcom wl driver. This proprietary broadcom wl driver was taken from some Linksys router firmware and was used (in Linksys) with different models of wifi cards (controllers). As I know WL-500 W/B/G has different Broadcom wifi cards, but I think broadcom proprietary wl driwer will work with any of them.

Using a different miniPCI wireless card (and Kernel 2.6)

Because the WL500W has a miniPCI port, it is possible to swap out the original Broadcom MIMO card with another card (such as an Atheros 5xxx model). The Atheros madwifi drivers are compatible with kernel 2.6 and come built in with OpenWRT. When doing a custom build, just 'make menuconfig' and select the 2.6 kernel as well as the Atheros WiFi. This has been tested and is working (OpenWRT r12384). It may even be possible to use the Madwifi r5k atheros source drivers. Remember to enable the wirless with uci (see the WL500GP page).

How does the reflash procedure looks like for WL500w?

While holding in the black reset button apply the power. Then release the reset button. The Power Led should blink. Initiate tftp transfer from windows/linux and wait about 3-4 sek (100Mb/s). Do not disconnect power for at least 6 min (copied from WL500g page) after you get successful tftp copy status report. After bricking one router earlier I use to wait more than 30min. Then I HAVE TO pull out the power cable, wait 20 seconds and reapply the power. Router boots the kamikaze for the first time. Boot sequence begins with Power LED on for a couple of seconds, then off for the whole boot time (about 30s) and at the end it goes permanently on. You can log in with telnet as root without the password if it's the first reflash. Run "mtd -r erase …" as described above. That reboots the router for the second time. Then set root password and you will be able to login as root over ssh from then on. If you later repeat reflashing with newer kamikaze release, your settings as password, net configuration,… are preserved (were for me this - my first time). This is the approximate sequence as I remember it from the day before. It will get checked exactly and optionally corrected the next time through.

Using software raid with 2.4 kernel and mdadm

Ugly hack

This is an ugly hack, but it works for me. I have 2 external 160 Gb harddisks attached to the WL500w running as a raid0 array. You should apply the patch below to the kernel. Then edit the feeds/packages/utils/mdadm/Makefile and remove or comment out the DEPENDS:=@LINUX_2_6 line. Run make menuconfig and select mdadm. The run make kernel_menuconfig and set raid, usb mass storage and scsi disk support to compile into the kernel.

Patch:

diff .prev/drivers/md/md.c ./drivers/md/md.c
--- .prev/drivers/md/md.c	2007-05-07 14:33:31.000000000 +1000
+++ ./drivers/md/md.c	2007-05-07 14:57:41.000000000 +1000
@@ -590,14 +590,41 @@ abort:
 	return ret;
 }

+
+static u32 md_csum_fold(u32 csum)
+{
+	csum = (csum & 0xffff) + (csum >> 16);
+	return (csum & 0xffff) + (csum >> 16);
+}
+
 static unsigned int calc_sb_csum(mdp_super_t * sb)
 {
+	u64 newcsum = 0;
+	u32 *sb32 = (u32*)sb;
+	int i;
 	unsigned int disk_csum, csum;

 	disk_csum = sb->sb_csum;
 	sb->sb_csum = 0;
-	csum = csum_partial((void *)sb, MD_SB_BYTES, 0);
+
+	for (i = 0; i < MD_SB_BYTES/4 ; i++)
+		newcsum += sb32[i];
+	csum = (newcsum & 0xffffffff) + (newcsum>>32);
+
+
+#ifdef CONFIG_ALPHA
+	/* This used to use csum_partial, which was wrong for several
+	 * reasons including that different results are returned on
+	 * different architectures.  It isn't critical that we get exactly
+	 * the same return value as before (we always csum_fold before
+	 * testing, and that removes any differences).  However as we
+	 * know that csum_partial always returned a 16bit value on
+	 * alphas, do a fold to maximise conformity to previous behaviour.
+	 */
+	sb->sb_csum = md_csum_fold(disk_csum);
+#else
 	sb->sb_csum = disk_csum;
+#endif
 	return csum;
 }

@@ -685,7 +712,7 @@ static int super_90_load(mdk_rdev_t *rde
 	if (sb->raid_disks <= 0)
 		goto abort;

-	if (csum_fold(calc_sb_csum(sb)) != csum_fold(sb->sb_csum)) {
+	if (md_csum_fold(calc_sb_csum(sb)) != md_csum_fold(sb->sb_csum)) {
 		printk(KERN_WARNING "md: invalid superblock checksum on %s\n",
 			b);
 		goto abort;
-

Adding a USB serial port

I successfully added a USB serial port to my WL500W. Docs and pics are at http://www.zacpod.com/?p=13


CategoryModel Category80211nDevice

Back to top

oldwiki/openwrtdocs/hardware/asus/wl500w.txt · Last modified: 2011/10/26 18:21 by orca