yvess
Posts: 1
Joined: Thu Aug 30, 2012 10:30 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Thu Aug 30, 2012 10:35 pm

I can connect to a normal wlan network with the setup from http://dl.dropbox.com/u/80256631/instal ... -latest.sh.
I'm now trying to setup it as a wlan access point with hostapd.
should hostapd be possible with this driver?
I'm running debian wheezy.
I get this error:

Code: Select all

nl80211: 'nl80211' generic netlink not found
Failed to initialize driver 'nl80211'
rmdir[ctrl_interface]: No such file or directory

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Thu Aug 30, 2012 11:29 pm

MotoBlue wrote:Little whoopsy happened to me again tonight - this is the second time this has happened.

After running rpi-update tonight, the wifi wasn't working so I ran the script sat in my /boot directory with the result - I am running the latest script, unknown kernel & script aborted.
I then found the install script renamed with .1 added and a new downloaded script with the name ending .2
I renamed the latest script which when executed, updated my wireless config without issue.
Which directory were the .1 and .2 files in, presumably your home directory? Did you backup the one in /boot with a copy in the home directory? If the script finds an unknow kernel it will download the new one to your home directory then compares the one in the /boot directory with the new one. If they are different it should move the new one to the boot directory and re-run it automatically. If the new download has an extra .1 or .2 tagged on to the file name then it's not going to work properly :(

Something else to add to my todo list.

OK, found a fix - now to upgrade the scripts. Thanks for the info.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Thu Aug 30, 2012 11:46 pm

yvess wrote:I can connect to a normal wlan network with the setup from http://dl.dropbox.com/u/80256631/instal ... -latest.sh.
I'm now trying to setup it as a wlan access point with hostapd.
should hostapd be possible with this driver?
I'm running debian wheezy.
I get this error:

Code: Select all

nl80211: 'nl80211' generic netlink not found
Failed to initialize driver 'nl80211'
rmdir[ctrl_interface]: No such file or directory
I've no idea. There is some stuff referencing hostapd in the driver source file available at Realtek so probably yes. Driver source which includes a load of documentation can be found at http://www.realtek.com.tw/downloads/dow ... loads=true
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

mm0dun
Posts: 3
Joined: Thu Aug 30, 2012 1:24 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Aug 31, 2012 6:43 am

MrENGMAN WROTE: What is the output of command "uname -a". And what is the image you are using. Not seen that one before. Where can I download it from?

From MM0DUN:
uname -a shows:
"Linux raspberrypi 3.2.23-rpi1+ #3 Sun Jul 15 16:46:51 BST 2012 armv61 GNU/Linux"

Image created by fellow radio HAM ON4TOP Image source: http://www.on4top.be/raspberry/G4KLX-ke ... 8-2012.rar

I think he stripped out alot of stuff from the image and customised it for us hams using to control radio repeaters and digital internet gateways.

Any help you can give would be very greatly appreciated.

Martin MM0DUN

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Aug 31, 2012 12:24 pm

mm0dun wrote: "Linux raspberrypi 3.2.23-rpi1+ #3 Sun Jul 15 16:46:51 BST 2012 armv61 GNU/Linux"

Image created by fellow radio HAM ON4TOP Image source: http://www.on4top.be/raspberry/G4KLX-ke ... 8-2012.rar

I think he stripped out alot of stuff from the image and customised it for us hams using to control radio repeaters and digital internet gateways.
Just a comment... It might be worth contacting ON4TOP to see if he can include the driver(s) in his ROM as an added bonus which would then allow his rom to support this type of WiFi dongle out of the box.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Aug 31, 2012 2:42 pm

Dweeber wrote:
mm0dun wrote: "Linux raspberrypi 3.2.23-rpi1+ #3 Sun Jul 15 16:46:51 BST 2012 armv61 GNU/Linux"

Image created by fellow radio HAM ON4TOP Image source: http://www.on4top.be/raspberry/G4KLX-ke ... 8-2012.rar

