(If you come from OpenWrt's official wiki, skip forward to the section "802.11n" for your answer.)

Overview

It took me a while to figure out how to setup 802.11n in OpenWrt on Asus RT-N16 so I figured I'd share the process, hopefully to save somebody's time.

Background

I've used dd-wrt for a long time (on 4 wireless routers over the years). However, my network setup is getting more and more complex. While dd-wrt allows some customization, the inconsistency between GUI and the command-line configuration made it very hard for me to maintain. For example, editing the DHCP static address table from the GUI is a tedious process because it doesn't sort so it's very hard to detect duplication. I could edit the configuration file directly but the GUI does not reflect my changes correctly. Saving from the GUI can easily overwrite my manually edited config files.

Choosing Alternatives

Therefore, I started to look for an alternative. Besides dd-wrt, Tomato and it's family, and OpenWrt are the other two high-profile router firmware development efforts. And both lineages provide very customizable environment.

However, there are two things I'm looking for.

  1. I am looking for a project that's still actively maintained, especially after Heart Bleed, Shell Shock, and Poodle. (Note that these vulnerabilities don't necessarily compromise home routers, but in my environment, I'd rather not take the chance.) While a repository system allows individual package upgrade, I want the base developers to still be around.

  2. I'm looking for a project that's owned by a team rather than individuals. In the WRT history, there have been many brilliant individuals that made crucial advances for everyone. However, it has happened a few times when these individuals moved on, their projects died, too.

Therefore, I ended up choosing OpenWrt.

Installation

It was quite straightforward to switch to OpenWrt from dd-wrt, as instructed in the official guide.

Securing the admin access was obvious. However, it took me a while to realize that I also needed to reboot my Cable Modem for it to reset its DHCP. If you are also doing this, I suggest you open all installation guides in the browser first before you flash your new firmware. I had to use my phone to check the guides before my internet was up.

802.11n

This took me a while because the guide is not very obvious. Anyway, after some trials and errors, broadcom-wl was the only one that worked for me (thanks to Stratos about the dependency nas. I already had that so I didn't realize that dependency).

opkg update
opkg install kmod-brcm-wl wl wlc
rm /etc/config/wireless
opkg install nas
reboot

Then login to shell again to edit /etc/config/wireless . This is mine.

config wifi-device  wl0
        option type       broadcom
        option channel    1
        option txantenna  3
        option rxantenna  3
        option txpower    '20'
        option plcphdr    'auto'
        option frameburst 1
        option disabled   0
config wifi-iface
        option device     wl0
        option network    lan
        option mode       ap
        option ssid       YOUR\_SSID
        option key        YOUR\_KEY
        option wmm        1
        option encryption 'psk2'
        option disabled   '0'

I added plcphdr and frameburst after reading this discussion thread.

Another strange thing to work around is that after reboot, while a client can connect to the router with 802.11n, the DHCP failed to issue IPs. I had to turn the wifi off and on for it to work properly.

wifi down
wifi up

I did not spend time debugging. Instead, as a temporary workaround, I added that to /etc/rc.local, which now looks like this:

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
# workaround for Broadcom proprietary driver problem
/sbin/wifi down
/bin/sleep 1
/sbin/wifi up
exit 0

Update: badineu in the comment mentioned that he also needed to manually select the wifi frequency. You may also have to do so if, for some reason, it's not already properly set.

Comments



Anonymous on Sunday, March 22, 2015 at 3:15:00 PM EDT


Thank you! Your workaround for the Broadcom proprietary driver helped me finish my configuration.




TK on Thursday, March 26, 2015 at 12:19:00 AM EDT


I'm glad that this guide helped you. Thank you for letting me know.




StratoS on Monday, March 30, 2015 at 7:22:00 AM EDT


You have to install utility called nas to get wifi authentication working:

opkg update
opkg install nas




TK on Monday, April 13, 2015 at 12:40:00 AM EDT


Thanks a lot, StratoS. I've updated the post to include your info. I already had that installed so I didn't realize its dependency.




Anonymous on Wednesday, June 10, 2015 at 3:36:00 PM EDT


Thank you for the info! I was not able to get a stable connection using the kmod-brcmsmac driver but 'kmod-brcm-wl' driver is rock solid!




Anonymous on Friday, June 26, 2015 at 1:37:00 AM EDT


Thank you! I also had to switch the operating frequency in the wifi settings

https://i.imgur.com/IIqwRfI.png




TK on Saturday, June 27, 2015 at 3:05:00 AM EDT


Thanks for letting me know, my anonymous friend.

badineu, I added a note at the end of the post to mention that. Thank you for adding that info.




Anonymous on Saturday, September 12, 2015 at 1:13:00 PM EDT


Directions worked perfectly on the latest release, Chaos Calmer 15.05. Thanks for the info!




TK on Sunday, September 13, 2015 at 7:33:00 AM EDT


Wonderful. Glad it helped.




Unknown on Monday, October 12, 2015 at 10:11:00 AM EDT


Thank u, it is working great!!




TK on Sunday, October 25, 2015 at 3:01:00 AM EDT


You are welcome! Glad I could help.




Unknown on Thursday, October 15, 2015 at 8:45:00 AM EDT


I use N16 both as Client and Master. With what you gave

/sbin/wifi down
/bin/sleep 1
/sbin/wifi up

Client mode works perfectly after reboot but Master mode does not. As you said, while a client can connect to the router with 802.11n, the DHCP failed to issue IPs.




TK on Thursday, October 22, 2015 at 7:25:00 PM EDT


Hero, my setting works for me on the Master (AP) mode, which is probably what most people use here, so I assume it works for most people on the Master mode. I'm therefore a bit surprised that you client mode works but master doesn't. I wish I could be of more help.




Unknown on Thursday, October 15, 2015 at 9:01:00 AM EDT




Brain2000 on Sunday, February 7, 2016 at 6:43:00 PM EST


Be careful using kmod-brcmsmac with the RT-N16. It uses 100% of the CPU at under 20mbits. The kmod-b43 works perfectly at 5% at about 20mbits, but unfortunately it doesn't support N. For me the Broadcom-wl proprietary driver isn't a solution because it doesn't support 802.1X authentication.




TK on Tuesday, February 9, 2016 at 10:29:00 PM EST


Thanks for the information. My router CPU level is very low though. I wonder what made the difference on your side.




Chen on Wednesday, July 13, 2016 at 1:40:00 AM EDT


Thanks. You saved my day. Unable to get 11n has been a huge trouble since i flashed my RT-N16 to OpenWrt




TK on Friday, July 15, 2016 at 2:13:00 PM EDT


You are welcome. I'm glad it was helpful for you.




Garrett on Tuesday, December 27, 2016 at 12:12:00 PM EST


works with current release of 15.05.1. Thank you!

Note: the 2nd line of your instructions is missing 'install' after opkg...

opkg install kmod-brcm-wl wl wlc




TK on Sunday, January 1, 2017 at 10:35:00 PM EST


Thank you! Updated.




Gene on Sunday, February 20, 2022 at 5:26:00 PM EST


plcphdr makes absolutely no sense as it's absent from broadcom.sh script, that is mapping uci config to wlc command.