Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

[Update]:
The same problem exists in Kubuntu and is solved in the same manner.
[Solved]:
By applying the following command nmcli nm I got the following:

Before suspend

RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN      
running         connected       enabled         enabled    enabled         enabled  

as can you see the state is connected and the rest are enabled and running

After suspend

RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN      
running         asleep          enabled         enabled    enabled         disabled

as can you see the state is asleep meaning our dear network manager is still napping, so to solve use the fallowing command line:
sudo nmcli nm sleep false
this tells the network manager to wake the hell up. to make this permenant :
create a script in /etc/pm/sleep.d containg the following (and don't forget to mark the script as executable):

#!/bin/sh

case "${1}" in
        resume|thaw)
        nmcli nm sleep false
                ;;
esac

Thanks to this

The original problem:

I just downloaded Ubuntu 14.04 and installed on my laptop: ASUS X61SL with Intel P8400 Core2Duo x64 processor.
When I close the lid, the system is suspended, but when I open the lid again and resume, the wireless networking is not activited (networking as a whole is disabled), and when I select "Enable Networking" nothing happens.
This is the information about my wireless adapter:

$ lspci | grep -i wireless
02:00.0 Network controller: Qualcomm Atheros AR928X Wireless Network Adapter (PCI-Express) (rev 01)  

This problem wasn't present in Ubuntu 13.04, Linux Mint Debian Edition or Debian 7 wheezy (GNOME or KDE).

Edit: few test with the following results :
The problem effects my wireless and wired networking.
Note: I need to add the pci=nomsi line to grub in order to boot.
When logging out manually then suspend then resume then log in every thing works just fine.
When suspending directly while logged in the problem happens.
Locking and suspending causes the same problem as suspending directly.
Also this problem appearnlty affects log out function: if you chose log out from the user menu in unity panel then you wan't log out, but if you use the command line gnome-session-quit --logout then you can log out.
Now with lshw -C network output:
Normal (fully functional networking):

  *-network               
       description: Ethernet interface
       product: 191 Gigabit Ethernet Adapter
       vendor: Silicon Integrated Systems [SiS]
       physical id: 4
       bus info: pci@0000:00:04.0
       logical name: eth0
       version: 02
       serial: 00:24:8c:1e:f8:53
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=sis190 driverversion=1.4 duplex=half latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:19 memory:fddfcc00-fddfcc7f ioport:cc00(size=128)
  *-network
       description: Wireless interface
       product: AR928X Wireless Network Adapter (PCI-Express)
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: 00:15:af:e2:13:db
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=3.13.0-24-generic firmware=N/A ip=6.6.6.8 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
       resources: irq:16 memory:fdff0000-fdffffff

After resume ("/etc/pm/config.d" does not contains "unload_modules"):

 *-network DISABLED      
       description: Ethernet interface
       product: 191 Gigabit Ethernet Adapter
       vendor: Silicon Integrated Systems [SiS]
       physical id: 4
       bus info: pci@0000:00:04.0
       logical name: eth0
       version: 02
       serial: 00:24:8c:1e:f8:53
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=sis190 driverversion=1.4 duplex=half latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:19 memory:fddfcc00-fddfcc7f ioport:cc00(size=128)
  *-network DISABLED
       description: Wireless interface
       product: AR928X Wireless Network Adapter (PCI-Express)
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: 00:15:af:e2:13:db
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=3.13.0-24-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
       resources: irq:16 memory:fdff0000-fdffffff

When I added the file unload_modules to directory "/etc/pm/config.d" as suggested by here, after logging out, suspend ,resume then log in the networking works but I cannot connect to my wireless network.
Again the result of lshw -C network After resume ( "/etc/pm/config.d" contains "unload_modules"):

 *-network DISABLED      
       description: Ethernet interface
       product: 191 Gigabit Ethernet Adapter
       vendor: Silicon Integrated Systems [SiS]
       physical id: 4
       bus info: pci@0000:00:04.0
       logical name: eth0
       version: 02
       serial: 00:24:8c:1e:f8:53
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=sis190 driverversion=1.4 duplex=half latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:19 memory:fddfcc00-fddfcc7f ioport:cc00(size=128)
  *-network DISABLED
       description: Wireless interface
       product: AR928X Wireless Network Adapter (PCI-Express)
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: 00:15:af:e2:13:db
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=3.13.0-24-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
       resources: irq:16 memory:fdff0000-fdffffff

The contents of 'unload_modules" where:

SUSPEND_MODULES="$SUSPEND_MODULES ath9k"
SUSPEND_MODULES="$SUSPEND_MODULES sis190"

Where 'ath9k' is my wireless module and 'sis190' is my Ethernet module.

share|improve this question
    
I have disconnected instead of asleep in my status, how can I solve the problem with that? Thx – Luigi Tiburzi Apr 27 '14 at 10:04
    
