Debian – Two usb wifi adapaters, only wlan0 appears, how to get wlan1

debianusbwifi

I'm attempting to connect two wifi USB dongles to a debian system. One is to connect to a local lan, the other I plan to use in adhoc mode to connect to a specific device. You could look at this as an attempt to connect two wifi dongles to a linux device to connect to two separate wifi networks at the same time.

The USB devices appear to be recognised correctly with no problems. ifconfig reports wlan0 and I was able to setup /etc/network/interfaces so it configures correctly and connects to my lan via my access point.

My /etc/network/interfaces is:

auto wlan0

iface lo inet loopback
iface eth0 inet dhcp
iface wlan0 inet dhcp

wpa-conf /etc/wpa.config

my /etc/wpa.config is:

ap_scan=1
ctrl_interface=/var/run/wpa_supplicant

network={
    ssid="###"
    psk="##########"
}

Both usb wifi dongles are identical (ASUS EX N) and the first one is recognised and I can configure (as above), while the second one is detected but not recognised as a lan device. Experimenting with dmesg I can find out the following for each usb device:

dmesg | grep "usb1"

[    1.841842] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.850929] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.860403] usb usb1: Product: DWC OTG Controller
[    1.867357] usb usb1: Manufacturer: Linux 3.2.27+ dwc_otg_hcd
[    1.875306] usb usb1: SerialNumber: bcm2708_usb

dmesg | grep "1-1:"

[    2.343158] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    2.563416] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[    2.572622] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.583814] hub 1-1:1.0: USB hub found
[    2.591025] hub 1-1:1.0: 3 ports detected

dmesg | grep "1-1.1:"

[    2.873414] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    2.983730] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    2.995145] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.078641] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:e8:9f:ac
[   24.257871] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1

dmesg | grep "1-1.2:"

[    3.193382] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[    3.306387] usb 1-1.2: New USB device found, idVendor=0b05, idProduct=1786
[    3.319133] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.329079] usb 1-1.2: Product: ASUS EZ N Network Adapter
[    3.340862] usb 1-1.2: Manufacturer: Manufacturer Realtek 
[    3.349052] usb 1-1.2: SerialNumber: 00e04c000001

I've tried googling but cannot find any info about connecting two wifi dongles to a device. I suspect that I have to somehow apply the drivers (which are obviously already available) and make wlan1 appear, once there then I will be able to figure out the rest. Any help would be appreciated.

Added extra information as requested:

lsusb:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 0b05:1786 ASUSTek Computer, Inc. USB-N10 802.11n Network Adapter [Realtek RTL8188SU]

/var/log/messages (sample, presuming this is relevant):

[   13.057545] r8712u: module is from the staging directory, the quality is unknown, you have been warned.
[   13.500489] r8712u: DriverVersion: v7_0.20100831
[   13.783452] r8712u: register rtl8712_netdev_ops to netdev_ops
[   13.791591] r8712u: USB_SPEED_HIGH with 4 endpoints
[   14.027050] r8712u: Boot from EFUSE: Autoload OK
[   15.017889] r8712u: CustomerID = 0x0010
[   15.024091] r8712u: MAC Address from efuse = 30:85:a9:6e:a6:bb
[   15.032267] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
...
[   30.073530] r8712u: 1 RCR=0x153f00e
[   30.074269] r8712u: 2 RCR=0x553f00e
...
[   38.336980] r8712u: [r8712_got_addbareq_event_callback] mac = 58:6d:8f:00:37:45, seq = 0, tid = 0

The mac addy 30:85:a9:6e:a6:bb matches the one from ifconfig, so I am presuming that the r8712u is what is used for the ASUS EX N that is recognised. ifconfig -a:

eth0  Link encap:Ethernet  HWaddr b8:27:eb:e8:9f:ac  
      inet addr:192.168.1.132  Bcast:192.168.1.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:656 errors:0 dropped:0 overruns:0 frame:0
      TX packets:453 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:59529 (58.1 KiB)  TX bytes:105486 (103.0 KiB)

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 30:85:a9:6e:a6:bb  
      inet addr:192.168.1.117  Bcast:192.168.1.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:418 errors:0 dropped:1 overruns:0 frame:0
      TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:111070 (108.4 KiB)  TX bytes:1308 (1.2 KiB)

Please note that while I'm an experienced Unix/Linux user, I'm not very experienced with the kernel and drivers. So please be patient with me.

More info:

Tried replacing the second wifi dongle with a flash drive. That worked fine. Looking at messages I can see that it detects a usb 1-1.3, which it doesn't detect if I have the second wifi dongle in there.

[    9.443324] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
[    9.945760] usb 1-1.3: New USB device found, idVendor=090c, idProduct=1000
[    9.963268] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    9.976352] usb 1-1.3: Product: USB DISK
[    9.982674] usb 1-1.3: Manufacturer: SMI Corporation
[    9.992819] scsi0 : usb-storage 1-1.3:1.0

Even more info:

I decided to switch the to move the wifi dongle that works to the other usb port and then decided to plug in the other one. Interestingly lsusb now states:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 0b05:1786 ASUSTek Computer, Inc. USB-N10 802.11n Network Adapter [Realtek RTL8188SU]
Bus 001 Device 005: ID 0b05:1786 ASUSTek Computer, Inc. USB-N10 802.11n Network Adapter [Realtek RTL8188SU]

So it appears to detect both now (no idea why this is different to before). Strangely though wlan1 isn't coming up automatically, not sure why. In /var/log/messages I now see:

[    3.173177] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[    3.296059] usb 1-1.2: New USB device found, idVendor=0b05, idProduct=1786
[    3.305833] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.320060] usb 1-1.2: Product: ASUS EZ N Network Adapter
[    3.331367] usb 1-1.2: Manufacturer: Manufacturer Realtek
[    3.343032] usb 1-1.2: SerialNumber: 00e04c000001
[    3.443224] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
[    3.566236] usb 1-1.3: New USB device found, idVendor=0b05, idProduct=1786
[    3.575638] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.585429] usb 1-1.3: Product: ASUS EZ N Network Adapter
[    3.593239] usb 1-1.3: Manufacturer: Manufacturer Realtek
[    3.601034] usb 1-1.3: SerialNumber: 00e04c000001
...
[   11.713221] r8712u: module is from the staging directory, the quality is unknown, you have been warned.
[   11.728515] r8712u: module is from the staging directory, the quality is unknown, you have been warned.
[   12.124771] r8712u: DriverVersion: v7_0.20100831
[   12.131967] r8712u: register rtl8712_netdev_ops to netdev_ops
[   12.550340] r8712u: USB_SPEED_HIGH with 4 endpoints
[   12.691051] r8712u: Boot from EFUSE: Autoload OK
[   13.716918] r8712u: CustomerID = 0x0010
[   13.723264] r8712u: MAC Address from efuse = 30:85:a9:6e:a6:c9
[   13.731529] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
[   13.740279] r8712u: DriverVersion: v7_0.20100831
[   13.750556] r8712u: register rtl8712_netdev_ops to netdev_ops
[   13.760178] r8712u: USB_SPEED_HIGH with 4 endpoints
[   13.774319] r8712u: Boot from EFUSE: Autoload OK
[   14.532517] r8712u: CustomerID = 0x0010
[   14.538717] r8712u: MAC Address from efuse = 30:85:a9:6e:a6:bb
[   14.546902] r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
...
[   32.273631] r8712u: 1 RCR=0x153f00e
[   32.274494] r8712u: 2 RCR=0x553f00e

Via ifconfig I am only seeing wlan1 and not wlan0. Very weird…


Changed ifconfig to ifconfig -a above, output is the same (wlan1 is not shown). If I do a ifconfig wlan1 then I get:

wlan1: error fetching interface information: Device not found

When I swap them around and lsusb is showing all five usb devices (listed above), when I do a ifconfig -a I get both wlan0 and wlan1:

eth0  Link encap:Ethernet  HWaddr b8:27:eb:e8:9f:ac  
      inet addr:192.168.1.132  Bcast:192.168.1.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:117 errors:0 dropped:0 overruns:0 frame:0
      TX packets:95 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:12685 (12.3 KiB)  TX bytes:12594 (12.2 KiB)

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 30:85:a9:6e:a6:bb  
      inet addr:192.168.1.117  Bcast:192.168.1.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:32 errors:0 dropped:1 overruns:0 frame:0
      TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:5674 (5.5 KiB)  TX bytes:1098 (1.0 KiB)

wlan1 Link encap:Ethernet  HWaddr 30:85:a9:6e:a6:c9  
      UP BROADCAST RUNNING 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)

and doing a ifconfig wlan1 shows the wlan1 info as shown above.


ip link show in the swapped usb device config shows:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether b8:27:eb:e8:9f:ac brd ff:ff:ff:ff:ff:ff
3: wlan1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 1000
    link/ether 30:85:a9:6e:a6:c9 brd ff:ff:ff:ff:ff:ff
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT qlen 1000
    link/ether 30:85:a9:6e:a6:bb brd ff:ff:ff:ff:ff:ff

Best Answer

It appears that the device I'm using doesn't like the two wifi dongles connected in the order that I had them connected. Reversing the order in which they are connected resulted in both wifi dongles being recognised (as seen via lsusb) and then consequently configurable via /etc/network/interfaces, after which they could be brought up via ifup wlan1.

The final entries in /etc/network/interfaces that worked was:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa.config

auto wlan1
iface wlan1 inet dhcp
    wireless-essid ardrone_3

and the results with ifconfig are:

eth0  Link encap:Ethernet  HWaddr b8:27:eb:e8:9f:ac  
      inet addr:192.168.1.132  Bcast:192.168.1.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:5111 errors:0 dropped:0 overruns:0 frame:0
      TX packets:3001 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:431610 (421.4 KiB)  TX bytes:552794 (539.8 KiB)

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 30:85:a9:6e:a6:bb  
      inet addr:192.168.1.117  Bcast:192.168.1.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:4743 errors:0 dropped:1 overruns:0 frame:0
      TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:1322366 (1.2 MiB)  TX bytes:1309 (1.2 KiB)

wlan1 Link encap:Ethernet  HWaddr 30:85:a9:6e:a6:c9  
      inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:5 errors:0 dropped:0 overruns:0 frame:0
      TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:2420 (2.3 KiB)  TX bytes:1476 (1.4 KiB)

As can be seen, both wifi devices are working and have received ip addresses.

It appears that the problem was not a configuration issue of debian but an issue with the hardware that required the two devices to be swapped.

A big thank you to Gert van den Berg and user1129682 for their patience with me.

Related Question