# Troubleshooting wireless

## parsim

Sometimes my wireless just won't come up. It's always been a bit dodgy, working most times but not always, but suddenly it won't work at all. This is a big problem and I've spent the last two days fruitlessly trying to debug it.

This is the process I'm going through. First, I look at my card:

```
# iwconfig wlan0

wlan0      IEEE 802.11g  ESSID:off/any

           Mode:Managed  Frequency:2.412  Cell: 00:00:00:00:00:00

           Bit Rate:54 Mb/s   Tx-Power:10 dBm  Sensitivity:0/3

           RTS thr:2347 B   Fragment thr:2312 B

           Encryption: key:off

           Power Management:off

           Link Quality:100  Signal level:0  Noise level:0

           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

           Tx excessive retries:0  Invalid misc:0  Missed beacon:0
```

Then I verify that it can see my access point:

```
# iwlist wlan0 scanning

wlan0    Scan completed :

         Cell 01 - Address: 00:0F:B5:50:1C:D2

                   ESSID:"airmax"

                   Protocol:IEEE 802.11b

                   Mode:Managed

                   Frequency:2.462 GHz (Channel 11)

                   Quality:0/100  Signal level:-33 dBm  Noise level:-256dBm

                   Encryption key:on

                   Bit Rate:1 Mb/s

                   Bit Rate:2 Mb/s

                   Bit Rate:5.5 Mb/s

                   Bit Rate:11 Mb/s

                   Bit Rate:6 Mb/s

                   Bit Rate:9 Mb/s

                   Bit Rate:12 Mb/s

                   Bit Rate:18 Mb/s

                   Bit Rate:24 Mb/s

                   Bit Rate:36 Mb/s

                   Bit Rate:48 Mb/s

                   Bit Rate:54 Mb/s

                   Extra:bcn_int=100

                   Extra:atim=0
```

This is the correct ESSID of my Netgear wireless router, its internet port MAC address, and the right channel. The only strange thing is that the router says it's running both g and b protocols, but the card sees only b. I have tried forcibly setting the router to g protocol only, but the PC still scans a b.

So, let's bring it up!

```
# /etc/init.d/net.wlan0 start

* Starting wlan0

*    Configuring wireless network for wlan0

*    wlan0 does not support setting keys

*    or the parameter "mac_key_airmax" or "key_airmax" is incorrect

*    Failed to configure wireless for wlan0                                 [!!]
```

However, I know "key_airmax" is correct, because it's worked before, and I've checked it carefully.

Having the card scan again now suddenly detects a second, "phantom" AP:

```
# iwlist wlan0 scanning

wlan0    Scan completed :

         Cell 01 - Address: 00:0F:B5:50:1C:D2

                   ESSID:"airmax"

                   ... snip (same as above) ...

         Cell 02 - Address: 00:7E:0A:7E:41:31

                   ESSID:""

                   Protocol:IEEE 802.11b

                   Mode:Ad-Hoc

                   Frequency:2.462 GHz (Channel 1)

                   Quality:0  Signal level:0  Noise level:0

                   Encryption key:off

                   Bit Rate:1 Mb/s

                   Bit Rate:2 Mb/s

                   Bit Rate:5.5 Mb/s

                   Bit Rate:11 Mb/s

                   Bit Rate:6 Mb/s

                   Bit Rate:9 Mb/s

                   Bit Rate:12 Mb/s

                   Bit Rate:18 Mb/s

                   Bit Rate:24 Mb/s

                   Bit Rate:36 Mb/s

                   Bit Rate:48 Mb/s

                   Bit Rate:54 Mb/s

                   Extra:bcn_int=200

                   Extra:atim=0
```

The address is nothing I recognize.  It belongs to neither the router nor the three other computers on this network.

And iwconfig reports the card has its ESSID set to blank and its mode to Ad-Hoc.

```
# iwconfig wlan0

wlan0      IEEE 802.11g  ESSID:""

           Mode:Ad-Hoc  Frequency:2.412  Cell: 00:00:00:00:00:00

           Bit Rate:54 Mb/s   Tx-Power:10 dBm  Sensitivity:0/3

           RTS thr:2347 B   Fragment thr:2312 B

           Encryption: key:off

           Power Management:off

           Link Quality:100  Signal level:0  Noise level:0

           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

           Tx excessive retries:0  Invalid misc:0  Missed beacon:0
```

My /etc/conf.d/wireles, sans comments, and with part of the key obscured:

```
essid_wlan0="airmax"

key_airmax="8065-4513-21d1-xxxx-xxxx-xxxx-24"

preferred_aps=( "airmax" )
```

Heeeeeelp! If anyone knows what I can do to debug further, I'd be very grateful.

----------

## parsim

I tried removing WEP, to see if I could get a connection up without encryption. Instead I got this:

```
# /etc/init.d/net.wlan0 start

* Starting wlan0

*    Configuring wireless network for wlan0

*    wlan0 does not support setting ESSID to "airmax"

*    Failed to configure wireless for wlan0                                 [!!]
```

 :Exclamation:   :Question:  That's crazy; I can set "iwconfig wlan0 essid airmax" from the command line just fine!

----------

## UberLord

What chipset/driver is your wireless card?

----------

## parsim

It's a Netgear WG311v2 PCI card: it has the Texas Instruments ACX100/111 chipset and runs with ndiswrapper.

----------

## UberLord

Why don't you try the native acx100 driver?

----------

## parsim

I will, thanks. I think I originally avoided acx100 because it couldn't do WEP with the g protocol, and I didn't want to run an unsecure network. But b seemed adequate for my needs, so I'll give acx100 a go and report back.

----------

## parsim