I think he stripped out alot of stuff from the image and customised it for us hams using to control radio repeaters and digital internet gateways.
Just a comment... It might be worth contacting ON4TOP to see if he can include the driver(s) in his ROM as an added bonus which would then allow his rom to support this type of WiFi dongle out of the box.
Just what I was thinking. There are a couple of images with the driver now included - Adafruit who compile there own I guess, and XBian, although I compile the driver for that one, which also includes a cutdown script to install it from a setup program in the GUI.

Ideally though it would be great if the built in driver was fixed. The source is way different to the driver on Realtek's site but the maintainers include a couple of guys from Realtek. I've had a look at it on and off but not having any tech documents on the rtl8188cus, Realtek are rather like Broadcom in this respect, it's a bit poke and hope.

It's easy enough to compile the driver I have from Realtek if the linux source is available. Just getting the right source is the biggest problem for the more obscure images available. For the standard versions on the RPi web site the source is readily available. Takes less than 15 minutes to compile a new linux kernel and less than a minute for the driver when needed. I just need to keep an eye out for when the code changes to keep my current one up to date. Running rpi-update several times everyday has become a bit of a habit. If an update breaks the driver I then just run a script, to try and keep it as simple as possible and save typing, to update the source, compile the updated kernel and compile a new driver version. The last week or two have been a bit hectic with the change to the new kernel revision but things are calming down again now.

If the image AND the kernel source is available then I'm quite at ease looking after the driver for whatever images people are interested in.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

markyd
Posts: 40
Joined: Fri Jan 13, 2012 11:40 am
Contact: Website

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Aug 31, 2012 3:30 pm

Hello there, not sure if I should have started a new thread but there does seem to be a lot of "knowledge" on the WiFi scene in this thread, have a working Pi for many months with an up to date "Wheezy" build and I followed the istructions to the letter re the auto build script found at:

(Instructions)
http://dl.dropbox.com/u/80256631/install-rtl8188cus.txt

(Get Script)
sudo wget http://dl.dropbox.com/u/80256631/ins...8cus-latest.sh -O /boot/install-rtl8188cus-latest.sh

(Execute Script)
sudo /boot/install-rtl8188cus-latest.sh

The script then runs, tells when to plug in your dongle, asks questions about your SSID etc ... then in my case, could not find my Virgin Media hub and bombed out .... I tried using the WPA and WEP options but both got stuck at the same place Ctrl+C had no effect :-( any ideas?

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Aug 31, 2012 4:46 pm

markyd wrote:Hello there, not sure if I should have started a new thread but there does seem to be a lot of "knowledge" on the WiFi scene in this thread, have a working Pi for many months with an up to date "Wheezy" build and I followed the istructions to the letter re the auto build script found at:

(Instructions)
http://dl.dropbox.com/u/80256631/install-rtl8188cus.txt

(Get Script)
sudo wget http://dl.dropbox.com/u/80256631/ins...8cus-latest.sh -O /boot/install-rtl8188cus-latest.sh

(Execute Script)
sudo /boot/install-rtl8188cus-latest.sh

The script then runs, tells when to plug in your dongle, asks questions about your SSID etc ... then in my case, could not find my Virgin Media hub and bombed out .... I tried using the WPA and WEP options but both got stuck at the same place Ctrl+C had no effect :-( any ideas?
"bombed out"? what's that supposed to mean? What actually happened?

You say you tried using WEP and WPA. Don't you know how your hub is set up? That's not going to help.

"could not find my Virgin Media hub" - is that just after it asks for the ssid and then says the network is not visible or what else?

If you see a list of networks but it doesn't include your network does the hub transmit it's network name (ssid). If not you will need to reconfigure the hub to transmit it's name.

Check the file /etc/udev/rules.d/70-persistent.net.rules. This file can sometimes have invalid entries in it that effectively change the name associated with the wifi adapter and can stop it working. If there are any lines referencing "wlanx" - x=0, 1, etc. edit the file and delete them.

If the sidd or password have any non-alphanumeric characters in them this can cause problems and stop the wifi connecting.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

strangelookingnerd
Posts: 7
Joined: Fri Aug 31, 2012 10:53 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Aug 31, 2012 11:03 pm

Hey there!

I'm desperatly lost while trying to get this edimax ew-7811un running on "2012-08-16-wheezy-raspbian" :( I'm trying to install without ethernet on fresh sd card.
I got the script and the 8192cu-20120726.tar.gz both in /boot but it won't find my ssid/network when running the script.
I tried running xbian since I read that newest versions come with this script and all needed files included. Running the script from xbian worked like a charm, straight connecting to my network. Therefor i conclude that the naming of the ssid can't be a problem, same for power issues (since i connect the dongle directly to the pi) and the signal. Since I would rather run raspbian i would really appreciate some assistance!

kind regards

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 1:31 am

strangelookingnerd wrote:Hey there!

I'm desperatly lost while trying to get this edimax ew-7811un running on "2012-08-16-wheezy-raspbian" :( I'm trying to install without ethernet on fresh sd card.
I got the script and the 8192cu-20120726.tar.gz both in /boot but it won't find my ssid/network when running the script.
I tried running xbian since I read that newest versions come with this script and all needed files included. Running the script from xbian worked like a charm, straight connecting to my network. Therefor i conclude that the naming of the ssid can't be a problem, same for power issues (since i connect the dongle directly to the pi) and the signal. Since I would rather run raspbian i would really appreciate some assistance!

kind regards
Where does the script get to when you decide it doesn't find your network? Just after inputting the ssid, before then or when "Waiting for the wifi adapter to connect." Does the LED on the wifi adapter flash at any point? If it does it would indicate the driver was installed OK.

Try the following. Unplug the wifi adapter. Delete the file /etc/udev/rules.d/70-persistent-net.rules.

Code: Select all

sudo rm /etc/udev/rules.d/70-persistent-net.rules
Reboot the Pi and run the script again.

Code: Select all

sudo /boot/install-rtl8188cus-latest.sh
. You may find it asks for the driver 8192cu-20120726.tar.gz file to be copied to the SD card again. Check, after the first key press to continue, if it says "You have 0 wifi adapters configured." or "1 wifi adapter configured". If it says 1 , then, when asked if you want to upgrade or add a new wifi adapter, select the upgrade option. Press U key. Otherwise if it says "0 adapters are configured" use the A key, add new adapter option. See how it goes from here.

There is some issue with wheezy and the file /etc/udev/rules.d/70-persistent-net.rules that stores persistent names assigned to wifi adapters. It can sometimes have invalid entries that can stop wifi adapters connecting.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 2:34 am

On a headless system, I always put a copy of the scripts and the driver(s) into a subdirectory of /boot called rpi. When I need to do the install, I use a small script in /boot/rpi called wifiup which copies the scripts to the /boot directory.

I found that if I need to run the script multiple times, the driver file is removed from /boot. So I would need to shutdown and play the mount the sdcard thing and then start over. Now I just run the small script (wifiup) which copies them back to /boot and I can try again.

Contents of my /boot/rpi directory

Code: Select all

[email protected]:/boot/rpi$ ls -al
total 384
drwxr-xr-x 2 root root   8192 Aug 30 04:35 .
drwxr-xr-x 4 root root  16384 Aug 30 06:37 ..
-rwxr-xr-x 1 root root 214260 Aug 25 13:56 8192cu-20120825.tar.gz
-rwxr-xr-x 1 root root  25839 Aug 27 08:49 config.txt.working
-rwxr-xr-x 1 root root  13081 Aug 27 20:48 debug.log
-rwxr-xr-x 1 root root  48600 Aug 30 04:35 install-rtl8188cus-latest.sh
-rwxr-xr-x 1 root root  40502 Aug 30 04:34 install-rtl8188cus.txt
-rwxr-xr-x 1 root root    149 Aug 27 08:48 interfaces
-rwxr-xr-x 1 root root     56 Aug 27 12:48 wifiup
The interfaces is the same found in /etc/network and is known working version in case I need that again. debug.log is something I can activate if needed for blind boots to collect some data that I can then see when I mount the sdcard. In /etc/rc.local I have a snippet that looks like:

Code: Select all

#printf "Copying Debug info to /boot/rpi\n"
#cat /var/log/dmesg >> /boot/rpi/debug.log
#lsusb >> /boot/rpi/debug.log
#ifconfig -a >> /boot/rpi/debug.log
#netstat -rn >> /boot/rpi/debug.log
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

strangelookingnerd
Posts: 7
Joined: Fri Aug 31, 2012 10:53 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 11:05 am

MrEngman wrote: Where does the script get to when you decide it doesn't find your network? Just after inputting the ssid, before then or when "Waiting for the wifi adapter to connect." Does the LED on the wifi adapter flash at any point? If it does it would indicate the driver was installed OK.
after I enter my SSID it tells me there is no such network in reach. so actually before i could enter a password. the LED remains off, no flashing. the adapter is working under windows and when i try the script with xbian as mentioned.
MrEngman wrote: Try the following. Unplug the wifi adapter. Delete the file /etc/udev/rules.d/70-persistent-net.rules.

Code: Select all

sudo rm /etc/udev/rules.d/70-persistent-net.rules
Reboot the Pi and run the script again.

Code: Select all

sudo /boot/install-rtl8188cus-latest.sh
. You may find it asks for the driver 8192cu-20120726.tar.gz file to be copied to the SD card again. Check, after the first key press to continue, if it says "You have 0 wifi adapters configured." or "1 wifi adapter configured". If it says 1 , then, when asked if you want to upgrade or add a new wifi adapter, select the upgrade option. Press U key. Otherwise if it says "0 adapters are configured" use the A key, add new adapter option. See how it goes from here.

There is some issue with wheezy and the file /etc/udev/rules.d/70-persistent-net.rules that stores persistent names assigned to wifi adapters. It can sometimes have invalid entries that can stop wifi adapters connecting.
i tried this. unplugged the adapter, restarting the pi. the 70-persistens-net.rules file doesn't exist (so i can't delete it). i start the script, 0 adapters configured. get asked to plug in the adapter, when i do so the pi restarts (kernel panic?) and then there is this:

booting gets stuck for a while

Code: Select all

waiting /dev to to be fully populated calling crda to update world regulatory domain
after it continues a message like this

Code: Select all

udevd timeout killing /sbin modprobe -b usb somecrypticalphanumerics [190]
is printed several times while the booting goes on. it stops when i try to login.
when rerunning the script now, still 0 adapter configured. again can't find my network on the same step as mentioned above. no flashing led, no searching for networks supported - so the driver isn't installed propably.

on next boot, the error messages are gone, trying to rerun the script fails because the tar.gz isn't found (guess its deleted by the script?) and still no adapter configured.

mm0dun
Posts: 3
Joined: Thu Aug 30, 2012 1:24 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 11:36 am

MrEngman wrote:
Dweeber wrote:
mm0dun wrote: "Linux raspberrypi 3.2.23-rpi1+ #3 Sun Jul 15 16:46:51 BST 2012 armv61 GNU/Linux"

Image created by fellow radio HAM ON4TOP Image source: http://www.on4top.be/raspberry/G4KLX-ke ... 8-2012.rar

I think he stripped out alot of stuff from the image and customised it for us hams using to control radio repeaters and digital internet gateways.
Just a comment... It might be worth contacting ON4TOP to see if he can include the driver(s) in his ROM as an added bonus which would then allow his rom to support this type of WiFi dongle out of the box.
Just what I was thinking. There are a couple of images with the driver now included - Adafruit who compile there own I guess, and XBian, although I compile the driver for that one, which also includes a cutdown script to install it from a setup program in the GUI.

Ideally though it would be great if the built in driver was fixed. The source is way different to the driver on Realtek's site but the maintainers include a couple of guys from Realtek. I've had a look at it on and off but not having any tech documents on the rtl8188cus, Realtek are rather like Broadcom in this respect, it's a bit poke and hope.

It's easy enough to compile the driver I have from Realtek if the linux source is available. Just getting the right source is the biggest problem for the more obscure images available. For the standard versions on the RPi web site the source is readily available. Takes less than 15 minutes to compile a new linux kernel and less than a minute for the driver when needed. I just need to keep an eye out for when the code changes to keep my current one up to date. Running rpi-update several times everyday has become a bit of a habit. If an update breaks the driver I then just run a script, to try and keep it as simple as possible and save typing, to update the source, compile the updated kernel and compile a new driver version. The last week or two have been a bit hectic with the change to the new kernel revision but things are calming down again now.

If the image AND the kernel source is available then I'm quite at ease looking after the driver for whatever images people are interested in.

MrEngman
When I plugin the wifi dongle when prompted the Pi reboots. If I remove the dongle the Pi reboots

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 12:29 pm

strangelookingnerd wrote: i tried this. unplugged the adapter, restarting the pi. the 70-persistens-net.rules file doesn't exist (so i can't delete it). i start the script, 0 adapters configured. get asked to plug in the adapter, when i do so the pi restarts (kernel panic?) and then there is this:

