Debian Squeeze: WiFi RealTek RTL8191SU: Problem Setting up Driver


46 posts   Page 1 of 2   1, 2
by greypower » Tue May 08, 2012 10:11 am
I am using Debian 19-3 version for Raspberry Pi.

I have the above WiFi adaptor connected to a Belkin hub. It is recognised on boot and in using lsusb command.

I have followed the instructions in:

http://wiki.debian.org/rtl819x

for installing the driver.

In running these instructions I used "sudo su" to get into root. All seemed to go well with the download.

At the completion of stage 3 (see instructions) the contents of

/usr/local/lib/firmware/RTL8192U are three files:

boot.img data.img main.image

Doing iwcongfig gives:

lo    no wireless extensions

eth0 no wireless extensions

Unplugging the adaptor  &/or rebooting gives the same iwconfig results

i.e. the adaptor is still not working

Any thoughts on what I am doing wrong??
Posts: 91
Joined: Sat Jan 07, 2012 10:00 am
by felixfurtak » Tue May 08, 2012 10:43 am

Assuming it"s a compatible chipset (I think it is), you should be able to get it working by following the steps detailed in the R-Pi forum here: http://www.raspberrypi.org/for.....ic-working
The basic steps are:-
1) edit the file "/etc/modprobe.d/blacklist.conf" and add the line
blacklist rtl8192cu

2) Get hold of module file "8192cu.ko" either by compiling from source for ARM (hard) or from the link provided in the forum (easy, shown below)


and then type
tar xf 8192cu.tar.gz

sudo install -p -m 644 8192cu.ko /lib/modules/3.1.9+/kernel/drivers/net/wireless/

sudo depmod -a

3) Make sure you have the file /lib/firmware/rtlwifi/rtl8712u.bin. If not, there is a link in the forum for you to download it.

4) Insert the dongle and reboot. You should see the module initializing as it boots

To check functionality (on an unencrypted wireless lan)

sudo ifconfig wlan0 up

sudo iwlist wlan0 scanning

sudo iwconfig wlan0 essid <YOURESSID>

sudo apt-get install dhcpcd

sudo dhcpcd wlan0.

You can now configure your /etc/network/interfaces file accordingly. From memory I added the lines:

auto wlan0

iface wlan0 inet dhcp

wireless-essid <essid>

If your wireless lan is encrypted with WEP or WPA (it should be!) you will have to add more configuration options. This is fairly well documented elsewhere (e.g. Debian forums).


Posts: 47
Joined: Wed Nov 16, 2011 10:41 am
by greypower » Tue May 08, 2012 1:40 pm
@felix...

Many thanks for your speedy reply.

I have followed your script and it all went OK

But(!!) there is no sign of the driver loading at boot - there is no

"Calling CRDA to update world regulatory domain" etc etc on recognising the adaptor during the boot requence.(Nor in the lsmod output when unplugged/plugged)

So I guess I'm stuck - any further diagnosis suggestions anyone??
Posts: 91
Joined: Sat Jan 07, 2012 10:00 am
by tqm » Tue May 08, 2012 3:37 pm
If you have blacklisted the original rtl8192 module you have to load the new one

modprobe 8192cu

or add this line

8192cu

to /etc/modules and reboot to test... this will load this module regardless of hardware present or not and if hardware is there, it will work :-)

I've just set up my Edimax card to use the same module and work with WPA2-AES-CCMP network. Will blog full config very soon.

Posts: 16
Joined: Tue May 08, 2012 12:00 pm
by greypower » Tue May 08, 2012 4:31 pm
@tqm:

Thanks - have added module to /etc/modules.

lsmod shows 8191cu loaded (size=409936)

but(!!) device not picked-up on reboot.

I look forward to your blog when you've finished
Posts: 91
Joined: Sat Jan 07, 2012 10:00 am
by felixfurtak » Tue May 08, 2012 10:23 pm
Is there any relevant error message in dmesg?

dmesg | grep -i rtl

Also check your firmware is present. There are a few variations in the path for the firmware in different distributions. Did you install

sudo apt-get install firmware-realtek
Posts: 47
Joined: Wed Nov 16, 2011 10:41 am
by tqm » Tue May 08, 2012 11:05 pm
firmware-realtek package doesn't seem to help at all :-(

