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

Sun Sep 16, 2012 12:01 am

castalla wrote:I have to run the script from ssh as I can't have ethernet and hdmi connection at the same time,

I just tried running the Engman script with 0.63 - same outcome. The script terminates with error.

I'm confused as there are numerous posts confirming that Engman script works.
If you are getting the same error as before...

Unrecognised software version: Linux XBian 3.2.27+ #2 PREEMPT Sun Sep 2 15:29:38 CEST 2012 armv6l GNU/Linux

It means the same thing. The script doesn't know that version of OS.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 12:53 am

castalla wrote:I have encountered a problem trying to run the wifi script on the latest Xbian (the beta updated version).

The script terminates with:

Unrecognised software version: Linux XBian 3.2.27+ #2 PREEMPT Sun Sep 2 15:29:38 CEST 2012 armv6l GNU/Linux

How should I proceed?
There is a special version of the script built into XBian. Access it from Programs/addons in th GUI.
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: 3856
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 2:25 am

ng28 wrote:MrEngman

Yes the script is identifying the Edimax details correctly vid/pid etc...just before getting into the loop.
The file /etc/udev/rules.d/70-persistent-net.rules can stop the wifi working if it has an invalid entry but without this file with the correct data in it the wifi will not work either. This file is usually generated automatically when a wifi adapter is installed and allocates a persistent name to a particular adapter linked to the MAC address of the adapter.

I don't know why it is not being created but as it doesn't exist I am sure this is probably why the wifi is not installing. 2012-08-16-wheezy-rasbian is the primary image I now use to test the script and there really shouldn't be any problems installing the Edimax with this image. It could be there is a problem with the image you downloaded or your SD card. Whether the image can be used to make an SD card if it is corrupt I don't know but did you check the download file SHA-1 was Ok. It may be worth while making a new SD card and running the script on the fresh image.

Also don't know when you downloaded the script but it was last updated late last Friday.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

aarstar
Posts: 1
Joined: Sun Sep 16, 2012 7:04 am

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 7:07 am

Just wanted to say that I was also experiencing the loop error setting up my Edimax EW-7811Un, but your newest script worked perfectly. Thanks!

castalla
Posts: 558
Joined: Thu Jul 19, 2012 3:46 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 10:22 am

MrEngman wrote: There is a special version of the script built into XBian. Access it from Programs/addons in th GUI.
Is there a way to run this script from the command line?

As I said, I have to use ssh because the router and TV are too far apart physically for me to run xbmc & access the programs section on screen.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 1:03 pm

castalla wrote:
MrEngman wrote: There is a special version of the script built into XBian. Access it from Programs/addons in th GUI.
Is there a way to run this script from the command line?

As I said, I have to use ssh because the router and TV are too far apart physically for me to run xbmc & access the programs section on screen.
If this is any help you do not need an internet connection to the Pi to install the wifi on XBian. All the files you need are already included with the XBian image.

You should find the script here:-

Code: Select all

/root/.xbmc/addons/script.xbiansettings/resources/install-rtl8188cus-latest.sh
I would suggest you copy the script to the /boot directory and then run it with the command

Code: Select all

/boot/install-rtl8188cus-latest.sh
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

castalla
Posts: 558
Joined: Thu Jul 19, 2012 3:46 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 1:14 pm

Thanks! I'll give this a try later today.

oms
Posts: 2
Joined: Sun Sep 16, 2012 12:03 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 1:27 pm

I've had a similar problem as reported by ng28.