booting gets stuck for a while

Code: Select all

waiting /dev to to be fully populated calling crda to update world regulatory domain
after it continues a message like this

Code: Select all

udevd timeout killing /sbin modprobe -b usb somecrypticalphanumerics [190]
is printed several times while the booting goes on. it stops when i try to login.
when rerunning the script now, still 0 adapter configured. again can't find my network on the same step as mentioned above. no flashing led, no searching for networks supported - so the driver isn't installed propably.

on next boot, the error messages are gone, trying to rerun the script fails because the tar.gz isn't found (guess its deleted by the script?) and still no adapter configured.
The fact that the kernel appeared to crash when you plugged in the wifi adapter would seem to indicate a psu stability problem. Do you have a powered hub you can plug the wifi in to? There have been quite a few people who have had similar problems and then moved the wifi to a hub or tried a different PSU and then found the wifi installed OK.

Some of the errors you saw after rebooting were almost certainly due to the crash and it's possible the image could be corrupted in some way. You could always write a new image to the SD card and try installing again but I'd recommend you try with the wifi in a powered hub if you have one.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

strangelookingnerd
Posts: 7
Joined: Fri Aug 31, 2012 10:53 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 12:35 pm

MrEngman wrote: The fact that the kernel appeared to crash when you plugged in the wifi adapter would seem to indicate a psu stability problem. Do you have a powered hub you can plug the wifi in to? There have been quite a few people who have had similar problems and then moved the wifi to a hub or tried a different PSU and then found the wifi installed OK.

