Posts: 8
Joined: Fri Nov 13, 2015 11:45 am

Pi 3B+, Stretch, predictive interface names for onboardWiFi and dongle.

Tue May 15, 2018 10:12 am


I bought 2 Raspberry Pi 3B +, withe the intention of creating and ad-hoc WiFi among them, without AP at 5GHZ
to choose the channel:
$sudo iwlist freq

In order to do this I edited the file.

Code: Select all

allow-hotplug wlan0
iface wpa0 inet static
wireless-essid PiAdhoc
wireless-channel 149
I also included in wpa_supplicant.conf
country= My country code

I configured the same the 3 Raspi-s, with differents IPs in the same range. --- This worked, I can do ping among the Raspis

Then I add a WiFi dongle at 2.4GHz. This radio will conect to a regular access point WiFi with an ssid and psk saved in wpa_supplicant.conf

I have to include this new interface in /etc/network/interfaces:

allow allow-hotplug wlan1
iface wpa0 inet static
wpa_conf /etc/wpa_supplicant/wpa_supplicant.conf

$sudo reboot
This doesn't work.

To see what happens:
$ sudo iwconfig

It seems that the names of the interfaces are mixed, and the dongle is named after the onboard raspi radio and on the contrary, so at the end, both radios are working at 2.4 GHz.
After some reading I get to this solution, but it ony worked partially:
- Avoid using channel 149, for some reason, when connecting the WiFi dongle this channel is not available any more, I selected channel 36
- To fix the name of the interfaces>
ifconfig, and note down the MAC address of each device (on Board WiFi and dongle)

Create new .link file in this folder:

Code: Select all

sudo nano /etc/systemd/network/



sudo reboot. 
After doing this, the dongle, in this cases is always called wpa0.

But I don't know how to fix the name of the onboardWifi.
I tried creating another .link file for the wpa1, with the onboardwifi MAC, but it didn't work, doing ifconfig only wpa0 appeared.

Return to “Networking and servers”