Yesterday, I loaded up raspbian wheezy 2012-08-16 and tried the latest script (http://dl.dropbox.com/u/80256631/instal ... -latest.sh) the distro was at this point vanilla, no apt-get upgrade or rpi-update had been done.

The wifi-dongle in question is an Edimax 7811UN.

Kernel info:

Code: Select all

Linux raspberrypi 3.1.9+ #272 PREEMPT Tue Aug 7 22:51:44 BST 2012 armv6l GNU/Linux
Upon running the script it says it blacklists the rtl8192cu driver, tells me to reboot, and re-run the script. At this stage it told me something about loading the appropriate driver, and that it would start scanning for networks, here I got an error message that scanning was not supported by wlan0.

I am not sure if I did a reboot in-between here, but I uncovered several puzzling bits:
  • dmesg emitting lines about "8192 disagrees about symbol ...."
  • lsmod showed that no 8192 module was loaded
  • trying to manually load the module with insmod, yielded another error basically stating the module was not compatible
My suspicion at this point was that the script was confused about the driver on the system:

I downloaded the compiled version, 8192cu-20120726.tar.gz, as suggested in the readme for the script, which matched my kernel version, extracted it, and saw that it was different than the module residing at:

Code: Select all

/lib/modules/3.1.9+/kernel/drivers/net/wireless/8192cu.ko
Manually inserting the 20120726 module succeeded. I checked with iwlist wlan0 scanning that it also was able to see APs around. replacing the module in /lib/modules, running depmod -a, and then rerunning the script, allowed me to continue the setup, and finally setup the /etc/network files to allow it to load on boot after this.

The bottom line, is I think there is some driver confusion which leads it to getting stuck at the scanning for APs portion, and it is probably some logic which fails to pick up that one of the modules failed to load properly.

Anyway, thanks for the tremendous effort with this script, which is no small feat, and I hope the above story, will help in pinpointing any remaining snags there may be in there.

Cheers.

castalla
Posts: 558
Joined: Thu Jul 19, 2012 3:46 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 2:28 pm

Unfortunately copying & running the script from command line doesn't work. I get the following:

=====================================================
login as: root
[email protected]'s password:
Linux XBian 3.2.27+ #1 PREEMPT Mon Aug 20 18:33:59 CEST 2012 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
[email protected]:~# /boot/install-rtl8188cus-latest.sh

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

For all images other than XBian the script will also update the software to the
latest version using apt-get update, apt-get upgrade and rpi-update.

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.

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 XBian 3.2.27+ #1 PREEMPT Mon Aug 20 18:33:59 CEST 2012 armv6l GNU/Linux

Downloading the latest script.

The script you're using is the latest version.

Aborting the rtl8188cus installation script.

[email protected]:~#

====================================================

Any more ideas?

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 2:44 pm

castalla wrote:Thanks! I'll give this a try later today.
Just tried it to see what happens and only connected to the Pi using ssh. Started with 0.6 and update to 0.6.1 then 0.6.2 then 0.6.3 then 0.7B1. Started with the wifi plugged in while running all the XBian upgrades which doesn't cause problems unlike many other images. Copied the script to /boot then ran it. It gets to the point where it shows

Code: Select all

The wifi adapter should start automatically. Just wait a while for the wifi
adapter LED to start flashing then press any key to continue...

You now have 1 wifi adapter configured
The LED doesn't start flashing so pressed the key to continue anyway and is says the wifi is configured. It now appears to hang as the wifi LED doesn't flash at all. Aborted the script with ctrl-C and then rebooted and the wifi came up OK. This is probably due to the wifi already being plugged in when the driver module is installed and so file /etc/udev/rules.d/70-persistent-net.rules is not updated with the wifi data. Normally you could get it working by removing the wifi and then plugging it back in again but I am using the new version Pi with no fuses on the USB power. It has a nasty habit of rebooting if I plug in the wifi with the Pi powered on and running, although that may be partly down to the fact I am powering it from the USB ports of my laptop. However, the power cable is from my external DVD drive and is very hefty and has two USB connectors to get sufficient power by plugging into two USB ports but doesn't help at all.

You will likely need to abort the script and reboot to get the wifi to come up regardless of the version of XBian you're using.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

castalla
Posts: 558
Joined: Thu Jul 19, 2012 3:46 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 2:56 pm

So, are you suggesting that the wifi should be plugged in before running the script?

I'm using 0.63

castalla
Posts: 558
Joined: Thu Jul 19, 2012 3:46 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 3:03 pm

Sorry - plugging the wifi in before running the script still gives the same outcome.

I'm lost!

ps: your standard script worked a treat with squeezeplug.
Last edited by castalla on Sun Sep 16, 2012 3:07 pm, edited 1 time in total.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 3:06 pm

castalla wrote:So, are you suggesting that the wifi should be plugged in before running the script?

I'm using 0.63
Your previous post showed the script you were running is NOT the one included with XBian. Do not download any scripts from the internet. They will not work. You need to run the script included with XBian.

Delete any scripts you have in your /boot directory then copy the XBian script from the location I gave in my previous post to the /boot directory and run that one.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

castalla
Posts: 558
Joined: Thu Jul 19, 2012 3:46 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 3:20 pm

You're correct - old internet script was there! Now retrying with correct script - thanks. Will update on progress later.

castalla
Posts: 558
Joined: Thu Jul 19, 2012 3:46 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 3:48 pm

Bingo!

Thanks so much for perservering with my clumsy linux skills.

Now got xbmc on wifi - streaming live tv now!

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 4:57 pm

MrEngman wrote:
ng28 wrote:MrEngman

I don't know why it is not being created but as it doesn't exist I am sure this is probably why the wifi is not installing. 2012-08-16-wheezy-rasbian is the primary image I now use to test the script and there really shouldn't be any problems installing the Edimax with this image. It could be there is a problem with the image you downloaded or your SD card. Whether the image can be used to make an SD card if it is corrupt I don't know but did you check the download file SHA-1 was Ok. It may be worth while making a new SD card and running the script on the fresh image.

Also don't know when you downloaded the script but it was last updated late last Friday.
MrEngman thanks for your help. I tried all of the above and still have the same outcome from the script its going into the loop.
- downloaded the wheezy and check the sha1
- downloaded the script and driver file
- used new SD card Sandisk class 4 8GB (earlier was using Kingston 2gb, class 2)

I am now trying options suggested by 'oms' - thanks oms for that. I am not so comfy with Linux so have started with man pages for dmesg, lsmod etc.. :) will report back later on the outcome.

