Sunday, June 27, 2010

Workaround for Stuck Beacon Problem

Stuck beacon is a notorious problem on madwifi (the wireless driver DD-WRT used for Atheros routers).  If you never experienced any wireless interruptions with DD-WRT then just ignore this article. However, if you're annoyed by this stuck beacon problem with constantly dropping wireless connection, then I hope this can be of help.

I personally prefer the open source ath9k driver which doesn't suffer from this, but some important feature like WDS is missing from ath9k. So to each its own, DD-WRT has the perfect reason to stick with madwifi and I don't expect the switch to ath9k anytime soon. And, seems that the problem only happens under certain circumstance. In my case, the connection drops with an Atheros wireless N card -- same card works great with stock firmware -- but works fine with another Intel WiFI 1000 11N card. So if a stable wireless connection is very important, the best solution might be flashing back to stock firmware or just try another card.

Below is a quick hack, not a completely fix but would make life a little easier. The idea is to watch the output of dmesg and when the "stuck beacon" error messages flood, reset the wireless interface to bring it back to life.

  1. The watchdog script
    When wireless connection is dropeed, a typical out from dmesg would like this

    ath_bstuck_tasklet : Entering
    Resetting; Code: 01
    ath_bstuck_tasklet : Entering
    Resetting; Code: 01
    ath_bstuck_tasklet : Entering
    Resetting; Code: 01
    ath_bstuck_tasklet : Entering
    Resetting; Code: 01
    ath_bstuck_tasklet : Entering
    Resetting; Code: 01
    ath_bstuck_tasklet : Entering
    Resetting; Code: 01

    the same error message will keep repeating and flood the kernel log. So we can use this as a trigger and reset wireless interface when the error occurs.

    Below is the /opt/usr/local/bin/wifi-watchdog.sh script

    #!/bin/sh

    dmesg | tail -n 5 | grep -q ath_bstuck_tasklet || exit

    echo fixing...
    #a log file
    echo `date` >> /tmp/wifi-wathdog.log

    ifconfig ath0 down
    #for VAP, bring additional interface(s) down
    #ifconfig ath0.1 down
    sleep 2
    ifconfig ath0 up
    #bring it back
    #ifconfig ath0.1 up

    Set permissions
    chmod a+x /opt/usr/local/bin/wifi-watchdog.sh

  2. Set cron job
    With the watchdog script ready, we can use cron to set it run every one minute.
    Add a new job:

    * * * * * /opt/usr/local/bin/wifi-watchdog.sh

    and it's done. Again, its not a completely fix just save the trouble of resetting the router each time.

27 comments:

unknowngunman said...

i'll be trying this when i get home. otherwise, i hate to admit, i'll be going back to the stock firmware...

Anonymous said...

Im on the dd-wrt firmware that came with the router and getting network not in range. I need to reboot to get it to work again. I hope this helps because it sucks having to reboot every time.

Anonymous said...

Great post!
I am wondering if the 'Stuck Beacon' problem still exist till date (late Feb 2011) or this has already been fixed... I hope so :)
I am considering to purchase WZR-HP-G300NH to run dd-wrt but I can't afford disconnection.
Any ideas?

