Page 1 of 1

[SOLVED] Wireless fails to connect after resuming from sleep

Posted: Thu Jan 03, 2013 11:55 pm
by andrewbootlegger
Just installed Mint 14 on my laptop and having some issues with wifi when I resume from sleep. I've spent the last few days searching for people with similar issues, reading logs, but haven't had much luck on my own. I should mention that I've tried this on two different access points, one 802.11G the other .11N and the fore with WPA-PSK, the latter network is open. Here's my mintwifi output:

Code: Select all

-------------------------
* I. scanning WIFI PCI devices...
  -- Intel Corporation Centrino Wireless-N + WiMAX 6150 (rev 67)
      ==> PCI ID = 8086:0886 (rev 67)
-------------------------
* II. querying ndiswrapper...
-------------------------
* III. querying iwconfig...
eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"TDSWIFI"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: 40:8B:07:F1:CD:87   
          Bit Rate=65 Mb/s   Tx-Power=15 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
          Link Quality=40/70  Signal level=-70 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:930  Invalid misc:99   Missed beacon:0

-------------------------
* IV. querying ifconfig...
eth0      Link encap:Ethernet  HWaddr 08:2e:5f:8c:77:4b  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:267 errors:0 dropped:0 overruns:0 frame:0
          TX packets:267 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:46821 (46.8 KB)  TX bytes:46821 (46.8 KB)

wlan0     Link encap:Ethernet  HWaddr 40:25:c2:de:aa:74  
          inet addr:192.168.0.27  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::4225:c2ff:fede:aa74/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5631 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4498 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6454678 (6.4 MB)  TX bytes:743006 (743.0 KB)

-------------------------
* V. querying DHCP...
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service smbd reload

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the reload(8) utility, e.g. reload smbd
RTNETLINK answers: File exists
-------------------------
* VI. querying nslookup google.com...
Server:		192.168.0.1
Address:	192.168.0.1#53

Non-authoritative answer:
Name:	google.com
Address: 74.125.139.100
Name:	google.com
Address: 74.125.139.101
Name:	google.com
Address: 74.125.139.102
Name:	google.com
Address: 74.125.139.113
Name:	google.com
Address: 74.125.139.138
Name:	google.com
Address: 74.125.139.139
Here are some solutions I've tried and they've failed:
  • Turning off wifi with the keyboard on/off key before suspending.
  • Turning wifi on/off with the key after suspending and while it won't connect
  • Manually reloading the module.
  • Adding a script to reload the module to /etc/pm/sleep.d
  • sudo service network-manager restart
The only real fix is to reboot the machine. Oddly enough, I can turn the wifi on and off with the toggle key and it comes back up and reconnects.

Looking through logs have revealed only these suspicious looking entries:

/var/log/syslog

Code: Select all

Jan  3 21:07:16 aanya kernel: [  169.236542] iwlwifi 0000:07:00.0: >fail to flush all tx fifo queues
Jan  3 21:07:16 aanya kernel: [  169.236990] iwlwifi 0000:07:00.0: >Request scan called when driver not ready.
Jan  3 21:07:16 aanya kernel: [  169.237096] iwlwifi 0000:07:00.0: >L1 Enabled; Disabling L0S
/var/log/pm-suspend.log

Code: Select all

/etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/55NetworkManager suspend suspend:
Having NetworkManager put all interaces to sleep...Failed.

/usr/lib/pm-utils/sleep.d/55NetworkManager suspend suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend:
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
Seems to be it would be something to do with the system waking up from sleep, but I'm not sure where to start. Any suggestions would be greatly appreciated. Thanks in advance.

Re: Wireless fails to connect after resuming from sleep

Posted: Sat Jan 05, 2013 2:13 pm
by andrewbootlegger
Ran /usr/lib/pm-utils/sleep.d/55NetworkManager resume suspend and got:

Code: Select all

andy@aanya ~ $ /usr/lib/pm-utils/sleep.d/55NetworkManager resume suspend
/usr/lib/pm-utils/sleep.d/55NetworkManager: 9: .: : not found
andy@aanya ~ $ 
Perhaps a bug?

Re: Wireless fails to connect after resuming from sleep

Posted: Thu Jan 10, 2013 11:14 pm
by andrewbootlegger
Back at it again. On my WPA wireless lan, it just asks for the password over and over. Here's a log entry on successful connection:

Code: Select all

Jan 10 21:12:54 aanya wpa_supplicant[925]: wlan0: SME: Trying to authenticate with 00:10:18:90:20:db (SSID='Purgatory' freq=2462 MHz)
Jan 10 21:12:54 aanya wpa_supplicant[925]: wlan0: Trying to associate with 00:10:18:90:20:db (SSID='Purgatory' freq=2462 MHz)
Jan 10 21:12:54 aanya wpa_supplicant[925]: wlan0: Associated with 00:10:18:90:20:db
Jan 10 21:12:54 aanya wpa_supplicant[925]: wlan0: WPA: Key negotiation completed with 00:10:18:90:20:db [PTK=CCMP GTK=CCMP]
Jan 10 21:12:54 aanya wpa_supplicant[925]: wlan0: CTRL-EVENT-CONNECTED - Connection to 00:10:18:90:20:db completed (auth) [id=0 id_str=]
...and a log entry when I'm having problems.

Code: Select all

Jan 10 21:10:52 aanya wpa_supplicant[872]: wlan0: SME: Trying to authenticate with 00:10:18:90:20:db (SSID='Purgatory' freq=2462 MHz)
Jan 10 21:10:54 aanya wpa_supplicant[872]: wlan0: Failed to initiate AP scan

Re: Wireless fails to connect after resuming from sleep

Posted: Mon Mar 18, 2013 6:04 am
by andrewbootlegger
Appreciate the suggestion. Sadly, it didn't work. I had found a very similar idea on an Ubuntu forum that didn't work either.

Re: Wireless fails to connect after resuming from sleep

Posted: Mon Mar 18, 2013 8:10 am
by austin.texas
here is one person's solution:
The suspend key on my keyboard worked properly and my netbook went into suspend. Unfortunately when I resumed the system, my wifi Internet connection was not longer working. It ended up taking a reboot to fix it. Luckily, this issue is easy to fix. One simple command in the terminal was all it took to fix the issue.
sudo touch /etc/pm/power.d/wireless

After using that command, my netbook now properly suspends and resumes.
http://tuxtweaks.com/2012/05/distro-rev ... n-edition/

Re: Wireless fails to connect after resuming from sleep

Posted: Wed Mar 27, 2013 6:17 pm
by andrewbootlegger
Thanks for the link, but still can't get things working. I keep seeing this in the log and wondering if the culprit lies here.

/var/log/pm-suspend.log

Code: Select all

/etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/55NetworkManager suspend suspend:
Having NetworkManager put all interaces to sleep...Failed.

/usr/lib/pm-utils/sleep.d/55NetworkManager suspend suspend: success.
Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend:
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
I'm going to dig a little more and find out why wpa_ctrl_open doesn't work with PM.

Re: Wireless fails to connect after resuming from sleep

Posted: Mon Apr 29, 2013 3:26 am
by andrewbootlegger
Finally found a fix.

Created a script: /etc/pm/sleep.d/resume_iwlwifi

Code: Select all

#! /bin/sh

rmmod iwldvm && rmmod iwlwifi && modprobe iwlwifi bt_coex_active=0
Works great. Credit: https://bugs.launchpad.net/ubuntu/+sour ... bug/614954