Skip to main content

1 Pi, 2 WiFi

For those requiring multiples of WiFi adapters recognized and functional on their Raspberry Pi- A large variety of trouble shooting/ general setup(for those lucky types who things "just work" for them...)    and further trouble shooting for the others where things just can't, aren't, may never be as simple as plug and play- it is more; play, plug, play, un plug, reset, plug, play play play, plug, reset,restart computer since all resources have been tied up in all the tabs/ windows open for a solution so that at one weird odd moment down the road the thing might just work and you may have no idea what even was the fixx since it just did,,,,  Or you just give up having done enough cursing to no avail- questioning the saving that are seen when considering DIY or Buy?

Sometimes all we need is that 1 forum thread...

...being:
 https://forums.raspberrypi.com/viewtopic.php?t=49283

Solution and Trouble Shooting Issues with 2 WiFi Adapters/ Interfaces  Running at the Same Time

Run dmesg to see kernel messages of hardware when added,,,


whatis dmesg -- dmesg description/ what dmesg is

dmesg -w 

Remove all USB WiFi Dongles/adapters,

do dmesg -c command. (clears buffer)

plug adapter in.

wait...

plug second adapter in.

wait...

use `dmesg >dmesg_log.txt` to write log to a file.

and `cat dmesg_log.txt` to show.


Some of the Many Commands used:

lsusb - connected by USB

ifconfig - hardware info -- be scared if you se r8712u <much troubles, many bad time.

ifconfig -a

uname -a  - hardware, Pi OS

sudo ifdown --force wlan0 - turns wlan off 

sudo ifup --force wlan0 - turns wlan on

or:

 sudo ifdown wlan1 and then sudo ifup wlan1 or even sudo ifdown --force wlan1 and then sudo ifup --force wlan1

What you are looking for:

wlan0, wlan1 etc.. what are these? Take note of description, make/model, IP, MAC, chipset


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

Look for the below in the last file- should look same same/ similar and will allow the 2 adapters to play together- mind your power consumption where you may require a powered hub, find 1 with 5v, 4amps preferably- also mind USB version...2 or 3? Your devices compatible> Cables? OTG? Hub compatible?: Continue on....

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"


Hardware Mentions

Hardware confirmed to work: 

...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. -- from https://forums.raspberrypi.com/viewtopic.php?p=385707&sid=68d34da69e7472b3a2ffc9b469822e9c#p385707

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).  -- From https://forums.raspberrypi.com/viewtopic.php?p=459833&sid=68d34da69e7472b3a2ffc9b469822e9c#p459833

Other Considerations

Issues with resolution:

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 run the two of them together, the wlan1 device would not register,

Solution that Worked

This worked:

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

$ sudo vi /etc/modprobe.d/wlan-blacklist.conf

blacklist r8712u

blacklist 8192cu

$ sudo depmod -ae (may have issues here where instead of -ae you may require -E or -F)

$ 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.):

# /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

Reboot 


and it worked for this person...

More to add to the above solution:

https://forums.raspberrypi.com/viewtopic.php?p=891662&sid=68d34da69e7472b3a2ffc9b469822e9c#p891662


To have your interfaces/ adapters named with specific interface names - from https://forums.raspberrypi.com/viewtopic.php?p=1302491&sid=4e8b91bc6ed59e0528e5121e58854e45#p1302491


Create a new file in directory /etc/wpa_supplicant/. The new file should be named with interface name i.e

wpa_supplicant-wlan1.conf

- file /etc/wpa_supplicant/wpa_supplicant-wlan0.conf for interface wlan0

- file /etc/wpa_supplicant/wpa_supplicant-wlan1.conf for interface wlan1

- content of wpa_supplicant-wlan0.conf file

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

country=US

network={

ssid="ssid0"

psk="pass0"

}

- content of wpa_supplicant-wlan1.conf file

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

country=US

network={

ssid="ssid1"

psk="pass1"

}

reboot PI and you should have SSID attached to an interface.
Final Comment

If you don't get 2 WiFi adapters to work after all that then... I wish you good luck. But, if you do find a different solution that wasn't found here, yet worked for you, then report back- leave a comment- If it works, then i'll feature your solution also.

Anyone else, if this helped, please do let me know- or maybe you required a bit oif editing of the info above- leave a comment- it will help others.

Comments

Popular posts from this blog

Windows Doesn't recognize Your HackRF device? Wrong Drivers? Try ...

 Mostly for me to remember, but Windows at times has a lapse in judgement with certain devices, DIY gadgets, peripherals that you maybe trying to connect to- for me, it was my HackRF( I have since stumbled upon a better way to start for the HackF if having driver woes- which I will cover in another post- but keep reading, since this is still good knowledge to know regarding driver issues )- no matter what, my PC could not recognize the HackRF/ or would recognize it, but as a keyboard. I required Windows to apply the correct drivers to the device so that it could be recognized for what it is... a...SDR. A HackRF.  Guessing What's Right... Making Assumptions. Getting it Wrong. So, really what we see here is that when connecting that never connected before thing into your PC, Windows is making an assumption on what that thing is, and then applying the best driver that it thinks suites that thing... From experience, and a general rule of life... "assumptions" aren't the b...

Maximising RF Range as per Texas Instruments

Making electronics such as semiconductors and pioneering advances in integrated circuits. Consistently Texas Instruments brings us innovation - in their "about me" they state this mentioning advancements "to make technology smaller, more efficient, more reliable and more affordable" – "Engineering Progress.", that is what Texas Instruments are about. Wireless/ RF Texas Instruments  or TI with their many product offerings and solutions, many of which fall into the category of being wireless- that is what our modern world is now- involving many technologies, but today we are talking more in the area of RF or Radio Frequencies. Though these technologies have advanced, and our knowledge has grown in said technologies- still, limitations exist. One of them, when talking about RF is the range that your solution needs, and realistically, the actual range possible with the technologies being utilized.  How Far Can My RF Signal Transmit? Receive? Sorry to burst you...

Miggitty Miggitty Mac Address

 Helping your router identify your WiFi adapter on your network. A Mac address is unique. Kinda like your device's fingerprint. It's made of 6 sets of 2 characters and separated by semiolonsì. A Mac address is comprised of letters and numbers. As an example; something like this ... 01:aa:gg:88:bb:ccp What Makes a Mac Address First six characters are classified as organizational unique identifier.. or OUI...  popular lookup tools/ databases are IEEE ieee Public Mac Address Look Up Tool... Online Search Tool by Wire Shark, to name a couple- there are many more...some more upto date than the other. If you can't locate the OUI within one, give the others a try.  A Tool such as the WiFi Pineapple can link directly to OUI resources giving us an efficient research tool for network analysis. OUI's For Research Utilising such data as an OUI can be of tremendous importance- providing shortcuts, Where once blind, guessing... now, knowing a manufacturer, can point us to default log...