On the other note, let me ask you, did you get a change to install tonido-app (http://www.tonido.com/application_download.html) on WZR-HP-G300NH.
Any insight if this is possible or not?
I don't want to get the plug device.

MikeDawg said...

I'm still having issues, using their latest (alpha release, only after previous release suffered from same problem):

DD-WRT v24SP2-MULTI (04/12/11) std - build 16783

Anonymous said...

Just found i'm having this problem with the wndr3700 v2

Anonymous said...

FWIW, have same problem with my new WNDR3700v2.
Firmware: DD-WRT v24-sp2 (06/14/11) std

Running the watchdog for now to see if I can find a culprit among my clients. Worst case it will be back to stock firmware.

Anonymous said...

I'm the same poster as above.
I went back to the stock firmware but just couldn't live with its limitations. So I went back to DD-WRT with watchdog. Amazingly, it's now been running for 6 days already without any drop. The watchdog logfile is still empty.
AFAIK the only thing that is different from previous attempt, is that I'm now using channel 2 instead of channel 1.

Anonymous said...

Same problem as September 19th., 2011 commenter. Same version and firmware.

Kuma said...

Still same beacon problem on my Netgear WNDR3700v1 having wrt build 17201. For now using custom channels 2 (due to neighbors with monster routers), mixed network model and... an usb printer and an usb hard drive.

It is usually under heavy load on the wireless from random computers. No solution yet, sorry.

Anonymous said...

is there a way to add this job via the web interface? Thank you

Router Login said...

very nice post, i enjoy this fabulous blog. It is very helpful for me!

Router Login not working
Routerlogin admin page
Routerlogin
Routerlogin Net

Anonymous said...

This is the absolutely very first time I see right here. I placed many satisfying things on your blog site
While using HP printer if there is any issue created then easily visit hp setup to get the best solution.

Anonymous said...

If you are using Brother printer, it is possible for your printer stops to printing suddenly and you notice a message displaying brother printer offline fix. This is frustrating especially when you wish to print something important. However, check out the step-by-step guide to combat the issue effectively.
brother printer offline

Anonymous said...

My Epson printer is creating a really weird situation for me. Every time, I try to print anything from windows 10 or Mac computer. It says Epson printer offline.
epson printer offline

eyosingh said...

hello guys good morning here we provide service related to Brother Printer if you want services then you can immidetely our website and click here .
canon printer offline

Printer Setup and Support said...

I truly appreciate that you've posted an educational article. Much obliged to you for sharing this good post. Likewise visit our website.
123.hp.com || 123.hp.com/setup || 123HP Setup || hp.com/setup || hp.com/123 || 123.hp.com setup || 123 HP Printer Setup || 123 HP Printer Support || 123 HP Setup Install || 123hpcom || 123 HP Printer Install || 123hpcomsetup || 123 HP Printer Setup || 123HP Install || hpcom/123 || 123hpcominstall || 123HP Setup || 123 HP Smart App || Install 123 HP || HP 123 Setup

epsonprinter98 said...

Error Code 1433 on Epson Printer mainly appears when the firmware of the printer has been damaged or outdated.
https://www.epsonhelpline247.com/how-to-resolve-epson-printer-error-code-1433/

sophieturner said...

Dell Support Assistant is nothing but the primary proactive and predictive support solution for your systems and tablets. aside from that, Support Assist also ready to calculate the health of yours. Moreover, it'll also maintain the space for storing .
Whenever we mention brands, Dell comes first in our mind. Dell products are user-friendly and are available up with brilliant features. In spite of being one among the simplest laptop brands, it too creates serious issues that sometimes interrupt us with our daily work.
Dell Support Assistant | Dell Command Update | dell live chat

adamparker said...

If you have the requirements for 123.hp.com/setup, the printer setup is easy
• Power up the device using the power cable
• Make sure that you fix the cables properly
• Check the compatibility of the wireless settings
• Go to the device control panel and select the option, wireless setup wizard
• Start answering the guidelines of the wizard
• Wait and the list of networks will appear
• Select and provide the wireless network username and the password
• The network connection will be active after a while

123.hp.com/setup
www.123.hp.com/setup
set up your hp printer at 123.hp.com
123.hp.com/support
www 123 hp com setup
www.123.hp.com
For more updates on the 123.hp.com/setup you can get in touch with our expert team number +1-800-237-0201 and resolve the issues in the driver installation.


Anonymous said...

To install the Canon printer software on a device that you have recently purchased will take up to 10 minutes. If you are installing it on an old device, then it may take longer than normal to install. If you are installing it for the initial time, then you may visit canon.com/ijsetup for detailed commands to find the software as well as install it.

Sumit Kumar said...

Quickbooks error 41

Quickbooks Login error

Quickbooks payroll update

Quickbooks error code 1402

Quickbooks online login error

Sumit Kumar said...

unblock Extratorrent
Unlock the extratorrent

Rakshan said...

Do you meet your hp printer in error state or printer offline because of any interrupted in wireless connection, disconnection printer receiver problem, printer not connected with the devices, so it may be very difficult or easy to fix based on their type of problem so feel free, we are here for fixing your 123.hp.com/envy5530 hp printer error or printer offline problem by well-experienced printer technician by through online session of our website

john nicholas said...

HP Printers are among the most popular printers on the market, and they work well with PCs. There is no doubt that 123 hp Printers are a top choice for home users, small offices, and even business customers

Alfie said...

For the temporary fix to the stuck beacon problem, the troubleshooting steps provided offer a pragmatic solution. Top VPNs Websites While not a permanent resolution, this quick remedy ensures continued functionality while the underlying issue is addressed.

Anonymous said...

Great and I have a tremendous offer: How Much Renovate House green home remodeling

Anonymous said...

Thank You and I have a tremendous proposal: How Much Renovate House old house renovation ideas

Post a Comment