Thanks

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 5:44 pm

oms wrote:I've had a similar problem as reported by ng28.

Yesterday, I loaded up raspbian wheezy 2012-08-16 and tried the latest script (http://dl.dropbox.com/u/80256631/instal ... -latest.sh) the distro was at this point vanilla, no apt-get upgrade or rpi-update had been done.

The wifi-dongle in question is an Edimax 7811UN.

Kernel info:

Code: Select all

Linux raspberrypi 3.1.9+ #272 PREEMPT Tue Aug 7 22:51:44 BST 2012 armv6l GNU/Linux
Upon running the script it says it blacklists the rtl8192cu driver, tells me to reboot, and re-run the script. At this stage it told me something about loading the appropriate driver, and that it would start scanning for networks, here I got an error message that scanning was not supported by wlan0.

I am not sure if I did a reboot in-between here, but I uncovered several puzzling bits:
  • dmesg emitting lines about "8192 disagrees about symbol ...."
  • lsmod showed that no 8192 module was loaded
  • trying to manually load the module with insmod, yielded another error basically stating the module was not compatible
Right I've just tested again. Made an SD card with the 2012-08-16-wheezy-raspbian image. First with the Pi connected with a wired interface. Booted the Pi and ran through the raspi-config to resize the image etc. and rebooted. Downloaded the script and ran it. Script adjusts some config and shuts down to let you plug in the wifi adapter. Plugged in the wifi adapter and power up. Ran the script and it installed OK. No issues at all. Using an EW-7811Un.

Made another fresh image. Now with no internet connection. Downloaded the script and driver file (8192cu-20120726.tar.gz) and copied them to the SD card /boot directory. Powered up the Pi with NO internet connection. Went through raspi-config and rebooted. Ran the script. Adjusts the config and shuts down. Plugged in the wifi adapter and powered up again. Ran the script and the wifi was installed without problems.

In both cases I exited the script without running apt-get update/upgrade and rpi-update. But I think you hadn't got to this point when you had your problem.

Were you using a wired internet connection or no internet connection and so copying all necessary files to the SD card?

How you ended up with the error messages about 8192cu I've no idea, well I have one. A different version of the driver was somehow installed but how did it get there? Did you have any other driver files loaded on the SD card and if you did where were they? If you did and they were in your home directory that might cause a problem.

OK done some more testing and have found that if there is a different driver tar.gz file in your home directory and it has been untared so the 8192cu.ko file is also in the home directory then the correct driver will not be installed, but the one in your home directory will be, and you will get stuck in the scan loop. The correct driver tar file is not untared but gives an error that I've not seen before. It is however relatively easily fixed by aborting the script with cntl-C, running the reset command to reset the terminal screen to a working state, deleting the 8192cu-2012*.tar.gz files and running the script again.

Having a look at the script now to sort this one out.
Last edited by MrEngman on Sun Sep 16, 2012 5:49 pm, edited 1 time in total.
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: 3856
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 5:45 pm

castalla wrote:Bingo!

Thanks so much for perservering with my clumsy linux skills.

Now got xbmc on wifi - streaming live tv now!
Thanks for the update and good to hear you're now up and running. :D
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: 3856
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 5:53 pm

ng28 wrote:
MrEngman wrote:
ng28 wrote:MrEngman

I don't know why it is not being created but as it doesn't exist I am sure this is probably why the wifi is not installing. 2012-08-16-wheezy-rasbian is the primary image I now use to test the script and there really shouldn't be any problems installing the Edimax with this image. It could be there is a problem with the image you downloaded or your SD card. Whether the image can be used to make an SD card if it is corrupt I don't know but did you check the download file SHA-1 was Ok. It may be worth while making a new SD card and running the script on the fresh image.

Also don't know when you downloaded the script but it was last updated late last Friday.
MrEngman thanks for your help. I tried all of the above and still have the same outcome from the script its going into the loop.
- downloaded the wheezy and check the sha1
- downloaded the script and driver file
- used new SD card Sandisk class 4 8GB (earlier was using Kingston 2gb, class 2)

I am now trying options suggested by 'oms' - thanks oms for that. I am not so comfy with Linux so have started with man pages for dmesg, lsmod etc.. :) will report back later on the outcome.

