OpenSUSE 11.4 - wifi won't reconnect automatically

I upgraded my openSUSE to 11.4 and wifi was still working out of the box.

However now when I turn the wifi off using the hardware button and than back on, or when I wake up from hibernate, (k)networkmanager won’t recognize the wifi device… I actually have to run /etc/init.d/network restart to reconnect to network. The problem is that it worked in 11.3… why not in 11.4? Now every time I hibernate my laptop I had to manually restart network. In 11.3 it was automatic…

I would run YaST / Network Settings / Network Devices / Global Options Tab and select “User Controlled with NetworkManager”. In KDE, you also need to run KWallet in order for your pass phrase to be saved. I think you can select the Wireless Network to connect automatically then. Of course, I have not tried Hibernate myself just yet as openSUSE 11.4 is so new.

Thank You,

Hi, thank you for you answer, however it didn’t help. NetworkManager was already set in YaST to control network. I think that the problem is somewhere deeper. The wlan device just gets lost after turning it manually off/on (or hibernating and waking up again, the result is actually the same). I have to manually restart the network service so that the device could be found again. And after that I have to again manually click on “enable wireless” in knetworkmanager which finally results in connecting to network. In 11.3 I had just to hit the hardware wifi button twice (->off ->on) to properly reconnect to wifi network after waking up. Or I could just wait few seconds longer and knetworkmanager connected itself without any help after a while. It also wasn’t perfect but now it is terrible :frowning:

Ok, I managed to fix this.

I believe there are two different problems regarding wifi on my laptop.

The first is that NetworkManager for some reason can’t connect to wifi using wlan device after waking up from suspend/hibernate. This device has to be manually turned off and on (using a hw switch) so that NetworkManager could connect to network. I wasn’t able to find any software solution, even brutal /etc/init.d/network restart didn’t help. This problem I had also with opensuse 11.3.

The second is that NetworkManager doesn’t catch the event when the wifi is enabled by the hardware button. I have to manually click on the “enable wireless” button to connect to network. And this problem is weird because it worked properly in 11.3. When I pushed the hw wifi switch, networkmanager reacted properly and started to look for wifi networks around.

Luckily, this feature isn’t difficult to add. I tried dmesg to see what’s happening when the hw switch is triggered and following message appeared (this is good to check to see if you’re suffering from the same problem as I was):

iwlagn 0000:06:00.0: RF_KILL bit toggled to enable radio.

I found in some forum that this event can be caught by udev, so I added a proper rule to /etc/udev/rules.d/50-wifi-toogle.rules:

SUBSYSTEM=="rfkill", ATTR{type}=="wlan", RUN+="/path/to/your/script/rfkill.sh"

And my rfkill.sh looks something like this:


#!/bin/bash
if  "${RFKILL_STATE}" == 1 ]; then
        nmcli nm wifi on
else # state is 0 or 2
        nmcli nm wifi off
fi

Nmcli is a command-line tool for controlling NetworkManager and particular command turns on/off wifi networking in NetworkManager according to whetheer the wlan device has been turned on/off. So basically what happens is that I hit the hw wlan swich, the event is caught by udev, udev calls rfkill.sh and rfkill.sh enables wifi networking. The changes immediately appear in NetworkManager Plasmoids and the process of connecting to wifi continues as it should.

This doesn’t fix the first problem, however now when I wake up from suspend, I just hit the hw switch twice and I’m connected in a few seconds.

Funny is that after several hours of hacking I’m where I was yesterday before upgrading to 11.4 :slight_smile: OpenSUSE rocks!

Happy to hear of your solution. I just know that the detail you posted here can also help others with openSUSE 11.4.

Thank You,

What you have posted is very useful as I’ve been using wicd for controlling my network and wifi settings. But since development on wicd seems to have stalled and hasn’t been packaged for 11.4 yet I’ll need to use NM when I upgrade to 11.4.

Can you not apply a similar technique to the wake from suspend or hibernate? Find the wake event and then add a rule to start the wifi. I did something similar for my mouse pointer which for some reason always lost it’s speed and sensitivity settings after waking from hibernating so I just added the two settings to a rule after the wake event was detected.

Well, the problem is that the wlan device is not working after waking up… no matter what I do. As I wrote before, even brutal restarting /etc/init.d/network restart doesn’t do anything, NM is just not able to connect. I could for example try to reload the wlan driver, but I suppose it is what hibernating/weaking does so I don’t think it would lead anywhere. So only solution I found is to ‘restart’ the wifi device manually using hardware switch on my laptop. After that the device is ready and I all I need to do is to notify NM to start connecting. And that’s what I’m describing in my post.