Some of the errors you saw after rebooting were almost certainly due to the crash and it's possible the image could be corrupted in some way. You could always write a new image to the SD card and try installing again but I'd recommend you try with the wifi in a powered hub if you have one.
I don't have a powered hub around atm but i will look into this.
but there are still two questions that bother me:
why was it working in xbian just fine?
why would i need to plug the adapter during install and not before? whats the difference?

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 12:38 pm

mm0dun wrote: When I plugin the wifi dongle when prompted the Pi reboots. If I remove the dongle the Pi reboots
Very helpful message. For a start what image is this with?

Get a decent power supply. Or plug the wifi into a powered hub.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

strangelookingnerd
Posts: 7
Joined: Fri Aug 31, 2012 10:53 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 3:59 pm

Okay, got it working with an powered usb hub. kinda odd it works with xbian out of the box but nevermind, there is the next problem. after the connection to my network was established i was asked to get some update. foolish as i am i agreed. next reboot the wlan0 isn't recognized and rerunning the script fails because of unrecognized kernel version (3.2.27+ #102 Sep 1 arm61 GNU/Linux). Script may be out of date.

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 5:23 pm

strangelookingnerd wrote:Okay, got it working with an powered usb hub. kinda odd it works with xbian out of the box but nevermind, there is the next problem. after the connection to my network was established i was asked to get some update. foolish as i am i agreed. next reboot the wlan0 isn't recognized and rerunning the script fails because of unrecognized kernel version (3.2.27+ #102 Sep 1 arm61 GNU/Linux). Script may be out of date.
Script was updated early this morning to handle the latest update. Download the script "install-rtl8188cus-latest.sh" and the latest driver "8192cu-20120830.tar.gz" and copy to the /boot directory and run the script. Select Update as opposed to adding a new adapter when asked. You do not need to unplug and plug the wifi adapter back in even though the script says you should to get the LED flashing. It should start up anyway - just takes a little longer.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 5:26 pm

strangelookingnerd wrote:
MrEngman wrote: The fact that the kernel appeared to crash when you plugged in the wifi adapter would seem to indicate a psu stability problem. Do you have a powered hub you can plug the wifi in to? There have been quite a few people who have had similar problems and then moved the wifi to a hub or tried a different PSU and then found the wifi installed OK.

Some of the errors you saw after rebooting were almost certainly due to the crash and it's possible the image could be corrupted in some way. You could always write a new image to the SD card and try installing again but I'd recommend you try with the wifi in a powered hub if you have one.
I don't have a powered hub around atm but i will look into this.
but there are still two questions that bother me:
why was it working in xbian just fine?
why would i need to plug the adapter during install and not before? whats the difference?
There is a driver included in the kernel that is supposed to support wifi adapters using the rtl8188cus chip but it doesn't work and can cause the kernel to effectively hang if the adapter is plugged in before the working driver is installed and the broken driver is disabled.

Regarding XBian it could be it uses a little less power allowing more for the wifi adapter without upsetting the Pi. Or with 2012-08-16-wheezy the reboot was just an unlucky occurence. Plugging in the wifi could have caused a current spike that upset the kernel. Difficult to tell without checking voltage levels on the Pi and USB ports.

Check back through this thread and elsewhere on the forum and you will find plenty of people reporting similar issues which were fixed by either using a powered hub for the wifi or changing the power supply.

UPDATE: I've just run some tests on a fresh 2012-08-16-wheezy-raspbian image which gave interesting results. Explains why your adapter would not connect originally.

OK. Created a new image. Plugged it into the PI. Plugged the wifi adapter, EW-7811Un, into the Pi's USB port. Powered on and waited for it to boot. Gets to the point where it displays the message

Code: Select all

cfg80211: Calling CRDA to update world regulator domain
and then appears to hang. However, after a short delay screen starts outputting a load of messages

Code: Select all

udev[168]: timeout: killing '/sbin/modprobe -b usb:v7392p7811d0200dc00dsc00dp00icFFicsFFipFF' [190]
This is refering to the wifi adapter. v7392p7811 is the USB id of the wifi adapter and probably due to the faulty driver included in the image. Eventually the logon prompt appears. Logged on and then ran the script. Stopped after inputting the ssid as it said it was not visible.

Checked file /etc/udev/rules.d/70-persistent-net.rules. It did not exist. It should be there and have a line referencing the wifi adapter as "wlan0" as this is the first wifi installed. I believe it's not there because of the error messages referencing udev above. A problem because of the non-working driver included in the kernel images I expect.

Then removed the wifi adapter and rebooted. Logged on and ran the script, plugging in the wifi when told to, and installed the wifi without problems.

I'm certain it did not connect the first time because /etc/udev/rules.d/70-persistent-net.rules did not exist. When a wifi device is plugged in an entry is normally made in this file tying the MAC address of the wifi adapter to the wifi name "wlan0" or whatever depending if more than one is configured. It can, however, cause problems if it contains an invalid entry which is why I asked you to look at it in the first place.

There appears to be a way round this which allows you to plug in the wifi adapter before running the script. You need to generate the file /etc/modprobe.d/blacklist.conf with a line "blacklist rtl8192cu" included in it.

Start with a new image with the driver and script in the /boot directory, power on and do the necessary raspi-config setup and then reboot. Now run the commands

Code: Select all

sudo su
echo "blacklist rtl8192cu" >> /etc/modprobe.d/blacklist.conf
exit
This will add the line to the file and stop the faulty driver loading and allow you to run the Pi with the wifi plugged in before installing then driver. Now shutdown the Pi

