Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to reconnect to a wireless network as fast as possible when waking up my computer from sleep mode. It always takes a while (usually 15-30 seconds) before there's even a listing of available networks. Scanning with iwlist does not even take one second so I guess it takes a while before it even starts scanning.

Can I shorten the scan interval or solve my problem in a different way?

I'm running Debian Wheezy without any special configurations. Network connections are handled by the GUI but I'm a long time Debian user and not afraid of the command line. Even Bash solutions are welcome - anything which solves my problem.

share|improve this question
add comment

3 Answers

It's going to depend on a number of factors.

Sleep vs Hibernate

Software Issues

  • Connecting to an open wifi network or specific net

  • Not Connecting without waiting for a BSID

  • Accessing your password

  • KWallet issue from KDE ?

Hardware Issues

  • Sleep modes can differ with manufactures

  • Wireless Drivers can be very different

Direction For research:

Although I can't directly answer your question, you would likely be able to execute a direct scan with iwlist, and join an open network based on the Power management hook in Wheezy.

ACPI (old way)

This action would be scripted through the ACPID event hooks.

You can learn more about acpid /etc/acpi/actions

PM-Utils launchpad

This action would be scripted through pm-util event hooks

  • resume -- The hook MUST perform whatever action is appropriate when the system is coming out of suspend.

  • thaw -- The hook MUST perform whatever action is appropriate when the system is coming out of suspend-to-disk.

Suspend/resume functionality can be easily modified by installing files into the /etc/pm/sleep.d directory. These files, known as hooks, can perform specific tasks on suspend/resume.

  1. Some event happens to wake the machine up

  2. Each of /etc/pm/sleep.d/* are executed in reverse C sort order, with a command line argument of "resume" or "thaw"

share|improve this answer
    
Thanks! I will definitely try some of this! ACPI hooks looks like the right way to go. The problem, by the way, is not the time it takes to connect, but the time it takes before it even begins to scan for networks. –  Emil Vikström Aug 10 '12 at 17:08
add comment

If your network uses only iPv4, the problem could be that Debian Linux is first trying to connect via iPv6 without success, before passing on to iPv4 and succeeding. Turning off iPv6 might in this case solve the problem.

For more details see the Debian IPv6 Project, and especially the section How to turn off IPv6.

share|improve this answer
1  
Nice catch, but I've already checked this and disabled IPv6. The problem is not the connection time, it is the time it takes before it even starts to scan for networks. –  Emil Vikström Aug 10 '12 at 17:07
    
Have you tried to debug the wake-up, maybe using tools such as in Help on software suspend. –  harrymc Aug 10 '12 at 17:33
add comment

You've mentioned you are running Debian Wheezy without any special configurations, so I assume you are using NetworkManager. What you can try to do is forcing NetworkManager to reconnect as soon as your machine wakes up.

To do that, try this way:

  1. get the UUID of the connection you're interested in:

    $ nmcli con
    
  2. ensure you have the pm-utils package installed and create a script in /etc/pm/sleep.d/ like this:

    nmcli con up uuid 9890c6b9-d2b4-4ed2-a743-ad07cb6c125f

Obviously, replace the UUID with the one you got in step 1. The script has to be executable, and it will be executed every time your laptop comes out of suspend (or suspend-to-disk).

share|improve this answer
add comment

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.