Find the answer to your Linux question:
Results 1 to 10 of 10
How must I amend my wireless config. to automate wireless to resume connection after sleeping/hibernating my laptop? Please don't assume I know anything and walk me through any code changes ...
  1. #1
    Linux Newbie
    Join Date
    May 2010
    Posts
    125

    How to automate wireless to resume sleep hibernate, using wpa_supp.?

    How must I amend my wireless config. to automate wireless to resume connection after sleeping/hibernating my laptop?

    Please don't assume I know anything and walk me through any code changes or commands.

    Deb 6 Wheezy, 32-bit.

    gksudo mousepad /etc/wpa_supplicant.conf

    Code:
    ap_scan=1
    ctrl_interface=/var/run/wpa_supplicant
    
    # connection at home
    network={
      ssid="XXXX"
      scan_ssid=1
      psk="XXXX"
    }
    
    # connection at uni
    network={
      ssid="uniwide"
      scan_ssid=1
      key_mgmt=WPA-EAP
      eap=PEAP
      phase2="auth=MSCHAPv2"
      identity="XXXX"
      password="XXXX"
    }
    gksudo mousepad /etc/network/interfaces
    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    allow-hotplug eth0
    iface eth0 inet dhcp
    
    # wifi
    noauto wlan0
    allow-hotplug wlan0
    iface wlan0 inet manual
       wpa-roam /etc/wpa_supplicant.conf
    iface default inet dhcp

  2. #2
    Guest
    Join Date
    Feb 2005
    Posts
    314
    There are different ways of doing this, but by far the easiest is to use a network connection manager such as Wicd or NetworkManager. These should take care of putting the interface back up after hibernate or suspend. They are also much better for laptops and wireless in general and managing of multiple wifi access points, etc.

    As an aside, you don't need root privileges, a command like "gksudo" or a graphical text editor to get that kind of output. The cat command is much more convenient for this e.g.

    Code:
    cat /etc/network/interfaces

  3. #3
    Linux Newbie
    Join Date
    May 2010
    Posts
    125
    Quote Originally Posted by cynwulf View Post
    There are different ways of doing this, but by far the easiest is to use a network connection manager such as Wicd or NetworkManager. These should take care of putting the interface back up after hibernate or suspend. They are also much better for laptops and wireless in general and managing of multiple wifi access points, etc.
    I'm in an Xfce desktop environment. These days I alternate between desktop environments so I value the desktop-independence of the methods I use; that rules out Network Manager. As for Wicd, I thought Wicd was having precisely this defect, can anyone confirm if Wicd automatically resumes wireless connections after suspend/hibernate? I have to say, Wicd has made a very bad impression on me. About a year ago I was posting in forums trying to troubleshoot bugs, and one year on things haven't improved. I'm rather annoyed with the performance of Wicd atm actually, but if we have first hand accounts of other people being able to retain wireless functionality through sleep/hibernate, then I'll pursue the Wicd solution further.

    Also, for my education, and possibly as the primary solution to this problem, is there a simple, direct way via wpa_supplicant to have automatic resumption of wireless connections after sleep/hibernate?

  4. #4
    Guest
    Join Date
    Feb 2005
    Posts
    314
    Quote Originally Posted by lindsey View Post
    I'm in an Xfce desktop environment. These days I alternate between desktop environments so I value the desktop-independence of the methods I use; that rules out Network Manager. As for Wicd, I thought Wicd was having precisely this defect, can anyone confirm if Wicd automatically resumes wireless connections after suspend/hibernate?
    I'm also using Xfce, with wicd and the active connection does resume after suspend - I can't speak for hibernate however, as I never use it.

    networkmanager does not have gnome dependencies, you can install cnetworkmanager which is a python based cli client, though I have no experience of it as I haven't used networkmanager, in any form, for years.

    Debian -- Details of package network-manager in squeeze
    Debian -- Details of package cnetworkmanager in squeeze

  5. #5
    Linux Newbie
    Join Date
    May 2010
    Posts
    125
    Isn't it just a quick press of a button to find out if wireless connections resume after hibernate? Perhaps you could kindly test it out? Do wireless connections resume after you return from a #sudo pm-hibernate#?

  6. #6
    Linux Newbie
    Join Date
    May 2010
    Posts
    125
    This problem is still unresolved. I am using Wicd as well as wpa_supplicant simultaneously as per my original post. I don't know if the two conflict in any way. If you think I should not be using wpa_supplicant, can you tell me what the contents of the /etc/network/interfaces and the /etc/wpa_supplicant.conf should be changed back to to disable wpa-supplicant, as I don't actually know what the original contents of either config files were before I ammended them. Do the two config files need to be deleted altogether?

    Symptoms and problems persist: Wicd and/or wpa_supplicant
    1. Does not resume wireless connections after hibernate/sleeping the system
    2. I cannot manually connect via Wicd after hibernate/sleeping my computer; I get "Bad Password" error even though my password is correctly entered
    3. I do not know how to manually connect via wpa_supplicant, all I did was ammend the /etc/network/interfaces and /etc/wpa_supplicant.conf as in the original post. Are there commands I can issue to get wireless back up?
    4. Ultimately, I want either Wicd or wpa_supplicant to resume wireless connections after suspend, automatically without my intervention



    Can someone please help me. It is really frustrating that I have not been able to find a solution after a week, and there isn't enough community support for Debian to help me through this.

  7. #7
    Guest
    Join Date
    Feb 2005
    Posts
    314
    If you want wicd to handle the interface you're going to need to take any reference to the interface out of the interfaces file, so comment out everything except loopback (lo):

    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    #allow-hotplug eth0
    #iface eth0 inet dhcp
    
    # wifi
    #noauto wlan0
    #allow-hotplug wlan0
    #iface wlan0 inet manual
    #   wpa-roam /etc/wpa_supplicant.conf
    #iface default inet dhcp
    I would then advise that you back up wpa_supplicant.conf and

    Code:
    aptitude purge wpasupplicant && aptitude install wpasupplicant
    This will reinstall it with a clean config file.

    Then reboot and wicd should manage the connection when it's daemon starts up (or you can bring down the interface and restart the wicd daemon manually).

    If wicd is still not managing the wireless go into wicd gtk (the control panel - i.e. click the icon), into preferences and enter the interface name of the wireless adaptor (in your case wlan0) and click refresh.

    If your password is not working, you might need to enter the actual password hash rather than the passphrase. I've seen this behaviour with wicd and certain wireless adaptors.

    Quote Originally Posted by lindsey View Post
    Can someone please help me. It is really frustrating that I have not been able to find a solution after a week, and there isn't enough community support for Debian to help me through this.
    debianuserforums.org
    Debian - LinuxQuestions.org
    Debian User Forums (.net)
    debianHELP | Militantly FREE software support.

    Wifi/network specific wiki pages:
    WiFi - Debian Wiki
    WiFi/HowToUse - Debian Wiki

  8. #8
    Linux Newbie
    Join Date
    May 2010
    Posts
    125
    Thanks for your reply - I will try your suggestions, cynwulf. Please bear with me as I left my machine in my locker at uni and can't currently access it until the day after the next. But I'm very keen to try your suggestions and will report back as soon as I have! That debianHELP link sounds pretty hardcore* - will definitely keep them in mind if we run out of ideas. Talk soon!

    (If anyone else has any other ideas, keep them coming, as the more ideas, the more chance I have of solving this. My history shows that more then half of my Debian problems are never solved. But with your help, perhaps this will change.)

    * I may have spoken too soon, I just checked out debianHELP and the first impression is not good... Maybe I'm yet to be proven wrong, but rate of reply in that militantly helpful forum seems really low and a number of questions have been up for over a month with no response!
    Last edited by lindsey; 09-19-2011 at 10:09 AM.

  9. #9
    Guest
    Join Date
    Feb 2005
    Posts
    314
    Quote Originally Posted by lindsey View Post
    * I may have spoken too soon, I just checked out debianHELP and the first impression is not good... Maybe I'm yet to be proven wrong, but rate of reply in that militantly helpful forum seems really low and a number of questions have been up for over a month with no response!
    I don't have an account at debianhelp so I'm not sure about how they operate or the level of traffic there. But they are one of the two main links from debian.org. IMO the other three sites are better - in priority of the order I listed them.

    If you're not getting answers to your questions then there are a few possible reasons - including but by no means limited to:

    1) Your question is just unique, no one really knows the answer

    2) You haven't provided enough information

    3) You've included something in your OP which may put people off - us debian users can be elitist arseholes. If you want a more noob friendly distro then go for one of the butnut or mint distros. If we see something like "with butnut it just worked" or "I require step by step instructions" it tends to aggravate our bowels. Short version: If you're perceived as being a lazy individual who wants others to do their work for them, it can also put people off from bothering to reply.

    4) Some may feel that your question is easily resolved by reading the documentation and using a search engine for existing threads (at the forums I linked to in the previous post).

    Thus ends the possible reasons.

    Try what I posted in the previous post and see how you get on. Wicd should reconnect the last active connection if you set it up properly. Again look in preferences for "attempt to reconnect" on loss of connection type options. Mine does work but wicd does take about 10 seconds before it shows the connection is up (it takes a while to re-establish the connection, especially if you use dhcp).

  10. #10
    Linux Newbie
    Join Date
    May 2010
    Posts
    125
    Try what I posted in the previous post and see how you get on. Wicd should reconnect the last active connection if you set it up properly. Again look in preferences for "attempt to reconnect" on loss of connection type options. Mine does work but wicd does take about 10 seconds before it shows the connection is up (it takes a while to re-establish the connection, especially if you use dhcp).
    @cynwulf I followed your instructions with success.

    For those having similar problems:

    1. Comment out all entries in the network interface
    2. Remove wicd, daemon, wpasupplicant, and associated
    3. Reinstall said packages


    It occurred to me to expect possible problem if you are purely reliant on a wireless connection. If you issue the command to remove wpasupplicant in this way, it will also propose to remove wicd and its associated daemon.

    If you agree to proceed, you may find yourself without any wireless connection, and therefore you may not be able to proceed with reinstall if aptitude needs to have internet access to redownload the packages. Catch 22 situation in other words, but I was at home so potential problem averted - I just used an Ethernet connection.

    Some minor hiccups along the way with root authorization and deletion issues with an reported empty folder unable to be deleted. But by this stage, it appeared wicd and wpasupplicant was for the most part removed. I should note that wicd remembered some of my previous settings - so clearly the purge was incomplete. But this was not a problem, just a slightly annoying observation.

    Once I was plunged into wireless-less state I simply hooked up my machine with an Ethernet cable and was back online. Reinstalled wicd and associated packages by Synaptic.

    Moment of truth: Hibernated, with automatically reconnect option checked in wicd. On return, it does successfully reconnect within 11 seconds - somewhat a drawn out process, but it comes around eventually. As you said to expect cynwulf.

    I don't know exactly why it worked, but obviously it must be one of the 2 things I did in accordance with cynwolf's advice: (1) comment out all entries in the network interface file except loopback, (2) delete and reinstall wpasupplicant/wicd.

    Thanks for your help cynwulf! Hopefully my wireless doesn't break again!

    Aside:Ubuntu makes everything so effortless by comparison to Debian. I'm primarily only using Debian because of rumored advantages on low spec systems like my 2GB atomic processor netbook. Things do appear to happen quickly with Deb running with Xfce. Does it hold any significant advantage over Xubuntu (Ubuntu + Xfce)? I read it does. LMDE has caught my eye now. Maybe Linux Mint has reworked or configured the user interface to be easier on users.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •