Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running Ubuntu 11.04 on a laptop, and quite often (but not always), if I open the lid to wake the computer from Suspend, the wireless connection finds nothing.

I've tried using ifup and ifdown, but to no avail. The only solution I've found is to reboot the whole system.

Any solution - a setting somewhere, a text file to edit or a script to run?

Thanks.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

First find out what your wireless kernel driver you use:

Run

sudo lshw -class network

Then look for "driver=xxxxx" e.g.

enter image description here

Now create a text-file called "reset_wireless.sh" with the following:

#!/bin/sh
service network-manager stop
modprobe -r brcm80211
modprobe brcm80211
service network-manager start

obviously change "brcm80211" with your driver.

Give it execute rights i.e.

chmod +x reset_wireless.sh

Now right-click and create a launcher on your desktop with the command:

gksudo reset_wireless.sh

Now when you awaken you can reset your wireless by double-clicking on the new launcher.

Automating

You can try the following to automate the above script on resume:

Move the file to a known location e.g.

sudo mv ~/resume_wireless.sh /var/local

Now create a new script:

#!/bin/sh
case "$1" in
        thaw|resume)
    /var/local/resume_wireless.sh
    /var/local/resume_wireless.sh
        ;;
        *)
        ;;
        esac
exit $?

save this script in the folder /etc/pm/sleep.d called 99wireless-resume and give it execute rights.

technique borrowed from here and here

share|improve this answer
    
That's a much more clear guide than I could find anywhere else, thanks. –  citizenkong Sep 22 '11 at 7:42

Could pm-powersave be the cause of your problem? My answer to How to connect wirelessly in a cafe with 11.04 might apply

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.