mattjw
Posts: 2
Joined: Thu Jul 05, 2012 1:11 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Thu Jul 05, 2012 1:15 pm

Hi MrEngman,

Thanks a lot for your advice and help throughout this thread. Between your explanations, your compiled kernel modules, and the eLinux EW-7811Un guide, I've finally managed to get the adapter working perfectly on my Raspberry Pi running the Raspberry Pi Foundation's Debian Wheezy beta image (Kernel version 3.1.9+).

The most time-consuming step for me was finding a 8192cu kernel module (8192cu.ko) that was compatible with the Wheezy beta's Kernel. I went through quite a few incompatible versions before finally trying the 20120629 version you posted up a few day ago, which successfully loads.

Note: For anyone else having the same problem, if you try to modprobe the kernel module (i.e., "modprobe 8192cu") and you encounter an "Exec format" error (or "disagrees about version symbol" errors in dmesg), it probably means that the particular .ko file you're using isn't compatible with your particular Kernel build.

I'm guessing from the various different versions of 8192cu.ko you've posted up over the last few weeks that you're compiling these modules yourself from the realtek driver sources and Kernel sources? Even though I have the EDIMAX adapter working now, I'd be interested in being able to compile the 8192cu Kernel module myself, to deal with future Kernel upgrades or platform changes. If you have the time, a guide on how you're going about building 8192cu.ko would be really useful!

I've already attempted doing it myself -- getting the RPi Kernel source from the git repo (https://github.com/raspberrypi/linux) and the realtek driver source (http://nathan.chantrell.net/20120526/ed ... pberry-pi/) and compiling it on the RPi -- but the resulting 8192cu.ko was not compatible.

Thanks again!

tehowe
Posts: 7
Joined: Mon Jun 25, 2012 3:49 am

Re: Automatic setup for RTL8188CUS based wifi adapters

Thu Jul 05, 2012 1:29 pm

MrEngman wrote:
tehowe wrote:My Edimax EW-7811Un was delivered today, so I took the first opportunity to set up and execute MrEngMan's script on a fresh Debian SD card, however the wlan0 interface remains Unassociated.
What happens if you try the command

Code: Select all

ifup --force wlan0
I get this...

Code: Select all

[email protected]:~$ ifup --force wlan0
ifup: failed to open statefile /etc/network/run/ifstate: Permission denied
[email protected]:~$ sudo ifup --force wlan0
ioctl[SIOCSIWAP]: Operation not permitted
wpa_supplicant: wpa-ssid "OnoSendai" failed!
wpa_supplicant: wpa-psk ***** failed!
wpa_supplicant: enabling network block 'ADD_NETWORK' command timed out. failed!
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Error getting interface address for 'wlan0'; No such device
Error getting interface information.
Thanks

koot
Posts: 25
Joined: Thu May 17, 2012 4:45 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Thu Jul 05, 2012 3:56 pm

Im trying tu run Edimax wifi but what i see in messages:

Code: Select all

[  788.463269] 8192cu: disagrees about version of symbol skb_queue_purge
[  788.463296] 8192cu: Unknown symbol skb_queue_purge (err -22)
[  788.463347] 8192cu: disagrees about version of symbol __pskb_pull_tail
[  788.463367] 8192cu: Unknown symbol __pskb_pull_tail (err -22)
[  788.463388] 8192cu: disagrees about version of symbol netif_rx
[  788.463414] 8192cu: Unknown symbol netif_rx (err -22)
[  788.463436] 8192cu: disagrees about version of symbol __netdev_alloc_skb
[  788.463456] 8192cu: Unknown symbol __netdev_alloc_skb (err -22)
[  788.463487] 8192cu: disagrees about version of symbol skb_trim
[  788.463505] 8192cu: Unknown symbol skb_trim (err -22)
[  788.463623] 8192cu: disagrees about version of symbol netif_carrier_off
[  788.463644] 8192cu: Unknown symbol netif_carrier_off (err -22)
[  788.463688] 8192cu: disagrees about version of symbol skb_copy
[  788.463708] 8192cu: Unknown symbol skb_copy (err -22)
[  788.463732] 8192cu: disagrees about version of symbol skb_clone
[  788.463750] 8192cu: Unknown symbol skb_clone (err -22)
[  788.463768] 8192cu: disagrees about version of symbol dev_get_by_name
[  788.463795] 8192cu: Unknown symbol dev_get_by_name (err -22)
[  788.463821] 8192cu: disagrees about version of symbol netif_carrier_on
[  788.463840] 8192cu: Unknown symbol netif_carrier_on (err -22)
[  788.463949] 8192cu: disagrees about version of symbol register_netdevice
[  788.463971] 8192cu: Unknown symbol register_netdevice (err -22)

im using this http://dl.dropbox.com/u/80256631/8192cu-20120629.tar.gz driver

Code: Select all

[email protected]:~# uname -a
Linux raspberrypi 3.1.9+ #149 PREEMPT Thu Jul 5 01:33:01 BST 2012 armv6l GNU/Linux
Why its not working? :(

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Thu Jul 05, 2012 8:39 pm

mattjw wrote:Hi MrEngman,
I'm guessing from the various different versions of 8192cu.ko you've posted up over the last few weeks that you're compiling these modules yourself from the realtek driver sources and Kernel sources? Even though I have the EDIMAX adapter working now, I'd be interested in being able to compile the 8192cu Kernel module myself, to deal with future Kernel upgrades or platform changes. If you have the time, a guide on how you're going about building 8192cu.ko would be really useful!

I've already attempted doing it myself -- getting the RPi Kernel source from the git repo (https://github.com/raspberrypi/linux) and the realtek driver source (http://nathan.chantrell.net/20120526/ed ... pberry-pi/) and compiling it on the RPi -- but the resulting 8192cu.ko was not compatible.

Thanks again!
I have a desktop system which I use to compile the kernel and driver. Much quicker than directly on the Pi. I also log in as root. Makes life a little simpler. Using the Pi is probably pretty much the same, just takes a loooong time to compile the kernel ~ 7hrs I think.

For a start the source you're using is old. There is a new version on Realtek's website here. Just look for the 8188CUS version.This is the one I use.

To get the kernel source I've used 'git clone'. Takes a while but is only needed once then to keep up to date I cd into the linux source directory and use 'git pull'. It will automatically update the source as necessary. I also have the firmware and tools code and use git pull on those so can tell if the firmware has changed and so run rpi-update to check if I need to update the driver. If using git clone on the Pi enable the swap partition or a swap file or change the memory configuration to 224/32MB otherwise git clone may fail part way through. I would certainly recommend getting the initial code using git clone as keeping it up to date is then so simple and really quick using git pull and it will tell you almost immediately if the code has been updated or not. No need to go and check on the git website if there's been an update.

As you've got your kernel loaded already first create a couple of symlinks. I've made a directory 'src' in my home directory, '/root', where I have linux and the other sources loaded. Change '/root/src' or '~/src' wherever you see them to suit your directory tree. If login in as the default user Pi '/root' will be replaced by '/home/pi' and you may need to prepend some of the commands with 'sudo'.

Code: Select all

ln -s  /root/src/linux /lib/modules/3.1.9+/build
ln -s /root/src/linux/arch/arm /root/src/linux/arch/arm6vl (<--lowercase L, not number 1)
Download the driver from Realtek in to the 'src' directory. unzip the driver file in to the 'src' directory alongside the linux directory. cd into the directory that's created, 'RTL....' and then cd into the 'driver' directory. There is a tar.gz file with the driver source. Untar it and cd into the directory created 'rtl....'. e.g. -

Code: Select all

cd ~/src
wget http://www.realtek.com.tw/downloads/RedirectFTPSite.aspx?SiteID=2&DownTypeID=3&DownID=919&PFid=48&Conn=4&FTPPath=ftp%3a%2f%2f95.130.192.218%2fcn%2fwlan%2fRTL819xCU+_USB_linux_v3.4.3_4369.20120622.zip
unzip RTL*
cd RTL*
cd driver
tar -xzf rtl*.tar.gz
cd rtl*
Now edit the Makefile although I'm not sure this is strictly necessary. In the list of platforms I changed the first line and added the last line.

Code: Select all

CONFIG_PLATFORM_I386_PC = n             <--changed y to n
CONFIG_PLATFORM_TI_AM3517 = n
.
.
CONFIG_PLATFORM_MSTAR_TITANIA12 = n
CONFIG_PLATFORM_ARM_BCM2708 = y         <--add this line
I then added the following in the list of platform dependencies just before the i386_PC section

Code: Select all

ifeq ($(CONFIG_PLATFORM_ARM_BCM2708), y)      <--added from here
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
ARCH := arm
CROSS_COMPILE := arm-linux-gnueabi-
KVER  := 3.1.9+
KSRC := /lib/modules/$(KVER)/build
endif                                         <--to here

ifeq ($(CONFIG_PLATFORM_I386_PC), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
Now in your home directory generate a file "one.txt". It is used when compiling the driver to select compiling the rtl8192c rather than rtl8192d driver.

Code: Select all

cd
echo "1" >one.txt
And now me being me I compile by using a script. Saves a load of typing and is almost but not quite automatic. I've called the script 'compile'. You can of course just type the commands by hand. You will see as well where the one.txt file is used to feed input into the make_drv command for the driver compile

Code: Select all

#!/bin/bash
# compile the kernel
cd ~/src/linux
make mrproper
cp arch/arm/configs/bcmrpi_defconfig .config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- KSRC=/root/src/linux KVER=3.1.9+ menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- KSRC=/root/src/linux KVER=3.1.9+ -k
# Now to compile the rtl8188cus compatible driver
cd ~/src/RTL8188C_8192C_8192D_USB_linux_v3.4.2_3727.20120404/driver/rtl8188C_8192C_8192D_usb_linux_v3.4.2_3727.20120404
make clean
./make_drv < /root/one.txt
make
So to compile the kernel and driver I just need to run the command.

Code: Select all

./compile
The compile will start and after a short while a menu will appear for configuring the kernel. I don't do anything with it and exit it using "ESC, ESC Y" key presses. After a while if all is well you should find the driver module in the driver source directory ~/src/RTL.../driver/rtl..../8192cu.ko. I made a couple of changes to the source. One to remove some annoying debug output and the other to add the Netgear WNA1000M wifi dongle.

In the file ./driver/rtl.../autoconf_rtl8192c_usb_linux.h

Code: Select all

/*
 * Debug  Related Config
 */
//#define CONFIG_DEBUG_RTL871X

#define DBG	0
//#define CONFIG_DEBUG_RTL819X    <--comment out this line

#define CONFIG_PROC_DEBUG	1
And in ./driver/rtl..../os_dep/linux/usb_intf.c

Code: Select all

	{USB_DEVICE(0x2019, 0xAB2E)},//SW-WF02-AD15 -Abocom
	{USB_DEVICE(0x0846, 0x9041)},//Netgear     <--add this line

	/****** 8188 RU ********/
	{USB_DEVICE(0x0BDA, 0x317F)},//Netcore,Netcore
Well that's it I think. Hopefully this is what you are looking for. Should keep you busy for a little while so have fun. Hmmm. Really must generate a website to keep all this stuff easily available.
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: 3868
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Thu Jul 05, 2012 8:46 pm

koot wrote:Im trying tu run Edimax wifi but what i see in messages:

Code: Select all

[  788.463269] 8192cu: disagrees about version of symbol skb_queue_purge
[  788.463296] 8192cu: Unknown symbol skb_queue_purge (err -22)
[  788.463347] 8192cu: disagrees about version of symbol __pskb_pull_tail
[  788.463367] 8192cu: Unknown symbol __pskb_pull_tail (err -22)
.
.
[  788.463949] 8192cu: disagrees about version of symbol register_netdevice
[  788.463971] 8192cu: Unknown symbol register_netdevice (err -22)

im using this http://dl.dropbox.com/u/80256631/8192cu-20120629.tar.gz driver

Code: Select all

[email protected]:~# uname -a
Linux raspberrypi 3.1.9+ #149 PREEMPT Thu Jul 5 01:33:01 BST 2012 armv6l GNU/Linux
Why its not working? :(
You need a driver update as the Linux version has been updated. Use this one. Using this link should always download the newest version of 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.

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Thu Jul 05, 2012 9:16 pm

tehowe wrote: I get this...

Code: Select all

[email protected]:~$ ifup --force wlan0
ifup: failed to open statefile /etc/network/run/ifstate: Permission denied
[email protected]:~$ sudo ifup --force wlan0
ioctl[SIOCSIWAP]: Operation not permitted
wpa_supplicant: wpa-ssid "OnoSendai" failed!
wpa_supplicant: wpa-psk ***** failed!
wpa_supplicant: enabling network block 'ADD_NETWORK' command timed out. failed!
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Error getting interface address for 'wlan0'; No such device
Error getting interface information.
Thanks
Have you edited /etc/network/interfaces to use wpa_supplicant? I've not been able to get my system up using wpa-supplicant but haven't been able to figure out why so far.

Another issue I've seen raised is with wireless access points that do not transmit their ssid. Again the wifi couldn't get connected until the access point set up was changed to transmit the ssid.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

selectnone
Posts: 55
Joined: Fri Jun 22, 2012 10:16 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 12:28 am

MrEngman wrote:Well that's it I think. Hopefully this is what you are looking for. Should keep you busy for a little while so have fun. Hmmm. Really must generate a website to keep all this stuff easily available.
Thanks for all this, this is exactly what I need :D

Can you maybe add your knowledge/docs straight onto the elinux.org wiki?
(I'm assuming that's generally open for editing, but I've not checked)

I've not had much luck getting my Micronet dongle working recently - I know it works because I had it working with your driver a few weeks ago, but I think I've lost the knack :P

I've just now been looking into compiling the driver myself, but my Linuxing is still relatively weak, so this was perfectly timed!

koot
Posts: 25
Joined: Thu May 17, 2012 4:45 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 6:18 am

MrEngman wrote: You need a driver update as the Linux version has been updated. Use this one. Using this link should always download the newest version of the driver.
wlan0 Link encap:Ethernet HWaddr 80:1f:02:21:1f:8c
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Thank You very very much! :)

mattjw
Posts: 2
Joined: Thu Jul 05, 2012 1:11 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 9:29 am

MrEngman wrote:Well that's it I think. Hopefully this is what you are looking for. Should keep you busy for a little while so have fun. Hmmm. Really must generate a website to keep all this stuff easily available.
That's absolutely brilliant. I look forward to giving it a shot. Cheers!

Hubertrum
Posts: 29
Joined: Tue May 22, 2012 11:56 am

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 11:13 am

I have my Edimax EW-7811Un. Now is it best to start with Squeeze, Wheezy or RASPBMC images? In the end I will need a working XBMC for which I have to use RASPBMC and a working Debian for my other work.

I am new to Linux. I have the Pi working but not connected to the Internet so far. I am downloading using my Windows PC to an SD Card. I have downloaded the driver for this Wifi Adapter and unzipped it. I now have a 8192cu,ko object. I am not sure what to do with this driver. How do I get it into my image?

I do have Oracle VM running on my PC. But, as yet, I can't see my SD card whilst in there. Are there settings I need to change to view my G: drive?

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 1:19 pm

Hubertrum wrote:I have my Edimax EW-7811Un. Now is it best to start with Squeeze, Wheezy or RASPBMC images? In the end I will need a working XBMC for which I have to use RASPBMC and a working Debian for my other work.

I am new to Linux. I have the Pi working but not connected to the Internet so far. I am downloading using my Windows PC to an SD Card. I have downloaded the driver for this Wifi Adapter and unzipped it. I now have a 8192cu,ko object. I am not sure what to do with this driver. How do I get it into my image?

I do have Oracle VM running on my PC. But, as yet, I can't see my SD card whilst in there. Are there settings I need to change to view my G: drive?
There is a script for setting up the wifi adapter you have and a load of others based on the Realtek RTL8188CUS device.

Look on this wiki page and the links are in the Micronet SP907NS, 11N Wireless LAN USB Adapter section.

Taking a look at the instructions first would be a good idea.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

tehowe
Posts: 7
Joined: Mon Jun 25, 2012 3:49 am

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 1:43 pm

MrEngman wrote:Have you edited /etc/network/interfaces to use wpa_supplicant? I've not been able to get my system up using wpa-supplicant but haven't been able to figure out why so far.
There's an example wpa_supplicant.conf walkthrough on the raspi wiki http://elinux.org/RPi_edimax_EW-7811Un I gave that a shot and noted that the ethernet lights go out when the dongle flashes blue - so it's doing *something* different, but haven't got it working yet either.
MrEngman wrote:Another issue I've seen raised is with wireless access points that do not transmit their ssid. Again the wifi couldn't get connected until the access point set up was changed to transmit the ssid.
DD-WRT reports SSID Broadcast is enabled. What are the chances my EW-7811Un dongle needs a little more current than the port provides and I just got a 'bad' one?

I'll keep hacking away at it, appreciate the help.

Hubertrum
Posts: 29
Joined: Tue May 22, 2012 11:56 am

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 3:13 pm

What I need is a lower level instruction of how to use my Edimax USB Adapter.

1) Should I use Squeeze or Wheezy; or does it make no difference?

2) I have downloaded Squeeze and the driver. They are in my c:\downloads drive in my Windows PC. Can I do anything with them there? Can I use Oracle Vm on my PC to "link" the 2 together?
Do I have to link them on my Pi? If so how do I do that?

3) What is being downloaded from github and why?

koot
Posts: 25
Joined: Thu May 17, 2012 4:45 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 5:46 pm

koot wrote:
wlan0 Link encap:Ethernet HWaddr 80:1f:02:21:1f:8c
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Thank You very very much! :)
Now:

Code: Select all

[email protected]:~# ifup wlan0
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/80:1f:02:21:1f:8c
Sending on   LPF/wlan0/80:1f:02:21:1f:8c
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
receive_packet failed on wlan0: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
send_packet: No such device
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
No DHCPOFFERS received.
Unable to obtain a lease on first try.  Exiting.
Failed to bring up wlan0.

what is wrong now? :|

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 7:03 pm

koot wrote:
koot wrote:
wlan0 Link encap:Ethernet HWaddr 80:1f:02:21:1f:8c
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Thank You very very much! :)
Now:

Code: Select all

[email protected]:~# ifup wlan0
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/80:1f:02:21:1f:8c
Sending on   LPF/wlan0/80:1f:02:21:1f:8c
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
receive_packet failed on wlan0: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
send_packet: No such device
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
No DHCPOFFERS received.
Unable to obtain a lease on first try.  Exiting.
Failed to bring up wlan0.

what is wrong now? :|
From what I see when you use the command

Code: Select all

ifconfig
you see the wifi adapter wlan0 listed. Is that correct?

