79

[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.

16
  • I have disconnected instead of asleep in my status, how can I solve the problem with that? Thx Apr 27, 2014 at 10:04
  • 11
    If you solve your own problem, you should post an answer, not include the answer in your question. Aug 30, 2014 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 ... Dec 23, 2014 at 9:17
  • 5
    The command nmcli nm complains: Object 'nm' is unknown
    – Alireza
    May 2, 2015 at 19:24
  • 1
    @umpirsky try nmcli general status
    – rsht
    May 30, 2016 at 10:37

5 Answers 5

27

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
Make it executable sudo chmod 755 /etc/pm/sleep.d/10_resume_wifi and the problem should be fixed immediately.

6
  • 1
    this resolved it for me on 15.04
    – STW
    Sep 26, 2015 at 22:46
  • Why not "off" before going to sleep? Feb 26, 2016 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, 2016 at 23:51
  • 1
    Worked for me 16.04 May 29, 2016 at 6:35
  • @FizxMike The r specifies object 'radio' in my version of nmcli (Ubuntu 16.04). When I type nmcli r --help, I see the available targets of a command are COMMAND := { all | wifi | wwan } and the available commands are [ on | off]. I surmise that previous to Ubuntu 14.10, it was not possible to target individual objects that are controlled by NetworkManager.
    – MDMower
    Jul 31, 2016 at 19:48
21

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

sudo service network-manager restart

It is not the permanent solution.

5
  • This solution is the only one that worked for me on 15.10 with Intel Wireless 7260 Mar 24, 2016 at 14:23
  • This solution is also worked on 14.04 LTS and 14.10
    – hmjha
    Apr 3, 2016 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, 2016 at 8:07
  • @umpirsky yes we can do from that method also. Thanks
    – hmjha
    May 23, 2016 at 12:18
  • 2
    Worked for me on Ubuntu 16.10. However, apparently /etc/pm/sleep.d is no longer used. I put it instead in /lib/systemd/system-sleep, as: #!/bin/sh case $1 in post) service network-manager restart ;; esac Oct 19, 2016 at 15:49
4

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.

3
  • Can I somehow test this without making it permanent? What do the commands do?
    – tokam
    May 5, 2016 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, 2016 at 23:50
  • This works for me on mint mate 18, which is based on ubuntu 16.04.1.
    – Eric
    Aug 8, 2016 at 15:23
0

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!!

-3

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.

3
  • 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! Feb 28, 2015 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! Mar 31, 2015 at 6:48
  • 3
    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, 2016 at 10:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .