vDOS
Posts: 8
Joined: Sun Jul 07, 2013 3:06 pm

Two WiFi Adapters

Sun Jul 07, 2013 3:22 pm

Hi everybody!

Got my Raspberry Pi last week and started "playing" with it. So far everything works great, but yesterday I got stuck.

I tried to connect two USB WiFi Adapters to my Raspberry Pi, but sadly only one is recognized.

The output of lsusb is:

Code: Select all

Bus 001 Device 006: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter
Bus 001 Device 007: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter
So the devices are found.

But in ifconfig -a I only got wlan0.

Can anybody help me with this, so wlan1 is also shown for the second USB WiFi Adapter?

Thanks a lot!

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

Re: Two WiFi Adapters

Sun Jul 07, 2013 4:50 pm

Edit the file /etc/network/interfaces to look like this adding your own network names and passwords

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "Network-0"
wpa-psk "Password-0"

allow-hotplug wlan1
iface wlan1 inet dhcp
wpa-ssid "Network-1"
wpa-psk "Password-1"
This will allow your Pi to use two wifi adaptors at the same time. The first wifi adaptor recognised at boot time will get the name wlan0, the second one will get the name wlan1.

Be careful about power usage. Use a powered hub for the wifi adapters to avoid power issues with the Pi.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

vDOS
Posts: 8
Joined: Sun Jul 07, 2013 3:06 pm

Re: Two WiFi Adapters

Sun Jul 07, 2013 6:21 pm

Hi MrEngman,

I tried something similar, but it did not work. wlan1 was not found.

I also tried you approach but nothing happend :/

My current /etc/network/interfaces looks like this:

Code: Select all

auto lo

#loopback
iface lo inet loopback

#eth0
iface eth0 inet manual

#wlan0
allow-hotplug wlan0
iface wlan0 inet manual
        wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

#wlan1
allow-hotplug wlan1
iface wlan1 inet manual
        wpa-ssid "Rasp42"
        wpa-psk "Password01"

#other
iface default inet dhcp

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

Re: Two WiFi Adapters

Sun Jul 07, 2013 7:20 pm

Try and change the setting for wlan1 from manual to dhcp. That might help but I don't know for definite as I have never tried /etc/network/interfaces set up that way but I don't think manual will work.

I have found other people with strange set ups for /etc/network/interfaces having problems. Advising them to use the format I have has usually fixed their problems.

I have never been able to get two wifi adapters working using wpa_supplicant. Using the /etc/network/interfaces file format from my previous post works for every image I have tried. I even have some images set up to use 4 wifi adaptors using the same format with additional settings for wlan2 and wlan3 and they can all connect without problems.

Why that file format doesn't work for you I don't know. It would expect it to. Did you use the exact setup I showed with your own network names and passwords of course or did you change it?

Do you see wlan1 when you use command ifconfig? If you see wlan1 but it has not connected then try using the commands

Code: Select all

sudo ifdown --force wlan1
sudo ifup --force wlan1
and see what happens then.

FYI this is the output for ifconfig from my Pi next to me

Code: Select all

