# Wireless problems with DWA-140

## mungo_k

Details:

Access point: 80211b/g wpa2-psk aes

/etc/conf.d/net:

```

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

wpa_timeout_wlan0=30

config_ESSID=("MyMudem")

config_wlan0=("192.168.14.8 netmask 255.255.255.0")

routes_wlan0=("default via 192.168.14.1")

```

/etc/wpa_supplicant/wpa_supplicant.conf:

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

update_config=1

country=BY

network={

   ssid="MyAP"

   scan_ssid=1

   psk="secret"

   proto=RSN

   key_mgmt=WPA-PSK

   pairwise=CCMP

   priority=10

}

```

iwconfig:

```

wlan0     IEEE 802.11bgn  ESSID:"MyAP"

          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:24:01:8A:91:DF

          Bit Rate=1 Mb/s   Tx-Power=20 dBm

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:on

          Link Quality=70/70  Signal level=-177 dBm

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

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

```

D-Link DWA-140 based on rt2870. There is driver in current kernel, we need only the firmware (i took it from ralink site) in /lib/firmware. Well, udev loads driver, card is visible.

The problem: dmesg: - No probe response from AP xxx after 500ms, disconnecting.

Sometimes LED on wi-fi lights, sometimes not. And reconnect infinite. Sometimes it stops, but nothing work. LED is off. WPA_GUI says "associated".

The wifi module good. It was tested with same AP on windows - it works fine.

Any suggestions?

----------

## DONAHUE

don't use the rt2x00 driver

use the driver in staging instead

 *Quote:*   

> Device Drivers  --->
> 
> [*] Network device support  ---> 
> 
> [*]  Wireless LAN (IEEE 802.11)  --->
> ...

 

----------

## mungo_k

Well, now it works... some sort. AP associated (checked in AP). But TX always 1-2 KiB, and no more. RX always receiving something.

I tried driver from manufacturer with same result. What should i check now?

----------

## DONAHUE

Recommend: remove any rt2870 firmware from /lib/firmware then recompile the kernel using the staging driver and try the following in /etc/conf.d/net

 *Quote:*   

> modules_wlan0=( "wpa_supplicant" )
> 
> wpa_supplicant_wlan0="-Dwext"
> 
> wpa_timeout_wlan0=15
> ...

 #leave out config_essid.

in /etc/wpa_supplicant/wpa_supplicant.conf: *Quote:*   

> ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
> 
> update_config=1
> 
> ap_scan=1

 leave out:  *Quote:*   

> country=BY 
> 
> network={ 
> 
>    ssid="MyAP" 
> ...

 

```
/etc/init.d/net.wlan0 restart
```

run wpa_gui from applications menu or a terminal to scan for, configure, and connect your network. when connected save the configuration

if still troubled, rerun and post the results of: 

```
ifconfig -a

iwconfig

iwlist scan
```

----------

## mungo_k

Without

 *Quote:*   

> 
> 
> country=BY
> 
> network={
> ...

 

wpa_supplicant doesn't run. It says 'cannot connect to AP'. Therefore GUI not work. Moreover, staging driver want AP named 'Zyxel' (with this config). I don't know from where it took...

----------

## DONAHUE

run wpa_gui from applications menu or a terminal to scan for, configure, and connect your network. when connected save the configuration

if you use gnome desktop it appears under internet as "WPA Supplicant Administration GUI"

in a terminal in desktop 

```
wpa_gui
```

does iwconfig still show wlan0 interface?

does iwlist scan show zyxel as a possible access point? zyxel is a router maker with a presence in belarus. their default ssid may be zyxel.

does iwlist scan show your ap?

if the steps above go nowhere or if you need to communicate add  *Quote:*   

> country=BY 
> 
> network={ 
> 
> ssid="MyAP"  
> ...

 

to wpa_supplicant and then run wpa_gui ....

----------

## mungo_k

I know what is wpa_gui. I know how it looks, what it and so far.

iwlist doesn't show anything. iwconfig show wlan0. zyxel cannot be shown because there is no zyxel modems/routers at all.

Well, there is another question. Stagin driver wants some file in /etc/Wireless. Something like rt3070.dat. Where i should take it?

And look at my 1st post. AP uses AES encription. wpa_supplicant not using encription. Maybe it is a problem? How to set encription?

----------

## DONAHUE

 *Quote:*   

> I know what is wpa_gui. I know how it looks, what it and so far.

  Excellent.

 *Quote:*   

> iwlist doesn't show anything.

 

```
iwlist scan
```

iwlist scan shows nothing? I did write just iwlist first which was wrong (does nothing).

```
iwconfig shows wlan0.
```

Good.

 *Quote:*   

> zyxel cannot be shown because there is no zyxel modems/routers at all.

 A neighbor may be in range with a zyxel router. 

 *Quote:*   

> Well, there is another question. Staging driver wants some file in /etc/Wireless. Something like rt3070.dat. 

 That is a file and location used by the manufacturer provided driver. I think the staging driver is supposed to use /etc/Wireless.prop as the location. 

 *Quote:*   

> Where i should take it?

  

```
rm -rf /etc/Wireless

rm -rf /etc/Wireless.prop
```

 and recompile the kernel for the staging driver

 *Quote:*   

> And look at my 1st post. AP uses AES encription. wpa_supplicant not using encription. Maybe it is a problem? How to set encription?

  Want you to set and save this in wpa_gui if we can get it running.

What kernel are you using?

----------

## mungo_k

Well, zyxel not in range. I scanned with my phone.

/etc/Wireless don't exists. Therefore driver wants exactly that file in that location.

My system is updated a week ago with emerge --sync && emerge -vuD world. So al packages are current. Kernel 2.6.32.

----------

## DONAHUE

i'm going to be repeating the install on a 2.6.34 kernel. the help notes on 2.6.34 acknowledge that the built-in driver does not work with 11n. I've a clean install with no /etc/Wireless at all. I/ll let you know what files the staging driver puts where without having to depend on memory.

----------

## DONAHUE

Here's the deal: 

My memory was that the staging driver compilation took care of installing firmware. Either that memory was wrong or when the 2870 and 3070 firmware were combined for kernel 2.6.32-? it became necessary to download the firmware oneself. But in any case what you need to do is:

you might consider using kernel 2.6.34 (determined to work last night).

clean up any residuals from previous attempts at builtin, manufacturer, and staging drivers

```
mv /usr/src/linux/.config /usr/src/

cd /usr/src/linux

make clean

make mrproper

mv /usr/src/.config /usr/src/linux/

rm -rf /etc/Wireless
```

recompile the kernel with the staging driver rt2870 as a module.

download Firmware RT28XX/RT30XX USB series (RT2870/RT2770/RT3572/RT3070) , extract and copy rt2870.bin to /lib/firmware.

```
modprobe -r rt2870sta 

modprobe rt2870sta
```

 to reload the module with firmware.

```
/etc/init.d/net.wlan0 restart
```

use wpa_gui to do the scanning, configuring, and saving of your network

----------

## mungo_k

Thank you, DONAHUE!

Shame on me! I didn't stoped eth0 (but cabel was cut-off by my child   :Very Happy:  ). All packets sent to eth0, wlan0 was ignored completly. Stagin driver work fine, all configuration from 1st message right.

----------

## DONAHUE

glad to hear it, I was getting worried. Your 2.6.32 kernel should have been from when staging was loading the firmware. Hope they get the builtin right someday soon.

----------