I think basically the wifi cannot connect to the wireless network for some reason. You could try the command

Code: Select all

sudo ifup --force wlan0
and see what happens. The three ioctl errors, 'operation not permitted' and 'invalid argument' appear for me as well and do not cause any problems. Ignore them.

Here's a few possibilities.
1. Are the SSID and PASSWORD correct? If the password contains the backslash character you need to put a pair of backslashes for each one in the password.
2. Are you using the correct security mode for your network e.g. unsecured, WEP or WPA/WPA2. The settings in the file /etc/network/interfaces are different for each.
3. Does your wireless access point transmit the SSID. If not change the settings to allow it to transmit the SSID. There is a problem with connecting to networks that do not transmit the SSID.
4. Does your wireless network filter connections using the MAC address? If yes add the wifi's MAC address to the list in your router/access point.
5. Check the file /etc/udev/rules.d/70-persistent-net.rules to see if it contains any lines referencing wlanx - wlan0, wlan1 etc. Not likely but delete them if yes then try and connect again.
6. Check file /etc/network/interfaces is OK. It probably is if wlan0 shows with command ifconfig. Although SSID and PASSWORD entries could be incorrect and wlan0 would still show in ifconfig.
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: 3868
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 8:04 pm

Hubertrum wrote:What I need is a lower level instruction of how to use my Edimax USB Adapter.