Thanks
Do you have any 8192cu-2012xxyy.tar.gz files in your home directory. If you do delete them or move them to a different directory. These files in the home directory will stop the script working properly.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

oms
Posts: 2
Joined: Sun Sep 16, 2012 12:03 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 6:09 pm

MrEngman wrote:
[snip]

Right I've just tested again. Made an SD card with the 2012-08-16-wheezy-raspbian image. First with the Pi connected with a wired interface. Booted the Pi and ran through the raspi-config to resize the image etc. and rebooted. Downloaded the script and ran it. Script adjusts some config and shuts down to let you plug in the wifi adapter. Plugged in the wifi adapter and power up. Ran the script and it installed OK. No issues at all. Using an EW-7811Un.

Made another fresh image. Now with no internet connection. Downloaded the script and driver file (8192cu-20120726.tar.gz) and copied them to the SD card /boot directory. Powered up the Pi with NO internet connection. Went through raspi-config and rebooted. Ran the script. Adjusts the config and shuts down. Plugged in the wifi adapter and powered up again. Ran the script and the wifi was installed without problems.

In both cases I exited the script without running apt-get update/upgrade and rpi-update. But I think you hadn't got to this point when you had your problem.

Were you using a wired internet connection or no internet connection and so copying all necessary files to the SD card?
I was using a wired connection when running script. Used wget to place it in /boot, and therafter running it with sudo.
MrEngman wrote: How you ended up with the error messages about 8192cu I've no idea, well I have one. A different version of the driver was somehow installed but how did it get there? Did you have any other driver files loaded on the SD card and if you did where were they? If you did and they were in your home directory that might cause a problem.

OK done some more testing and have found that if there is a different driver tar.gz file in your home directory and it has been untared so the 8192cu.ko file is also in the home directory then the correct driver will not be installed, but the one in your home directory will be, and you will get stuck in the scan loop. The correct driver tar file is not untared but gives an error that I've not seen before. It is however relatively easily fixed by aborting the script with cntl-C, running the reset command to reset the terminal screen to a working state, deleting the 8192cu-2012*.tar.gz files and running the script again.