I've dropped complete step by step description of getting 8192cu driver (binary blob mentioned above in this thread) working. Have a look at http://www.ctrl-alt-del.cc/201.....s-ada.html - maybe this will help.
Posts: 16
Joined: Tue May 08, 2012 12:00 pm
by felixfurtak » Wed May 09, 2012 1:34 am
Interesting. I have exactly the same Wi-Fi dongle (Edimax EW-7811Un) and didn"t need to install any extra firmware with the same Debian image.

The only file that I needed was the ARM compiled 8192cu.ko file. I did not try to use it with wpa_supplicant though.

Greypower: what is the make/model VID/PID of your wireless dongle when you type lsusb?
Posts: 47
Joined: Wed Nov 16, 2011 10:41 am
by tqm » Wed May 09, 2012 7:27 am
Mine is USB ID 7392:7811

Yes, adding the 8192cu module (binary blob) was fine to get the card running but then serious stability issues started showing up - that's what pushed me to update kernel.I've seen various threads and comments saying there is several revisions of the hardware itself. Maybe some of us will be lucky to have it work out of the box with Debian drivers… Surely I wasn't one of them ;-) but hey – it works just fine, no problems any more.

Actually I'd add USB ID to the blog post – that's a very good point – thank you!
Posts: 16
Joined: Tue May 08, 2012 12:00 pm
by greypower » Wed May 09, 2012 10:40 am
I have uploaded a copy of the log together with lsusb list here:

http://dl.dropbox.com/u/784104.....utputs.txt

The adaptor is labeled "getnet 300" and has the part no GN-621U. Works fine on Windows

(sorry to use that word !!)

Yes I performed aptitude to get realtek firmware. Ran without errors

Being a noob I am at a complete loss - but learning (with your help, of course!)

Cheers,

Richard
Posts: 91
Joined: Sat Jan 07, 2012 10:00 am
by felixfurtak » Thu May 10, 2012 3:29 am
Hi Richard,

This is probably nothing, but can I suggest that you do your testing with the minimum of USB devices connected. There are currently problems in the kernel with certain USB devices causing conflicts, especially when a USB hub is connected.

I"m not saying this is the cause of your problems, but it might be worth a go.

The best configuration for testing is to simply have your keyboard plugged into one usb port and the wireless dongle on the other one (no hub).

If you type

sudo ifconfig wlan0 up

followed by

sudo ifconfig


what is the output then?
Posts: 47
Joined: Wed Nov 16, 2011 10:41 am
by fulburncams » Thu May 10, 2012 7:21 am
Hi Greypower

There appears to be hardware issues around the power supply to the USB  which have a polyfuse set to 140mA.  My wifi adapter TP722 current consumption was in that region so i made a short USB cable which broke the 5V supply and enabled me to supply the wifi adapter from an independed 5V supply,  from then on it all worked fine.  I had also tried with a Belkin hub but that caused all sorts of problems with keyboard etc.

Regards

