How to solve wifi connection problems between Arch Linux and a WPA2 network

networkmanagerwicdwifi

My home network uses WPA2 for encryption. To connect to it from my Arch Linux insallation, I first tried using NetworkManager, however, that only managed to connect for a minute at most before dropping the connection.

I replaced it with wicd, which worked satisfactorily until somewhat recently. Since then, if it fails to establish the connection at startup, or if it loses connection, it will be unable to establish a connection. Attempting to reconnect with the GUI slows the system down so much that I have to switch from X to a tty and kill the process. The curses interface is unable to establish a connection in these circumstances, but doesn't impair system performance.

Restarting the daemon is not enough to fix it from the bugged state. I need to power the system off and on again.

The windows installation on the same laptop does suffer some intermittent connectivity problems (it's a crappy ISP router powering the network), but recovers from them, only requiring reconnecting to the network. Prior to using Arch Linux, I used to use Ubuntu as the Linux distro on the laptop, and that had the same results as Windows.

What could be causing this problem (which I suspect may be related to the earlier NetworkManager problem), and how can I resolve it?

For what it's worth, my wireless network card is a broadcom BCM4312, and it is using the b43 drivers.

EDIT: Attempting to run wpa_supplicant while wicd is unable to connect produces this output:

ioctl[SIOCSIWSCAN]: Device or resource busy
Failed to initiate AP scan.
ioctl[SIOCSIWSCAN]: Device or resource busy
Failed to initiate AP scan.
No network configuration found for the current AP
CTRL-EVENT-DISCONNECTED bssid=00:00:00:00:00:00 reason=0
ioctl[SIOCSIWSCAN]: Device or resource busy
Failed to initiate AP scan.

Further edit: The problem is significantly more likely to occur when the system is running on battery power, but can still occur while it is plugged in.

EDIT 3: This is almost certainly related to power saving options. Paying more attention, this always occurs when either the system is running on battery power, when it has been left alone for a significant period of time, or when the lid is closed.

Best Answer

You can start by running wpa_supplicant manually without the -B option: it will stay in the foreground and show you what's happening. The Arch wiki has a good section on wpa_supplicant

Related Question