Having a look at the script now to sort this one out.
Aha, that is probably it! I did indeed have a copy of a 8192*-latest.tar.gz as well as an extracted .ko file in ~pi. I'm guessing there won't be many users who manage to run into that behaviour, but I am grateful for having clarity on the matter, and that you took time to investigate.

Thanks and Cheers :-)

ralph_shade
Posts: 1
Joined: Sat Aug 11, 2012 11:49 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 8:27 pm

I'm very much a linux newbie, so this could just be lack of experience, but in case others are having mysterious failures, I want to share this:

I tried about five times to install my wifi adapter always getting the "The scan for wifi networks failed to find any networks." message. Today, as a desperate last ditch attempt prior to asking for help, I re-did everything from scratch, fresh SD card and all. But, this time I said NO to <automatically start graphics shell>. Everything worked like a charm!!! I can't prove this was the problem, but it was the only thing I did differently than yesterday.

So, if you've checked, rechecked and retried everything with no success, turn off the automatic startup of the graphics shell.

Ralph Shade

Hope this helps some other frustrated soul out there.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 16, 2012 10:38 pm

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.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 10:05 am

ng28 wrote:Hi

I am facing an issue configuring my EDIMAX EW-7811Un on Pi. This is my first time with installation/driver etc on Linux.

Using below devices and configuration
- Belkin 7 Port USB Hub F5U700
- huawei mifi e586 as wifi router (it can connect 5 machines)
- 2012-08-16-wheezy-raspbian
- Using MrEngman Script 'install-rtl8188cus.latest.sh'
- 8192cu-20120726.tar, as suggested by script

Issue is - The script is going into the infinite loop at line# 921 (while [ ${ADAPTER_COUNTER} -le ${ADAPTER_NUMBER} ] && [ ${EXITSTATUS} != 0 ] ; do
And keep displaying following messages.
echo "Scanning networks using wlan$ADAPTER_COUNTER" (where counter=0)
echo "The scan for wifi networks failed to find any networks."
echo
read -p "Press any key to continue... " -n1 -s

I have put in some extra echo stmt to confirm the above behavior, so am quite sure about it.

I tried putting edimax into Pi and Hub both, getting same results.

can someone help me please?

Thanks in adv.
Hi ng28,

I don't know if you've solved your problem, but I had exactly the same problem and solved it like this:

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

just puts "device does not support scanning in network-list.txt"

so to prevent the infinite loop I added an EXITSTATUS=0 as marked below


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

and then added another EXITSTATUS=0 to this bit to prevent later lockups

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 then finally to prevent the next infinite loop due to network-list.txt I commented out this block


#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

After that the script worked a treat and I've set up 3 pi's with this version

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 11:18 am

MrEngman wrote: Do you have any 8192cu-2012xxyy.tar.gz files in your home directory. If you do delete them or move them to a different directory. These files in the home directory will stop the script working properly.
I am not sure but I will check later today, but this is what I did last time. I have not internet connection to my Pi. Only option I have is make Edimax working on Pi, to access internet on Pi
- Prepared SD card with new Wheezy image on windows
- Copied your script and driver file (8192cu-20120726.tar.gz) on SD card from my windows PC. I don't see any /boot folder on SD card when i view it through windows explorer
- Put the new SD card, Edimax, Usb dongle for my RiiTek wireless key board

1) Switch on Pi, it went through normal boot process and at the end display configuration dialog with several option, exited from this windows without changing anything. Also I did not opeted for auto StartX this time earlier I had it enabled.

2) Exucted install-rtl8188cus.latest.sh

Is there a possibility that 2012-08-16-wheezy-raspbian image contains Edimax driver may be some old version or OMS's finding doesn't apply in my case. Also do you see anything wrong in the above process. I have tried to power Pi using PS and Belkin USB hub and also putting Edimax and RiiTek USB dongle in Pi and in USB hub with same outcome.

Thanks for your help

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 17, 2012 11:32 am

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

Return to “Beginners”