# Wifi Card (Ralink)

## vasy

Hy.

Wifi I suck with a card a time of his under Gentoo and I can solve it in no way. I rehearsed everything already. The driver, I put it up, but not the portage, but hand I put it up.

I can be doing with him, so the cordless networks looks it up, but is not willing to join onto him.

In the kernel the wifi* part, understand it device driver->network->wireless lan + there is something on his front wifihez related little stuff, that turned, what I knew I put everything into it. Or I was making a film totally, or what I did not know in this manner, it I put it into a module.

```
iwconfig
```

command, then eth0, lo and ra0 will be from what I inferred it, that ra0 will be the my wifi, but mutual, that let me be able to revive my card,  he needs him the

```
dhclient ra0 
```

, and the card swelled up already in this manner.

```

vasy ~ # iwconfig

eth0 no wireless extensions.

lo no wireless extensions.

ra0 RT61 Wireless ESSID:"" Nickname:""

Mode:Auto Frequency:2.427 GHz Bit Rate=54 Mb/s

RTS thr:off Fragment thr:off

Encryption key:off

Link Quality=97/100 Signal level:-36 dBm Noise level:-111 dBm

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

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

vasy ~ # 
```

Mutual watch him doing nice if I am searching the tiny.

```
vasy ~ # iwlist ra0 scan

ra0 Scan completed :

Cell 01 - Address: 00:18:39:23:47:2C

Mode:Managed

ESSID:"linksys"

Channel:4

Encryption key:on

Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s

9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

48 Mb/s; 54 Mb/s

Quality:91/100 Signal level:-48 dBm Noise level:-79 dBm

IE: WPA Version 1

Group Cipher : TKIP

Pairwise Ciphers (1) : TKIP

Authentication Suites (1) : PSK

Cell 02 - Address: 00:0E:2E:AF:C1:67

Mode:Managed

ESSID:"default"

Channel:11

Encryption key:on

Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s

9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

48 Mb/s; 54 Mb/s

Quality:85/100 Signal level:-54 dBm Noise level:-79 dBm

Cell 03 - Address: 00:19:5B:BD:00:C1

Mode:Managed

ESSID:"dlink-Vasy"

Channel:4

Encryption key:on

Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

48 Mb/s; 54 Mb/s

Quality:100/100 Signal level:-30 dBm Noise level:-79 dBm

IE: WPA Version 1

Group Cipher : TKIP

Pairwise Ciphers (1) : TKIP

Authentication Suites (1) : PSK

vasy ~ # 
```

From this mine the dlink*-Vasy, I would like to get connected to it.

Mutual if I would be attached, then with this error message crumbles away:

```

vasy ~ # iwconfig ra0 essid "dlink-Vasy"

Error for wireless request "Set ESSID" (8B1A) :

SET failed on device ra0 ; Network is down.

vasy ~ #
```

If the mac I want to join based on a title, then there is nothing problem, like that, as if would join, but there is not internet always yet.

```
vasy ~ # iwconfig ra0 ap 00:18:39:23:47:2C

vasy ~ #
```

So I do not have net now the wifi, only dhcp-n.

What may be his reason? How I should solve it, that let the net be going? The networkmanager and the pynetworkmanager is above. 

From where I watched the stuffs: http://fr.gentoo-wiki.com/HOWTO_Wi-Fi#rt2400.2Frt2500.2Frt2570

