thordy
Posts: 1
Joined: Sat Sep 08, 2012 12:30 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 08, 2012 2:53 pm

Hi,

I'm trying to get my wifi adapter to work, but having a problem with the script.
It all seems to be working fine, but once it gets to the part of "Waiting for wifi to connect" (or something like that) and it "crashes". IT gives me the following message

line1252: 1814 terminated ifup --force wlan$ADAPTER_NUMBER > /dev/null 2>&1

and nothing more happens. I let it run for a while, but ended up terminating it with CTRL-C. Tried re running it with both as an "upgrade" and "add new adapter", but both gave the same error.

Also, when it get to that point it stops blinking the LED on the wifi card.

Suggestions? Thanks in advance!

LondonPi
Posts: 2
Joined: Thu Sep 06, 2012 10:56 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 08, 2012 4:44 pm

MrEngman wrote:
LondonPi wrote:Hi there,

I'm new to the Pi, just go it this week and am from a mostly-Windows background. I have the Edimax wireless adapter listed in the dropbox and I am trying to follow the script you provided.
I once ran the setup without the adapter in and it ran successfully. I input all the SSID/password etc.
Now when I start up the Pi without the adapter it warns me that "wlan0 is not connected". I take this as a good sign that the script ran properly and it's searching for the unplugged adapter.

However when I reran the script and it prompts me to plug in the wifi adapter I plug it in and my keyboard cuts out, so I can't "press any key to continue".

I am using a Microsoft Curve 2000 keyboard, rated 5V 100mA on the back. I've not really had problems with it the rest of the time with my Pi. If those numbers sound too high please tell me and I'll try to borrow a lower power keyboard.
I'm using a nearly fresh SD card with Raspbian on it (downloaded 15-07-2012). The only additions are the 2 licence keys for MPEG and WVC-1 and installing xterm.

If I turn it on with the adapter plugged in the keyboard is unresponsive (though the startup screen indicates its detected it, I see its name flash past) but periodically the green light on the adapter rlashes and the CPU monitor indicates some usage, so I expect it's doing something but with no keyboard I can't really find out what.
If I then unplug the adapter, my CPU usage jumps to 20% permanantly but the keyboard (even un/replugged) remains unresponsive until I reboot the Pi.
(Sorry if this is longwinded, I'm just trying to flesh out the problem and what I've tried)
Sounds like you need a new power supply not a different keyboard. Or you may get it working by plugging the wifi adapter into a powered hub. There's plenty of discussions about suitable power units throughout the forum and the wiki. And also using hubs for the wifi adapters. Although not always necessary if you have a high quality power supply, not a phone charger or equivalent.

Even though the keyboard label says 5v 100mA I'd expect it to take a fair bit less. This is a standard USB power spec in which the max current is stated in units of 100mA, e.g. 100mA, 200mA, 300mA etc, and is not the actual max current. Mine indicates the same but uses less than 3mA with no LEDs on and less than 27mA with all 3 LEDs on. The wifi adapter, however, will take quite a bit more than 100mA when active especially when transmitting.

So you ran the script and ignored the instructions to plug in the wifi adapter. OK, that's up to you, but don't expect it to work when you've fixed your power issues.

When you re-run the script please follow the instructions although I cannot say if it will work since you didn't the first time. It should ask if you want to upgrade or add a new adapter. Select upgrade. If it does you may be OK and it may set things up alright. If it doesn't then the setup's likely broken and you may need to fix files by editing by hand as it were, rather than via the script.
Thank you. A powered hub solved all the problems (also solved my Raspbmc problems too)
I didn't follow the script correctly first time because (and I should've learnt to not do this by now) I was playing with the Pi at 2am... silly me. Given the script had been run it all worked first time when I powered the Pi from the hub (as well as having my keyboard, mouse and EHD plugged into that) while the wifi adapter took the 2nd USB port.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 08, 2012 5:19 pm

Hi Dweeber and Dave_PL,

I'm pretty certain I've seen the /sbin/modprobe errors when the wifi apapter is plugged in from power on/rebooting and the old non-working driver loads. Do you see a message about CRDA followed by a fairly long delay and then these messages or just these messages. Just in case we're looking at two different things.

Do you see any errors in dmesg regarding 8192cu.ko or rtl8192cu.ko

