# [SOLVED]: noob having issues setting up wireless

## dab1414

So this is my first time setting up gentoo. I have tried to follow the handbook, other network guides, the man pages, and other forum posts ... to no avail.

     As far as I can figure is that wlan0 is not set up correctly. I have manually configured the kernel, with rt2860sta loaded at boot. I have emerged net-wireless/wireless-tools. Whenever I try to iwlist wlan0 scan it says the network is down. I am assuming I havent set up /etc/conf.d/net correctly. But any help in helping my figuring this out would be greatly appreciated.

----------

## NeddySeagoon

dab1414,

Welcome to Gentoo.

Why do you think you need the rt2860sta driver?  

Im not suggesting you don't but rule one of helping is assume nothing.

Please post the line from lspci or lsusb that shows your wireless card.

From memory, the rt2860sta driver needs firmware. The Debian Wiki confirms that. You should make the driver a module in your kernel and put the firmware into /lib/firmware.

```
dmesg | less
```

  will show you what firmware the module has tried to load and if it found it or not.

----------

## dab1414

NeddySeagoon, 

       Thanks for your reply, I followed pappys kernel seeds, i used lspci, lsusb, lsmod to determine what drivers to install, and took advice to make wireless drivers modules. I put rt2680sta in the /etc/modules.autoload.d/kernel-2.6. 

As far as firmware I dont know, I do not have a /lib/firmware and I didnt read anything about doing that. But I could have missed it. 

lspci -vv (from the livedvd) shows this for wireless card

01:00.0 Network controller: RaLink RT2860 Wireless 802.11n PCIe

	Subsystem: Belkin Device 8073

	Flags: bus master, fast devsel, latency 0, IRQ 17

	Memory at b4000000 (32-bit, non-prefetchable) [size=64K]

	Capabilities: [40] Power Management version 2

	Capabilities: [50] MSI: Enable- Count=1/32 Maskable- 64bit+

	Capabilities: [70] Express Endpoint, MSI 00

	Capabilities: [100] Advanced Error Reporting

	Kernel driver in use: rt2800pci

	Kernel modules: rt2860sta, rt2800pci

and dmesg | less shows these for the wireless

[   45.111212] rt2800pci 0000:01:00.0: PCI INT A -> Link[LK2E] -> GSI 17 (level, high) -> IRQ 17

[   45.111223] rt2800pci 0000:01:00.0: setting latency timer to 64

[   45.517414] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'

[   45.517643] Registered led device: rt2800pci-phy0::radio

[   45.517671] Registered led device: rt2800pci-phy0::assoc

[   45.517698] Registered led device: rt2800pci-phy0::quality

[   46.466366] rt2860sta: module is from the staging directory, the quality is unknown, you have been warned.

[   91.532172] phy0 -> rt2800pci_mcu_status: Error - MCU request failed, no response from hardware

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

[   97.403883] eth0: no link during initialization.

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

[  226.132536] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[  226.133057] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[  226.133569] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[  226.153780] phy0 -> rt2800pci_mcu_status: Error - MCU request failed, no response from hardware

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

[  226.310726] eth0: no link during initialization.

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

[  226.345542] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[  226.346064] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[  226.346575] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[  226.366761] phy0 -> rt2800pci_mcu_status: Error - MCU request failed, no response from hardware

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

[  228.402240] wlan0: authenticate with 5c:da:d4:f3:3b:ce (try 1)

[  228.403998] wlan0: authenticated

[  228.404484] wlan0: associate with 5c:da:d4:f3:3b:ce (try 1)

[  228.406337] wlan0: deauthenticating from 5c:da:d4:f3:3b:ce by local choice (reason=3)

[  228.406420] wlan0: authenticate with 5c:da:d4:f3:3b:ce (try 1)

[  228.409860] wlan0: authenticated

[  228.410244] wlan0: associate with 5c:da:d4:f3:3b:ce (try 1)

[  228.410376] wlan0: deauthenticating from 5c:da:d4:f3:3b:ce by local choice (reason=3)

[  228.410653] wlan0: authenticate with 5c:da:d4:f3:3b:ce (try 1)

