I want my raspberry pi 3 b to automatically connect to a wireless network via antenna (not with integrated one), the interface is wlan1. I want to do this only via terminal. Is there a wpa_supplicant word key that lets me to choose the interface?
Asked
Active
Viewed 338 times
1 Answers
0
You can e.g. use the wpa_supplicant command line interface wpa_cli to connect to a network. As you want to use the interface wlan1, you simply have put it as parameter.
This is an example for wpa_cli in interactive mode (replace AP_NAME with the name of your AP, passphrase with the passphrase of the AP and 0 with the number that is printed to stdout after ADD_NETWORK):
sudo wpa_cli -i wlan1
> ADD_NETWORK
> SET_NETWORK 0 ssid "AP_NAME"
> SET_NETWORK 0 psk "passphrase"
> ENABLE_NETWORK 0
> quit
You can find the reference for wpa_cli here.
If you want a permanent connection, please follow the official documentation and update the wpa_supplicant.conf file.
Details regarding two wlan interfaces can be found e.g. here.
oh.dae.su
- 318