Automatic setup for RTL8188CUS based wifi adapters


 
1148 posts   Page 6 of 46   1 ... 3, 4, 5, 6, 7, 8, 9 ... 46
by texy » Thu Jun 14, 2012 6:53 pm
I also forgot to mention that I am running the new debian wheezy distro from the 11th june.

T.
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2342
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by Smartybones » Thu Jun 14, 2012 8:15 pm
Just to add my 2p worth,,,

To start with, Thanks for the script and all the hard work and time you have put in to this. as relative linux newbie but learning fast, This has been invaluable to me getting wifi working. ~~

I have then got to add to all the people that are having problems getting this working that you must be doing something wrong. I have followed the script to the letter and with the exception with a minor error, which is easy fixable, the result is that it gets wifi working on my wifi adapter.

if you are having problems, try to go through these steps for a working wifi.

first of all, make sure you have a clean SD card. zero fill the drive.

Code: Select all
dd if=/dev/zero of=/dev/sdX

replace the X in the sdX to match your SD card location on your computer

you should all know how to write the debian image to your card by now. I dont know about other releases, but this script definately works on debian6-19-04-2012,img If you are using any other distro's then your on your own, sort it out for yourself.

once your image is written to the card, if you are going to work via ssh, then rename the file in the boot partition "boot_enable_ssh.rc" to "boot.rc"

make sure you get the latest script from http://elinux.org/RPi_VerifiedPeripherals#USB_WiFi_Adapters and scroll down to the Micronet section. there is a link to the latest script there. you cant miss it, its marked Auto-install script. Download it and copy it to your boot partition of your SD card. You don't need to bother with any other files if you plug your RPi into a LAN. Its really worth the effort to do this as it makes sure its installing the correct driver/FW for the Wifi,

plug The sdcard into your Pi, and power it up, Either login to the pi, or remotely via ssh.

DO NOT PLUG THE NETWORK ADAPTER IN UNTIL TOLD TO
run the script by issuing the following command...

Code: Select all
sudo /boot/install-rtl8188cus-20120611.sh


if all goes well, the script will update and install all the necessary files. update debian squeeze and then run the rpi-update.

I got an error while it was running the rpi-update.

Code: Select all
/opt/vc/sbin/vcfiled: error while loading shared libraries: libvchiq_arm.so: cannot open shared object file: No such file or directory


but a quick look at the info on github about hte update, its a known issue and is easy fixed by issuing the following command,

Code: Select all
ldconfig

then re-running the rpi update.
Code: Select all
sudo rpi-update

the script did its thing, the pi was rebooted with
Code: Select all
sudo reboot

and I had working wifi.




.
Posts: 174
Joined: Wed Feb 08, 2012 5:03 pm
by texy » Thu Jun 14, 2012 8:41 pm
Yes it is as simple as that....with the 19042012 Debian image. The problem is using later versions of Debian. and as I've said before - I am very grateful to mr Engman - I know he is up against it.
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2342
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by TrevorAppleton » Thu Jun 14, 2012 8:53 pm
I now have working wifi from my Raspberry Pi!

Many thanks MrEngman for all your work on this - I appreciate your efforts.
Check out my blog post for Raspberry Pi and Python tutorials.

http://trevorappleton.blogspot.co.uk/
Posts: 61
Joined: Wed May 30, 2012 7:26 pm
by markp1989 » Thu Jun 14, 2012 9:14 pm
It worked for me with a Edimax Wireless-N150 Nano

http://www.ebuyer.com/220220-edimax-wir ... -ew-7811un

Thanks.
Posts: 2
Joined: Mon May 28, 2012 10:27 pm
by MrEngman » Thu Jun 14, 2012 10:17 pm
texy wrote:Yes it is as simple as that....with the 19042012 Debian image. The problem is using later versions of Debian. and as I've said before - I am very grateful to mr Engman - I know he is up against it.
Texy


Thank you Texy,

I'm currently reworking the script so a bit tied up at the moment. It's rather try-and-see-what-happens again and again and .........but hopefully it will finish it one day. And it may even be able to handle updates, not just the initial installation.

On your previous post about kernel versions. I use
Code: Select all
uname -a
to show the kernel version data.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1843
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by MrEngman » Fri Jun 15, 2012 2:43 am
texy wrote:Hi,
I,m not sure how you got the kernel versions above, but if I use
/opt/vc/bin/vcgencmd version
I get
version 319515 (released)

Do we need a newer driver, as your 20120611 one above doesn't appear to work ?
I have only run your 20120611 script once, so I know there isn't any duplicate entries.

Texy

The driver loaded by the current script 20120611 runs OK on the latest image from the latest rpi-update. Well, it does for me. :o

If you have a wired ethernet connection you only need the script to install the wifi. Everything else needed is loaded from the internet. If you start without a wired ethernet you need two additional files named below. Download details are in the instructions available via the link on the wiki. These two files are to get the wifi running on the base Debian6-19-04-2012 image so the remaining files required can be downloaded from the internet via the wifi.

Right I've just done two new installations on two brand new, never before used, SD cards. I generated two SD cards using the Debian6-19-04-2012 image.

For the first test I copied one file, the install-rtl8188cus-20120611.sh script to the /boot sector. Plugged it into the Pi, plugged in an ethernet cable and powered on. The Pi went through the first time initialisation process and when finished I then logged in. Then I started the script.
Code: Select all
sudo /boot/install-rtl8188cus-20120611.sh
The script ran loading all the required files from the internet via the wired ethernet. When prompted at the end of the script I plugged in the wifi adapter, removed the ethernet cable and pressed a key to reboot. The Pi rebooted and the wifi started up and connected without problems. I then shutdown and powered off ready for the second test.

I then ran the second test with the other newly generated card. First I copied the script and then two additional files, the driver and firmware files
Code: Select all
install-rtl8188cus-20120611.sh
8192cu.tar.gz
dwa130_revC_drivers_linux_006.zip
to the /boot directory of the SD card. Then I plugged it into the Pi, disconnected the wireless ethernet cable and then powered on the Pi. The Pi once again ran through the first time initialisation routine And I then logged in. I then started the script.
Code: Select all
sudo /boot/install-rtl8188cus-20120611.sh
As this time there was no ethernet connection the script installed the driver and firmware from the two files I'd copied into the /boot sector. The wireless started up OK and then the script continued to do the software updates as with the other test. At the end of the script the updated driver module was installed and I was asked to press any key to reboot. Again the Pi rebooted Ok and the wifi started up and ran OK.

Checking the version of code loaded both SD cards gave the same response.
Code: Select all
uname -a
Linux raspberrypi 3.1.9+ #110 PREEMPT Wed Jun 13 11:44:58 BST 2012 armv6l
If the wifi is installed on a Pi without ethernet connection it first loads the original driver and firmware mentioned above. This step is ignored if the Pi has a wired ethernet connection. The script then loads a DHCP update, updates the Debian package list and automatically updates a number of packages, I think mostly libraries, using apt-get upgrade. Additional packages needed to run rpi are loaded, rpi-update is intalled and run to update the Pi firmware. After rpi-update is finished my latest version of the wifi driver is loaded and installed. The Pi is then rebooted to finish the installation.

You can change the version of driver used quite simply to see if a different driver works. First copy the driver into a directory on the SD card. Untar it and from the same directory the drive file is in run the commands
Code: Select all
install -p -m 644 8192cu.ko /lib/modules/3.1.9+/kernel/drivers/net/wireless/
depmod -a
This will install the new driver module and initialise it. Then to start the wifi you should only need to unplug it and then plug it back in. However, I would really expect the wifi to run with the latest driver.

You might find a clue as to why the wifi is not working by using the command
Code: Select all
dmesg | more
This will output the log data from booting a page at a time. Press space to go to the next page. See if there is anything referencing "8192cu". If you find anything it may help explain why your wifi doesn't want to work.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1843
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by texy » Fri Jun 15, 2012 6:18 am
MrEngman wrote:
texy wrote:Hi,
I,m not sure how you got the kernel versions above, but if I use
/opt/vc/bin/vcgencmd version
I get
version 319515 (released)

Do we need a newer driver, as your 20120611 one above doesn't appear to work ?
I have only run your 20120611 script once, so I know there isn't any duplicate entries.

Texy

The driver loaded by the current script 20120611 runs OK on the latest image from the latest rpi-update. Well, it does for me. :o
.


...yes it does for me too ;)
Where it does not work is with the new wheezy distro outlined here :
viewtopic.php?f=50&t=8071

I,m guessing that as you have needed to compile the driver for different version of squeezy, then there would be a need for a new one for wheezy as well?

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2342
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by Nburnes » Fri Jun 15, 2012 8:03 am
texy wrote:
MrEngman wrote:
texy wrote:Hi,
I,m not sure how you got the kernel versions above, but if I use
/opt/vc/bin/vcgencmd version
I get
version 319515 (released)

Do we need a newer driver, as your 20120611 one above doesn't appear to work ?
I have only run your 20120611 script once, so I know there isn't any duplicate entries.

Texy

The driver loaded by the current script 20120611 runs OK on the latest image from the latest rpi-update. Well, it does for me. :o
.


...yes it does for me too ;)
Where it does not work is with the new wheezy distro outlined here :
viewtopic.php?f=50&t=8071

I,m guessing that as you have needed to compile the driver for different version of squeezy, then there would be a need for a new one for wheezy as well?

Texy

*Squeeze

I can back the fact it doesn't work on the new alpha/beta/test image of wheezy.
Posts: 23
Joined: Fri May 25, 2012 7:00 am
by Reider » Fri Jun 15, 2012 10:19 am
This link....http://wiki.debian.org/rtl819x may help with the Edimax 7811Un and install into Wheezy. I cannot follow it on my meds but someone else may be able to. There is a Wheezy link and the Edimax 7811Un is on the supported list. That link to wheezy goes here....http://wiki.debian.org/rtl819x#Wheezy Hope it works....

Steve
Posts: 75
Joined: Sun Mar 04, 2012 12:00 pm
by MrEngman » Fri Jun 15, 2012 11:39 am
texy wrote:I also forgot to mention that I am running the new debian wheezy distro from the 11th june.

T.


Just seen this. No wonder the driver isn't working. I'm getting hold of a copy and will take a look at getting the driver working on it.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1843
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by asb » Fri Jun 15, 2012 11:40 am
MrEngman wrote:
texy wrote:I also forgot to mention that I am running the new debian wheezy distro from the 11th june.

T.


Just seen this. No wonder the driver isn't working. I'm getting hold of a copy and will take a look at getting the driver working on it.

MrEngman


And indeed, if people with the right hardware could let me know the minimal changes to have it working out of the box for them I'd be most grateful.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 794
Joined: Fri Sep 16, 2011 7:16 pm
by texy » Fri Jun 15, 2012 12:02 pm
asb wrote:
MrEngman wrote:
texy wrote:I also forgot to mention that I am running the new debian wheezy distro from the 11th june.

T.


Just seen this. No wonder the driver isn't working. I'm getting hold of a copy and will take a look at getting the driver working on it.

MrEngman


And indeed, if people with the right hardware could let me know the minimal changes to have it working out of the box for them I'd be most grateful.


....what does this :
Wheezy
The testing distribution currently supports Realtek RTL8188CE, RTL8188CUS,....


from this :
http://wiki.debian.org/rtl819x#Wheezy

actually mean? With regards to getting it working on a pi ?

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2342
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by asb » Fri Jun 15, 2012 12:24 pm
texy wrote:Wheezy
The testing distribution currently supports Realtek RTL8188CE, RTL8188CUS,....


from this :
http://wiki.debian.org/rtl819x#Wheezy

actually mean? With regards to getting it working on a pi ?
[/quote]

Should be the same procedure. The following Realtek kernel modules at least are included, so if you adapter is supported by one you should just need the firmware:

Code: Select all
./3.1.9+/kernel/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
./3.1.9+/kernel/drivers/net/wireless/rtlwifi/rtlwifi.ko
./3.1.9+/kernel/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
./3.1.9+/kernel/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko
./3.1.9+/kernel/drivers/staging/rtl8712/r8712u.ko
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 794
Joined: Fri Sep 16, 2011 7:16 pm
by rcosnett » Fri Jun 15, 2012 2:48 pm
Hi,
Have you tried to setup the Raspbian and or the new Debian Wheeze,

I have tried both, I have used half your script, (without the update function). Checked the entries, but
have had no success.

Any help will be useful, trying to understand Debian Linux.

Cheers
Bob
Posts: 4
Joined: Sun Jun 10, 2012 8:18 am
by texy » Fri Jun 15, 2012 2:54 pm
Bob, read the last 5 or 6 posts in this thread !!!!!

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2342
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by joeh » Fri Jun 15, 2012 6:29 pm
Anyone have any suggestions ..... (please :) )

I have tried various different PSUs, memory cards etc but cannot get the edimax nano dongle to work reliably

I have the standard debian image, used the install script and yes after a reboot the card works but then after a random period of time the network will drop out and looking at the kernel log I end up with a load of garbage characters in the kernel log.

I'm running with a 2amp Blackberry playbook adaptor and connecting to a wireless N network (TP-Link W8960n router) with iwconfig showing a connection of 150Mbps on the Pi.

It appears as though as soon as I put any amount of network load on the link it craps out.

Anyone else seeing this, is it the N network, not enough power, now using a powered hub?
Posts: 6
Joined: Tue Jun 12, 2012 9:29 pm
by olibanum » Fri Jun 15, 2012 6:35 pm
Have you tried checking the voltage on the board? Puttin a voltmeter on the test points and reporting back the average you are seeing. 5 volts is needed but I've seen it drop to as low as 4.5v and still run ok.
A friend of mine was having issues similar to this using a 2 amp iPad charger but found it was actually the cable that was causing a drop in voltage ranging from 3.6v to 4.3v
Posts: 20
Joined: Wed Jun 06, 2012 9:11 pm
by joeh » Fri Jun 15, 2012 6:51 pm
Fingers crossed may have just found the issue, wireless hasn't crapped out since I changed my router from 20Mhz to 20/40Mhz mode .... go figure :shock:
Posts: 6
Joined: Tue Jun 12, 2012 9:29 pm
by joeh » Fri Jun 15, 2012 8:01 pm
No it crapped out yet again after 20 minutes, after plugging both the Pi and the wireless dongle into separate ports on a powered hub it seems to be working fine.
Posts: 6
Joined: Tue Jun 12, 2012 9:29 pm
by Reider » Fri Jun 15, 2012 9:44 pm
I believe the Wheezy Beta may well be released this weekend. So the goalposts may move again. Hopefully those of us with the Edimax 7811Un and others using similar hardware and drivers will be able to get them working. If the Beta is anything like half as good as the Alpha, which it should be, then it will be fast and smooth in use. Having the WiFi work from source or at the selection of a menu would make it even better.

The original poster in this thread will know exactly what is needed to make it all work. Or at least have a good idea. I hope this works out for all. Thanks for posting all of you,

Steve
Posts: 75
Joined: Sun Mar 04, 2012 12:00 pm
by AndyOfLinux » Sat Jun 16, 2012 1:23 am
Thanks for the script and 8192cu module(s)!

I finally have WiFi working with my Edimax EW-7811Un USB ID 7392:7811, RTL8192CU adapter.

But...

my logs are working overtime with messages (kern.log, messages, syslog):
Code: Select all
pi@raspberrypi:/var/log$ uname -a
Linux raspberrypi 3.1.9+ #110 PREEMPT Wed Jun 13 11:41:58 BST 2012 armv6l GNU/Linux

>>> /var/log/messages:

Jun 15 18:19:37 raspberrypi kernel: [ 1334.215066] rtl8192c_set_FwPwrMode_cmd(): Mode = 1, SmartPS = 2
Jun 15 18:19:49 raspberrypi kernel: [ 1346.063958] rtw_set_ps_mode(): Busy Traffic , Leave 802.11 power save..
Jun 15 18:19:49 raspberrypi kernel: [ 1346.064273] rtl8192c_set_FwPwrMode_cmd(): Mode = 0, SmartPS = 0
Jun 15 18:19:49 raspberrypi kernel: [ 1346.225773] rtl8192c_dm_RF_Saving(): RF_Save
Jun 15 18:19:53 raspberrypi kernel: [ 1350.217093] rtw_set_ps_mode(): Enter 802.11 power save mode...
Jun 15 18:19:53 raspberrypi kernel: [ 1350.219636] rtl8192c_dm_RF_Saving(): RF_Normal