Steve
User avatar
Posts: 70
Joined: Wed Nov 30, 2011 8:29 pm
by greypower » Thu May 10, 2012 10:47 am
pi@raspberrypi:~$ sudo ifconfig wlan0 up
wlan0: ERROR while getting interface flags: No such device
pi@raspberrypi:~$ sudo if config
sudo: if: command not found
pi@raspberrypi:~$ sudo ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:8b:46:21
inet addr:192.168.1.4 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1488 Metric:1
RX packets:727 errors:0 dropped:0 overruns:0 frame:0
TX packets:847 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:411784 (402.1 KiB) TX bytes:151692 (148.1 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1664 (1.6 KiB) TX bytes:1664 (1.6 KiB)

@tqm: output as above after loading on a "reduced confi" as you advised
Still no joy - time for a new adaptor?!!!

@fulburn cams: would love to get as far as blowing a fuse!!! - I think I"ve got to the point of blowing my own!!!!!
Posts: 91
Joined: Sat Jan 07, 2012 10:00 am
by tqm » Thu May 10, 2012 2:04 pm
First of all show me what "sudo iwconfig" shows… iwconfig is for configuring wireless interfaces (mode, frequency/channel, etc), then ifconfig to set link up/down and IP – do not confuse them.

Mine says:


root@raspberrypi:~# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11bg  ESSID:"MyWPA2wifi"  Nickname:"<WIFI@REALTEK>"
Mode:Managed  Frequency:2.472 GHz  Access Point: **:**:**:**:E6:21
Bit Rate:54 Mb/s   Sensitivity:0/0
Retry:off   RTS thr:off   Fragment thr:off
Encryption key:****-****-****-****-****-****-****-****   Security mode:open
Power Management:off
Link Quality=50/100  Signal level=50/100  Noise level=0/100
Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
Tx excessive retries:0  Invalid misc:0   Missed beacon:0


If it doesn"t show wlan0 at all or says "no wireless extension", your card was not detected – check if you ran "depmod -a" and loaded the module.
Posts: 16
Joined: Tue May 08, 2012 12:00 pm
by raspberrypiAndMe » Thu May 10, 2012 7:20 pm
Hi tqm,

i also have some little problems to get my "Edimax EW-7811Un" starting.

I first tried your tutorial http://www.ctrl-alt-del.cc/201.....s-ada.html without updating the firmware-stuff. Unfortunately didn"t work.

So i did it "the hard way" and updated the firmware later. Surprisingly it still booted and so i repeated the wireless part, but as i ran "depmod -a" i got a lot of…

... WARNING: Can"t read module /lib/modules/3.1.9+/kernel/sound/drivers/._snd-serial-u16550.ko: Exec format error WARNING: Can"t read module /lib/modules/3.1.9+/kernel/sound/drivers/mpu401/._snd-mpu401-uart.ko: Exec format error WARNING: Can"t read module /lib/modules/3.1.9+/kernel/sound/drivers/mpu401/._snd-mpu401.ko: Exec format error WARNING: Can"t read module /lib/modules/3.1.9+/kernel/sound/drivers/._snd-mtpav.ko: Exec format error WARNING: Can"t read module /lib/modules/3.1.9+/kernel/sound/drivers/._snd-dummy.ko: Exec format error FATAL: Could not open /lib/modules/3.1.9+/modules.dep.temp for writing: Permission denied

So i know it"s because of the permissions and the hard way didn"t really work. Is it possible to solve that by giving the right permissions?

Here is my iwconfig and ifconfig if it helps.

pi@raspberrypi:~$ sudo iwconfig lo no wireless extensions. eth0 no wireless extensions. wlan0 unassociated Nickname:"<WIFI@REALTEK>" Mode:Managed Frequency=2.412 GHz 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

pi@raspberrypi:~$ ifconfig eth0 Link encap:Ethernet HWaddr b8:27:eb:69:09:16 inet addr:192.168.178.38 Bcast:192.168.178.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5109 errors:0 dropped:0 overruns:0 frame:0 TX packets:3831 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:398822 (389.4 KiB) TX bytes:1275095 (1.2 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:560 (560.0 B) TX bytes:560 (560.0 B) wlan0 Link encap:Ethernet HWaddr 80:1f:02:45:a0:16 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:2991 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 hope you can help me out?

Thanks a lot!
Posts: 10
Joined: Thu May 10, 2012 6:00 pm
by raspberrypiAndMe » Thu May 10, 2012 8:02 pm
Just changed the permission of all "/lib/modules/3.1.9+/modules.*" to 755 so now i just have warnings... But still doesn't work... :(
Posts: 10
Joined: Thu May 10, 2012 6:00 pm
by tqm » Thu May 10, 2012 9:20 pm
Ok, the depmod errors are for sound stuff, not really related to wireless so I'll ignore them in this thread.

iwconfig shows your wlan0 properly, the card was detected and works - now all you have to do is to connect to your network. WPA and WPA2 networks need wpa_supplicant - I hope you're not on open or WEP protected one.
Posts: 16
Joined: Tue May 08, 2012 12:00 pm
by raspberrypiAndMe » Fri May 11, 2012 5:37 am
I got a protected WPA+WPA2. But I could change that to WPA2 (CCMP) or WPA (TKIP)?

My wpa_supplicant.conf:


# Automatically connet to WPA2 network at boot!
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="MyWlanName"
scan_ssid=1
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
# to get encoded PSK run: wpa_passphrase <ESSID> <PWD>
psk=(here is my psk)
}


I just changed the modus of my router to WPA2 (CCMP) and tried


# Automatically connet to WPA2 network at boot!
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="MyWlanName"
scan_ssid=1
proto=RSN
key_mgmt=WPA2
pairwise=AES-CCMP
group=AES-CCMP
# to get encoded PSK run: wpa_passphrase <ESSID> <PWD>
psk=(here is my psk) }


without success.
Posts: 10
Joined: Thu May 10, 2012 6:00 pm
by tqm » Fri May 11, 2012 6:25 am
There is no such thing in config like WPA2 or AES-CCMP… The config I gave in the post was already for WPA2 network (AES-CCMP), so DO NOT change 'WPA' to 'WPA2' - it will not work.

For WPA/WPA2 with TKIP and CCMP (auto-negotiate) you should use:


key_mgmt=WPA
pairwise=TKIP CCMP
group=TKIP CCMP


as far as I remember...
Posts: 16
Joined: Tue May 08, 2012 12:00 pm
by raspberrypiAndMe » Fri May 11, 2012 11:03 am
Unfortunately didn't work so I tried

key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
pairwise=CCMP TKIP
group=CCMP TKIP


Also didn't work but at least gave me some more "output" (ifconfig)

wlan0     Link encap:Ethernet  HWaddr 80:1f:02:45:a0:16
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:130 errors:0 dropped:832 overruns:0 frame:0
TX packets:74 errors:0 dropped:5 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10086 (9.8 KiB) TX bytes:11470 (11.2 KiB)


Still no IP. What else could it be? Sorry, I've never done this before.
Posts: 10
Joined: Thu May 10, 2012 6:00 pm
by tqm » Fri May 11, 2012 11:06 am
Did you follow the whole of my blog post?

What do you have in /etc/network/interfaces?
Posts: 16
Joined: Tue May 08, 2012 12:00 pm
by raspberrypiAndMe » Fri May 11, 2012 11:19 am
auto lo

iface lo inet loopback
iface eth0 inet dhcp

# make interface come up automatically
auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant.conf -B

Yes I did, thank you very much for that by the way. :o )
I just tried

key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP

Still not working but gave me "recvframe_chkmic: didn't install group key!!!!" when booting. It always tries to connect at the startup, for about six times, but never receives a IP.
Posts: 10
Joined: Thu May 10, 2012 6:00 pm
by tqm » Fri May 11, 2012 11:28 am
Where did you get key_mgmt=WPA-PSK from? I guess from the docs…

The config in my blog post works on AP that doesn"t do WPA, only WPA2. The chkmic error you get is related to one of the security checks on the packet (for simplicity let"s say it"s checksum) so you have misconfiguration somewhere – maybe wrong PSK?

If your AP is set up to do WPA-PSK, just switch to WPA-PSK and don"t use WPA2.


$ man wpa_supplicant.conf

[...]

QUICK EXAMPLES
1. WPA-Personal  (PSK)  as home network and WPA-Enterprise with EAP-TLS
as work network.

# allow frontend (e.g., wpa_cli) to be used by all users in "wheel" group
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
#
# home network; allow all valid ciphers
network={
ssid="home"
scan_ssid=1
key_mgmt=WPA-PSK
psk="very secret passphrase"
}

[...]


which means you don"t have to specify anything about CCMP or TKIP – this one above is straight from the documentation… you can have psk in quotes like above or as string generated by wpa_passphrase – remember SSID is case sensitive, so is the passphrase.

Bottom line - your wireless adapter is fine. What you have now is connection configuration issue.
Posts: 16
Joined: Tue May 08, 2012 12:00 pm
by raspberrypiAndMe » Fri May 11, 2012 11:39 am
I just gave it try 'cause I thought my router maybe needs a different key_mgmt.

So that's what my router is able to:

WPA (TKIP)

WPA2 (CCMP)

WPA+WPA2
Posts: 10
Joined: Thu May 10, 2012 6:00 pm
by tqm » Fri May 11, 2012 11:42 am
Yup... and above you have exact working configuration examples for all of those options - WPA-PSK (from documentation) and WPA2-CCMP (via my blog) - sorry, can't help any more than that.
Posts: 16
Joined: Tue May 08, 2012 12:00 pm