Automatic setup for RTL8188CUS based wifi adapters


 
1148 posts   Page 3 of 46   1, 2, 3, 4, 5, 6 ... 46
by Badvok » Wed May 30, 2012 11:04 am
Hi,
just wanted to say thanks, as a complete novice i didn't think i'd get my wifi working so easily,
excellent job, works perfectly with my Edimax EW-7811Un
Posts: 5
Joined: Tue May 01, 2012 8:33 am
by MrEngman » Wed May 30, 2012 11:40 am
rahduke wrote:UPDATE: IT WORKS!!! Switched out my router from an old WRT54G to a new Cisco Linksys E1200 and the script worked 1st time through!! MrEngmann Thank you so much for all your help! I've been waiting over a year for this day :P :P :P


That's really good to hear. Thanks for letting me know.

EDIT: You could try updating dhcp on the Pi to get it to work with your other router but I don't suppose you'll care too much about that now :)

Any way if you're interested try "sudo apt-get install isc-dhsp-client". This has fixed a number of issues I've seen where attempts to access the Pi across the network can only be done using IP numbers, not using host names. e.g. you use SSH to access the Pi and can only use IP numbers. Updating dhcp should allow you to use the host name.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1863
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by texy » Wed May 30, 2012 6:13 pm
Well my Edimax EW-7811Un arrived from amazon today. All was going well until the rpi-updater wanted to update the firmware. It did say it would take a few minutes, which it did, but then an error occured. However it continued and after the reboot wlan0 is no longer being seen?
lsusb still detects the Edimax OK, and it was obviously working OK during the driver install, etc, so I,m not sure whats gone wrong ?
Does the rpi-updater NEED to run in order for the adapter to work? (I have not run it since receiving my Pi)
Maybe I need to start again with a fresh Debian image.

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2451
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by rahduke » Wed May 30, 2012 6:55 pm
texy wrote:Well my Edimax EW-7811Un arrived from amazon today. All was going well until the rpi-updater wanted to update the firmware. It did say it would take a few minutes, which it did, but then an error occured. However it continued and after the reboot wlan0 is no longer being seen?
lsusb still detects the Edimax OK, and it was obviously working OK during the driver install, etc, so I,m not sure whats gone wrong ?
Does the rpi-updater NEED to run in order for the adapter to work? (I have not run it since receiving my Pi)
Maybe I need to start again with a fresh Debian image.

Texy


I was having a similiar issue after it first installed, I removed the adapter rebooted loggged in without the adapter plugged in. Then I plugged it in, and issued a networking restart sudo /etc/init.d/networking restart and my adapter worked. Try that
Posts: 11
Joined: Fri May 25, 2012 11:56 pm
by MrEngman » Wed May 30, 2012 7:30 pm
texy wrote:Well my Edimax EW-7811Un arrived from amazon today. All was going well until the rpi-updater wanted to update the firmware. It did say it would take a few minutes, which it did, but then an error occured. However it continued and after the reboot wlan0 is no longer being seen?
lsusb still detects the Edimax OK, and it was obviously working OK during the driver install, etc, so I,m not sure whats gone wrong ?
Does the rpi-updater NEED to run in order for the adapter to work? (I have not run it since receiving my Pi)
Maybe I need to start again with a fresh Debian image.

Texy


Guess rpi-update doesn't need to run. It does, however, reputedly fix some issues with usb and other things. I run it fairly often and always use it when starting with a newly written SD card via my script. I think the only time I've had any problems is when I've not downloaded one of the packages it needs and then it aborts anyway before doing any updates. Using my script it's never given me any problem.

Any idea what the error while running rpi-udate was? I've run rpi-update quite a few times without problems and just again after seeing your post - no problems. It does say when it finishes "If no errors appeared, your firmware was successfully updated". Implying there may be a software problem if there was an error.

There have been some issues with rpi-update in the early days but not recently as far as I know.

I would suggest trying with a fresh install and see what happens. If rpi-update gives an error make a note of what it is.

If you'd rather not download any of the updates in the script you can edit the script to stop it after installing the wifi and before doing the updates.

I use the editor nano. To edit the script run the command
Code: Select all
sudo nano /boot/install-rtl8188cus.sh

then look for the line containing
Code: Select all
sleep 2