Any thoughts or help would be appreciated!
User avatar
Posts: 7
Joined: Mon Sep 26, 2011 8:54 pm
by MrEngman » Sat Jun 16, 2012 9:46 am
AndyOfLinux wrote:Thanks for the script and 8192cu module(s)!

I finally have WiFi working with my Edimax EW-7811Un USB ID 7392:7811, RTL8192CU adapter.

But...

my logs are working overtime with messages (kern.log, messages, syslog):
Code: Select all
pi@raspberrypi:/var/log$ uname -a
Linux raspberrypi 3.1.9+ #110 PREEMPT Wed Jun 13 11:41:58 BST 2012 armv6l GNU/Linux

>>> /var/log/messages:

Jun 15 18:19:37 raspberrypi kernel: [ 1334.215066] rtl8192c_set_FwPwrMode_cmd(): Mode = 1, SmartPS = 2
Jun 15 18:19:49 raspberrypi kernel: [ 1346.063958] rtw_set_ps_mode(): Busy Traffic , Leave 802.11 power save..
Jun 15 18:19:49 raspberrypi kernel: [ 1346.064273] rtl8192c_set_FwPwrMode_cmd(): Mode = 0, SmartPS = 0
Jun 15 18:19:49 raspberrypi kernel: [ 1346.225773] rtl8192c_dm_RF_Saving(): RF_Save
Jun 15 18:19:53 raspberrypi kernel: [ 1350.217093] rtw_set_ps_mode(): Enter 802.11 power save mode...
Jun 15 18:19:53 raspberrypi kernel: [ 1350.219636] rtl8192c_dm_RF_Saving(): RF_Normal

Any thoughts or help would be appreciated!


What did you have to do to finally get it going? I have my wifi adapter installed and the driver appears to be working but no wifi connection. The wifi adapter flashes it's LED just once when booting and that's it. Looks like some additional set up required somewhere.

The log stuff is annoying but I think just the new driver - not due to any problem - another item on my list of things to do.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1843
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by MrEngman » Sat Jun 16, 2012 12:26 pm
asb wrote:
texy wrote:
Wheezy
The testing distribution currently supports Realtek RTL8188CE, RTL8188CUS,....


from this :
http://wiki.debian.org/rtl819x#Wheezy

actually mean? With regards to getting it working on a pi ?


Should be the same procedure. The following Realtek kernel modules at least are included, so if you adapter is supported by one you should just need the firmware:

Code: Select all
./3.1.9+/kernel/drivers/net/wireless/rtl818x/rtl8187/rtl8187.ko
./3.1.9+/kernel/drivers/net/wireless/rtlwifi/rtlwifi.ko
./3.1.9+/kernel/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
./3.1.9+/kernel/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko
./3.1.9+/kernel/drivers/staging/rtl8712/r8712u.ko

Unfortunately not the case. There is a firmware-realtek package but adding that is no help as it doesn't contain the rtl8192cu firmware. I have found a firmware package on Ubuntu, linux-firmware, which does contain rtl8192cu firmware, and firmware for a whole host of other devices. I have tried installing that and it doesn't help either.

So if the driver is there where is the correct firmware to get it running, that is rt8188cus chip based adapters, described by Realtek as one of the rtl8192cu family and which works with the rtl8192cu drive from Realtek? Someone should know surely. So tell us where is it

And if there is no firmware why is that driver included? Why not just add the new driver, which does not need seperate firmware, to the source and have done with the problem.

So refering to Texy's quote, who wrote this because it is just not true. As far as I'm concerned the distribution DOES NOT support the RTL8188CUS otherwise you would be able to plug it, configure it, and and it would work!! I fact no distribution I've tried supports the RTL8188CUS.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1843
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by Montala » Sat Jun 16, 2012 1:17 pm
Very many thanks to MrEngman for all his hard work on this subject, which I am sure will be appreciated by a lot of members... including myself!

I don't wish to stray too far 'off topic' here, but has anyone who has managed to get one of these devices working successfully done so with the tiny Edimax adapter plugged directly into one of the USB ports on their Raspberry Pi, and with something like a Logitech keyboard/mouse 'dongle' in the other one, without having to use a hub?

This is something I would really love to achieve! :)
User avatar
Posts: 638
Joined: Mon Mar 05, 2012 11:54 pm
Location: Herefordshire (U.K.)