pi@raspberrypi ~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:19:f0:e0
          inet addr:192.168.16.11  Bcast:192.168.16.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:151964 errors:0 dropped:2 overruns:0 frame:0
          TX packets:61301 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:167054312 (159.3 MiB)  TX bytes:5767438 (5.5 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  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:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 80:1f:02:4b:6f:d3
          inet addr:192.168.16.12  Bcast:192.168.16.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:81 errors:0 dropped:98 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:14834 (14.4 KiB)  TX bytes:1088 (1.0 KiB)

wlan1     Link encap:Ethernet  HWaddr 80:1f:02:8d:5d:1b
          inet addr:192.168.16.23  Bcast:192.168.16.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:44 errors:0 dropped:56 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8708 (8.5 KiB)  TX bytes:1028 (1.0 KiB)

wlan2     Link encap:Ethernet  HWaddr a0:f3:c1:25:7d:28
          inet addr:192.168.16.18  Bcast:192.168.16.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19 errors:0 dropped:21 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3572 (3.4 KiB)  TX bytes:652 (652.0 B)

wlan3     Link encap:Ethernet  HWaddr 80:1f:02:8d:5d:1c
          inet addr:192.168.16.16  Bcast:192.168.16.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15 errors:0 dropped:17 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3032 (2.9 KiB)  TX bytes:1020 (1020.0 B)

pi@raspberrypi ~ $
This uses the file format in my previous post with the extra settings required for wlan2 and wlan3 to work.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

vDOS
Posts: 8
Joined: Sun Jul 07, 2013 3:06 pm

Re: Two WiFi Adapters

Sun Jul 07, 2013 7:32 pm

I copied the configuration you posted, but i cannot find wlan1 listed if I execute ifconfig -a.

I will reinstall everything and try it again.

Thanks for you help.

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

Re: Two WiFi Adapters

Sun Jul 07, 2013 8:24 pm

Did you reboot the Pi after making the change?


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

vDOS
Posts: 8
Joined: Sun Jul 07, 2013 3:06 pm

Re: Two WiFi Adapters

Sun Jul 07, 2013 8:31 pm

Of course. ifup did not work either.
Nevermind, tomorrow I got some time to start from scratch.

Thanks, again.

pksato
Posts: 273
Joined: Fri Aug 03, 2012 5:25 pm
Location: Brazil

Re: Two WiFi Adapters

Sun Jul 07, 2013 8:59 pm

Need more information.

Remove all USB WiFi Dongle.
do dmesg -c command. (to clear buffer)
plug on of adapter.
wait some seconds.
plug second adapter.
wait some seconds.
use `dmesg >dmesg_log.txt` to write log to a file.
and `cat dmesg_log.txt` to show.
put result here.

vDOS
Posts: 8
Joined: Sun Jul 07, 2013 3:06 pm

Re: Two WiFi Adapters

Mon Jul 08, 2013 6:58 pm

Hi everybody!

I deleted everything and started from scratch. The problem still remains, only wlan0 is shown.

But there is one funny thing. I booted the pi without any usb adapters connected. After that I did what pksato told me and suddenly wlan0 and wlan1 were shown.
If I reboot the pi, only wlan0 is shown again. I have no idea why this is happening.

This is the output of dmesg after I connected the two wifi usb adapters :

Code: Select all

[   84.982948] usb 1-1.3.3: new high-speed USB device number 6 using dwc_otg
[   85.085461] usb 1-1.3.3: New USB device found, idVendor=0bda, idProduct=8172
[   85.085490] usb 1-1.3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   85.085506] usb 1-1.3.3: Product: RTL8191S WLAN Adapter
[   85.085520] usb 1-1.3.3: Manufacturer: Manufacturer Realtek
[   85.085534] usb 1-1.3.3: SerialNumber: 00e04c000001
[   85.138985] r8712u: module is from the staging directory, the quality is unknown, you have been warned.
[   85.146462] r8712u: Staging version
[   85.146584] r8712u: register rtl8712_netdev_ops to netdev_ops
[   85.146605] r8712u: USB_SPEED_HIGH with 4 endpoints
[   85.147514] r8712u: Boot from EFUSE: Autoload OK
[   85.879503] r8712u: CustomerID = 0x000a
[   85.879534] r8712u: MAC Address from efuse = 00:0d:81:a5:03:ad
[   85.879547] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
[   85.885399] usbcore: registered new interface driver r8712u
[   86.862914] r8712u: 1 RCR=0x153f00e
[   86.863764] r8712u: 2 RCR=0x553f00e
[   88.572949] usb 1-1.3.2: new high-speed USB device number 7 using dwc_otg
[   88.676320] usb 1-1.3.2: New USB device found, idVendor=0bda, idProduct=8172
[   88.676351] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   88.676369] usb 1-1.3.2: Product: RTL8191S WLAN Adapter
[   88.676382] usb 1-1.3.2: Manufacturer: Manufacturer Realtek
[   88.676396] usb 1-1.3.2: SerialNumber: 00e04c000001
[   88.677719] r8712u: Staging version
[   88.677842] r8712u: register rtl8712_netdev_ops to netdev_ops
[   88.677862] r8712u: USB_SPEED_HIGH with 4 endpoints
[   88.678894] r8712u: Boot from EFUSE: Autoload OK
[   89.411997] r8712u: CustomerID = 0x000a
[   89.412029] r8712u: MAC Address from efuse = 00:0d:81:a5:02:4c
[   89.412041] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
[   90.403029] r8712u: 1 RCR=0x153f00e
[   90.403875] r8712u: 2 RCR=0x553f00e
This is my /etc/network/interfaces

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet static
        address 192.168.0.42
        subnet 255.255.255.0


allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "Network-0"
wpa-psk "Password-0"

allow-hotplug wlan1
iface wlan1 inet dhcp
wpa-ssid "Network-1"
wpa-psk "Password-1"
After a reboot only wlan0 is shown again. This is the dmesg after the reboot. Do be honest, I have no idea what is going on, because my experience about these things is quite limited.

Code: Select all

[    2.572789] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[    2.581605] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.591561] hub 1-1:1.0: USB hub found
[    2.598369] hub 1-1:1.0: 3 ports detected
[    2.882724] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    3.013112] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    3.022083] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.055588] smsc95xx v1.0.4
[    3.127830] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:b9:57:f4
[    3.222777] usb 1-1.3: new high-speed USB device number 4 using dwc_otg
[    3.356586] usb 1-1.3: New USB device found, idVendor=2101, idProduct=8500
[    3.382285] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.391906] usb 1-1.3: Product: USB2.0 Hub
[    3.407356] usb 1-1.3: Manufacturer: Action Star
[    3.421920] hub 1-1.3:1.0: USB hub found
[    3.433220] hub 1-1.3:1.0: 5 ports detected
[    3.723002] usb 1-1.3.1: new high-speed USB device number 5 using dwc_otg
[    3.771008] udevd[154]: starting version 175
[    3.847997] usb 1-1.3.1: New USB device found, idVendor=2101, idProduct=8501
[    3.866953] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.911270] usb 1-1.3.1: Product: USB HID
[    3.922495] usb 1-1.3.1: Manufacturer: Action Star
[    3.953709] hid-generic 0003:2101:8501.0001: hiddev0,hidraw0: USB HID v1.11 Device [Action Star USB HID] on usb-bcm2708_usb-1.3.1/input0
[    4.093002] usb 1-1.3.2: new high-speed USB device number 6 using dwc_otg
[    4.205791] usb 1-1.3.2: New USB device found, idVendor=0bda, idProduct=8172
[    4.228213] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    4.265336] usb 1-1.3.2: Product: RTL8191S WLAN Adapter
[    4.292579] usb 1-1.3.2: Manufacturer: Manufacturer Realtek
[    4.300416] usb 1-1.3.2: SerialNumber: 00e04c000001
[    4.422990] usb 1-1.3.3: new high-speed USB device number 7 using dwc_otg
[    4.565595] usb 1-1.3.3: New USB device found, idVendor=0bda, idProduct=8172
[    4.592519] usb 1-1.3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    4.626178] usb 1-1.3.3: Product: RTL8191S WLAN Adapter
[    4.649417] usb 1-1.3.3: Manufacturer: Manufacturer Realtek
[    4.672510] usb 1-1.3.3: SerialNumber: 00e04c000001
[    4.894919] r8712u: module is from the staging directory, the quality is unknown, you have been warned.
[    5.120398] r8712u: Staging version
[    5.182042] Registered led device: led0
[    5.188815] r8712u: register rtl8712_netdev_ops to netdev_ops
[    5.236651] r8712u: USB_SPEED_HIGH with 4 endpoints
[    5.313521] r8712u: Boot from EFUSE: Autoload OK
[    6.798812] r8712u: CustomerID = 0x000a
[    6.817042] r8712u: MAC Address from efuse = 00:0d:81:a5:02:4c
[    6.854520] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
[    6.888474] r8712u: Staging version
[    6.898397] r8712u: register rtl8712_netdev_ops to netdev_ops
[    6.906431] r8712u: USB_SPEED_HIGH with 4 endpoints
[    6.920951] r8712u: Boot from EFUSE: Autoload OK
[    7.667540] r8712u: CustomerID = 0x000a
[    7.673353] r8712u: MAC Address from efuse = 00:0d:81:a5:03:ad
[    7.681057] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
[    7.693995] usbcore: registered new interface driver r8712u
[   10.963578] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   11.389319] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   20.363227] r8712u: 1 RCR=0x153f00e
[   20.364212] r8712u: 2 RCR=0x553f00e
[   21.547679] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[   24.361217] Adding 102396k swap on /var/swap.  Priority:-1 extents:2 across:507900k SS
Some other thing I tried, after the reboot.

