Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

All,

I have a fresh install of Ubuntu 12.04 32 bit on a Lenovo X220. I've bought this model on purpose as the hardware is known to perform well in 11.10 64 bit (see here) and indeed I did not have any issues so far but the one below.

If I start the laptop or I wake it up from suspend and I am running on battery power, the wifi network does not work.

Oddly enough, I do get the popup saying I connected successfully to my home's wifi, and I get a correct IP address from the DHCP on my home's access point (what I can see from ifconfig -a) but the network is dead, I can't even ping the access point. This is what I see, that is identical to when the network works.

giacecco@giaceccos-x220:~$ ifconfig -a
(...)
wlan0     Link encap:Ethernet  HWaddr 8c:70:5a:3e:f1:80  
          inet addr:192.168.1.24  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::8e70:5aff:fe3e:f180/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:87965 errors:0 dropped:0 overruns:0 frame:0
          TX packets:108083 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:33751259 (33.7 MB)  TX bytes:111481622 (111.4 MB)

giacecco@giaceccos-x220:~$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
^C
--- 192.168.1.1 ping statistics ---
77 packets transmitted, 0 received, 100% packet loss, time 76608ms

To make it work again I have noticed that it is sufficient to disable and enable wireless networking (not networking in general) from the global menu bar.

The issue cannot be reproduced by doing the same when plugged in, or using an ethernet cable.

Following the instructions here I have also amended the laptop's radio settings to be the correct ones (GB in my case).

Below is the output of lshw -C in case it was useful.

giacecco@giaceccos-x220:~$ sudo lshw -C network
[sudo] password for giacecco: 
  *-network               
(...)
  *-network
       description: Wireless interface
       product: Centrino Advanced-N 6205
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlan0
       version: 34
       serial: 8c:70:5a:3e:f1:80
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=3.2.0-26-generic-pae firmware=17.168.5.3 build 42301 ip=192.168.1.24 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
       resources: irq:44 memory:f2400000-f2401fff
  *-network DISABLED
(...)

This is incredibly annoying, as I am such a little step to have the perfect Linux laptop.

As a start, can you suggest what exact script is behind the "Enable Networking" menu item, and how its behaviour could change depending when being on battery power?

Thanks.

share|improve this question
    
I have realised today that I cannot reproduce the issue away from home, which means that my wireless router, an usually trustworthy Draytek 2850Vn, is part of the problem. Both at a cafe in my home town and using my mobile phone's tethering (Samsung Galaxy S3) wifi works nicely after waking the laptop up from suspend. I am contacting Draytek hoping they could have a few ideas to explore. –  giacecco Jul 17 '12 at 5:57
    
More updates. Together with the engineers at Draytek we are looking into syslog. At the moment it looks like it is the kernel disconnecting from the wifi network rather than the other way round. Two lines in the syslog I did not notice before are revealing and appear to say that wpa_supplicant disconnects me for 'reason=3'. –  giacecco Jul 21 '12 at 10:18
add comment

1 Answer 1

You could also try unloading the driver and then modprobe it back in.

Pasted for posterity (original reference):

Use the following script as /etc/pm/sleep.d/99_fixwifi.sh

#!/bin/sh

. "${PM_FUNCTIONS}"

resume_wifi()
{
        # Stop networking and network-manager
        stop network-manager
        service networking stop

        # Remove and reload the module for the wifi card
        # Change to the wifi driver of your choice.
        # You can probably find it by using
        #    `lspci | grep -i wireless`
        # and it's probably loaded somewhere in `modprobe -l`, 
        # maybe pipe modprobe's output to `grep iw`

        modprobe -r -f iwlwifi
        modprobe iwlwifi

        # Start networking and network-manager again
        service networking start
        start network-manager
}

case "$1" in
        thaw|resume)
                resume_wifi
                ;;
        *) exit $NA
                ;;
esac
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.