What do the outputs of "lsmod" and "uname -a" show?

You could try this

Code: Select all

#remove the old faulty driver
sudo rm -r /lib/modules/3.2.27+/kernel/drivers/net/wireless/rtlwifi/*
#check if the new built in driver is installed
ls -l /lib/modules/3.2.27+/kernel/drivers/net/wireless/rtl8192cu/8192cu.ko
#if the new driver is loaded remove the old one(s)
sudo rm /lib/modules/3.1.9+/kernel/drivers/net/wireless/8192cu.ko
sudo rm /lib/modules/3.2.27+/kernel/drivers/net/wireless/8192cu.ko
Then try a reboot.

Don't know what version of script you're using but it was last updated early this morning - 08 Sep 00:15 BST to fix a minor bug. Could report the driver was not installed when in fact it is. The latest script attempts to remove old driver versions although this has been part of the script since I learnt of the change to include the driver.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

Dave_PL
Posts: 4
Joined: Sat Sep 08, 2012 2:45 pm
Location: Cracow, PL

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 08, 2012 5:43 pm

MrEngman wrote:Hi Dweeber and Dave_PL,

...message about CRDA followed by a fairly long delay and then these messages .
This is exactly what happened. Now Im trying updating all from 3.1.9+ and if I dont succeed I will do what you said.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 08, 2012 5:49 pm

Dave_PL wrote:
MrEngman wrote:Hi Dweeber and Dave_PL,

...message about CRDA followed by a fairly long delay and then these messages .
This is exactly what happened. Now Im trying updating all from 3.1.9+ and if I dont succeed I will do what you said.
Check file /etc/udev/rules.d/70-persistent-net.rules. This can sometimes contain erroneous data for some reason. Never found out why. You could try deleting it. Won't stop it working if you do but may allow it to 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: 3918
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 08, 2012 6:30 pm

thordy wrote:Hi,

I'm trying to get my wifi adapter to work, but having a problem with the script.
It all seems to be working fine, but once it gets to the part of "Waiting for wifi to connect" (or something like that) and it "crashes". IT gives me the following message

line1252: 1814 terminated ifup --force wlan$ADAPTER_NUMBER > /dev/null 2>&1

and nothing more happens. I let it run for a while, but ended up terminating it with CTRL-C. Tried re running it with both as an "upgrade" and "add new adapter", but both gave the same error.

Also, when it get to that point it stops blinking the LED on the wifi card.

Suggestions? Thanks in advance!
Personally I've never ever seen errors like this. It really sounds like it may be a power issue. Do you have a powered hub you can plug your wifi adapter in to?

If you run the script more than once selecting add a new adaptor but using the same adapter each time you will not get it to work. It will add the information needed to run a new adapter into the file /etc/network/interfaces but will do nothing to get the original one working. However it shouldn't stop the original from working.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

NielsMayer
Posts: 13
Joined: Mon Aug 13, 2012 4:25 am

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Sep 08, 2012 10:09 pm

From #raspberrypi
(02:32:32 PM) npm: yay finally got wireless working... MrEngman's script breaks for "Revision : 0003" hardware, but works for "Revision : 0002" using "Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]" ( http://www.amazon.com/gp/product/B005CLMJLU/ )
(02:33:52 PM) npm: for "revision 0003", when MrEngman's script asks you to plugin the wireless adapter, it's like the 'pi is momentarily shorted out and reboots ... and then the wrong version of the driver is loaded...
(02:46:41 PM) npm: one concern is that the new "fuseless" design for latest rpi 2.0 ( http://www.raspberrypi.org/archives/1929 ) might break stuff that used to work , while fixing other problems ( http://www.raspberrypi.org/phpBB3/viewt ... 3&p=160461 ? )
Note that the issues w/ shortout/reboot occur with "revision 0003" == "Model B Revision 1.0 + ECN0001 (no fuses, D14 removed)" ( http://www.raspberrypi.org/phpBB3/viewt ... 3&p=160461 ) whereas no such problems occur with the original "revision 0002" == "Model B Revision 1.0" with fuses and diode.

Hope this can be worked around with revision 2.0 boards, so they don't have this "short out" issue
that seem to be absent from the initial 1.0 boards.

For those with rev 0003 boards, perhaps replacing the 0 ohm resistors replacing F1 and F2 with low-ohmage resistor would prevent the short-out/reboot (perhaps resulting from a current surge charging internal power supply of wifi adapter?).

FYI I'm using a 1.2 A Nokia AC-10U power adapter and no USB hub for the wifi'd pi.

After successfully running MrEngman's script, the revision 0002 'pi boots headlessly and plays back internet radio and podcast through the nearby loudspeakers, as intended ( http://www.nielsmayer.com/bin/view/Rasp ... ith+gst123 )
wlan0 Link encap:Ethernet HWaddr xxxxxxxxxxxx
inet addr:192.168.0.22 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:116139 errors:0 dropped:118561 overruns:0 frame:0
TX packets:181935 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:43502046 (41.4 MiB) TX bytes:32777570 (31.2 MiB)

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 09, 2012 12:07 am

New RPi is a catch 22....

When I start out, the WiFi is not attached. Run the script to the point where it says insert the WiFi and the system reboots... If it boots with the WiFi attached, I get the modprobe errors, and I get stuck in the loop that Wlan0 Interface doesn't support scanning. The file in /etc/udev/...persist... does not exists so there is nothing to remove.

The new RPi is not Rev2 but does have 0000 resistors in place of the polyfuses.

I tried to get Eth0 going headless as well, but it didn't work. I have no way to hookup a monitor where that is so I really can't see what is going on. Link lights etc... all there. Even tried the static setup in the cmdline.txt file.

**UPDATE**
So, when I tried this with the new RPi, I used a new download of the Raspbian OS...

I just took that, and put it in the older RPi (without the 0000) and I got WiFi working. Just for kicks, it is now doing an Update... Will see if I can get it to work again after the update. If so, I think I can then just stick that OS into the new RPi and it should work hopefully. This would be a workaround for the new RPi etc... but not helpful to anyone that has just the 0000 resistors. Don't know what happens with Rev2 since I didn't get one (yet).
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

NielsMayer
Posts: 13
Joined: Mon Aug 13, 2012 4:25 am

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 09, 2012 12:46 am

FYI, to determine which version raspberry pi you have, run

Code: Select all

 grep Revision /proc/cpuinfo
then see http://www.raspberrypi.org/archives/1929 and look up the "codes" in the first table to determine which hardware you have:

Code: Select all

MODEL AND REVISION	                                                CODE(S)
Model B Revision 1.0                                   2
Model B Revision 1.0 + ECN0001 (no fuses, D14 removed) 3
Model B Revision 2.0                                   4, 5, 6

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 09, 2012 1:06 am

NielsMayer wrote:FYI, to determine which version raspberry pi you have, run
Knew how to do that but you have to have access to the running system to do it.
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

Sun Sep 09, 2012 1:18 am

I got it working. Started with the fresh OS download on a 4GB card. Details are below.

Just for documentation purposes.... How I built the current system.

o I took a MicroUSB 4GB card with a SDCard adapter.
o Put the current Rapbian OS 2012-08-16-wheezy-raspbian
o Loaded it onto the MicroUSB card using win32 disk manager
o This is the older RPi and it is a 0002 board:

Code: Select all

	Processor       : ARMv6-compatible processor rev 7 (v6l)
	BogoMIPS        : 697.95
	Features        : swp half thumb fastmult vfp edsp java tls 
	CPU implementer : 0x41
	CPU architecture: 7
	CPU variant     : 0x0
	CPU part        : 0xb76
	CPU revision    : 7
	
	Hardware        : BCM2708
	Revision        : 0002
o It has an HDMI connection to a 60" TV
o It has a USB connection (bottom port) to a simple plain keyboard (Lenovo)
o I have an Airplay 101 WiFi USB (Not connected) which has worked in the past. This will go into the Upper USB connector when I use it.
o No hub, no mouse, nothing else connected.

o I booted up the OS.... in raspi-config:
- Set Local to US
- Set Timezone to America/Phonenix
- Set SSH on (think it is on by default)
- I did NOT use the expand to full SDcard (Yet) - Since this is a 4GB card, I should have done this now.
o Rebooted...

o Linux raspberrypi 3.1.9+ #272 PREEMPT Tue Aug 7 22:51:44 BST 2012 armv6l GNU/Linux
o Sudo to root
o cd /boot
o cp rpi/* . (this brings over current copies of the the MrEngman install scripts and several of the drivers (will want 8192cu-20120726.tar.gz for sure).
o Ran ./install*.sh
o Went through the process.. When it wanted me to insert the WiFi, I installed (no reboot)
o Setup using A for WPA setup
o Added SSID
o Added Password
o It saw the network... Happy Dance...

Crossed my fingers and I told it to do the Update.... took a long time...

o Updated completed...
o Immediately after reboot, I had no choice but to expand to the size of the SDcard as I had not room left.... 4GB card, so used raspi-config to do that.
o Reboot again

WiFi is WORKING with:

Code: Select all

Linux raspberrypi 3.2.27+ #114 PREEMPT Tue Sep 4 00:15:33 BST 2012 armv6l GNU/Linux
Now, lets see if it will work in the RPi 0003 card...

o Shutdown...

Moved all the same connections to the new RPi. The only difference is the board 0003 instead of 0002 and the new RPi is still without any kind of case...

o Power it up... cross fingers.

Still have WiFi.... Yeah...

o RPi Info:

Code: Select all

	Processor       : ARMv6-compatible processor rev 7 (v6l)
	BogoMIPS        : 697.95
	Features        : swp half thumb fastmult vfp edsp java tls 
	CPU implementer : 0x41
	CPU architecture: 7
	CPU variant     : 0x0
	CPU part        : 0xb76
	CPU revision    : 7
	
	Hardware        : BCM2708
	Revision        : 0003
So, I have taken a few steps back... On a 4GB card for the moment, but have working WiFi on the new RPi.... Will backup and move to a 16GB card but need to make sure that when it expands it does not use 100% of the whole card so that I can restore it to other cards without running out of space.

Not sure what someone with a Revision 0003 is supposed to do to get this working though. If you go to insert the WiFi card, it will reboot, then you have the modprobe etc... issues. Not sure what happens with Rev2 boards either since I didn't get one as I thought I was. Will try again in a few weeks, then I will have all three.

Now... I need to get back to where I was before... moved over to a 16GB card, with the packages I had loaded, configuration etc... luckily I have documented what I've changed so it will be easier. The expand image thing has been worried though since I was not able to restore a saved image before because it was too large. Need to work on that.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 09, 2012 4:34 am

The script is not working anymore.

Code: Select all

Unrecognised software version: Linux raspberrypi 3.2.27+ #102 PREEMPT Sat Sep 1 01:00:50 BST 2012 armv6l GNU/Linux

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 09, 2012 7:24 am

wallarug wrote:The script is not working anymore.

Code: Select all

Unrecognised software version: Linux raspberrypi 3.2.27+ #102 PREEMPT Sat Sep 1 01:00:50 BST 2012 armv6l GNU/Linux
All fixed. Just needed latest script.

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 09, 2012 7:29 am

wallarug wrote:
wallarug wrote:The script is not working anymore.

Code: Select all

Unrecognised software version: Linux raspberrypi 3.2.27+ #102 PREEMPT Sat Sep 1 01:00:50 BST 2012 armv6l GNU/Linux
All fixed. Just needed latest script.
Curious... did you download the latest version Before you tried using it back when you posted the other note and have now just downloaded a newer version...
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

JonB
Posts: 220
Joined: Tue Nov 29, 2011 9:26 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 09, 2012 1:41 pm

Here's my report.

I don't quite know why, but it sems to be working. After an upgrade bricked the ting, I went back to the original Foundation image and loaded up MrEngman's script. It ran, but I didn't want to try and enter the 64 character WPA passkey for my network because it is a load of random nonsense. So I broke out of the script and had a look at it. Turns out it puts the ssid and passkey into /etc/network/interfaces, instead of using a wpa-supplicant config file as explained in the web page http://omer.me/2012/04/setting-up-wirel ... pberry-pi/.

So I have partially run the script, and manually edited /etc/network/interfaces so it has my ssid / key and it is working for now. Of course it will be broken no doubt by a kernel update.. maybe.. and I have yet to run the script in upgrade mode. I'm going to try it now...

Anyway, I have to conclude that most of my problem was the machine having dodgy USB drivers, or perhaps an old driver for my card lying about.

Many thanks to MrEngman for the script - very useful!

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Sep 09, 2012 2:26 pm

Hi Guys,

An update on the script. I am working on modifying it so you don't need to hot-plug the wifi adapter. It will set up the image so you can plug the wifi adapter in and it will boot with it plugged in without problems.

I'm not keen on this but to avoid kernel crashes some have had when plugging the wifi adapter in to the Pi while the script is running there's not much else I can do. And this is likely to become more of a problem with the new version 2 Pi and is the primary reason for the change. Personally I think this may could indicate a PSU issue. The alternative of course is to use a powered hub and plug the wifi adapter into the hub.

Hopefully the mod will be completed later today. I am in the process of testing it but it's taking some time. I will post again when it is done.

MrEngman
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

Mon Sep 10, 2012 4:45 am

That is good to hear.

I have both RPi's working now.

One thing that I thought was interesting was when I got one of them working, I made a copy of the image, and tried it on the second. This ended up being a no go since the WiFi I was using was different. The original has the Airlink 101 and the new one has the Edimax EW-7811Un.

They should use the same driver, but when I took the image from the one with the Airlink 101 and then used it with the Edimax, I got into that fun loop again.

All I can think is that there is something on the image that has the MAC code or something in it that needs to be removed before you could add a new adapter.

I planned on looking at the two setups to see what differences I could find.

Ideally, I want to be able to backup a working image, write it to a new card and be able to setup another RPi with a new WiFi adapter without having to go back to scratch every time.

I need to be able to get to the point where I can come up with a configured image and then setup 30 additional systems using it. I just figured out a way to expand the FS to fit the SDcard without it actually taking the whole card, allowing for the resulting image to be copied over and over to multiple memory cards without the problem of them being too large.

Look forward to what your script looks like. I've been playing with this all weekend long... I can relate to how long it can take.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

Jim Ford
Posts: 17
Joined: Fri Jul 06, 2012 3:43 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 10, 2012 9:41 am

This driver business is all very tiresome!

Virtually every day there are updates to the Pi OS - so what's the problem with the maintainers including a driver that works for one of the most popular wifi adapters in use?

Jim

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 10, 2012 10:33 am

Jim Ford wrote:This driver business is all very tiresome!

Virtually every day there are updates to the Pi OS - so what's the problem with the maintainers including a driver that works for one of the most popular wifi adapters in use?

Jim
Well that's rather an exageration isn't it. And a kernel update doesn't necessarily mean the driver needs updating. Anyway it has been included now. Take a look here http://www.raspberrypi.org/phpBB3/viewt ... 39#p165139

Try reading the posts.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

Jim Ford
Posts: 17
Joined: Fri Jul 06, 2012 3:43 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 10, 2012 10:48 am

Don't get me wrong 'MrEngman' I appreciate the work you've been doing on the driver, but I found it so frustrating to keep reinstalling the driver up to a few weeks ago that I gave up and went back to ethernet.

Looks like the situation has settled down now and I can plug my Edimax dongle back in and expect to see it working.

Jim

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 10, 2012 11:59 am

Dweeber wrote:That is good to hear.

I have both RPi's working now.

One thing that I thought was interesting was when I got one of them working, I made a copy of the image, and tried it on the second. This ended up being a no go since the WiFi I was using was different. The original has the Airlink 101 and the new one has the Edimax EW-7811Un.

They should use the same driver, but when I took the image from the one with the Airlink 101 and then used it with the Edimax, I got into that fun loop again.

All I can think is that there is something on the image that has the MAC code or something in it that needs to be removed before you could add a new adapter.

I planned on looking at the two setups to see what differences I could find.

Ideally, I want to be able to backup a working image, write it to a new card and be able to setup another RPi with a new WiFi adapter without having to go back to scratch every time.

I need to be able to get to the point where I can come up with a configured image and then setup 30 additional systems using it. I just figured out a way to expand the FS to fit the SDcard without it actually taking the whole card, allowing for the resulting image to be copied over and over to multiple memory cards without the problem of them being too large.

Look forward to what your script looks like. I've been playing with this all weekend long... I can relate to how long it can take.
Take a look at the file /etc/udev/rules.d/70-persistent-net.rules. This saves a list of adapters and assigns names, wlan0, wlan1 etc associated with the MAC address of your wifi adapters. If you've plugged more than one adapter in to the Pi this file should have more than one reference to wifi adapters. If you've only configured a single adapter but plugged in two different ones the first you plugged in will be wlan0, the second wlan1. Could be the one you're trying to use is in the udev file as wlan1.

You should be able to fix it in a couple of ways. Either update /etc/network/interfaces file to include an entry for wlan1. Just copy the info you use for wlan0 and change the references to wlan0 in the added data to wlan1. This will allow you to plug in either adapter. You could do this with the script using the Add option instead of update. Effectively adding a second adapter into the configuration.

The other way is to delete the file /etc/udev/rules.d/70-persistent-net.rules. This file will then be regenerated with whatever wifi is plugged in when you reboot as wlan0.

Using the add option might be better if you want to test wifi adapters as the image will then accept either one and you won't need to worry which adapter you plug in. It should then work with either.

If you're making images to copy onto multiple systems then you should probably delete the /etc/udev/rules.d/70-persistent-net.rules file before making the image you are going to copy to other cards. Then when a new system is brought up with a different wifi adapter the udev file will assign the new adapter as wlan0.

One other rather strange solution I came across while testing my script was to edit /etc/udev/rules.d/70-persistent-net.rules and delete all entries except for wlan0 and then change the MAC address to "*". The text in the udev file says don't edit it except for the name but it works. Just tried it again on one of my Pi's configured with 4 different wifi adapters and linux #114. Changed wlan0 MAC to "*" and deleted all the other entries. Now the two adapters I've tried, one at a time, both come up as wlan0.

MrEngman

Update: If you're setting up loads of Pi's to connect to a single network don't forget to change the hostname. The router might get confused with a load of hosts all called "raspberrypi" :D
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 10, 2012 12:50 pm

So are these drivers included in the new kernel now?

User avatar
Licaon_Kter
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 10, 2012 12:54 pm

Alesbi wrote:So are these drivers included in the new kernel now?
yes, update & upgrade or rpi-update
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)

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

Mon Sep 10, 2012 2:39 pm

MrEngman wrote: Take a look at the file /etc/udev/rules.d/70-persistent-net.rules. This saves a list of adapters and assigns names, wlan0, wlan1 etc associated with the MAC address of your wifi adapters. If you've plugged more than one adapter in to the Pi this file should have more than one reference to wifi adapters. If you've only configured a single adapter but plugged in two different ones the first you plugged in will be wlan0, the second wlan1. Could be the one you're trying to use is in the udev file as wlan1.
I thought I looked for that, but then I was using a keyboard one handed sitting in front of the 60" not connected via a terminal.

I just looked and do see those. Will try using the * for the MAC address.
MrEngman wrote: Update: If you're setting up loads of Pi's to connect to a single network don't forget to change the hostname. The router might get confused with a load of hosts all called "raspberrypi" :D
Yes... I am already doing that.

For anyone reading that doesn't know, you can change the /etc/hostname and the entry in /etc/hosts then reboot. Been using raspbi0X for each unit.


Getting closer... I was able to successfully take a working image (4gb), save it as an img, Write it to a 16gb card, boot, run a script that expands it but still makes it a tad bit smaller, save that image and then write that image to several 16GB cards without having the saved image being too large. Lose a little in the expand, but makes doing full system backups a sure thing.

Just need to clean up the script that does the expand and do some more testing with it (when I get some time)... work day.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Sep 10, 2012 2:50 pm

Hi Everyone,

The script has been updated to avoid having to hot-plug the wifi adapter. This has been causing problems for some with kernel crashes when the wifi adapter was plugged in to the Pi's USB port while it was powered on. If you do have this problem I would suggest you look at replacing your power supply or use a powered hub to attach the wifi.

For first time users the script will make a configuration change and then shutdown the Pi. You can then plug in the wifi adapter and restart the Pi with the wifi adapter plugged in. Run the script again to install the driver and configure the wifi. This will not happen for people who have already used the script as the configuration change will already have been made.

The script willl also handle the change over from using the downloaded drivers to the new built in driver including tidying up some stuff that apt-get upgrade attempts to, but fails, to delete in the process.

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”