[  228.414947] wlan0: authenticated

[  228.415374] wlan0: associate with 5c:da:d4:f3:3b:ce (try 1)

[  228.418954] wlan0: RX AssocResp from 5c:da:d4:f3:3b:ce (capab=0x421 status=0 aid=1)

[  228.418960] wlan0: associated

[  228.419906] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

[  238.882030] wlan0: no IPv6 routers present

[  731.410400] wlan0: deauthenticated from 5c:da:d4:f3:3b:ce (Reason: 2)

[  737.310531] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[  737.311052] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[  737.311562] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[  737.331752] phy0 -> rt2800pci_mcu_status: Error - MCU request failed, no response from hardware

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

[  737.379885] eth0: no link during initialization.

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

[ 1433.883541] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[ 1433.884063] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[ 1433.884574] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[ 1433.904769] phy0 -> rt2800pci_mcu_status: Error - MCU request failed, no response from hardware

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

[ 1433.947224] eth0: no link during initialization.

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

[ 1433.986539] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[ 1433.987061] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[ 1433.987572] phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00007010, value=0x05100000

[ 1434.007771] phy0 -> rt2800pci_mcu_status: Error - MCU request failed, no response from hardware

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

[ 1436.240368] wlan0: authenticate with 5c:da:d4:f3:3b:ce (try 1)

[ 1436.242117] wlan0: authenticated

[ 1436.242489] wlan0: associate with 5c:da:d4:f3:3b:ce (try 1)

[ 1436.245251] wlan0: RX AssocResp from 5c:da:d4:f3:3b:ce (capab=0x421 status=0 aid=1)

[ 1436.245256] wlan0: associated

[ 1436.245965] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

[ 1446.466013] wlan0: no IPv6 routers present

and as a note I have been trying to set up most of this while in chroot, using the livedvd.

----------

## NeddySeagoon

dab1414,

Your dmesg is encouraging.

```
[ 228.409860] wlan0: authenticated

[ 228.410244] wlan0: associate with 5c:da:d4:f3:3b:ce (try 1)

[ 228.410376] wlan0: deauthenticating from 5c:da:d4:f3:3b:ce by local choice (reason=3) 
```

The authenticated line says its worked. The last line says something asked it to deauthenticate at your end.

If you are using wicd or network manager, disable them meanwhile.  They both give me results like you have posted with my ath5k chipset but the standard setup justworks.  I don't know why yet.

What encryption are you using ?

That seems to work anyway, as you actually get authenticated and thats normally the hard bit.

Please post your /etc/conf.d/net file and if you are using wpa_supplicant, your /etc/wpa_supplicant/wpa_supplicant.conf file.  One or more of those files will contain your encryption key, so you might want to hide that before you post.

It could be a driver issue too.  Be sure the use the latest testing gentoo-sources as the staging drivers are under heavy development.  Occasionally, there is a regression.  Something that worked no longer does, so it might be worth dropping back a kernel version too. So try a 2.6.38, .37 and .36 kernel.  Keep them all in /boot so you can choose at boot time.

----------

## dab1414

my /etc/conf.d/net shows this

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

modules=( "iwconfig" )

essid_wlan0="any"

mode_wlan0="auto"

and right now I am not using encryption. I set it up that way to get it to work. I figured the simpler the better to start.

----------

## DONAHUE

See if a driver exists:

```
lspci -k
```

 should show  *Quote:*   

> Network controller: Ralink corp. RT2800 802.11n PCI
> 
> Subsystem: Ralink corp. Device 2860
> 
> Kernel driver in use: rt2860
> ...

 See if the firmware is present:

```
ls /lib/firmware
```

output should include  *Quote:*   

> rt2860.bin

 If it does not, download from

http://www.ralinktech.com/license_us.php?n=2&p=1&t=U0wyRnpjMlYwY3k4eU1ERXdMekF6THpNeEwyUnZkMjVzYjJGa01UWTBNamsyTVRBNE1pNTZhWEE5UFQxU1ZESTROakJmUm1seWJYZGhjbVZmVmpJMkM%3D