```
vasy ~ # dhclient ra0

Internet Systems Consortium DHCP Client V3.1.0-Gentoo

Copyright 2004-2007 Internet Systems Consortium.

All rights reserved.

For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/ra0/00:1b:11:09:04:88

Sending on LPF/ra0/00:1b:11:09:04:88

Sending on Socket/fallback

option_space_encapsulate: option space agent does not exist, but is configured.

DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 3

DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 5

DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 5

DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 6

DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 14

DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 17

DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 10

DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 1

No DHCPOFFERS received.

No working leases in persistent database - sleeping.

vasy ~ # iwlist scan

eth0 Interface doesn't support scanning.

lo Interface doesn't support scanning.

ra0 Scan completed :

Cell 01 - Address: 00:19:5B:BD:00:C1

Mode:Managed

ESSID:"dlink-Vasy"

Channel:4

Encryption key:off

Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

48 Mb/s; 54 Mb/s

Quality:100/100 Signal level:-40 dBm Noise level:-79 dBm

Cell 02 - Address: 00:18:39:23:47:2C

Mode:Managed

ESSID:"linksys"

Channel:4

Encryption key:on

Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s

9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

48 Mb/s; 54 Mb/s

Quality:79/100 Signal level:-60 dBm Noise level:-79 dBm

IE: WPA Version 1

Group Cipher : TKIP

Pairwise Ciphers (1) : TKIP

Authentication Suites (1) : PSK

Cell 03 - Address: 00:0E:2E:AF:C1:67

Mode:Managed

ESSID:"default"

Channel:11

Encryption key:on

Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s

9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

48 Mb/s; 54 Mb/s

Quality:79/100 Signal level:-60 dBm Noise level:-79 dBm

vasy ~ # iwconfig ra0 mode managed essid "dlink-Vasy"

Error for wireless request "Set Mode" (8B06) :

SET failed on device ra0 ; Network is down.

vasy ~ # iwconfig ra0 key off

Error for wireless request "Set Encode" (8B2A) :

SET failed on device ra0 ; Network is down.

vasy ~ # iwconfig ra0 essid "dlink-Vasy"

Error for wireless request "Set ESSID" (8B1A) :

SET failed on device ra0 ; Network is down.

vasy ~ # iwconfig ra0 ap00:19:5B:BD:00:C1

iwconfig: unknown command "ap00:19:5B:BD:00:C1"

vasy ~ # iwconfig ra0 ap 00:19:5B:BD:00:C1

vasy ~ # 
```

The type of the card:

```
05:01.0 Network controller: RaLink RT2561/RT61 rev B 802.11g
```

How I know this to manage to solve that he should be going the net?

----------

## ltboy

Your network is WPA encrypted. wireless-tools(iwconfig,etc...) package doesn't handle this. Use wpa_supplicant.

----------

## ltboy

Oh, and you also need to bring your device up

```

ifconfig ra0 up

```

----------

## vasy

Tried the wpa_supplicant, but it does not see my card.

I tested what you wrote now, but it was not good.

```

vasy ~ # ifconfig ra0 up 

vasy ~ # iwconfig ra0 essid adlink-Vasy 

Error for wireless request "Set ESSID" (8B1A) :

    SET failed on device ra0 ; Network is down.

vasy ~ # 
```

----------

## ltboy

Hmmm... just a thought, but does your computer have a hardware on/off switch or button for wireless?

----------

## vasy

Is not button the wireless on a card unfortunately. I do not know why this may be. Already former I make an attempt, but never gets together.

What may be the trouble according to you?

----------

## Berty

The same problem, I have ra61 card and WPA encryption; wireless-tools doesn't support this method. But why wpa_supplicant doesnt see my card? I've emerged ralink-rt61 and loaded modlue, it even scans APs with iwlist ra0 scanning...

----------

## ltboy

Have either of you tried networkmanager? Yeah, if you've read any of my other posts, I've been touting that one a lot lately... That's because it seems to work quite well. If you do try it though, I recommend the nm-applet as an interface to the daemon.

----------

## Berty

Well I've managed to launch wep with wpa_supplicant and my ralink card) No wpa though, for now. 

A guy from #gentoo-ru named Parafin wrote his own ebuild for both wpa_supplocant and ralink driver so now wpa_supplicant support whis card.You may ask him if you wish.

----------

## gerardo

Try this:

```
cd /tmp/

wget http://rt2x00.serialmonkey.com/rt61-cvs-daily.tar.gz 

tar -zxvf rt61-cvs-daily.tar.gz

cd rt61-cvs-2008020615/

cd Module/

make

make install

```

Use the rt61 module, not the rt61pci which you might already have compiled in your kernel:

```
modprobe -r rt61

modprobe rt61
```

I've made a simple script to connect: ~/wifi.sh

```
#!/bin/bash

/sbin/ifconfig wlan0 down

/sbin/iwconfig wlan0 mode managed

/sbin/ifconfig wlan0 up

/sbin/iwconfig wlan0 essid YourESSID

/sbin/iwpriv wlan0 set AuthMode=WPAPSK

/sbin/iwpriv wlan0 set WPAPSK="Your WPA-key"

/sbin/iwpriv wlan0 set EncrypType=TKIP

# /sbin/dhclient wlan0

dhcpcd wlan0

```

