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.
I also included in wpa_supplicant.conf
Code: Select all
/etc/network/interfaces allow-hotplug wlan0 iface wpa0 inet static address 192.168.30.2 netmask 255.255.255.0 wireless-essid PiAdhoc wireless-channel 149
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
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:
After doing this, the dongle, in this cases is always called wpa0.
Code: Select all
sudo nano /etc/systemd/network/10-wpa0.link [Match] MACAddress=x.x.x.x [Link] Name=wpa0 sudo reboot.
But I don't know how to fix the name of the onboardWifi.
I tried creating another .link file for the wpa1 11-wpa1.link, with the onboardwifi MAC, but it didn't work, doing ifconfig only wpa0 appeared.