unzip the package, RT2860_Firmware_V26.zip, then copy rt2860.bin from RT2860_Firmware_V26 to /lib/firmware . Then 

```
modprobe -r rt2860sta

modprobe rt2860sta
```

Then run 

```
ifconfig -a
```

 which should show wlan0 followed by 

```
ifconfig
```

 which also should show wlan0. If it does not, run

```
ifconfig wlan0 up

ifconfig
```

hopefully wlan0 appears. 

```
nano /etc/portage/package.use
```

Edit to include: *Quote:*   

> net-wireless/wpa_supplicant qt4

 Then run

```
emerge wireless-tools ifplugd wpa_supplicant
```

Then run 

```
iwlist wlan0 scan
```

which should read available routers/access points; for example: *Quote:*   

>   iwlist wlan0 scan
> 
> wlan0     Scan completed :
> 
>           Cell 01 - Address: 00:00:00:00:00:01
> ...

 add global controls to wpa_supplicant:

```
nano /etc/wpa_supplicant/wpa_supplicant.conf
```

 edit to include  *Quote:*   

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

  and setup gentoo networking

```
nano /etc/conf.d/net
```

edit to  *Quote:*   

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

 make a symlink to run the gentoo networking script for wlan0

```
cd /etc/init.d

ln -s net.lo net.wlan0
```

add net.wlan0 to start automatically

```
rc-update add net.wlan0 default
```

```
reboot
```

when back up and in desktop/gui start wpa_gui from a toolbar or a terminal and configure your connection.exciting wpa_gui slide show

----------

## dab1414

DONAHUE.

Before I continue I was wondering with this

 *Quote:*   

> Code:
> 
>   nano /etc/portage/package.use
> 
>   Edit to include:
> ...

 

Since I do not have a desktop yet and entirely command line, when I 

```
emerge -p wireless-tools ifplugd wpa_supplicant
```

it states

 *Quote:*   

> emerge: there are no ebuilds built with USE flags to satisfy ">=x11-libs/cairo-1.10.0[-qt4]".
> 
> !!! One of the following packages is required to complete your request:
> 
> - x11-libs/cairo-1.10.2-r1 (Change USE: -qt4)

 

So I should change your line 

 *Quote:*   

> Code:
> 
>   nano /etc/portage/package.use
> 
>   Edit to include:
> ...

 

to ???

 *Quote:*   

> 
> 
>   net-wireless/wpa_supplicant -qt4

 

Thanks for your informative how to hopefully this will work for me and i am understanding where i have gone astray to this point.

----------

## DONAHUE

don't do this: *Quote:*   

> 
> 
> ```
> nano /etc/portage/package.use 
> ```
> ...

 

----------

## DONAHUE

Pick up with:

Then run

```
emerge wireless-tools ifplugd wpa_supplicant
```

Then run 

```
iwlist wlan0 scan
```

which should read available routers/access points; for example: *Quote:*   

>   iwlist wlan0 scan
> 
> wlan0     Scan completed :
> 
>           Cell 01 - Address: 00:00:00:00:00:01
> ...

 add global controls to wpa_supplicant:

```
nano /etc/wpa_supplicant/wpa_supplicant.conf
```

 edit to include  *Quote:*   

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

  and setup gentoo networking

```
nano /etc/conf.d/net
```

edit to  *Quote:*   

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

 make a symlink to run the gentoo networking script for wlan0

```
cd /etc/init.d

ln -s net.lo net.wlan0
```

add net.wlan0 to start automatically

```
rc-update add net.wlan0 default
```

As no desktop in service the network in wpa_supplicant must be done manually:

```
iwlist wlan0 scan | wgetpaste
```

 and post url if you wish help tailoring a network entry for wpa_supplicant.conf; my complete wpa_supplicant.conf based on the sample above:  *Quote:*   

> ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
> 
> update_config=1
> 
> network={
> ...

 

```
reboot
```

----------

## DONAHUE

your kernel appears to be configured with both the staging driver and the in kernel driver.

My 2860's are by encore and only work with the staging driver and only then when no part of of the in kernel driver is in my config.

I have seen two ASUS 2860's that said the in kernel worked for them, several others made by unknown makers that worked with staging, one other belkin that failed with in kernel that i never got to try the staging. 

Recommend purge the in kernel and try staging only. My config follows: *Quote:*   

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

 

----------

## dab1414

So far much better, I have followed your last 2 posts. As seeing I am only at command line (for my amusement, and curiosity), figuring things out is ...well stressful. So this is where I am at :

When I boot up my laptop I get multiple of these errors

error for wireless request (Set something then a code) 

set failed on device wlan0, network is down

wlan0 does not support setting(some setting in wpa_supplicant.conf)

However, I can do this

```
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
```

and then this

```
dhcpcd wlan0
```

And wow it works...

So is there something I might have missed to not allow this to automatically connect up on boot?

----------

## DONAHUE

what is in wpa_supplicant.conf?

what is in /etc/conf.d/net?

what is the output of

```
iwlist wlan0 scan
```

----------

## cach0rr0

 *dab1414 wrote:*   

> 
> 
> However, I can do this
> 
> ```
> ...

 

This means: 

-your driver setup is fine

-your wpa_supplicant.conf settings are fine

-dhcpcd is functional

Therefore, whatever you're using to make it run on startup is not invoking wpa_supplicant and dhcpcd in that same way

For those that wish to start things up with an init script, as you do, the settings the init script uses is controlled by /etc/conf.d/net

Meaning what you have in /etc/conf.d/net is not correct for wpa_supplicant

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4#doc_chap2

so, something like:

```

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

```

(i dont use the init script method, so i cant say with certainty)

----------

## dab1414

wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel 

update_config=1

network={ 

ssid="DavidG" 

#psk="aaaaaaaa" 

#proto=RSN 

key_mgmt=NONE

#pairwise=TKIP 

#auth_alg=OPEN 

#mode="Managed" 

#priority=10 

#id_str="Home" 

}

/etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

modules_wlan0="wpa_supplicant" 

wpa_supplicant_wlan0="-Dwext" 

wpa_timeout_wlan0=15 

modules_wlan0="dhcpcd" 

config_wlan0="dhcp nodns" 

dhcpcd_wlan0="-t 10" 

modules_eth0="ifconfig" 

modules_eth0="dhcpcd" 

config_eth0="dhcp nodns" 

dhcpcd_eth0="-t 10" 

dns_servers="8.8.8.8"

```
iwlist wlan0 scan
```

wlan0     Scan completed :

          Cell 01 - Address: 5C:DA:D4:F3:3B:CE

                    Channel:2

                    Frequency:2.417 GHz (Channel 2)

                    Quality=50/70  Signal level=-60 dBm  

                    Encryption key:off

                    ESSID:"DavidG"

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

                              12 Mb/s; 24 Mb/s; 9 Mb/s

                    Bit Rates:18 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s

                    Mode:Master

                    Extra:tsf=0000000dae2fecfd

                    Extra: Last beacon: 1024ms ago

                    IE: Unknown: 0006446176696447

                    IE: Unknown: 010882848B968C98B012

                    IE: Unknown: 030102

                    IE: Unknown: 2A0100

                    IE: Unknown: 32042448606C

----------

## DONAHUE

In my experience "Mode:Master" appearing in the iwlist scan is the kiss of death. My guess is that it indicates a situation where the nic manufacturer (Belkin in this case) has made a minor change that prevents the ralink software and firmware from controlling the chipset properly. As you report success using manual commands, try:

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

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

edit to *Quote:*   

> #!/sbin/runscript
> 
> depend() {
> 
>     need localmount
> ...

 

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

The alternative is to see if the in kernel drivers succeed with the staging drivers removed from the kernel.

----------

## dab1414

Well that did not work for me. I don't remember exactly what it says but wont start net.wlan0. But I am marking as solved since my title states a problem with wireless, and you have helped me to get it to work. Thank you for all your help. I will try to figure the rest out on my own, possibly breaking everything and trying to fix it all  :Wink: 

----------