1) Should I use Squeeze or Wheezy; or does it make no difference?

2) I have downloaded Squeeze and the driver. They are in my c:\downloads drive in my Windows PC. Can I do anything with them there? Can I use Oracle Vm on my PC to "link" the 2 together?
Do I have to link them on my Pi? If so how do I do that?

3) What is being downloaded from github and why?
There's nothing much lower level than my instructions, I'm afraid. But it doesn't seem like you've read them anyway.

As I said download the instructions I pointed you to on the Raspberry Pi wiki in my previous post to you. That will tell you in simple language exactly how to install the wifi adapter. There is also a link to a script (a batch file in Windows language) in the same place that will install the wifi for you almost automatically. After setting up the SD card you just need to run the script to install the wifi. It will ask a few questions while it is running about things like wireless network name and password to allow it to complete the install correctly.

The instructions tell you how to set up your SD card, what files you need to install the wifi and where to download them from and how to install them on the SD card and how to run the script.

Start with the Debian6-19-04-2012 image just to try things out. That is probably the easiest.

You say you have a driver - what is the file, the name of the file you downloaded, and where did you get it from? I'm curious.

And what's that about github - there is no mention of that in my instructions. What are you looking at? Where?

To try and make it as simple as possible, instead of having to navigate to the wiki, the link to the instructions are here and the link to the script is here. The instructions will tell what other files you need and where to get them from. Download them via Windows Internet Explorer onto your Windows machine. Read the instructions and proceed from there.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

RussF
Posts: 2
Joined: Fri Jan 20, 2012 5:48 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Fri Jul 06, 2012 10:41 pm

Mr EngMan, great job, but I'm having an annoyingly un-understanding time. With squeeze, the WLAN doesn't work at all. With the official? wheezy, the wlan works, but only if I boot with a TV connected, and with Pieces, it works until I try to run shairport,then wifi dies. Is it me? Do in need an AC hub (seems odd as the dongle runs with wheezy. Grrrr, so annoyed! Would recompiling the kernel work? I'm prepared to put in the work, so long as I know what the work is.

Cheers,

Russ

murmur
Posts: 2
Joined: Sat Jul 07, 2012 10:00 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sat Jul 07, 2012 10:14 pm

I have an "Edimax EW-7811UN Wireless 802.11b/g/n 150Mbps Nano USB Adaptor".

I've installed the most recent Debian "squeeze" from the raspberrypi.org site: debian6-19-04-2012.zip

I then ran the most recent version of MrEngman's script, which appeared to complete without issue.

Code: Select all

[email protected]:~# uname -a
Linux raspberrypi 3.1.9+ #152 PREEMPT Fri Jul 6 18:47:16 BST 2012 armv6l GNU/Linux
[email protected]:~# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 80:1f:02:4b:74:35
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
Unfortunately, attempting to start up the wpa_supplicant, or to run something like "iwlist wlan0 scan", appears to result in the device being "removed"?

Code: Select all

[email protected]:~# wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant.conf
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCGIFINDEX]: No such device
Failed to initialize the driver after interface was added.
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
ioctl[SIOCSIWENCODEEXT]: No such device
ioctl[SIOCSIWENCODE]: No such device
ioctl[SIOCSIWENCODEEXT]: No such device
ioctl[SIOCSIWENCODE]: No such device
ioctl[SIOCSIWENCODEEXT]: No such device
ioctl[SIOCSIWENCODE]: No such device
ioctl[SIOCSIWENCODEEXT]: No such device
ioctl[SIOCSIWENCODE]: No such device
ioctl[SIOCSIWENCODEEXT]: No such device
ioctl[SIOCSIWENCODE]: No such device
ioctl[SIOCSIWSCAN]: No such device
Failed to initiate AP scan.
[ ... ]

Code: Select all

[email protected]:~# iwlist wlan0 scan
wlan0     Failed to read scan data : No such device
A "dmesg" reveals that the device appears to be being disconnected and then reconnected?

Code: Select all

[  683.363262] usb 1-1.3: new high speed USB device number 52 using dwc_otg
[  683.465388] usb 1-1.3: New USB device found, idVendor=7392, idProduct=7811
[  683.465425] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  683.465447] usb 1-1.3: Product: 802.11n WLAN Adapter
[  683.465484] usb 1-1.3: Manufacturer: Realtek
[  683.465503] usb 1-1.3: SerialNumber: 00e04c000001
[  684.880248] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  694.748486] usb 1-1.3: USB disconnect, device number 52
[  695.003285] usb 1-1.3: new high speed USB device number 53 using dwc_otg
[  695.105419] usb 1-1.3: New USB device found, idVendor=7392, idProduct=7811
[  695.105456] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  695.105479] usb 1-1.3: Product: 802.11n WLAN Adapter
[  695.105515] usb 1-1.3: Manufacturer: Realtek
[  695.105534] usb 1-1.3: SerialNumber: 00e04c000001
[  696.280067] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  697.564494] usb 1-1.3: USB disconnect, device number 53
[  697.813292] usb 1-1.3: new high speed USB device number 54 using dwc_otg
[  697.915426] usb 1-1.3: New USB device found, idVendor=7392, idProduct=7811
[  697.915463] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  697.915485] usb 1-1.3: Product: 802.11n WLAN Adapter
[  697.915512] usb 1-1.3: Manufacturer: Realtek
[  697.915530] usb 1-1.3: SerialNumber: 00e04c000001
[  699.330539] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  700.440070] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  703.452514] usb 1-1.3: USB disconnect, device number 54
[  703.703304] usb 1-1.3: new high speed USB device number 55 using dwc_otg
[  703.805443] usb 1-1.3: New USB device found, idVendor=7392, idProduct=7811
[  703.805480] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  703.805502] usb 1-1.3: Product: 802.11n WLAN Adapter
[  703.805530] usb 1-1.3: Manufacturer: Realtek
[  703.805548] usb 1-1.3: SerialNumber: 00e04c000001
[  705.210103] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  706.012514] usb 1-1.3: USB disconnect, device number 55
[  706.263029] usb 1-1.3: new high speed USB device number 56 using dwc_otg
[  706.365453] usb 1-1.3: New USB device found, idVendor=7392, idProduct=7811
[  706.365490] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  706.365510] usb 1-1.3: Product: 802.11n WLAN Adapter
[  706.365538] usb 1-1.3: Manufacturer: Realtek
[  706.365555] usb 1-1.3: SerialNumber: 00e04c000001
[  707.540097] ADDRCONF(NETDEV_UP): wlan0: link is not ready
I have a one of these powering the device, so I don't think it could be a low-power issue: http://www.maplin.co.uk/compact-twin-us ... ply-562310

The system works fine otherwise; no crashes or stalls while compiling some other applications and fiddling around; starting up sshd, etc.

I've tried redoing the compact flash and re-running the script a few times, as well as several reboots, but still no luck at getting the wireless to work. The wired connection works just fine.

Any clues of what to try next?

Thanks!

haltux
Posts: 4
Joined: Fri Jul 06, 2012 11:55 am

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Jul 08, 2012 9:02 am

Hello,

Thanks Mr Engman for your script.
I am not sure it is the right place to ask, but i have a small problem with my wifi connection (with a wna1000m dongle). Your installation/connection script is working great, but at some point (after hours...) I get disconnected. I don't think it is caused by my router but I am not sure. I have to say I am not powering the dongle, it could be a cause as well, but I am a bit surprised it takes that much time to fail.

When I do "ifconfig", the wlan interface is still there, but not associated to any IP.

If I remove and put back the dongle, it is working again flawlessly. But I would like it to reconnect automatically when it gets disconnected. Any idea?

Regards,

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Jul 08, 2012 5:48 pm

haltux wrote:Hello,

Thanks Mr Engman for your script.
I am not sure it is the right place to ask, but i have a small problem with my wifi connection (with a wna1000m dongle). Your installation/connection script is working great, but at some point (after hours...) I get disconnected. I don't think it is caused by my router but I am not sure. I have to say I am not powering the dongle, it could be a cause as well, but I am a bit surprised it takes that much time to fail.

When I do "ifconfig", the wlan interface is still there, but not associated to any IP.

If I remove and put back the dongle, it is working again flawlessly. But I would like it to reconnect automatically when it gets disconnected. Any idea?

Regards,
There's always the possibility of some sort of power issue I suppose. I run my Pi 24/7 and have no problems with the wifi but it is never very busy.

Is the time it takes before being disconnected fairly constant or does it vary. If reasonably constant it might be to do with dhcp lease time. You can check what the lease time is by running the command

Code: Select all

sudo /etc/init.d/networking restart
It should show the lease time near the end of the output it displays. Does the lease time tie up with time it takes to disconnect?

Does your Pi get assigned the same IP address or does it change when you make the reconnection? Does the MAC address change?
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: 3868
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Jul 08, 2012 6:43 pm

murmur wrote:I have an "Edimax EW-7811UN Wireless 802.11b/g/n 150Mbps Nano USB Adaptor".

I've installed the most recent Debian "squeeze" from the raspberrypi.org site: debian6-19-04-2012.zip

I then ran the most recent version of MrEngman's script, which appeared to complete without issue.
.
.
Unfortunately, attempting to start up the wpa_supplicant, or to run something like "iwlist wlan0 scan", appears to result in the device being "removed"?

Code: Select all

[email protected]:~# wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant.conf
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCGIFINDEX]: No such device
Failed to initialize the driver after interface was added.
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
ioctl[SIOCSIWENCODEEXT]: No such device
ioctl[SIOCSIWENCODE]: No such device
ioctl[SIOCSIWENCODEEXT]: No such device
ioctl[SIOCSIWENCODE]: No such device
ioctl[SIOCSIWENCODEEXT]: No such device
ioctl[SIOCSIWENCODE]: No such device
ioctl[SIOCSIWENCODEEXT]: No such device
ioctl[SIOCSIWENCODE]: No such device
ioctl[SIOCSIWENCODEEXT]: No such device
ioctl[SIOCSIWENCODE]: No such device
ioctl[SIOCSIWSCAN]: No such device
Failed to initiate AP scan.
[ ... ]
.
.
I have a one of these powering the device, so I don't think it could be a low-power issue: http://www.maplin.co.uk/compact-twin-us ... ply-562310

The system works fine otherwise; no crashes or stalls while compiling some other applications and fiddling around; starting up sshd, etc.

I've tried redoing the compact flash and re-running the script a few times, as well as several reboots, but still no luck at getting the wireless to work. The wired connection works just fine.

Any clues of what to try next?

Thanks!
As you're trying to start it up using wpa_supplicant have you modified the /etc/network/interfaces file to use wpa_supplicant? I've been trying for ages to get my network working with wpa_supplicant and only got it working yesterday. It's all rather complicated and I still don't understand what most of the settings are. Does help though if the various parameters needed are spelt correctly.

With the new linux version there appears to be some changes to networking which for one thing seems to make the way eth0 behaves when starting rather different, especially if the cable is not plugged in.

I have found the following command

Code: Select all

ifup --force wlan0
useful to start up.

There are also various postings which seem to indicate possible conflicts with various network managers which could cause problems.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

verbus17
Posts: 1
Joined: Sun Jul 08, 2012 8:18 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Jul 08, 2012 8:29 pm

Hi
it worked for my Hercules pico usb wifi
at first it didn't... the dongle was plugged in a USB hub
with keyboard and mouse, but when i started using an ssh connexion on ethernet
to reach my pi, suddenly i could see my wlan0 in ifconfig !!!
i realized watching a video on youtube about best power adapter for Raspberry Pi
that mine wasn't powerful enough for a hub... :shock:
when my usb dongle is the only device it's OK
as it's Ok now on a Hub but using another power adapter
Thanks anyway for your help !

justifier
Posts: 2
Joined: Sat Jul 07, 2012 2:50 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Jul 08, 2012 9:02 pm

Hi, thanks for the script and hard work eggman but.... I can't seem to get it working. (I have tried many other methods too)

script runs fine, all appears to be working but on reboot get wlan0 : no such device, or words to th any ideas?

Code: Select all

[email protected]:~$ uname -a 
Linux raspberrypi 3.1.9+ #152 PREEMPT Fri Jul 6 18:47:16 BST 2012 armv6l GNU/Linux

Code: Select all

[email protected]:~$ lsusb
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 005: ID 050d:1102 Belkin Components F7D1102 N150/Surf Micro Wireless Adapter v1000 [Realtek RTL8188CE-VAU]
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Code: Select all

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[email protected]:~$ lsmod
Module                  Size  Used by
fuse                   73593  1 
ipv6                  290227  18 
joydev                  9804  0 
evdev                   8922  2 

Code: Select all

[email protected]:~$ iwconfig 
lo        no wireless extensions.

eth0      no wireless extensions.

Code: Select all

[email protected]:~$ ifconfig 
eth0      Link encap:Ethernet  HWaddr b8:27:eb:49:12:e0  
          inet addr:192.168.1.65  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe49:12e0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1037 errors:0 dropped:0 overruns:0 frame:0
          TX packets:306 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:79727 (77.8 KiB)  TX bytes:35798 (34.9 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:560 (560.0 B)  TX bytes:560 (560.0 B)

Many thanks

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

Re: Automatic setup for RTL8188CUS based wifi adapters

Sun Jul 08, 2012 10:26 pm

justifier wrote:Hi, thanks for the script and hard work eggman but.... I can't seem to get it working. (I have tried many other methods too)

script runs fine, all appears to be working but on reboot get wlan0 : no such device, or words to th any ideas?

Code: Select all

[email protected]:~$ uname -a 
Linux raspberrypi 3.1.9+ #152 PREEMPT Fri Jul 6 18:47:16 BST 2012 armv6l GNU/Linux

Code: Select all

[email protected]:~$ lsusb
Bus 001 Device 005: ID 050d:1102 Belkin Components F7D1102 N150/Surf Micro Wireless Adapter v1000 [Realtek RTL8188CE-VAU]

Code: Select all

[email protected]:~$ lsmod
Module                  Size  Used by
fuse                   73593  1 
ipv6                  290227  18 
joydev                  9804  0 
evdev                   8922  2 

Many thanks
Something of a conflict somewhere. The command 'lsusb' reports the device as using an RTL8188CE-VAU. The device ID is shown in a list of usb devices here as using the RTL8188CUS. The device ID is also in the driver file as an RTL8188CUS. Could be a new version using a different chip and Belkin have screwed up the ID. However both chip types should work with the same driver.

lsmod also doesn't show the driver module being loaded. It should also show 8192cu in the list.

Code: Select all

Module                  Size  Used by
fuse                   73593  1 
ipv6                  290227  20 
8192cu                512098  0 
joydev                  9804  0 
evdev                   8922  2 
May be the driver is the wrong version. When did you update your code? driver version 8192cu-20120701.tar.gz worked when I updated on Fri 6 Jul to linux #152 but when I updated another SD card on Sat 7 Jul to linux #152 that driver did not work and I had to recompile it to get it working. The linux code changed but the version number did not. This is a problem with setting the linux version number which needs fixing and I find it really annoying as it creates problems choosing the right driver. The new driver is 8192cu-20120707.tar.gz (also available as 8192cu-latest.tar.gz). Which version of the driver are you using? Do you see any errors for 8192cu when booting? Take a look at dmesg. Command

Code: Select all

dmesg | less
is the easiest way and will let you page up and down through dmesg.

There also appears to have been some changes to the networking code, especially with how eth0 behaves, its very different during booting particularly when no cable is plugged in so I'm now wondering if that is having an effect on the wifi. I now find the best way to start wlan0 is use the command

Code: Select all

ifup --force wlan0
What do you see when trying that command?

MrEngman

EDIT: the module should show in lsmod even if the wifi module is not plugged in. You may need to change the driver module as its not loading.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

justifier
Posts: 2
Joined: Sat Jul 07, 2012 2:50 pm

Re: Automatic setup for RTL8188CUS based wifi adapters

Mon Jul 09, 2012 3:37 am

Something of a conflict somewhere. The command 'lsusb' reports the device as using an RTL8188CE-VAU. The device ID is shown in a list of usb devices here as using the RTL8188CUS. The device ID is also in the driver file as an RTL8188CUS. Could be a new version using a different chip and Belkin have screwed up the ID. However both chip types should work with the same driver.

lsmod also doesn't show the driver module being loaded. It should also show 8192cu in the list.
CODE: SELECT ALL
Module Size Used by
fuse 73593 1
ipv6 290227 20
8192cu 512098 0
joydev 9804 0
evdev 8922 2
May be the driver is the wrong version. When did you update your code? driver version 8192cu-20120701.tar.gz worked when I updated on Fri 6 Jul to linux #152 but when I updated another SD card on Sat 7 Jul to linux #152 that driver did not work and I had to recompile it to get it working. The linux code changed but the version number did not. This is a problem with setting the linux version number which needs fixing and I find it really annoying as it creates problems choosing the right driver. The new driver is 8192cu-20120707.tar.gz (also available as 8192cu-latest.tar.gz). Which version of the driver are you using? Do you see any errors for 8192cu when booting? Take a look at dmesg. Command
CODE: SELECT ALL
dmesg | less
is the easiest way and will let you page up and down through dmesg.

There also appears to have been some changes to the networking code, especially with how eth0 behaves, its very different during booting particularly when no cable is plugged in so I'm now wondering if that is having an effect on the wifi. I now find the best way to start wlan0 is use the command
CODE: SELECT ALL
ifup --force wlan0
What do you see when trying that command?

MrEngman

EDIT: the module should show in lsmod even if the wifi module is not plugged in. You may need to change the driver module as its not loading.
I used the version your script grabs.

dmesg contains the following errors with 8192cu

Code: Select all

[   12.814571] 8192cu: disagrees about version of symbol module_layout
[   17.531901] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   17.963413] 8192cu: disagrees about version of symbol module_layout
[   20.834563] NET: Registered protocol family 10
[   20.853159] ADDRCONF(NETDEV_UP): eth0: link is not ready
[   21.558463] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   21.574297] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x41E1

Code: Select all

ifup --force wlan0
reports the following

Code: Select all

[email protected]:~$ ifup --force wlan0
ifup: failed to open statefile /etc/network/run/ifstate: Permission denied
[email protected]:~$ sudo !!
sudo ifup --force wlan0
[sudo] password for adam: 
wlan0: ERROR while getting interface flags: No such device
Error for wireless request "Set Encode" (8B2A) :
    SET failed on device wlan0 ; No such device.
Error for wireless request "Set ESSID" (8B1A) :
    SET failed on device wlan0 ; No such device.
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Cannot find device "wlan0"
Bind socket to interface: No such device
Failed to bring up wlan0.
have you got the direct url's for the new drivers?

Many thanks

Return to “Beginners”