Make it executable and start it:

```
chmod u+x ~/wifi.sh

~/wifi.sh
```

If dhcpcd doesn't work, you can try setting your ip-address manually using ifconfig.

I had to add the route manually too (maybe because I was already connected to eth0 at the time).

```
route add default gw 192.168.1.1 wlan0
```

This way it works. I've tried a lot of other ways too before succeeding.

Thanks to the unknown: I got this somewhere from the net but I can't remember where...

----------

## GNUtoo

rt2500 doesn't support wpa(old driver)

rt2x00 does(now in 2.6.24 kernel)(new driver)

----------

## gerardo

I don't know about rt2500, but the rt61 does now (at least, the "daily"-version - see above)

I'm currently using it successfully with WPA. (Thrust me, I'm sure of it)

Another method than the above is (which I'm using for the moment):

 :Arrow:  remove (or move) all the drivers related to rt61pci 

probably only the rt61pci driver is enough, but I moved them all because I don't need them.

/lib/modules/2.6.24-zen1/kernel/drivers/input/input-polldev.ko

/lib/modules/2.6.24-zen1/kernel/drivers/leds/led-class.ko

/lib/modules/2.6.24-zen1/kernel/drivers/misc/eeprom_93cx6.ko

/lib/modules/2.6.24-zen1/kernel/drivers/net/wireless/rt2x00/rt2500pci.ko

/lib/modules/2.6.24-zen1/kernel/drivers/net/wireless/rt2x00/rt2x00lib.ko

/lib/modules/2.6.24-zen1/kernel/drivers/net/wireless/rt2x00/rt2x00pci.ko

/lib/modules/2.6.24-zen1/kernel/drivers/net/wireless/rt2x00/rt61pci.ko

/lib/modules/2.6.24-zen1/kernel/lib/crc-ccitt.ko

/lib/modules/2.6.24-zen1/kernel/lib/crc-itu-t.ko

/lib/modules/2.6.24-zen1/kernel/net/mac80211/mac80211.ko

/lib/modules/2.6.24-zen1/kernel/net/rfkill/rfkill.ko

/lib/modules/2.6.24-zen1/kernel/net/wireless/cfg80211.ko

 :Arrow:  add rt61 to /etc/modules.autoload.d/kernel-2.6

 :Arrow:  make your /etc/conf.d/net like this:

```
# iwconfig_wlan0="txpower on" is not needed for this driver

modules=( "iwconfig" "dhcpcd" )

mode_wlan0="managed"

essid_wlan0="YourESSID"

iwpriv_YourESSID=(

   "set AuthMode=WPAPSK"

   "set EncrypType=TKIP"

   "set WPAPSK=your WPA-passphrase"

)

config_YourESSID=( "dhcp" )

# config_wlan0=("192.168.1.10 netmask 255.255.255.0 brd 192.168.1.255")

# routes_wlan0=("default via 192.168.1.1")

```

----------

## intmain

I had a similar problem with the ralink-rt61 driver about a year ago. It was not possible to set any wireless parameter via iwconfig or /etc/conf.d/wireless.

I had to set all wireless parameters in /etc/Wireless/RT61STA/rt61sta.dat and the parameters defined in this file were used automatically when loading the kernel module.

I'm not sure if this is also necessary with the latest version as it is now a year ago I used this driver, so please correct me if I am wrong.

----------

## gerardo

no need for /etc/Wireless/RT61STA/rt61sta.dat anymore

interface is wlan0 in stead of ra0

BUT, I still have a problem with it...

dhcp doesn't seem to work at first, so net.wlan0 is loaded with fictious ip-addresses.

This causes ntp-client to fail (I don't have any mounted net drives)

But when I log in and Network Monitor applet appears, there's no problem anymore...

Setting fixed IP-addresses doesn't help.

EDIT: it works. I just had routes_wlan0 set to dhcp where it shouldn't have been.

Also, I have now config_ESSID in stead of config_wlan0

----------

## wjb

 *GNUtoo wrote:*   

> rt2500 doesn't support wpa(old driver)
> 
> rt2x00 does(now in 2.6.24 kernel)(new driver)

 

The rt2500 driver does do WPA, iwpriv_usage.txt (under /usr/share/doc/rt2500*) says how to set it up.

There is a similar doc file for the rt61 so its probably worth a look.

----------

## sarah_t_s

Got a weird one, well probably not that wierd... just me being dense. 

If I try and set anything via iwpriv I get this spat out:

wlan0     no private ioctls

I'm pretty sure I've forgotten to turn something on in the kernel but I've not a clue what. 

Using 2.6.24-gentoo-r2, ralink drivers compiled as modules.

lspci 

00:13.0 Network controller: RaLink RT2561/RT61 802.11g PCI

lsmod

Module                  Size  Used by

rtc                     5532  0 

rt61pci                16896  0 

rt2x00pci               3840  1 rt61pci

rt2x00lib               9856  2 rt61pci,rt2x00pci

vt8623fb                7552  0 

svgalib                 4224  1 vt8623fb

vgastate                6016  1 vt8623fb

thermal                 8092  0 

button                  3600  0 

processor              14640  1 thermal

nfs                    80108  1 

lockd                  39816  2 nfs

sunrpc                103836  8 nfs,lockd

scsi_wait_scan           640  0 

sbp2                   12296  0 

ohci1394               20272  0 

ieee1394               46004  2 sbp2,ohci1394

usbhid                 16256  0 

ohci_hcd               13956  0 

uhci_hcd               14220  0 

usb_storage            54080  0 

ehci_hcd               19724  0 

usbcore                78060  6 usbhid,ohci_hcd,uhci_hcd,usb_storage,ehci_hcd

So what have I missed?

----------

## gerardo

Kernel drivers don't work for me either.

See above

----------

## Holysword

People, I was abou to post here complaining that my card doesn't work too. 

Then I tried to set channel:

```
$ iwconfig ra0 channel "6"

$ dhcpcd -x ra0

$ dhcpcd ra0
```

Then it worked.

Hope it help you guys.

----------

## Holysword

Wow, now the things get strange :S

I really was able to access internet with that ra0 interface. I just tried to load www.google.com and it did. Then I posted here.

But the network is VERY slow :S

```
ping www.google.com

PING www.l.google.com (209.85.193.103) 56(84) bytes of data.

64 bytes from br-in-f103.google.com (209.85.193.103): icmp_seq=3 ttl=245 time=60.7 ms

64 bytes from br-in-f103.google.com (209.85.193.103): icmp_seq=5 ttl=245 time=57.4 ms

64 bytes from br-in-f103.google.com (209.85.193.103): icmp_seq=8 ttl=245 time=65.4 ms

64 bytes from br-in-f103.google.com (209.85.193.103): icmp_seq=9 ttl=245 time=61.8 ms

64 bytes from br-in-f103.google.com (209.85.193.103): icmp_seq=10 ttl=245 time=64.4 ms

64 bytes from br-in-f103.google.com (209.85.193.103): icmp_seq=11 ttl=245 time=62.7 ms

64 bytes from br-in-f103.google.com (209.85.193.103): icmp_seq=14 ttl=245 time=59.6 ms

64 bytes from br-in-f103.google.com (209.85.193.103): icmp_seq=16 ttl=245 time=61.8 ms

64 bytes from 209.85.193.103: icmp_seq=19 ttl=245 time=63.5 ms

--- www.l.google.com ping statistics ---

19 packets transmitted, 9 received, 52% packet loss, time 22122ms

rtt min/avg/max/mdev = 57.429/61.958/65.408/2.331 ms
```

In some few minutes I was unable to access internet from that interface again. I looked at router's status with another machine and, it displayed my ra0 MAC address there as an active connection :S

----------

## Holysword

Ow, I could figure out what was going on.

That daily driver posted up there installs the driver at /lib/modules/2.6.23-gentoo-r8/extra not at /lib/modules/2.6.23-gentoo-r8/net. So I was still using the old driver (with the ra0 name instead of the aliased wlan0).

I linked the extra/rt61.ko to net/rt61.ko and now its working. I swear that now its working, I'm posting here using wlan0 interface XD

----------

