1

I've been trying to configure my PI to connect to two networks at the same time with inconsistent results.

I am using both the built in adapter and a USB adapter. The USB adapter reports as a Edimax EW-7811Un (Realtek RTL8188CUS. As for the same file part. When I manually connect the adapters the network settings are both appended to the original supplicant file.

My only success so far has been temporary. If I clear out my wpa-supplicant file and connect each adapter to it's respective network things seem to work fine. This just adds two different entries into the same file for each network though, which I've learned isn't effective as a long term solution. The connection doesn't persist. After some time one network will disassociate and not reconnect and if I restart both adapters will only connect to the first entry in the supplicant file. Any attempt to manually connect the second device to the second network fails and it just stays disassociated. The only workaround seems to be to repeat the process of cleaning the file and manually connecting again.

I found this thread while searching for a solution but I seem to be missing something important: https://www.raspberrypi.org/forums/viewtopic.php?t=190525

I've created the separate supplicant files and entries in the interfaces file as mentioned. However there seems to be a critical step I'm missing as the system keeps referencing the original supplicant file. I assume the op understood some steps in the process that were not explicitly mentioned in the thread, leaving me guessing.

So what am I missing?

  • 1
    Hello Bolweevil. You're using an external adapter alongside the built-in one? You don't say so explicitly. What device is it (what does lsusb report?) What is "the same file for each network"? Please be precise and tell us. – roaima Feb 17 at 15:06
  • Sorry. Yes I am using both the built in adapter and a USB adapter. The USB adapter reports as a Edimax EW-7811Un (Realtek RTL8188CUS. As for the same file part. When I manually connect the adapters the network settings are both appended to the original supplicant file. – Bolweevil Feb 17 at 15:21
0

Here is an example from man wpa_supplicant to control multiple wifi interfaces using multiples configurations files through a single wpa_supplicant instance. e,g:

wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant0.conf -N \
               -iwlan1 -c /etc/wpa_supplicant/wpa_supplicant1.conf

To run wpa_supplicant in the background, use -B option:

wpa_supplicant -B -iwlan0 ...

sample configuration file:

/etc/wpa_supplicant/wpa_supplicant0.conf:

ctrl_interface=/run/wpa_supplicant
update_config=1

network={
    ssid="Network0"
    password="pass0"
    }

/etc/wpa_supplicant/wpa_supplicant1.conf:

ctrl_interface=/run/wpa_supplicant
update_config=1

network={
    ssid="Network1"
    password="pass1"
    }
  wpa_supplicant  can  control multiple interfaces (radios) either by running
    one process for each interface separately or by running just one process and
    list of options at command line. Each  interface  is separated  with -N 
    argument. As an example, following command would start wpa_supplicant for two
    interfaces:

         wpa_supplicant \
               -c wpa1.conf -i wlan0 -D nl80211 -N \
               -c wpa2.conf -i ath0 -D wext
| improve this answer | |
  • So I should replace the network connection entries currently in my supplicant file with something similar to that pointing to the separate files I have created with the connection settings? Do I need to specify the driver like in your example or can I rely on the system to detect the driver automatically like it's currently doing? – Bolweevil Feb 17 at 15:39
  • @Bolweevil This is just an example. You don't need to specify the driver, also you don't need to rename the wpa_supplicant file. – GAD3R Feb 17 at 15:43
  • Ok. I'm assuming those wpa files are in the same directory as the supplicant file and they contain the network connection settings you might normally find in the supplicant file for a single network setup? – Bolweevil Feb 17 at 15:47
  • @Bolweevil For every network interface , set a configuration file , it will be more easy to troubleshot the problem. – GAD3R Feb 17 at 15:53
  • Yes. I had already setup a file for each. I just tried your suggestion. I removed the network settings from my supplicant file and entered the information as you mentioned above. Everything looks the same minus the driver information. When I restarted neither device associated with a network at all. Attempting to click on the network settings icon also reveals that no wireless interfaces are found now. – Bolweevil Feb 17 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.