Code: Select all

sudo shutdown -h now
, power off, plug in the wifi adapter, power on and boot. After logging in run the script. This should start the wifi and allow the script to finish and run the updates. The updates will install a new version of linux so when it finishes you will need to reboot, but the wifi will not run after the reboot due to the new kernel revision, and so run the script one more time to complete the installation, requiring you to download a new driver version in the process. Hopefully you will end up with a working wifi adapter.

Let me know how you get on.

Update: good to hear you've manged to finally get it running. Just need to update the driver to handle the latest kernel update. :)

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

strangelookingnerd
Posts: 7
Joined: Fri Aug 31, 2012 10:53 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 5:32 pm

This worked for me. Thank you very much, your help and your work is much appreciated! Keep it up :lol:

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 5:35 pm

strangelookingnerd wrote:This worked for me. Thank you very much, your help and your work is much appreciated! Keep it up :lol:
Thanks.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

markyd
Posts: 40
Joined: Fri Jan 13, 2012 11:40 am
Contact: Website

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 7:23 pm

MrEngman wrote:
markyd wrote:Hello there, not sure if I should have started a new thread but there does seem to be a lot of "knowledge" on the WiFi scene in this thread, have a working Pi for many months with an up to date "Wheezy" build and I followed the istructions to the letter re the auto build script found at:

(Instructions)
http://dl.dropbox.com/u/80256631/install-rtl8188cus.txt

(Get Script)
sudo wget http://dl.dropbox.com/u/80256631/ins...8cus-latest.sh -O /boot/install-rtl8188cus-latest.sh

(Execute Script)
sudo /boot/install-rtl8188cus-latest.sh

