I've got a Debian 7 machine with Linux3.2 kernel and a USB wifi adapter with Atheros chipset (D-Link DWA-16 Xtreme N Dual Band), which in theory should work. Indeed, I managed to establish a wifi communication with NetworkManager and it worked more or less fine for ~30 minutes, but then disconnected and failed to reestablish the connection.I failed to reestablish the connection with NetworkManager, it successfully associates and authenticates, starts 4-way handshake, but then deauthenticates due to reason 15 (4-way handshake timeout).Then I tried to do the same via the good old ifupdown by creating an entry in /etc/network/interfaces:allow-hotplug wlan1iface wlan1 inet static       wpa-ssid MyNet       wpa-psk <My key hash generated by `wpa_passphrase MyNet key`>       address 192.168.1.2       netmask 255.255.255.0       broadcast 192.168.1.255       gateway 192.168.1.1       dns-nameservers a.b.c.dWhen I sudo ifup wlan1, it behaves reasonably,  until:wpa_supplicant[8258]: wlan1: Associated with <router's MAC>wpa_supplicant[3402]: wlan1: No network configuration found for the current AP(from  /var/log/syslog). Wireshark sees ARP packages going from my wifi adapter to the router, but the router doesn't reply.Do you have any ideas about what could that mean and how to troubleshoot this?SOLUTION:Thanks to suggestion by peterph, I tried to create wpa_supplicant.conf and run wpa_supplicant as a standalone program both in foreground and background and then used wpa-conf wpa_supplicant.conf in /etc/network/interfaces.sudo wpa_supplicant -iwlan1 -c/etc/wpa_supplicant/wpa_supplicant.conf -dsudo wpa_supplicant -iwlan1 -c/etc/wpa_supplicant/wpa_supplicant.conf -BI had the first part of troubles (with spontaneous disconnect after status: associated) disappear, when I killed a running instance of NetworkManager. It seems to have interfered.Second part of trouble was with the 4-way handshake failing. It passed ok, when I disabled MAC address filtration on the Access Point. My wifi interface's MAC was in the list of available MACs, but for some reason it still was failing to connect with MAC filtering on the router.UPDATE 2: The problems are back. 4-way handshake is failing again. Reload of the driver won't help.
wpa supplicant: No network configuration found for current AP - carl9170-driven wifi adapter glitching on Debian 7
debian;networking;wifi;wpa supplicant
This kind of problem is better divided into independent parts. In this case, circumventing ifupdown completely and doing all the steps manually - that is:run wpa_supplicant with an appropriate config fileonce connection is established, running dhcp client, To check how ifupdown runs wpa_supplicant - it has to pass it some sort of configuration in a file, that you could intercept - check the output of ps fax | grep wpa_supplicant when ifupdown is running - the parameter of the -c option is the name of the (probably on-the-fly generated) configuration file.If you decided to switch from ifupdown for some reason, you might be interested in wicd, which consists of a daemon controlled by various UIs (ncurses, GTK, Qt).By the way, some DHCP clients are able to set up the wireless connection by spawning wpa_supplicant on their own (I have seen dhcpcd doing that) - which can be quite intriguing (and interfering) when one tries to debug connection problems.