# [solved] Atheros AR9287 Won't Find Wireless Networks

## xxBartonxx

Hello all,

I'm a bit of a Gentoo noob, although I've been using Ubuntu for quite a while and use some SUSE systems at work. Anyway, I've been pulling my hair out for days trying to figure out why my wireless won't work on my laptop in Gentoo. I've followed every wiki and guide by Gentoo on the matter, and not a single forum search has found a fix. I've tried using both wicd and NetworkManger; no luck with either. The Network Manager applet doesn't even show wireless as an option (on the drop-down menu), and wicd simply says "No wireless networks found."

I have installed the ath9k drivers, configured (from what I can tell) all of the correct kernel components, installed wpa_supplicant, and dhcpcd.

I know that my hardware is detected, because ifconfig gives me

```

wlan0     Link encap:Ethernet  HWaddr 78:dd:08:c4:88:49  

             UP BROADCAST MULTICAST  MTU:1500  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000 

             RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

```

I'm not posting my kernel config in this post, but I have configured the ath9k wireless as a module, have set wireless extensions, and pretty much anything else that would be covered in your standard guide for these things. I'm running kernel version 3.2.1-r2, and this was a stage three install. My wireless card has worked with Ubuntu no problem for years, and I've booted both Backtrack 3 & 4, and both worked with my wireless as well (although I recognize BT4 is just a modified version of Ubuntu). I really can't find what the problem is. I followed the install docs verbatim, and have looked at the Module Networking section as well, all with no luck. Also, I know that the problem isn't that my wireless modules aren't getting loaded-- lsmod shows them. This one has really been stumping me.

All help/advice/conjecture/(constructive) insults-at-my-noobness are appreciated!Last edited by xxBartonxx on Tue Jul 03, 2012 10:08 pm; edited 1 time in total

----------

## DONAHUE

ifconfig should show results of dhcpcd running like 

```
inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
```

which yours does not, run

```
dhcpcd
```

 which should produce something like *Quote:*   

> dhcpcd[5823]: version 5.2.12 starting
> 
> dhcpcd[5823]: dummy0: broadcasting for a lease
> 
> dhcpcd[5823]: wlan0: broadcasting for a lease
> ...

 Does it?

----------

## xxBartonxx

Unfortunately, no. It did appear that it wasn't starting automatically, but manually starting it did not produce the desired results.

```
dhcpcd[4568]: version 5.2.12 starting

dhcpcd[4568]: no interfaces have a carrier

dhcpcd[4568]: forked to background, child pid 4969 
```

After that, I tried

```
ifconfig wlan0 up
```

 and still nothing. iwconfig returns "no wireless extensions" for each device. Network Manager still doesn't list wireless as an option, and wicd still says "No wireless networks found."

Thanks for the help. Any other suggestions?

----------

## cach0rr0

first, does the device exist? 

```

cat /proc/net/dev

```

if not, check for not just ATH9K but also ATH9K_PCI in your kernel

if you have both, once you modprobe ath9k, you should see it in /proc/net/dev

only *after* you have run wpa_supplicant by hand (leave it running, dont CTRL+C it), can you do dhcpcd. If you CTRL+C it you will no longer be associated/authenticated to the wireless AP.

----------

## xxBartonxx

Thanks for your reply,