The script then runs, tells when to plug in your dongle, asks questions about your SSID etc ... then in my case, could not find my Virgin Media hub and bombed out .... I tried using the WPA and WEP options but both got stuck at the same place Ctrl+C had no effect :-( any ideas?
"bombed out"? what's that supposed to mean? What actually happened?

You say you tried using WEP and WPA. Don't you know how your hub is set up? That's not going to help.

"could not find my Virgin Media hub" - is that just after it asks for the ssid and then says the network is not visible or what else?

If you see a list of networks but it doesn't include your network does the hub transmit it's network name (ssid). If not you will need to reconfigure the hub to transmit it's name.

Check the file /etc/udev/rules.d/70-persistent.net.rules. This file can sometimes have invalid entries in it that effectively change the name associated with the wifi adapter and can stop it working. If there are any lines referencing "wlanx" - x=0, 1, etc. edit the file and delete them.

If the sidd or password have any non-alphanumeric characters in them this can cause problems and stop the wifi connecting.

Firstly I do appeciate the time you took to reply, lets deal with things one at a time:

Bombed out .. sorry if my comments seemed a little casual I meant stopped working, became unresponsive .. no action to a CTRL+C and had to reboot.

My network is WPA, but I tried WEP too as I was not sure at the time.

After it asked for the SSID, it could not find mine and then there were no networks at all in any list and yes it is transmitting its SSID.

Check the file /etc/udev/rules.d/70-persistent.net.rules. .... ok there were two entries in there for WLAN0 and WLAN1 so as suggested I deleted them.

At this point I am going to pull the nano adaptor, reboot and try again.

sudo /boot/install-rtl8188cus-latest.sh

OK this time we made a lot more progress and the initial set up completed and I was asked if wanted to upgrade some stuff .... before I did that I did an ifconfig and wlan0 did exist and it did have an ip address.

Preparing to replace sysvinit-utils 2.88dsf-22.1 (using .../sysvinit-utils_2.88dsf-31_armhf.deb) ...
Unpacking replacement sysvinit-utils ...
Processing triggers for man-db ...
Setting up sysvinit-utils (2.88dsf-31) ...

That's where it stopped .. had a cup of coffee and then it was still at that stage, so rebooted. During the reboot log it mentioned it could not bring up wlan0 and ifconfig did not show wlan0.

Did I reboot too soon or had the script hung?

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 9:24 pm

markyd wrote:OK this time we made a lot more progress and the initial set up completed and I was asked if wanted to upgrade some stuff .... before I did that I did an ifconfig and wlan0 did exist and it did have an ip address.
Did you exit the script to run ifconfig or open another terminal window? There is no need as the script displays the output of the command ifconfig when a connection is made before it asks if you want to exit or continue and do the updates.
Preparing to replace sysvinit-utils 2.88dsf-22.1 (using .../sysvinit-utils_2.88dsf-31_armhf.deb) ...
Unpacking replacement sysvinit-utils ...
Processing triggers for man-db ...
Setting up sysvinit-utils (2.88dsf-31) ...

That's where it stopped .. had a cup of coffee and then it was still at that stage, so rebooted. During the reboot log it mentioned it could not bring up wlan0 and ifconfig did not show wlan0.

Did I reboot too soon or had the script hung?
I have seen installations fail during the update/upgrade. Sometimes the download site cannot be accessed for some reason. I've even had the kernel crash. If the script gets stuck try cntl-C and if that fails cntl-alt-del will usually get the pi to reboot. I have seen instances where the keyboard appears totally unusable except for cntl-alt del. Don't just power off and back on again. Normally I've seen the wifi come up as normal after events like these as the basic wifi setup is complete. The only additional thing the script will usually do after this point is possibly update the driver to the latest version if rpi-update is run.

However, there is an exception. With one version of wheezy I was testing, but not the very latest, when it ran apt-get upgrade it updated the Pi's firmware so after this type of upgrade the script will tell you you need to reboot and re-run the script again, using the upgrade option to upgrade the driver to match the new kernel version loaded by apt-get upgrade. This may now be becoming a standard feature when upgrading any version with apt-get. Re-running the script will install the version of driver to suit the new kernel version running and then continue on to complete the firmware and software upgrade

Be careful when interrupting upgrades. They may not necessarily have failed or hung. Especially for rpi-update. I have seen this take almost 20 minutes to do an update and there is no output to the screen during most of this time. Check if the green OK LED is flickering at all. If it is then it probably hasn't hung. But even the LED can appear to go to sleep for fairly lengthy periods.

I would suggest running the script again but this time when it asks if you want to Upgrade or Add a new adapter select Upgrade, U key. Generally the script can upgrade/re-install the drivers if an update causes the installed version to fail. That is provided the script and driver is upto date with the latest kernel version.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

Juggler
Posts: 35
Joined: Wed Aug 08, 2012 7:29 am

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 9:39 pm

MrEngman - thank you for your work.
I'm trying to setup xbian 0.6.3 with your script included.
What's wrong with it?
http://youtu.be/1oarGvgTcQs?t=1m20s
it just stops with "Firmware request failed" (I have no ethernet connection at all if it means anything).

p.s.: I'm using exaclty the same adapter in raspbian and it just work without ethernet etc...

MrEngman
Posts: 3939
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 01, 2012 10:32 pm

Juggler wrote:MrEngman - thank you for your work.
I'm trying to setup xbian 0.6.3 with your script included.
What's wrong with it?
http://youtu.be/1oarGvgTcQs?t=1m20s
it just stops with "Firmware request failed" (I have no ethernet connection at all if it means anything).

p.s.: I'm using exaclty the same adapter in raspbian and it just work without ethernet etc...
There's nothing wrong with the script as far as I know if you want to set up devices its designed to handle.

The XBian script is for adapters based on the Realtek RTL8188CUS device.!

From your video the wifi adapter you are using has USB ID 0bda:8171 which is a REALTEK RTL8188SU (8192SU family) based device, not an RTL8188CUS (8192CU family) device. Also it looks like you may need to load the firmware for this device as it shows an error "Firmware request failed". If you can arrange a wired internet connection the command

Code: Select all

sudo apt-get install firmware-realtek
may load the right firmware but I can't guarantee it. Otherwise you will need to download the firmware package and install it manually.

Check the forum on the XBian web site for various wifi installation howtos.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

Return to “Beginners”