ifconfig

echo

after that line add
Code: Select all
exit

that will terminate the script before running any updates. Save the change and exit nano by typing ctrl-X Y Enter.

You can then add any updates manually if you want to.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1863
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by texy » Wed May 30, 2012 7:46 pm
Sorry, memory like a sieve - is it logged anywhere?
The network restart doesn't work. wlan0 was definately working otherwise the updater would not of worked. i also noticed a message about a new ip address. It was only until after the updater forced a restart that it would not work. Would it not make sense to run the updater BEFORE the adapter install?

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2451
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by MrEngman » Wed May 30, 2012 8:29 pm
texy wrote:Sorry, memory like a sieve - is it logged anywhere?
The network restart doesn't work. wlan0 was definately working otherwise the updater would not of worked. i also noticed a message about a new ip address. It was only until after the updater forced a restart that it would not work. Would it not make sense to run the updater BEFORE the adapter install?

Texy


Logged anywhere? Possibly but sorry I've no idea where. dmesg keeps being mentioned but whether that will show the error I've no idea. There is a directory "/var/log" that has loads of log files but which file to look at I don't know.

My setup was intended to work without any initial network connection to the Pi - such as no wired connection being available. The network connection would then be made only after the wireless was installed. If you've got a wired connection then you can of course run the updates first.

And what about the model A Pi - no network connector. So you will need a USB to wired network adapter or a wifi adapter. And how do you then get an internet connection to get updates etc. if either type of adapter is not directly supported? First you will need to install the drivers for the networking device being used. So maybe some method in my madness ;)

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1863
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by texy » Thu May 31, 2012 6:25 am
Hi,
I reimaged my SD card with the 19/04/2012 Debian image and copied over the 3 files with my vista laptop. I then used wordpad to edit the script file as you
suggested above, but it seems wordpad alters the file somehow so that when you attempt to run it on the Pi it just immediately returns to the prompt.
It was getting late at that time, so I just copied over and ran the unaltered script file again to see if any improvement could be seen. Unfortunately it is still the same - the wifi adpater works when it is initially configured. By this time I had relegated from the family TV to upstairs and it getting darker, I noticed the blue LED on the adapter and of course it was busy flashing away when the rpi-updater was downloading packages. However shortly after the rpi firmware updater told you 'this may take a few minutes', the same problem occured - wlan0 stopped working and no amount of reset or repowering would kick it into life (and no blue LED). Ran out of time at that point, so tonight I will reimage the SD card again, and use the Pi to put in the extra 'exit' in the script. I am convinced the latest updates are killing the adapter, but we will see.
Thanks for your help so far - it is working for others, so I,m sure we will get there ;)

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2451
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by texy » Thu May 31, 2012 7:22 am
Incidently I've just cut and pasted this :

Using ARM/GPU memory split of 192MB/64MB
We're running for the first time
Setting up firmware (this will take a few minutes)
Using SoftFP libraries
/opt/vc/sbin/vcfiled: error while loading shared libraries: libvchiq_arm.so: cannot open shared object file: No such file or directory
If no errors appeared, your firmware was successfully setup

..this is the error I saw, others people have also seen it - its probably not relevant or important to my problem - or is it?


Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2451
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by MrEngman » Thu May 31, 2012 9:22 am
texy wrote:Incidently I've just cut and pasted this :

Using ARM/GPU memory split of 192MB/64MB
We're running for the first time
Setting up firmware (this will take a few minutes)
Using SoftFP libraries
/opt/vc/sbin/vcfiled: error while loading shared libraries: libvchiq_arm.so: cannot open shared object file: No such file or directory
If no errors appeared, your firmware was successfully setup

..this is the error I saw, others people have also seen it - its probably not relevant or important to my problem - or is it?


Texy


Hi Texy,

I've just started seeing this as well. Looks like there is a problem with rpi-update. And it screws up Debian so the wifi drive cannot load and so the wifi dies.

I've updated the script so rpi-update is not run. The third line of the script is now "UPDATER=0". The value of UPDATER enables or diables running rpi-update. 0 (zero) disables rpi-update, 1 (one) enables it. This should fix the problem. You can get the updated script here

