Friday, December 8, 2017

Multiple WiFi Networks with Raspberry Pi

All of this information (and more) is available on https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md.

All the WiFi network credentials should be listed in this file: /etc/wpa_supplicant/wpa_supplicant.conf. It should look like this:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=DE

network={
    ssid="ssid1"
    psk="plaintextpassword1"
    key_mgmt=WPA-PSK
}

network={
    ssid="ssid2"
    psk="plaintextpassword2"
    key_mgmt=WPA-PSK
}


Some additional useful commands:
  • List all available WiFi networks: iwlist wlan0 scan
  • Generate encrypted password: wpa_passphrase
  • Reconfigure the interface: wpa_cli -i wlan0 reconfigure
  • Verify if the connection was successful: ifconfig wlan0
For hidden networks add the scan_ssid=1 option, for priorization use the priority=1.

No comments: