clovis
Posts: 10
Joined: Sat Aug 25, 2012 5:33 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 12:16 pm

ng28 wrote:Thanks Colvis for the help. If i understand correctly you are suggesting 3 changes

- Put "device does not support scanning" in network-list.txt file
- Put EXITSTATUS=0 at two places in the script

I guess 'EXITSTATUS=0' will just help ignore following messages and proceed further. Is that correct?
echo "The scan for wifi networks failed to find any networks."

Thanks for your help
Sorry, I wasn't clear.

this line in the script
iwlist wlan$ADAPTER_COUNTER scanning > network-list.txt 2>&1

results with the network-list.txt containing the line "device does not support scanning" instead of your network SSID.
Now this can cause the script to get stuck in an infinite loop.

So I made three changes to prevent the script getting stuck.
In the script find the block of code below and add the marked line of code.

if [ ${COMPATIBLE_WIFI} == 0 ]; then
while [ ${ADAPTER_COUNTER} -le ${ADAPTER_NUMBER} ] && [ ${EXITSTATUS} != 0 ] ; do
echo "Scanning networks using wlan$ADAPTER_COUNTER"
iwlist wlan$ADAPTER_COUNTER scanning > network-list.txt 2>&1
if grep -q "ESSID" network-list.txt ; then
EXITSTATUS=0
else
let ADAPTER_COUNTER=ADAPTER_COUNTER+1
fi

# check scan worked and found a list of wireless networks with at least one visible SSID

if [ ${ADAPTER_COUNTER} == ${ADAPTER_NUMBER} ] && [ ${EXITSTATUS} != 0 ]; then
cat network-list.txt
echo "The scan for wifi networks failed to find any networks."
echo
read -p "Press any key to continue... " -n1 -s
EXITSTATUS=0 ***ADDED LINE****
echo
echo
let ADAPTER_COUNTER=0
fi
done
fi


Now do the same with this block of code.

until [ ${EXITSTATUS} == 0 ]; do
while true; do
echo
read -p "Please enter the Network SSID - " SSID
echo
echo "Your network SSID is \"$SSID\", is that correct?"
read -p "press Y to continue, any other key to re-enter the SSID. " -n1 RESPONSE
if [ "$RESPONSE" == "Y" ] || [ "$RESPONSE" == "y" ]; then
echo
EXITSTATUS=0 ****ADDED LINE***
break
fi
echo
done


and finally because network-list.txt contains rubbish find the last clock of code and comment it out. Otherwise the grep will fail and the script will get stuck again.


#if the scanning failed above this will also fail and we'll get stuck in a loop.
# check we can see the network you want to connect to
# if [ -f network-list.txt ]; then
# if grep -q "ESSID:\"$SSID\"" network-list.txt ; then
# EXITSTATUS=$?
# else
# echo
# echo "That network is not visible. Does your wireless access point or router transmit"
# echo "it's SSID (network name)? If not you need to configure your access point to"
# echo "transmit the ssid."
# echo
# echo "The list of available networks will now be displayed. You can scroll through the"
# echo "list using the up and down arrow keys. To quit viewing the list use the q key."
# read -p "Press any key to continue... " -n1 -s
# echo
# cat network-list.txt | less
# echo
# echo "Do you want to continue the installation? You will need to enter a valid SSID."
# read -p "To terminate the script press N/n, any other key to re-enter the SSID. " -n1 RESPONSE
# if [ "$RESPONSE" == "N" ] || [ "$RESPONSE" == "n" ]; then
# echo
# echo
# rm network-list.txt > /dev/null 2>&1
# exit 1
# fi
# echo
# fi
# else
# EXITSTATUS=0
# fi


all the best.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 5:54 pm

I have updated the script to handle a couple of wierd problems with the way some commands behave, highlighted by some recently reported problems, and hopefully it will fix some of the problems people have been having including scanning issues.

It is available at http://dl.dropbox.com/u/80256631/instal ... -latest.sh

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: 3920
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 6:00 pm

ng28 wrote:Thanks Colvis for the help. If i understand correctly you are suggesting 3 changes

- Put "device does not support scanning" in network-list.txt file
- Put EXITSTATUS=0 at two places in the script

I guess 'EXITSTATUS=0' will just help ignore following messages and proceed further. Is that correct?
echo "The scan for wifi networks failed to find any networks."

Thanks for your help
I would recommend using the updated script instead of editing the old version. This could just mean you get stuck at some other point.

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: 3920
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 6:52 pm

Spectrose wrote:I've tried using the script on Xbian to set up my dongle, but I keep getting hung up when it tries to connect. During a fresh install, it will tell me to plug in the dongle, but get hung up saying "ADDRCONF(NETDEV_UP): wlan0: link is not ready" It stays at this message until I stop the process.

I'm using an Edimax EW-7811Un wifi adapter, plugged into a powered USB hub. I'm on version 0.6.3 of Xbian. My internet is set up currently as wpa2, with a space in the SSID (which shouldn't be a problem, should it?). I normally have mac filtering turned on, but I have already added the mac of my dongle to the list. I have tried with the filtering turned off, too.

Any help would be much appreciated.
Are you using the script that is included in the XBian image? You access it in the GUI by selecting Programs/Addons/XBian-settings.

If you have not used the XBian script then you may not have all the files installed that are needed, or they may not be the correct ones, as XBian requires additional files to be installed.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

Spectrose
Posts: 8
Joined: Sun Sep 16, 2012 10:27 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 7:28 pm

I have actually tried both ways. Initially I tried going in through the command line, (I manually made sure all the files were in the root directory that were needed, according to the instructions). Later I reformated the SD card, and ran the script from the gui. Again, the drivers were installed, but when asked to plug in the dongle, the link is not ready message came up and stayed indefinitely.

rulet
Posts: 1
Joined: Mon Sep 17, 2012 7:48 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 7:52 pm

I have this error on the usual Debian installation(not on Raspberry Pi):
r@ngf:~$ sudo ./install-rtl8188cus.sh
[sudo] password for r:


IMPORTANT UPDATE: The RTL8188CUS driver is now included in the latest updates
for the RPi. The script has been updated to hopefully make the transition as
easy as possible. To update to the new driver run the script and it will end
by running rpi-update which should load the latest kernel version with the
new driver included. The script will then reconfigure the image to use the
new driver.

This script will install the driver for Realtek RTL8188CUS based wifi adapters.

To see a list of wifi adapters using this driver take a look at the document at
http://dl.dropbox.com/u/80256631/install-rtl8188cus.txt

1. It can install a new driver if you do not already have the rtl8188cus driver
installed and have no other wifi adapter installed.
2. It can install a wifi adapter using the rtl8188cus driver if you have a wifi
adapter using a different driver already installed.
3. If the driver is already installed it will update the driver and software, or
allow you to add an different wifi adapter using the rtl8188cus driver so you
can switch between them if you want to, e.g. unplug one and plug in another,
or even connect two wifi adapters at the same time.
4. It can repair a broken driver. e.g. if you have updated the software and the
wifi has stopped working it will update the driver to a working version if
one is available.

The script will also give you the option to update the software and firmware to
the latest versions using apt-get update, apt-get upgrade and rpi-update.

Press any key to continue...

The RTL8188CUS driver module is not installed.

You have 0 wifi adapters configured.

The Pi has an internet connection.

Any files needed for the installation/upgrade will be downloaded from the
Internet.


Unrecognised software version: Linux ngf 3.2.0-3-686-pae #1 SMP Mon Jul 23 03:50:34 UTC 2012 i686 GNU/Linux

Downloading the latest script.

The script has changed. The new script has been copied to the /boot directory
of the SD card and will now be run.

Press any key to continue...

IMPORTANT UPDATE: The RTL8188CUS driver is now included in the latest updates
for the RPi. The script has been updated to hopefully make the transition as
easy as possible. To update to the new driver run the script and it will end
by running rpi-update which should load the latest kernel version with the
new driver included. The script will then reconfigure the image to use the
new driver.

This script will install the driver for Realtek RTL8188CUS based wifi adapters.

To see a list of wifi adapters using this driver take a look at the document at
http://dl.dropbox.com/u/80256631/install-rtl8188cus.txt

1. It can install a new driver if you do not already have the rtl8188cus driver
installed and have no other wifi adapter installed.
2. It can install a wifi adapter using the rtl8188cus driver if you have a wifi
adapter using a different driver already installed.
3. If the driver is already installed it will update the driver and software, or
allow you to add an different wifi adapter using the rtl8188cus driver so you
can switch between them if you want to, e.g. unplug one and plug in another,
or even connect two wifi adapters at the same time.
4. It can repair a broken driver. e.g. if you have updated the software and the
wifi has stopped working it will update the driver to a working version if
one is available.

The script will also give you the option to update the software and firmware to
the latest versions using apt-get update, apt-get upgrade and rpi-update.

Press any key to continue...

The RTL8188CUS driver module is not installed.

You have 0 wifi adapters configured.

The Pi has an internet connection.

Any files needed for the installation/upgrade will be downloaded from the
Internet.


Unrecognised software version: Linux ngf 3.2.0-3-686-pae #1 SMP Mon Jul 23 03:50:34 UTC 2012 i686 GNU/Linux

Downloading the latest script.

The script you're using is the latest version.

Aborting the rtl8188cus installation script.


r@ngf:~$

hevilp
Posts: 64
Joined: Sun Sep 09, 2012 6:13 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 9:20 pm

can u fix the script for raspbmc-versions?

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 9:41 pm

hevilp wrote:can u fix the script for raspbmc-versions?
raspbmc uses a totally different method of handling the wifi configuration. I made a very basic script that configured the wifi for raspbmc rc3 I think. It is here http://dl.dropbox.com/u/80256631/instal ... 0120801.sh but I cannot guarantee it will work
.
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: 3920
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 9:44 pm

rulet wrote:I have this error on the usual Debian installation(not on Raspberry Pi):
.
.
Unrecognised software version: Linux ngf 3.2.0-3-686-pae #1 SMP Mon Jul 23 03:50:34 UTC 2012 i686 GNU/Linux

Downloading the latest script.

The script you're using is the latest version.

Aborting the rtl8188cus installation script.


r@ngf:~$
I'm not suprised. Get Debian to fix it. This is for the Raspberry Pi. Not a PC.
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: 3920
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 10:03 pm

Spectrose wrote:I have actually tried both ways. Initially I tried going in through the command line, (I manually made sure all the files were in the root directory that were needed, according to the instructions). Later I reformated the SD card, and ran the script from the gui. Again, the drivers were installed, but when asked to plug in the dongle, the link is not ready message came up and stayed indefinitely.
Is your wifi dongle OK have you checked it on any other system? If you run command dmesg do you see any messages about rtl8192cu? If you run the command lsmod do you see an entry for 8192cu?
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

theproff
Posts: 1
Joined: Sat Sep 15, 2012 8:34 am

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 11:38 pm

Excellent work, thanks for the instructions. Ive spent hours trying to get this wifi dongle to work, i nearly gave up and bought another one to try.

the script is great, simple to invoke and use. done all the updates for me. superb..

my dongle is marked as: 802.11n, and has EDUP wrote on it

the lsusb shows it as the Realtek RTL8188CUS 802.11n WLAN Adapter


"new to raspi, my second day of ownership"

deechster
Posts: 10
Joined: Tue Nov 29, 2011 9:35 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Tue Sep 18, 2012 12:35 am

Mr Engman,

I purchased a Monoprice mini wifi adaptor. When I did lsusb I get:

Bus 001 Device 007: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

I have installed the latest version of the script and it goes to try to scan for a network I get the following:
The script will now attempt to find a list of available wifi networks.
Press any key to continue...

Bus 001 Device 007: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

The wifi adapter has been detected and is compatible with the RTL8188CUS driver.
The script will now continue and install the driver and configure the wifi.

Scanning networks using wlan0
wlan0 Interface doesn't support scanning.

The scan for wifi networks failed to find any networks.

Press any key to continue..
Any input or suggestions would be appreciated.

Thanks,
Deechster

Spectrose
Posts: 8
Joined: Sun Sep 16, 2012 10:27 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Tue Sep 18, 2012 12:40 am

MrEngman wrote:Is your wifi dongle OK have you checked it on any other system? If you run command dmesg do you see any messages about rtl8192cu? If you run the command lsmod do you see an entry for 8192cu?
This is the only mention of rtl8192cu from dmesg.

Code: Select all

[  317.695611] usbcore: registered new interface driver rtl8192cu
[  318.595159] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  441.639097] ADDRCONF(NETDEV_UP): wlan0: link is not ready
This is my complete output for lsmod:

Code: Select all

Module                  Size  Used by
8192cu                409852  0 
nfsd                   73584  0 
exportfs                2968  1 nfsd
ipv6                  205092  24 
evdev                   6828  0 
I haven't yet checked the dongle on another computer, but I'm trying that shortly, and I'll post my results.

Spectrose
Posts: 8
Joined: Sun Sep 16, 2012 10:27 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Tue Sep 18, 2012 1:46 am

I tried setting up my dongle to an old windows xp desktop. I was able to see my wifi network, but unable to connect. This is a common issue that I run into with some older xp machines. The LED also started blinking, but was not blinking when plugged into my rpi.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Tue Sep 18, 2012 9:09 am

theproff wrote:Excellent work, thanks for the instructions. Ive spent hours trying to get this wifi dongle to work, i nearly gave up and bought another one to try.

the script is great, simple to invoke and use. done all the updates for me. superb..

my dongle is marked as: 802.11n, and has EDUP wrote on it

the lsusb shows it as the Realtek RTL8188CUS 802.11n WLAN Adapter


"new to raspi, my second day of ownership"
Nice to hear. Thanks for the feedback. Have fun with your Raspberry Pi
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: 3920
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Tue Sep 18, 2012 9:59 am

Spectrose wrote:
MrEngman wrote:Is your wifi dongle OK have you checked it on any other system? If you run command dmesg do you see any messages about rtl8192cu? If you run the command lsmod do you see an entry for 8192cu?
This is the only mention of rtl8192cu from dmesg.

Code: Select all

[  317.695611] usbcore: registered new interface driver rtl8192cu
[  318.595159] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  441.639097] ADDRCONF(NETDEV_UP): wlan0: link is not ready
This is my complete output for lsmod:

Code: Select all

Module                  Size  Used by
8192cu                409852  0 
nfsd                   73584  0 
exportfs                2968  1 nfsd
ipv6                  205092  24 
evdev                   6828  0 
I haven't yet checked the dongle on another computer, but I'm trying that shortly, and I'll post my results.
OK the driver is loaded OK - lsmod shows 8192cu installed and dmesg shows registered .. rtl8192cu. if there was a problem with the driver then it wouldn't be displayed in lsmod and dmesg would show some error or other. So why doesn't the dongle start up or scan? What does the file /etc/udev/rules.d/70-persistent-net.rules contain? Should have a line referencing wlan0 and no other wifi adapters. What does the command

Code: Select all

iwlist wlan0 scanning
output. If it doesn't show a list of networks then try

Code: Select all

sudo iwlist wlan0 scanning
. Try the command without sudo first.

I have seen that iwlist wlan0 scanning may not output a list of networks but sudo iwlist wlan0 scanning does. But then if I repeat the iwlist wlan0 scanning without sudo it will then show the network list. It's behaving as though there is some setup that needs root privileges to get configured but once that's set then any user can use the command without sudo. Seems like there is a bug of some sort somewhere maybe. Could be some files have the wrong privileges set but which ones and why? Hmm.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

Spectrose
Posts: 8
Joined: Sun Sep 16, 2012 10:27 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Tue Sep 18, 2012 11:01 am

MrEngman wrote:OK the driver is loaded OK - lsmod shows 8192cu installed and dmesg shows registered .. rtl8192cu. if there was a problem with the driver then it wouldn't be displayed in lsmod and dmesg would show some error or other. So why doesn't the dongle start up or scan? What does the file /etc/udev/rules.d/70-persistent-net.rules contain? Should have a line referencing wlan0 and no other wifi adapters. What does the command

Code: Select all

iwlist wlan0 scanning
output. If it doesn't show a list of networks then try

Code: Select all

sudo iwlist wlan0 scanning
. Try the command without sudo first.

I have seen that iwlist wlan0 scanning may not output a list of networks but sudo iwlist wlan0 scanning does. But then if I repeat the iwlist wlan0 scanning without sudo it will then show the network list. It's behaving as though there is some setup that needs root privileges to get configured but once that's set then any user can use the command without sudo. Seems like there is a bug of some sort somewhere maybe. Could be some files have the wrong privileges set but which ones and why? Hmm.
70-persistent-net.rules has this:

Code: Select all

 USB device 0x:0 (smsc95xx)
UYSTEM=="net", ACTION=="add", DRIVERS=="?x", ATTR(address)==[mac address], ATTR(dev_id)=="0x0", ATTR(type)=="1", KERNEL=="eth*", NAME="eth0"
USB device 0x:0 (rt18192cu)
UYSTEM=="net", ACTION=="add", DRIVERS=="?x", ATTR(address)==[mac address], ATTR(dev_id)=="0x0", ATTR(type)=="1", KERNEL=="wlan*", NAME="wlan0"
I'm getting no scan results, and using sudo is telling me "sudo: unable to resolve host Xbian", which I'm unsure if that's a problem or not.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Tue Sep 18, 2012 10:49 pm

Spectrose wrote:
MrEngman wrote:OK the driver is loaded OK - lsmod shows 8192cu installed and dmesg shows registered .. rtl8192cu. if there was a problem with the driver then it wouldn't be displayed in lsmod and dmesg would show some error or other. So why doesn't the dongle start up or scan? What does the file /etc/udev/rules.d/70-persistent-net.rules contain? Should have a line referencing wlan0 and no other wifi adapters. What does the command

Code: Select all

iwlist wlan0 scanning
output. If it doesn't show a list of networks then try

Code: Select all

sudo iwlist wlan0 scanning
. Try the command without sudo first.

I have seen that iwlist wlan0 scanning may not output a list of networks but sudo iwlist wlan0 scanning does. But then if I repeat the iwlist wlan0 scanning without sudo it will then show the network list. It's behaving as though there is some setup that needs root privileges to get configured but once that's set then any user can use the command without sudo. Seems like there is a bug of some sort somewhere maybe. Could be some files have the wrong privileges set but which ones and why? Hmm.
70-persistent-net.rules has this:

Code: Select all

 USB device 0x:0 (smsc95xx)
UYSTEM=="net", ACTION=="add", DRIVERS=="?x", ATTR(address)==[mac address], ATTR(dev_id)=="0x0", ATTR(type)=="1", KERNEL=="eth*", NAME="eth0"
USB device 0x:0 (rt18192cu)
UYSTEM=="net", ACTION=="add", DRIVERS=="?x", ATTR(address)==[mac address], ATTR(dev_id)=="0x0", ATTR(type)=="1", KERNEL=="wlan*", NAME="wlan0"
I'm getting no scan results, and using sudo is telling me "sudo: unable to resolve host Xbian", which I'm unsure if that's a problem or not.
Well the driver is loading OK, and from the above the 70-persistent-net.rules looks OK provided the mac address is not 00:E0:4C:xx:yy:zz. If it is delete the line. For the EW-7811Un I would expect it to be something like 80:1f:02:xx:yy:zz. So why the scan isn't working is really odd.

I'm sure I've seen the "unable to resolve the host" message somewhere. I think it was after I changed the host name on one of the raspbian images I have. Didn't stop the wireless working though although I think it was changed after the wifi was set up. I suppose if you've changed the host name you could try changing it back and if you haven't changed it then I have no idea why you get this message or whether it might be related to your problem.

I've done some more testing with xbian 0.6.3, with half a dozen or so fresh images, and the wifi has always been set up. I did find one issue though. If the wifi is plugged in before running the script then the script may hang when it gets near the end waiting for the wifi to connect. Had to interrupt the script with ctrl-C to end it. However, after a reboot the wifi comes up OK. If the wifi is not plugged in until the script says "If your wifi adapter is not already plugged in please plug it in now." then it will finish OK. Has to do with registering the driver module. Needs an additional line adding to the script to avoid this issue.

Have you tried with the wifi plugged directly into the Pi? Whether it may work like this is very dependent on the power supply though, but it will avoid any conflicts with any other devices plugged into the hub which is not unknown.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

Spectrose
Posts: 8
Joined: Sun Sep 16, 2012 10:27 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Tue Sep 18, 2012 11:46 pm

MrEngman wrote:Well the driver is loading OK, and from the above the 70-persistent-net.rules looks OK provided the mac address is not 00:E0:4C:xx:yy:zz. If it is delete the line. For the EW-7811Un I would expect it to be something like 80:1f:02:xx:yy:zz. So why the scan isn't working is really odd.

I'm sure I've seen the "unable to resolve the host" message somewhere. I think it was after I changed the host name on one of the raspbian images I have. Didn't stop the wireless working though although I think it was changed after the wifi was set up. I suppose if you've changed the host name you could try changing it back and if you haven't changed it then I have no idea why you get this message or whether it might be related to your problem.

I've done some more testing with xbian 0.6.3, with half a dozen or so fresh images, and the wifi has always been set up. I did find one issue though. If the wifi is plugged in before running the script then the script may hang when it gets near the end waiting for the wifi to connect. Had to interrupt the script with ctrl-C to end it. However, after a reboot the wifi comes up OK. If the wifi is not plugged in until the script says "If your wifi adapter is not already plugged in please plug it in now." then it will finish OK. Has to do with registering the driver module. Needs an additional line adding to the script to avoid this issue.

Have you tried with the wifi plugged directly into the Pi? Whether it may work like this is very dependent on the power supply though, but it will avoid any conflicts with any other devices plugged into the hub which is not unknown.
MAC address was ok, and haven't changed the hostname.

I tried plugging my wifi directly into the pi, but all it does is cause the pi to reboot. Starting the pi with it already plugged in gives the same link is not ready error. I have tried with just a keyboard/wifi plugged in, and with my keyboard plugged into the hub, which is plugged in directly to my pi with the wifi. The results were the same each time.

deechster
Posts: 10
Joined: Tue Nov 29, 2011 9:35 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Wed Sep 19, 2012 12:28 am

MrEngman and Spectrose,

Thanks for the helpful replies. I did some of the steps that you both recommended and did discover a few more things.

Here's my dmesg:

Code: Select all

[    4.967656] usb 1-1.3.4: Product: 802.11n WLAN Adapter
[    4.997744] usb 1-1.3.4: Manufacturer: 802.11n WLPN Adapter
[    5.035810] usb 1-1.3.4: SerialNumber: 00e04c000001
[    7.057836] usb 1-1.3.1: reset high-speed USB device number 5 using dwc_otg
[    7.196881] usbcore: registered new interface driver rtl8192cu
[    8.110382] udevd[181]: renamed network interface wlan0 to wlan1
and my lsmod:

Code: Select all

Module                  Size  Used by
snd_bcm2835            20345  0 
snd_pcm                74866  1 snd_bcm2835
snd_page_alloc          4951  1 snd_pcm
snd_seq                52536  0 
snd_seq_device          6300  1 snd_seq
snd_timer              19698  2 snd_seq,snd_pcm
snd                    52489  5 snd_timer,snd_seq_device,snd_seq,snd_pcm,snd_bcm
2835
evdev                   8682  2 
joydev                  9102  0 
8192cu                481778  0 
pi@raspberrypi ~ $ 
I noticed in my dmesg that it changed my interface name from wlan0 to wlan1. For what reason I do not know. However when I changed the next command iwlist wlan0 to wlan1, it did give me a list of networks!! Yay!

This now gives me some options. I can tinker with the script and somehow hard code it so it looks at wlan1 or see what the rest of the steps the script does to configure the wlan and do that from the command line.

Any ideas why I am seeing this wlan renaming behaviour? Any suggestions would be appreciated.

Thanks,
Deechster

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

Wed Sep 19, 2012 12:52 am

Did away with Mac Addresses in the in the /etc/udev/rules.d/70-persistent-net.rules file completely based on a message from MrEngman in the past.

This lets me interchange the OS memory cards between units using the same type(s) of WiFi cards.

They all now have:

Code: Select all

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
With the change being the section ATTR{address}=="*" where the mac address number is changed to a *

I now have 2 "production" OS cards (16gb) for each device and several test cards that can basically be interchanged between the two RPi's which have two different but the same driver WiFi cards plugged directly into them (Airlink 101 and Edimax). No longer matters which WiFi USB device I use in which device.

I have 2 Edimax WiFi USB's (one is defectively slow) and 2 Airlink 101 cards all based on the RTL8188CUS driver. I've got some Monoprice ones coming in for testing as well.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

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

Wed Sep 19, 2012 12:53 am

deechster wrote:...
I noticed in my dmesg that it changed my interface name from wlan0 to wlan1. For what reason I do not know. However when I changed the next command iwlist wlan0 to wlan1, it did give me a list of networks!! Yay!

This now gives me some options. I can tinker with the script and somehow hard code it so it looks at wlan1 or see what the rest of the steps the script does to configure the wlan and do that from the command line.
Check your /etc/udev/rules.d/70-persistent-net.rules file and you most likely have 2 wlan entries.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

davecochran
Posts: 5
Joined: Wed Sep 19, 2012 1:06 am
Location: Louisiana

Re: Automatic setup for RTL8188CUS based wifi adapters

Wed Sep 19, 2012 2:08 am

Thanks for taking the time to script all this... and constant updating it as well! Just got my Pi and some rtl8192 mini usb dongles ($5 each via eBay, some knock-off or another) and they now work flawlessly..

One note... the first 5-6 attempts the dongle was seen and driver loaded, but trying to discover any of my access points the script returned "The scan for wifi networks failed to find any networks." Many reboots, moving from slot to slot, and finally got it sorted.... the only way i could get the script to discover an access point was to plug the dongle into a powered USB hub. Moved the dongle back to the Pi's USB port and it works perfectly. Strange behavior.. but I was able to duplicate this behavior with a fresh wheezy install on another card.

Thanks again!
Dave

ng28
Posts: 10
Joined: Sat Sep 08, 2012 9:45 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Wed Sep 19, 2012 9:31 am

Finally I got my edimax ew-7811un working on 2012-08-16-wheezy-raspbian and xbian 0.6.3.

For some strange reason beyond my understanding my '8192cu-20120726.tar.gz' file was 220 KB when i downloaded it using Vodafone Mifi, when I downloaded again using my 3 Phone I got a complete file 222 KB. On 220KB file, Winzp was giving the error 'Error Reading Header After Processing 0 Entries' and when executed 'tar -zxf' in RPi, linux was also reporting an error and could not unzip and untar it.

I was using the same download location in both cases.
http://dl.dropbox.com/u/80256631/8192cu-20120726.tar.gz

The winzip error was trigger for doubt on valid file; I must have downloaded the file using Vodafone Mifi at least 10 times (as this is my primary internet g/w), every time it was 220 KB only. I noticed this behaviour for other tar.gz file from the same location (i.e. http://dl.dropbox.com/u/80256631/8192cu-20120819.tar.gz)

Today I also modified the script, to confirm if driver file '8192cu.ko' is actually extracted and installed correctly, I modified the script as below

install -p -m 644 8192cu.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ > /dev/null 2>&1
insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8192cu.ko > /dev/null 2>&1
depmod -a
-----------Entered following after above line of code OR @ line# 620 in install-rtl8188cus-latest.sh dated 17th Sept--------------
# check if a driver is installed,
if [ -f /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8192cu.ko ] ; then
echo "COINGRATS - DRIVER INSTALLED SUCCESSFULY
else
echo "SORRY - DRIVER INSTALLATION FAILED
fi


Earlier with corrupted version of 8192cu-20120726.tar.gz, script was getting stuck at in loop that contains below line and was reporting the scanning error. This is obvious in absence of a driver
iwlist wlan$ADAPTER_COUNTER scanning > network-list.txt 2>&1

Also in script dated 14th Sept below line is present after insmod command giving false impression about installation. This echo is missing in script dated 17th Sept.
echo "Installed new driver."

MrEngMan – many thanks for the script and all your help.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Wed Sep 19, 2012 3:48 pm

Hi ng28,

Sorry to hear you had so many problems but glad that you've finally sorted them out and are finally up and running.

You've supplied some really helpful information and I'm in the process of updating the script to make several new checks on file validity. After uploading files to Dropbox I always check that I can download and use them OK but I have seen a similar problem you had with downloading a while back. Then I tried downloading a script I had just uploaded to dropbox and it only download a file of about 2kB. And it kept repeating this when I re-tried the download, even though the file size showed a much larger file, and this was with the Pi. However, after rebooting the Pi the download was then OK. Wierd, and why it happened I've no Idea but very annoying. Does your mobile use Arm linux? :D

Anyway when the mods done it shouldn't try installing bad drivers and I'm looking at several other additional checks as well. Then its a matter of testing them. Should be interesting.

Once again thanks very much for the info. Really useful.

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”