# Help installing my Wireless Nic? (rtl8192su)

## Arthorn

Hello, I'm trying to install/configure my wireless NIC. This is my first time running a linux system, so I'm greatly confused on most everything.

So far I've emerged the firmware package from with portage (rtl8192su-firmware-2.6.0001.0320.2009), and set the driver to install (RealTek RTL8712U (RTL8192SU) WIRELESS LAN NIC driver) into my kernel. 

At this point, I've read through the gentoo documentation and found that using the wireless-tools package should be sufficient, but am still left baffled at what to do next. 

I've edited the "net" file in /etc/conf.d to look like:

modules="iwconfig"

key_ESSID1="[1] s:f3b39da9a5 [1] enc open"

preferred_aps="'ESSID1'"

The network I'm trying to connect to is a pretty generic setup, WEP secured. As I stated above, this is my first install. Can anyone offer me advice on where to go next with this setup? 

Thanks in advance,

Arthorn.

----------

## chithanh

You can use wpa_supplicant for connecting to all kinds of networks, unencrypted or WEP or WPA.

After you configured /etc/conf.d/net and /etc/wpa_supplicant/wpa_supplicant.conf as in the handbook, create a symlink /etc/init.d/net.wlan0 -> net.lo and start that init script.

----------

## NeddySeagoon

Arthorn,

Lets see how far you have got.

Do you have a wlan0 or other wireless interface in 

```
ifconfig -a
```

If not your firmware isn't being loaded or the kernel module isn't loaded.  The kernel module must be configured as <M> or it will try to load the firmware before root is mounted, which will fail as /lib/fimware will not exist.

dmesg can shed some light on this.

If you have a wlan0 then its time to play with wireless-tools, which is fine for WEP.

Note WEP is equal to no security at all. Don't get a false sense of security by using it.

Before you can get an IP address for a wireless NIC, the wireless bit of the link has to work.

What does iwconfig show ?

It should list all your interfaces, including the wireless NIC and show the wireless extensions.  If iwconfig shows your wlan0 and claims that it has ho wireless extensions do

```
ifconfig wlan0 up
```

and try again.

Your key looks like its in hex in which case 

```
key_ESSID1="[1] s:f3b39da9a5 [1] enc open" 
```

is not correct. The s: means a text string follows. Of course, your key is a legal text string too but the two will be treated differently.

/usr/share/doc/openrc-0.9.4/net.example.bz2 is well worth a read.  If you don't have openrc-0.9.4, just change the version in the filename.

The good thing about WEP and wireless-tools is that you can give all the commands at the console.

One last complication, when you get an IP address, you will need to stop eth0 to test if both wlan0 and eth0 are in the same subnet.

----------

## Arthorn

Thanks a bunch to both of you for your replies!

Here's what I'm getting in response to you Neddy:

ifconfig -a:

eth0      Link encap:Ethernet  HWaddr 00:0b:db:b1:ae:10

          inet addr:192.168.1.21  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::20b:dbff:feb1:ae10/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000

          RX bytes:50213 (49.0 KiB)  TX bytes:43058 (42.0 KiB)

          Interrupt:17

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  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:0

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

sit0      Link encap:IPv6-in-IPv4

          NOARP  MTU:1480  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:0

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

wlan0     Link encap:Ethernet  HWaddr 94:44:52:dc:2c:5a

          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 went and reinstalled the staging driver as a module. 

iwconfig:

lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

wlan0     unassociated  Nickname:"rtl_wifi"

          Mode:Auto  Access Point: Not-Associated   Sensitivity:0/0

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0  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

when I try ifconfig wlan0 up I get:

SIOCSIFFLAGS: Operation not permitted

Again I thank ya, and am currently taking a look at the net.examples.bz2 file.

----------

## Arthorn

demsg | tail provides me with the following:

[  104.533205] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"

[  104.577413] r8712u: Unable to load firmware

[  104.577420] r8712u: Install latest linux-firmware

Is there something I need to do besides emerge the firmware?

----------

## chithanh

The missing firmware file comes with the sys-kernel/linux-firmware package. I think the rtl8192su-firmware package is for some older driver only.

----------

## Arthorn

Awesome thanks. Another quick question, when I install stuff such as firmware, is a reboot required in order for it to start working? Or does it install and start automatically?

----------

## Arthorn

ifconfig -a gives me:

wlan0     Link encap:Ethernet  HWaddr 94:44:52:dc:2c:5a

          UP BROADCAST RUNNING 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)

iwconfig:

wlan0     unassociated  Nickname:"rtl_wifi"

          Mode:Auto  Access Point: Not-Associated   Sensitivity:0/0

          Retry:off   RTS thr:off   Fragment thr:off

          Power Management:off

          Link Quality:0  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

iwlist wlan0 scan:

wlan0     Scan completed :

          Cell 01 - Address: 00:23:97:BB:45:D6

                    ESSID:"09FX10091067"

                    Protocol:IEEE 802.11bg

                    Mode:Master

                    Frequency:2.437 GHz (Channel 6)

                    Encryption key:on

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

                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s

                              12 Mb/s; 48 Mb/s

                    Signal level=76/100

At this point do I want to create my symlink? Or are there more steps I must take?

----------

## NeddySeagoon

Arthorn,

Your post shows that your wireless is associated with an AP.

making the symlink and doing

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

should get you an IP.

If that works, 

```
/etc/inid.d/net.eth0 stop
```

will make you wireless only for testing.

Odd things will happen if wlan0 and eth0 get an IP in the same subnet and you leave them both working.

----------

## Arthorn

Wow. I'm getting ridiculously close here. Thanks again for your reply. I've got it to accept my key and appear to connect to the network, but it isn't showing up on my router's page, and if I killed eth0 I lose my connection. It's showing up as:

wlan0     Link encap:Ethernet  HWaddr 94:44:52:dc:2c:5a  

          inet addr:169.254.44.11  Bcast:169.254.255.255  Mask:255.255.0.0

          inet6 addr: fe80::9644:52ff:fedc:2c5a/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:586134 (572.3 KiB)  TX bytes:34146 (33.3 KiB)

here's my conf.d/net

modules="iwconfig"

config_eth0="dhcp"

config_wlan0="dhcp"

essid_wlan0="09FQ111191067"

key_ESSID1="[1] f3ad09da9a5 [1] enc open"

preferred_aps="'ESSID1'"

The subnet appears to be wrong, and the 169 inet addr also seems to be wrong. I gotta figure I need one more thing to fix it and it should be done! 

Thanks again for the help, this has been a learning experience for sure!

----------

## NeddySeagoon

Arthorn,

169.254.x.x is a link local IP address, its only useful in ad-hoc networks where there is no dhcp serer.  When dhcp times out, it can be set up to self assign  a link local address like this.  It tells that dhcp failed.

A few things to check:-

In your AP is MAC address filtering off or is 94:44:52:dc:2c:5a a permitted MAC addess?

In iwconfig, or your wireless transmitter on ?

Something may have turned it off for power savinging.

Does dmesg caontain anything useful ?

----------

## Arthorn

Howdy Neddy, or anyone else.

Sorry It's been so long since I could reply, I've been busy with finals and work and whatnot. I ended up going with wpa_supplicant to get it setup and running. The good news is that it I have been able to get the wireless nic to obtain an IP address and connect and everything. The bad news is that it doesn't like to do anything unless eth0 is up and running. I can turn the PC on and connect with my wireless adapter, then disconnect the wire and wlan0 continues to work fine. However, if I disconnect the wire before starting the system it won't connect to the wireless at all. 

dmesg gives me this:

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

[   11.233302] r8712u 1-6:1.0: usb_probe_interface

[   11.233312] r8712u 1-6:1.0: usb_probe_interface - got id

[   11.233317] r8712u: DriverVersion: v7_0.20100831

[   11.233362] r8712u: register rtl8712_netdev_ops to netdev_ops

[   11.233369] r8712u: USB_SPEED_HIGH with 4 endpoints

[   11.240123] r8712u: Boot from EFUSE: Autoload OK

[   12.084753] r8712u: CustomerID = 0x0000

[   12.084762] r8712u: MAC Address from efuse = 94:44:52:dc:2c:5a

[   12.101621] usbcore: registered new interface driver r8712u

[   26.075794] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"

[   26.785430] r8712u: 1 RCR=0x153f00e

[   26.786175] r8712u: 2 RCR=0x553f00e

[   32.492511] r8712u: wpa_set_encryption, crypt.alg = WEP

[10020.003310] r8712u: wpa_set_encryption, crypt.alg = WEP

when I grep for the wireless driver. 

and when I grep for the wired module I get:

 dmesg | grep b44

[    0.859466] b44 0000:01:09.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17

[    0.886470] b44: b44.c:v2.0

[    0.894908] b44 ssb0:0: eth0: Broadcom 44xx/47xx 10/100BaseT Ethernet 00:0b:db:b1:ae:10

[   16.706192] b44 ssb0:0: eth0: Link is up at 100 Mbps, full duplex

[   16.706200] b44 ssb0:0: eth0: Flow control is off for TX and off for RX

eth0:

[    0.894908] b44 ssb0:0: eth0: Broadcom 44xx/47xx 10/100BaseT Ethernet 00:0b:db:b1:ae:10

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

[   16.706192] b44 ssb0:0: eth0: Link is up at 100 Mbps, full duplex

[   16.706200] b44 ssb0:0: eth0: Flow control is off for TX and off for RX

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

[   27.602013] eth0: no IPv6 routers present

wlan0:

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

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

[   43.050013] wlan0: no IPv6 routers present

Not sure if any of this provides any useful information to anyone. 

As always thank you for your help!

----------

## NeddySeagoon

Arthorn,

Check your /etc/rc.conf file - its well commented.

You probaly need 

```
rc_depend_strict="NO"
```

in there so that networking is deemed to be up if only a single interface starts.

----------

## Arthorn

Neddy, you are incredible. 

Thanks a bunch, it appears that this install can be considered SOLVED!

Time to move on and figure out all sorts of fun things to do with my functional linux box!

Thanks again!

----------