sudo ifup wlan1

Code: Select all

wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
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 "wlan1"
Bind socket to interface: No such device
Failed to bring up wlan1.
It would be great if anybody could give me a hint!

Sorry my english is a bit rusty <(^_^)>

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

Re: Two WiFi Adapters

Mon Jul 08, 2013 7:52 pm

What does the output from command ifconfig show?


MrEngman


EDIT; Also instead of just trying sudo ifup wlan1, first do sudo ifdown wlan1 and then sudo ifup wlan1 or even sudo ifdown --force wlan1 and then sudo ifup --force wlan1
Last edited by MrEngman on Mon Jul 08, 2013 8:07 pm, edited 1 time in total.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

vDOS
Posts: 8
Joined: Sun Jul 07, 2013 3:06 pm

Re: Two WiFi Adapters

Mon Jul 08, 2013 7:55 pm

It only shows lo, eth0 and wlan0.

PS: ifdown followed by an ifup does not work :(

pksato
Posts: 273
Joined: Fri Aug 03, 2012 5:25 pm
Location: Brazil

Re: Two WiFi Adapters

Mon Jul 08, 2013 8:59 pm

Kernel module detecting two devices. great.
Now, check content of
/etc/udev/rules.d/70-persistent-net.rules
or file begin with other number that 70.
cat /etc/udev/rules.d/70-persistent-net.rules
Each device must be have a corresponding line.
like it:

Code: Select all

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:0b:79:67:75", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
On you case, three device can be listed.
Compare with situation with detect two wifi and one.

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

Re: Two WiFi Adapters

Mon Jul 08, 2013 9:58 pm

vDOS wrote:It only shows lo, eth0 and wlan0.
This is very strange. dmesg shows both wifi adaptors are found so I do not understand why they are not both shown by the ifconfig command. I could understand if only one had a connection but not why just one is shown by command ifconfig.

I am wondering if /etc/network/interfaces may cause some confusion. I would expect a static IP set up to look more like the following

Code: Select all

iface eth0 inet static
     address 192.168.0.42
     network 192.168.0.0
     netmask 255.255.255.0
     broadcast 192.168.0.255
     gateway 192.168.0.254
I have found some people with /etc/network/interfaces with set ups that are a little unusual and have had network problems with wifi or eth and the problems were fixed when they changed /etc/network/interfaces to a more standard set up.

I have two wifi adaptor connected to my system at the moment. One uses the same driver your wifi is using but the other one uses the rtl8188cus driver. I would like to find another one using the same driver as you do to see what happens if I use two adapters using the r8712u driver.

At the moment I do not understand why you have a problem with two wifi adaptors. I am sure there really should be no problem. From the output of dmesg I think you connect your wifi adaptors using a hub. Does the hub have it's own power supply? What is the current rating of the power supply. Can you try a different hub or plug one wifi adaptor directly into the USB on the Pi just to see what happens?

Have you tried each one on it's own to make sure they are both working correctly?

One thing would be useful to know is the version of Linux you are using and the output of command uname -a.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

vDOS
Posts: 8
Joined: Sun Jul 07, 2013 3:06 pm

Re: Two WiFi Adapters

Tue Jul 09, 2013 4:30 pm

Hallo again!

Today I tried a lot of things:

First of, I did not had the file /etc/udev/rules.d/70-persistent-net.rules so I created it.
I also hat the KERNEL=="wlan*" in it, but it does not make any difference.

Code: Select all

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0d:81:a5:03:ad", ATTR{type}=="1", NAME="wlan0"

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0d:81:a5:02:4c", ATTR{type}=="1", NAME="wlan1"
Now I am seeing wlan1 but not wlan0. If I change the addresses wlan0 is shown but not wlan1.

I stopped using the usb hub, but it does not make any difference.

Tested only one usb adapter at a time. Both adapters are working quite well.
I am getting wlan0 if I connect the first adapter and wlan1 if I connect the second one.

Both usb wireless adapters are working. Tested under my windows machine.

Output of uname -a

Code: Select all

Linux raspberrypi 3.6.11+ #456 PREEMPT Mon May 20 17:42:15 BST 2013 armv6l GNU/Linux
I also changed my /etc/network/interfaces. No difference.

Regards,
vDOS

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

Re: Two WiFi Adapters

Wed Jul 10, 2013 1:31 am

Hi vDOS,

If you did not have the file /etc/udev/rules.d/70-persistent-net.rules you do not need to make your own. It is not needed to get two adaptors working.

I tried two adapters today in the morning both using the r8712u driver and was able to get both working. They are not the same as the ones you use but I wanted to see if the problem was the driver used to operate the two modules. Unfortunately I do not remember which Linux version I was using.

However, I have just tried again and I am now seeing the same problems you are having and only one would work but I have now just got both working again. I have one plugged into a hub and one plugged into the Pi using a USB extension cable. This is with the latest raspbian, 2013-05-25-wheezy-raspbian.

I was only seeing one adaptor with command ifconfig like you so I unplugged the one that did not show and plugged it back in and it was then showing in ifconfig but it did not connect to the AP. I then used commands sudo ifdown --force wlan0 and then sudo ifup --force wlan0. I had to use these commands two or three times and then it finally connected and I had the two adaptors running.

However after rebooting. like you, only one adaptor worked, the one connected directly to the Pi. I shut down the Pi and disconnected the adaptor plugged into the Pi and booted. The other adaptor in the hub started working. I then plugged the second adaptor into the Pi and it showed in ifconfig. I then had to use ifdown and ifup commands again to get it to connect to the AP.

I have noticed that the adaptors I have get quite hot so they are probably using a lot of current. This could be one explanation why It is difficult to get both working but I don't think it is.

I am beginning to think it is a problem with the r8712u driver and maybe usb. This is because when I unplug an adaptor using the r8712u driver and the other adaptor is plugged in my Pi appears to crash or it hangs up. This is even if both adaptors are plugged into the hub. I have NEVER seen this with any of my other adaptors. And I can plug or unplug my other adaptors without problems, but they do not use the r8712u driver. I checked the log files and don't see any thing that says the kernel has crashed but everything stops working, no wifi, no ethernet.

I am normally able to run up to 4 wifi adaptors connected to my Pi without problems if I only use one adaptor that uses the r8712u driver. The other adaptors I have use the Realtek rtl8188cus and rtl8188eu drivers and one uses the Atheros ath9k_htc driver. I usually use wifi adaptors using the rtl8188cus chip.

I'm sorry but this is not going to help you very much at all but I cannot think of anything else except a possible problem with the r8712u driver.

All I can suggest is you try and borrow a different wifi adaptor that does not use the r8712u driver from a friend to see if you can get that working with one of yours and if it does then maybe buy one those for yourself if it does.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

vDOS
Posts: 8
Joined: Sun Jul 07, 2013 3:06 pm

Re: Two WiFi Adapters

Wed Jul 10, 2013 8:26 pm

Thanks a lot the help MrEngman.

I connect a different usb adapter to my PI and it does not make any difference. Only the new one is shown.
The adapter with the r8712u module is not visible again.

This is really frustrating.

I have no idea, but it looks like that the drivers for the r8712u are not working at all. If I disconnect one of my r8712u adapters the system crashes or hangs up.

Now I am looking for another os for the PI.

Regards,
vDOS

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

Re: Two WiFi Adapters

Wed Jul 10, 2013 11:01 pm

vDOS wrote:Thanks a lot the help MrEngman.

I connect a different usb adapter to my PI and it does not make any difference. Only the new one is shown.
The adapter with the r8712u module is not visible again.

This is really frustrating.

I have no idea, but it looks like that the drivers for the r8712u are not working at all. If I disconnect one of my r8712u adapters the system crashes or hangs up.

Now I am looking for another os for the PI.

Regards,
vDOS
Hi vDOS,

Sorry to hear you haven't been able to get things working yet. I don't think changing to a different OS will help if that's what you think. If it is Linux it will use the same r8712u driver.

What was the different wifi you used? To get things working it would need to use a different driver to the r8712u. If it used the same r8712u driver then it would not make any difference. I did get my system to work when I used 1 wifi adaptor using the r8712u driver and another adaptor that used a different driver,8188cus or 8188eu. I use Edimax EW-7811Un, using rtl8188cus driver, and TP-LINK TL-WN725N V2, using rtl8188eu driver. I have sometimes had 4 of these connected to my Pi at the same time and all working.

As your system appears to crash or hang when removing a wifi adaptor just like mine I'm now confident the r8712u driver is the problem.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

pottermagic
Posts: 2
Joined: Sun Jan 13, 2013 6:54 pm

Re: Two WiFi Adapters

Wed Aug 21, 2013 6:55 pm

Hi, did you resolve this issue eventually ?

I have a WiPi connected for standard PC to RPi wireless connectivity/remote connection.

I also invested in an LPRS Connect2Pi dongle and understand I need WLAN1 defined in the Interface File (etc) BUT I've never been able to get the RPi to recognise it.... very frustrating considering LPRS label it "Connect2Pi" and misleadingly state its "plug and play" !!!

I did make sure the Driver for the Connect2Pi Dongle was also downloaded and installed too

I'd appreciate any input on how to get the Connect2Pi recognised

basicbold
Posts: 1
Joined: Tue Nov 26, 2013 3:51 pm

Re: Two WiFi Adapters

Tue Nov 26, 2013 4:06 pm

I also ran into this issue while trying to get two wlan sticks to work simultaneously.

One was powered by the 8192cu module, the other one was a r8712u. Each of them worked fine as long as you connected them separately. At the moment you tried to run the two of them together, the wlan1 device would not register, even though the modules seemed to load fine.

For me the solution was to first suppress the loading of the modules by blacklisting and load them in a specific order later on:

Code: Select all

$ sudo vi /etc/modprobe.d/wlan-blacklist.conf
This creates a new file. Make sure to end it with ".conf". Insert your modules here:

Code: Select all

blacklist r8712u
blacklist 8192cu
Save and close the file. Now run this:

Code: Select all

$ sudo depmod -ae
$ sudo update-initramfs -u
$ sudo vi /etc/modules
At the end of the file you add your modules in the order that they are supposed to show up (i.e. wlan0 before wlan1, etc.):

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

snd-bcm2835
8192cu
r8712u
After that I rebooted and all was fine.

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

Re: Two WiFi Adapters

Tue Nov 26, 2013 4:55 pm

I run multiple wifi adaptors quite frequently and have had up to four running off a single RPi. I enable udev to manage the wifi adaptors.

Edit the file

Code: Select all

/lib/udev/rules.d/75-persistent-net-generator.rules
The file in current versions of Raspbian have the following line

Code: Select all

# device name whitelist
KERNEL!="ath*|msh*|ra*|sta*|ctc*|lcs*|hsi*", \
                                        GOTO="persistent_net_generator_end"
It used to be like this with entries for eth and wlan

Code: Select all

# device name whitelist
KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", \
                                        GOTO="persistent_net_generator_end"
I have changed it to handle multiple wlan wifi adaptors by adding back the entry |wlan*[0-9]| in to the current version of the file which works fine.

This then generates the file /etc/udev/rules.d/70-persistent-net.rules to assign persistent names to the different wifi adaptors.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

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

Re: Two WiFi Adapters

Tue Nov 26, 2013 5:13 pm

And I forgot to say I only need to set up file /etc/network/interfaces with the network connections - ssid and passwords for however many wifi modules I have connected or may connect. No need to mess with any other files.

I primarily use devices that use the 8192cu and 8188eu drivers, Edimax EW-7811Un and TP-Link TL-WN725N V2 but also sometimes use Edimax EW-7622UMn (r8712u driver) and Netgear WNA1100 (Atheros ath9k_htc driver).

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

antonio.raspberry
Posts: 12
Joined: Sat May 23, 2015 4:50 pm

Re: Two WiFi Adapters

Sun Jan 24, 2016 10:31 pm

For me the solution was to first suppress the loading of the modules by blacklisting and load them in a specific order later on:
...

Thanks a lot, basicbold. I was reluctant to follow your instructions because I did not know exactly what I was doing, but after too many hours trying different solutions I gave it a try and it worked for me.

Just for your information, depmod -ae command gave me a warning, because -e needs -E or -F. I hope this was not important.

Just curious, if the problem was the order of the modules, do you think that swapping the two dongles physically, so that they are detected in different order, would have worked as well?

Anyway, thanks again, I can now move on to the next problem: to get each wlan connected to a specific network. By now I get both connected to the preferred one.

Regards.
Antonio

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

Re: Two WiFi Adapters

Mon Jan 25, 2016 12:28 am

antonio.raspberry wrote:For me the solution was to first suppress the loading of the modules by blacklisting and load them in a specific order later on:
...

Thanks a lot, basicbold. I was reluctant to follow your instructions because I did not know exactly what I was doing, but after too many hours trying different solutions I gave it a try and it worked for me.

Just for your information, depmod -ae command gave me a warning, because -e needs -E or -F. I hope this was not important.

Just curious, if the problem was the order of the modules, do you think that swapping the two dongles physically, so that they are detected in different order, would have worked as well?

Anyway, thanks again, I can now move on to the next problem: to get each wlan connected to a specific network. By now I get both connected to the preferred one.

Regards.
Antonio
You do realise you are responding to a post more than two years old. :shock:

Anyway, to get the wifi adapters to always load with the same name, wlan0 or wlan1, there's no need to get so complicated. Just set up the udev rules as I noted in my post above then the wifi adapters will always be assigned the same names.

Ideally update the rules with just the wifi adapter you want named wlan0 and reboot the Pi, and then plug in the second wifi adapter which should then be assigned the name wlan1. The wifi adapters will then be assigned the same names whenever you reboot using file /etc/udev/rules.d/70-persistent-net.rules.

Connecting to different networks, especially now with the Jessie network changes is likely to be a totally different matter. Previously with wheezy it was easily done by just editing /etc/network/interfaces. Now, with Jessie, well ....



MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

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

antonio.raspberry
Posts: 12
Joined: Sat May 23, 2015 4:50 pm

Re: Two WiFi Adapters

Mon Jan 25, 2016 12:54 pm

MrEngman wrote:
antonio.raspberry wrote:For me the solution was to first suppress the loading of the modules by blacklisting and load them in a specific order later on:
...

Thanks a lot, basicbold. I was reluctant to follow your instructions because I did not know exactly what I was doing, but after too many hours trying different solutions I gave it a try and it worked for me.

Just for your information, depmod -ae command gave me a warning, because -e needs -E or -F. I hope this was not important.

Just curious, if the problem was the order of the modules, do you think that swapping the two dongles physically, so that they are detected in different order, would have worked as well?

Anyway, thanks again, I can now move on to the next problem: to get each wlan connected to a specific network. By now I get both connected to the preferred one.

Regards.
Antonio
You do realise you are responding to a post more than two years old. :shock:

Anyway, to get the wifi adapters to always load with the same name, wlan0 or wlan1, there's no need to get so complicated. Just set up the udev rules as I noted in my post above then the wifi adapters will always be assigned the same names.

Ideally update the rules with just the wifi adapter you want named wlan0 and reboot the Pi, and then plug in the second wifi adapter which should then be assigned the name wlan1. The wifi adapters will then be assigned the same names whenever you reboot using file /etc/udev/rules.d/70-persistent-net.rules.

Connecting to different networks, especially now with the Jessie network changes is likely to be a totally different matter. Previously with wheezy it was easily done by just editing /etc/network/interfaces. Now, with Jessie, well ....



MrEngman
I thought It was never late to thank Mr. basicbold :-). My problem was not persistent names, but that wlan1 did not show. basicbold's solution worked for me. It is good that one still can find solutions for old problems when they are new for one self.

Anyway, thanks for your comment. I will try not to bring attention to old posts by thanking them.

james942
Posts: 3
Joined: Sun May 08, 2016 11:43 am

Re: Two WiFi Adapters

Thu Oct 13, 2016 12:56 am

Salut tous,

This post regarding the driver management and order loading is very relevant and the best i found. thank you.

Regarding the r8712u driver and the pi3 integrated wifi, we can see that this last could also be loaded with this driver, so as should be the realtek usb wifi using it... it could be the source of conflict on the actual pi3

It appears necessary to order the loading in that case, just like you noticed.
first the brcmfmac, then the r8712u, but it didnt work for me via the /etc/module file.

I had to delay the module loading via crontab, having blacklisted it before as you suggested.
crontab:
@reboot root (sleep 10; modprobe r8712u) &

now it works. I would rather find a better workaround than the delayed...
keep looking...

Regards,
James

Return to “General discussion”

Who is online

Users browsing this forum: No registered users and 48 guests