Hmm, okay, after much frigging around, I have the card running with the acx_pci module, but WEP won't work. Earlier I thought WEP worked with this module if you ran it in 802.11b mode, as opposed to 802.11g, but now I see that's wrong -- apparently WEP just doesn't work at all with acx111 wireless cards.

Now I'm confused -- why anyone would run a wireless network with no security? I'm not prepared to run a network that vulnerable. The link quality and signal level also seem to be much worse now than they were under ndiswrapper.  :Sad: 

Any ideas? I'm getting a hernia from carrying this box upstairs to plug it into a monitor and keyboard all the time!

----------

## parsim

Anyone?

I'd love to know what steps I should follow to troubleshoot. Usually when things go wrong with my Gentoo box, I get reams of messages in the system log, which I can use to narrow down the problem. But this gives me nothing... just:

```
* Starting wlan0

*    Configuring wireless network for wlan0

*    Failed to configure wireless for wlan0                                 [!!]
```

----------

## UberLord

set RC_VERBOSE=yes in /etc/conf.d/rc - it should give you more information then

----------

## parsim

Aha, thanks. Okay, this is what happens now:

```
# modprobe ndiswrapper

# dmesg -c

ndiswrapper version 0.12 loaded (preempt=yes,smp=no)

ACPI: PCI interrupt 0000:02:00.0[A] -> GSI 11 (level, low) -> IRQ 11

ndiswrapper: using irq 11

wlan0: ndiswrapper ethernet device 00:09:5b:ba:f1:af using driver wg311v2

wlan0: encryption modes supported: WEP, WPA with TKIP

ndiswrapper: driver wg311v2 (NETGEAR, Inc.,04/04/2004,6.0.2.23) added

# /etc/init.d/net.wlan0 start

* Starting wlan0

*    Loading networking modules for wlan0

*       modules: iwconfig essidnet iptunnel ifconfig dhcpcd apipa

*          iwconfig provides wireless

*          ifconfig provides interface

*          dhcpcd provides dhcp

*    Configuring wireless network for wlan0

*    Connecting to "airmax2" (WEP disabled) ...

*    Failed to configure wireless for wlan0                                 [!!]
```

Alas, I am none the wiser.  :Sad: 

----------

## IamtheOne

The "Phantom Access Point" could be your wireless card itself...  Check the MAC addresses.

----------

## Adrien

Have a related qustion as I'm using the same card at the moment, is there anyway to set it on "monitor mode" 'cause I read it's quite hard..anyone knows?

----------

## parsim

 *IamtheOne wrote:*   

> The "Phantom Access Point" could be your wireless card itself...  Check the MAC addresses.

 

Good guess, but it's not. It's very weird: if I keep scanning, the address keeps changing. Specifically, it seems to be ticking up through addresses. One second it'll scan 00:7E:0A:7E:41:41, the next it'll say it's 00:7E:0A:7E:41:42. And so on. 

Right now the only AP the card says it can find is 00:85:69:85:41:5A (ticking upwards), which allegedly has a frequency of 5.26 GHz -- that's right, that's a 5.  :Shocked: 

----------

## parsim

No takers?  :Smile: 

----------

## Jengu

Have you tried with a different comp and card? Maybe that phantom AP is something that just came into your area causing hella interference.

----------

## parsim

I don't think that can be it, because the card has no trouble connecting to the AP under the acx100 driver. However, acx100 doesn't allow WEP with my card, so it's an unsecured network. Under ndiswrapper I can use WEP, but I'm suddenly getting this very weird behavior and am unable to connect.

My real issue here is I don't know how to troubleshoot -- that is, take tiny little steps along the process until something goes wrong, thus allowing me to pinpoint the problem. Instead I have this /etc/init.d/net.wlan0 script that fails without telling me anything much about what went wrong. Are there things I could try from the command line?

----------

## parsim

 *parsim wrote:*   

> My real issue here is I don't know how to troubleshoot -- that is, take tiny little steps along the process until something goes wrong, thus allowing me to pinpoint the problem. Instead I have this /etc/init.d/net.wlan0 script that fails without telling me anything much about what went wrong. Are there things I could try from the command line?

 

9 months on and I'm still having grief. The network works perfectly most of the time, but sometimes it just goes down and won't come back up. Sometimes it goes down and comes back a few minutes later. Sometimes it won't come up at all. Sometimes it will only come back if I reboot the router (!).

I've gone from ndiswrapper to acx100 and back again. I've tried it with WEP, without WEP, and with a heap of different versions of everything. I've tried so many things over the last 9 months and I'm going insane. It's incredibly painful to diagnose because the box is keyboardless: it NEEDS that network.

Can someone please give me some things to try to help nail down the source of the problem? I have no idea if it's a router problem or a card problem or an interference problem or a configuration problem or...

----------

## PipesDownUK

I found this thread while searching for fixes for my own problems with a Netgear WG311v2. I was looking for 'wlan0 does not support setting keys' which is the message I am getting. The Gentoo forums search did not find it, Google did, both links on these forums. 

Anyway back to the point, somewhere above it was said that the acx100 drivers do not support WEP. It looks to me (I will find out for real tomorrow when I try) that these drivers got WEP support in the middle of 2005.

 *Quote:*   

> I'm going to repeat that again: WEP for acx111 devices (lspci -n = 104c:9066) is supported only in version: 0.2.0pre8_plus_fixes_57 or later

 

which is information from here Craig's ACX100/111 Guide for Linux . Unfortunately the home site (or is it here ?) does not have much information on the drivers features. If it is not too late, perhaps Parsim could try the acx111 drivers again.

----------

## parsim

Thanks for the reply. 

When 0.3 of acx100 came out I tried that and--gasp--it worked perfectly. It's been up for a couple of months now. I don't know what the hell the problem was with all the 0.2 versions I tried, but 0.3 fixed it.

----------