Just Suspend the system and then resume back in. This surprisingly solves the wifi issue! Worked for me [ubuntu 14.04 LTS x64 on Asus laptop] – Rao Jul 23 '14 at 14:51
10  
If you solve your own problem, you should post an answer, not include the answer in your question. – Duncan Aug 30 '14 at 6:12
3  
Still no official fix to this issue? As per reading the bug report no. But this is highly surprising as it seems to affect quite many people ... – Augustin Riedinger Dec 23 '14 at 9:17
3  
The command nmcli nm complains: Object 'nm' is unknown – Alireza May 2 '15 at 19:24

The above answers did not work for me on 14.10. After a bit of trial-and-error, I ended up with this,

#!/bin/sh

case "${1}" in
  resume|thaw)
    nmcli r wifi off && nmcli r wifi on;
esac

Put this in /etc/pm/sleep.d/10_resume_wifi and the problem should be fixed immediately.

share|improve this answer
1  
this resolved it for me on 15.04 – STW Sep 26 '15 at 22:46
    
Why not "off" before going to sleep? – Petr Gladkikh Feb 26 at 11:05
2  
What is the 'r' for? I get "Error: Object 'r' is unknown." This seems to work for me: "nmcli nm wifi on;" (ubuntu 14.04 - dell precision laptop) – FizxMike May 14 at 23:51
1  
Worked for me 16.04 – Timothy Makobu May 29 at 6:35

I got a solution but it is just for restarting your network manager.

sudo service network-manager restart

It is not the permanent solution.

share|improve this answer
    
This solution is the only one that worked for me on 15.10 with Intel Wireless 7260 – Anton Matosov Mar 24 at 14:23
    
This solution is also worked on 14.04 LTS and 14.10 – hmjha Apr 3 at 9:27
    
Worked. @hmjha Maybe we can write a script in /etc/pm/sleep.d that checks if wifi works and restarts network-manager if not? – umpirsky May 19 at 8:07
    
@umpirsky yes we can do from that method also. Thanks – hmjha May 23 at 12:18

The script that finally worked for me:

$ cat /etc/pm/sleep.d/10_resume_wifi 
#!/bin/sh

case "${1}" in
  resume|thaw) nmcli nm sleep false ;;
esac

$ ll /etc/pm/sleep.d/10_resume_wifi
-rwxr-xr-x 1 root root 70 mars  31 09:09 /etc/pm/sleep.d/10_resume_wifi

The other answer has typos (they can be fixed I know), but never worked for me anyway.

share|improve this answer
    
Can I somehow test this without making it permanent? What do the commands do? – tokam May 5 at 8:09
    
Tokam, see my comment above on Owais' post about "nmcli nm wifi on" working in the script first. Basically, by placing a script in the sleep.d directory, it will be executed at resume time and get passed 'resume' or 'thaw'. The script checks for either arguments being passed to the script and executes the nmcli command (Network Manager Command Line Interface). The specific command I mentioned is equivalent to clicking on network manager in the status bar and checking "Enable WiFi". For verification, enter "nmcli nm help" in terminal. Also, you need to make sure the script it's executable. – FizxMike May 14 at 23:50

You may want to check whether your wireless driver module is unloaded. In my case, I got this problem. After loading the module which is iwl4965, wireless options got appeared. The command was sudo modprobe -i iwl4965.

I've put this with the hope that future visitor will get helped.

share|improve this answer

This worked for me on Ubuntu 14.04 on Dell Precision laptop.

In a terminal enter:

sudo nano /etc/pm/sleep.d/10_resume_wifi

Then paste in (ctrl+v):

#!/bin/sh
case "${1}" in
resume|thaw)
    nmcli nm wifi on
    ;;
esac

Then make the script executable:

sudo chmod +x /etc/pm/sleep.d/10_resume_wifi

Test out suspend and wake to see wifi on!!

share|improve this answer

Have you tried to make another script like this one enter in kate:

#/bin/sh

    case ![1] in
        ./bin/sh
        network="true"
        nmcli nm -c sleep=false -network
    endasc

and save it as jsin7 file in /etc/network, and call it network.d and this might work fine.

share|improve this answer
1  
I think the syntax has recently changed, I isssued nmcli nm sleep false followed by nm wifi on to get it running. +1 for the tip! – Mahmoud Al-Qudsi Feb 28 '15 at 12:52
    
The command sudo nmcli nm sleep false does work for me, so I'm not stuck. But the /etc/network/network.d script doesn't auto-resume. If I try to execute it, I get Syntax error: newline unexpected (expecting ")"). Could you be more specific on the 1. Why it doesn't work? 2. What is supposed to do the script (so we can fix it individually)? 3. Why network.d? Thanks! – Augustin Riedinger Mar 31 '15 at 6:48
2  
What is this supposed to do? What is ![$]? Why ./bin/sh? You're in /etc/network, there will be no ./bin/sh there. What's a jsin7 file? Case statements end with esac, not easc. They also need a variable and a condition. – terdon Jan 6 at 10:02

protected by Community Jun 2 '14 at 1:03

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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