Using "cat /proc/net/dev" does show wlan0 as an interface (since my laptop isn't currently connected to any networks all of the fields are zeros). I currently have ATH9K_PCI built in instead of being a module. Should that change?

I've tried getting wpa_supplicant to run by hand, but have had no luck. I might not be using the proper commands, though. Either way, from what I've read on other boards wicd is supposed to take control of dhcpcd, wpa_supplicant, and all of your net.* interfaces for you.

This has been the one thing stalling my migration from Ubuntu to Gentoo. I need wireless to work!

Thanks again for the help.

Edit: typo

----------

## cach0rr0

 *xxBartonxx wrote:*   

> 
> 
> Using "cat /proc/net/dev" does show wlan0 as an interface (since my laptop isn't currently connected to any networks all of the fields are zeros). I currently have ATH9K_PCI built in instead of being a module. Should that change?

 

ATH9K_PCI is only Y/N if i recall, no module option. But yeah, sounds like your driver is good to go

 *xxBartonxx wrote:*   

> 
> 
> I've tried getting wpa_supplicant to run by hand, but have had no luck. I might not be using the proper commands, though. 
> 
> 

 

try:

```

wpa_supplicant -Dnl80211 -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

```

or

```

wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

```

that assumes youve set up a wpa_supplicant.conf - 'man wpa_supplicant.conf' has a good bit of info on how to set one up. The one below will work as a template (less is more, as far as wpa_supplicant.conf goes)

```

network={

ssid="networkname"

scan_ssid=0

key_mgmt=WPA-PSK

psk="networkpassword"

}

```

any errors you hit, please post. 

If you get an error about being unable to set wlan0 to 'up', do this, which should error, and post the output of dmesg

```

rmmod ath9k

modprobe -v ath9k

dmesg |tail -n30

```

 *xxBartonxx wrote:*   

> 
> 
> Either way, from what I've read on other boards wicd is supposed to take control of dhcpcd, wpa_supplicant, and all of your net.* interfaces for you.
> 
> 

 

it does. rather, wicd does take all of that over. These bits with manually launching wpa_supplicant and dhcpcd are purely troubleshooting steps - in fact wicd does not use the wpa_supplicant.conf, rather, it generates its own .conf 

 *xxBartonxx wrote:*   

> 
> 
> This has been the one thing stalling my migration from Ubuntu to Gentoo. I need wireless to work!
> 
> Thanks again for the help.
> ...

 

should be able to get it sorted. You are fortunate to have an Atheros rig, as they are hands down the most pain-free of the linux wireless chipsets. Current pain excluded of course!

----------

## DONAHUE

 *Quote:*   

> [*]     Atheros ath9k PCI/PCIe bus support (NEW)

 has to show as built in. Check for *Quote:*   

> [*] Networking support  --->
> 
> -*-   Wireless  ---> 
> 
> --- Wireless                                                                   
> ...

 and *Quote:*   

> Device Drivers  --->
> 
> [*] Network device support  --->
> 
> [*]   Wireless LAN  --->
> ...

 

run 

```
lspci -k
```

and verify ath9k is listed as Kernel modules and Drivers in use as in: *Quote:*   

> Network controller: Atheros Communications Inc. AR9287 Wireless Network Adapter (rev 01) 
> 
>    Subsystem: Foxconn International, Inc. Device e034 
> 
>    Flags: bus master, fast devsel, latency 0, IRQ 19 
> ...

 (emerge pciutils in chroot if you do not have it already but run lspci -k in booted gentoo)

----------

## erzapito

I've got the same issue with an AR99227, I've checked all points made and still the problem persists. Kernel version is 3.2.12 and the strange thing is that I got a working USB realtek wifi.

----------

## cach0rr0

 *erzapito wrote:*   

> I've got the same issue with an AR99227, I've checked all points made and still the problem persists. Kernel version is 3.2.12 and the strange thing is that I got a working USB realtek wifi.

 

cant suggest heaps without seeing any diagnostic data 

I posted some bits to try above, in order; try those, at whichever step fails, post output (e.g. post your dmesg after doing a rmmod and modprobe, post output of wpa_supplicant if you get that far)

----------

## erzapito

I got wpa_supplicant working with the realtek USB, but with the atheros (and -dd flags) it keeps looking for APs constantly.

By the way, if I run:

```
 iwlist wlan0 scanning 
```

I doesn't show any network with the Atheros card, but the realtek USB does shows them.

----------

## cach0rr0

 *erzapito wrote:*   

> I got wpa_supplicant working with the realtek USB, but with the atheros (and -dd flags) it keeps looking for APs constantly.
> 
> By the way, if I run:
> 
> ```
> ...

 

should be

```

iw dev wlan0 scan

```

you  may need to emerge net-wireless/iw

i would make sure you have the realtek module rmmod'd before you do this with the ath9k card; and vice versa for testing the realtek card

in addition to the specific output from wpa_supplicant when running from the CLI, id be interested to see dmesg output

----------

## erzapito

I got the same results with iw.

Here are the logs for the Atheros (modprobe, wpa_supplicant):

http://pastebin.com/VNv3kDMR

and for the realtek (just for comparison):

http://pastebin.com/NZwCjzWu

----------

## Gusar

Instead of playing with that old kernel, I suggest either trying a newer kernel (3.3, 3.4) or wireless-compat.

----------

## erzapito

I'll try, but that's the current stable kernel and 3.4 has just been added to the tree. By the way, what's the wireless-compat?

----------

## Gusar

 *erzapito wrote:*   

> By the way, what's the wireless-compat?

 

It's a tarball with the latest wireless drivers, compilable against arbitrary kernels. It allows you to keep your current kernel, but get the latest wireless drivers.

I know 3.2.12 is the current "stable" in portage, but it's old. Even in the 3.2 series, 3.2.18 is the latest. And I recall from Arch forums that the ath9k driver had issues some time back, that's why my advice to try newer kernels. You could also try passing nohwcrypt=1 to the ath9k module.

----------

## erzapito

I've tried kernel 3.4 and it keeps the same. I've trying to set the country code but I don't know how.

The funny thing is the wireless card works with an Ubuntu live.

----------

## xxBartonxx

Hope I'm not bumping too soon   :Very Happy: 

I've been very busy with work and school, so today was my first day to sit down and mess with Gentoo again. Here's what we've got:

@cach0rr0 The first wpa_supplicant command you gave me (using -Dn180211) did not output any error. The second did; it gave me "Operation not supported" quite a few times, then "Failed to initiate AP scan". I ran the rmmod code while the first wpa_supplicant command was still active in another terminal; after doing so, wpa_supplicant started throwing the same errors. The output of my dmesg is here:

```
Deckard barton # dmesg | tail -n30

[ 2368.864899] eth0: no IPv6 routers present

[ 2369.115670] sky2 0000:04:00.0: eth0: Link is up at 100 Mbps, full duplex, flow control both

[ 2371.005284] sky2 0000:04:00.0: eth0: Link is down

[ 2372.768987] sky2 0000:04:00.0: eth0: Link is up at 100 Mbps, full duplex, flow control both

[ 2460.516978] ADDRCONF(NETDEV_UP): wlan0: link is not ready

[ 2460.566303] sky2 0000:04:00.0: eth0: disabling interface

[ 2460.572341] sky2 0000:04:00.0: eth0: enabling interface

[ 2460.572891] ADDRCONF(NETDEV_UP): eth0: link is not ready

[ 2460.583163] sky2 0000:04:00.0: eth0: disabling interface

[ 2460.593418] sky2 0000:04:00.0: eth0: enabling interface

[ 2460.594228] ADDRCONF(NETDEV_UP): eth0: link is not ready

[ 2462.423045] sky2 0000:04:00.0: eth0: Link is up at 100 Mbps, full duplex, flow control both

[ 2462.424246] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

[ 2473.244771] eth0: no IPv6 routers present

[ 3710.349583] ADDRCONF(NETDEV_UP): wlan0: link is not ready

[ 3739.133734] ADDRCONF(NETDEV_UP): wlan0: link is not ready

[ 3773.109312] ADDRCONF(NETDEV_UP): wlan0: link is not ready

[ 3809.806294] ath9k 0000:02:00.0: PCI INT A disabled

[ 3809.806309] ath9k: Driver unloaded

[ 3816.477450] ath9k 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

[ 3816.477471] ath9k 0000:02:00.0: setting latency timer to 64

[ 3816.567105] ath: EEPROM regdomain: 0x65

[ 3816.567107] ath: EEPROM indicates we should expect a direct regpair map

[ 3816.567109] ath: Country alpha2 being used: 00

[ 3816.567110] ath: Regpair used: 0x65

[ 3816.568398] ieee80211 phy1: Selected rate control algorithm 'ath9k_rate_control'

[ 3816.569002] Registered led device: ath9k-phy1

[ 3816.569009] ieee80211 phy1: Atheros AR9287 Rev:2 mem=0xffffc900059e0000, irq=16

[ 3816.585936] CE: hpet increased min_delta_ns to 20113 nsec

[ 3816.587033] ADDRCONF(NETDEV_UP): wlan0: link is not ready

```

Here is the good news (yes there is some!):

```
iwdev wlan0 scan
```

does work! It gave me a list of APs near me. But... I still don't know where to go from here.    :Confused: 

@DONAHUE I checked my kernel with what you posted and everything is good. At this point I'm pretty sure my kernel config is not what's stopping it from working.

Thanks again for the replies! I hope we can get this figured out for me and erzapito.

----------

## xxBartonxx

bump? I feel like I'm really close to getting this since I can now print out accurate APs. I just need to get wicd working as well.

----------

## wikol

I had just the same problem as you. Apparently,

```
wpa_supplicant -Dnl80211 -iwlan0 -cconf
```

solved it.

Also, I had to run 

```
ifconfig wlan0 up
```

 before.

----------

## xxBartonxx

Well, I finally got it. I'm only replying to this thread in case anyone has a similar issue in the future. I ended up doing a fresh install (for multiple reasons), so I now know exactly what it took to get it working. I'm going to put my steps below. More or less all of these can easily be found using the wireless docs on the official Gentoo page as well as the wicd page, but since it gave me months of grief I'm going to list the steps I performed, in order, from a fresh install.

Steps to get wireless working with Atheros AR9287 w/ wicd:

1. Build appropriate modules in the kernel (ath, ath9k, ath9k_hw, ath9k_common).

2. Ensure the modules load at boot by adding them to /etc/conf.d/modules

3. emerge dhcpcd

3. emerge wicd

4. If you've previously added wpa_supplicant, dhcpcd, or any net.* connection to the default run level, you should remove them since wicd takes care of these  (with the obvious exception of net.lo), then add wicd.

5. emerge wpa_supplicant

6. Set up basic wpa_supplicant.conf in /etc/wpa_supplicant/. (I used the one previously suggested by cach0rr0)

7. Tell wicd about your wireless card under Preferences->General Settings-> Network Interfaces-> Wireless Interface.

8. Reboot

Note: this assumes that you have the other correct basic wireless kernel functions built in. All of these were automatically enabled for me in my kernel config, using the default/linux/amd64/10.0/desktop/gnome profile on kernel 3.3.8.

I would imagine you could change the order of getting wicd/wpa_supplicant, but since I had so much trouble I'm just posting the exact steps I took.

Assuming you followed all of these steps, you will need to reboot before wicd will start listing APs. I can see how anyone who has done this in the past would think this post is unnecessary since it mostly just follows the steps suggested in the Gentoo guide, but two months ago I could have used such a straightforward guide.

----------

## erzapito

In my case I discovered that the card can detect WIFI networks with a lower channel (like 7). I think this may be an issue with country configuration, but I can't find a way to change it.

----------