In Linux the end of line in text files are only line-feed characters. In Windows generally the line endings are carriage-return + line-feed. Linux doesn't take too kindly to these line endings. It is possible to edit Linux files with Notepad without adding carriage-return characters but not easy. Editing using Wordpad will also always change the line-feeds to carriage-returns + line-feed.

I normally edit my files with Wordpad but then use a hex editor to remove the carriage returns (0D characters). Takes me back to the days when I used to write programs using hex object code. Those were the days.

Anyway sorry for the problems you had but the updated script should sort them out.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1863
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by texy » Thu May 31, 2012 9:49 am
Thanks - confirms my fears of the update. I'm sure we could of sorted it last nite, but ran out of time. I will try it again later. I'm sure others will join me in thanking you for the help you gave given us Linux newbies.
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2451
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by alexeames » Thu May 31, 2012 10:01 am
There's a text editor called Gedit which allows you to save files in either windows or Linux format.
It's pretty good for Python programming too. Recommend you give it a shot. Or just use nano to edit it on the Pi itself.

http://ftp.gnome.org/pub/gnome/binaries/win32/gedit/
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2091
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by TenderLoins » Thu May 31, 2012 10:19 am
MrEngman wrote:I've just started seeing this as well. Looks like there is a problem with rpi-update. And it screws up Debian so the wifi drive cannot load and so the wifi dies.

I've updated the script so rpi-update is not run. The third line of the script is now "UPDATER=0". The value of UPDATER enables or diables running rpi-update. 0 (zero) disables rpi-update, 1 (one) enables it. This should fix the problem. You can get the updated script here


Hi MrEngman, first, thank you for writing this little script, helped me out a great deal.

I managed to get my adapter working with your script a while back, but have a feeling that the rpi-update messed things up more recently. I'm gonna have another go at this this evening, and I was wondering whether you can run rpi-update first, and then your script to get around this issue? I just like to have everything nicely up-to-date :)

MrEngman wrote:In Linux the end of line in text files are only line-feed characters. In Windows generally the line endings are carriage-return + line-feed. Linux doesn't take too kindly to these line endings. It is possible to edit Linux files with Notepad without adding carriage-return characters but not easy. Editing using Wordpad will also always change the line-feeds to carriage-returns + line-feed.

I normally edit my files with Wordpad but then use a hex editor to remove the carriage returns (0D characters). Takes me back to the days when I used to write programs using hex object code. Those were the days.


Try Notepad++. Very nice editor, which has a feature that can change line-endings to your targetted system (e.g. Mac, Linux or Windows).
Posts: 12
Joined: Tue May 29, 2012 11:48 am
by xebyte » Thu May 31, 2012 11:15 am
Any luck with installation on OpenELEC/Raspbmc? I have Edimax nano and I'm trying to install this dongle on my Raspi for 3 days now :( If you have any tips on how to make it work It'll be really great.

Thanks
Posts: 2
Joined: Thu May 31, 2012 11:12 am
by MrEngman » Thu May 31, 2012 11:20 am
Hi Tenderloins,

Running rpi-update at the moment generates an error during the update indicating some issue in the update and also kills the rtl8188cus driver or more precisely doesn't let it run because something has changed in the module handling. So until at least the error is fixed it maybe better to forget rpi-update for the moment unfortunately.

I'm of the same mind and like to keep things upto date, hence running rpi-update in the script.

My prefered editor in Windows is Winedit, not to confuse it with Winedt, but it's no longer available and the version I have from 2001 doesn't work in Windows 7 although I can run it in an XP virtual machine. This also allows selecting various line-endings. Maybe I'll have a look at Notepad++ but I've yet to find anything to beat my prefered editor.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1863
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by texy » Thu May 31, 2012 5:47 pm
Many thanks again Engman - it is all now working :D

....now to get the hostname working properly, cos my router thinks its UNKNOWN.

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2451
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by drentsoft » Thu May 31, 2012 7:18 pm
Thanks Engman! Worked perfectly with my Novatech brand (Add-on Tech) 11N nano Wifi dongle! Much appreciated. :D
Posts: 19
Joined: Thu May 31, 2012 7:13 pm
Location: Berkshire, England
by MrEngman » Fri Jun 01, 2012 11:10 am
texy wrote:Many thanks again Engman - it is all now working :D

....now to get the hostname working properly, cos my router thinks its UNKNOWN.

Texy


When you ran the script to install the wifi did the dhcp update get installed or did the script stop before that. Without it I couldn't use hostnames to talk to the Pi and had to use IP addresses. To manually run the dhcp update the commands are:
Code: Select all
wget http://http.us.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp-common_4.2.2.dfsg.1-5_armel.deb
wget http://http.us.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp-client_4.2.2.dfsg.1-5_armel.deb
sudo dpkg -i isc-dhcp-common_4.2.2.dfsg.1-5_armel.deb
sudo dpkg -i isc-dhcp-client_4.2.2.dfsg.1-5_armel.deb
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1863
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by texy » Fri Jun 01, 2012 11:22 am
Sorry I don't know - I just left it to its own devices. Note that the Pi has always shown up as UNKNOWN, wifi or hardwired. So its off-topic for this thread as such. I have a thread here asking questions :

viewtopic.php?f=36&t=6998

...I have yet to tryo Bredman's suggestion.
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2451
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by Pi-n-Mash » Sun Jun 03, 2012 4:15 pm
xebyte wrote:Any luck with installation on OpenELEC/Raspbmc? I have Edimax nano and I'm trying to install this dongle on my Raspi for 3 days now :( If you have any tips on how to make it work It'll be really great.

Thanks


I've written some instructions for getting the Edimax EW-7811Un nano wifi adapter to work and have just posted them on the RPi Wiki http://elinux.org/images/4/4b/Raspberry_Pi_wireless_adapter.pdf

I had a lot of trouble with this, so the instructions are very detailed! Let me know of any problems (or successes).
Posts: 19
Joined: Thu Apr 19, 2012 5:19 pm
by morey8 » Tue Jun 05, 2012 12:11 am
Two questions before I try this method, or else I'd just be screwing around with no results.

Is it necessary to reimage the SD card? I'm not sure if the install txt was meant for those who have not setup their card's yet. I've already been using mine for a few days just working on getting sound and testing out a few things. If it is the case that I need to reimage the SD card do I need to format/partition with gparted?

Should you unzip/untar the two files before putting them on the SD card? Maybe that's a given but I don't see how the Pi would use these files in their compressed state, but then again I know very little about Linux.

Thank you for the script will update with my progress if anyone can answer those question's I'll go ahead and let you all know if it worked.

http://www.ebay.com/itm/USB-Wireless-Wi ... 9908034575

My USB adapter (RTL8188CUS verified by plugging into my laptop) if any US residents are interested in purchasing one as well.
Posts: 6
Joined: Sun Jun 03, 2012 5:48 am
by MrEngman » Tue Jun 05, 2012 1:30 am
Pi-n-Mash wrote:I've written some instructions for getting the Edimax EW-7811Un nano wifi adapter to work and have just posted them on the RPi Wiki http://elinux.org/images/4/4b/Raspberry_Pi_wireless_adapter.pdf

I had a lot of trouble with this, so the instructions are very detailed! Let me know of any problems (or successes).


The links in the PDF don't work - for me anyway. Using Adobe Reader 10.1.3.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1863
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK
by collywobbles » Wed Jun 06, 2012 7:59 pm
Just reporting the original script (only just saw that you updated it!) worked a treat, got the adapter working and did the updates....then on reboot nothing works and lots of error messages about wlan0 failing.

I guess it was the updates that screwed things?

Do I have to start from a fresh SD card again or can I rescue things? I have SSH access over wired ethernet.
Thanks!
Posts: 9
Joined: Mon Mar 19, 2012 12:06 pm
by Ringo » Wed Jun 06, 2012 8:31 pm
MrEngman your a legend!

I followed your instructions line by line and got a wireless Netgear N150 (WNA1000M) working on my Pi without any hiccups in 30 mins.... Take a bow sir!
Posts: 2
Joined: Fri Sep 02, 2011 7:57 am
by MrEngman » Wed Jun 06, 2012 9:07 pm
Ringo wrote:MrEngman your a legend!

I followed your instructions line by line and got a wireless Netgear N150 (WNA1000M) working on my Pi without any hiccups in 30 mins.... Take a bow sir!


Thank you very much.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1863
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK