The wireless adapter must be supported by Raspberry Pi. You can go to the official or http://shumeipai.net to view the hardware list
Either of the two solutions can not be changed
# Solution 1
# Configure network interfaces
Sudo nano/etc/Network/interfaces
The default file content is as follows:
Auto Lo
Iface lo Inet loopback
Iface eth0 Inet DHCP
Allow-hotplug wlan0
Iface wlan0 Inet Manual
WPA-roam/etc/wpa_supplicant/wpa_supplicant.conf
Iface default Inet DHCP
Modify as follows:
DHCP Configuration:
Auto Lo
Iface lo Inet loopback
Iface eth0 Inet DHCP
Allow-hotplug wlan0
Auto wlan0
Iface wlan0 Inet DHCP
WPA-roam/etc/wpa_supplicant/wpa_supplicant.conf
Static Configuration:
Auto Lo
Iface lo Inet loopback
Iface eth0 Inet DHCP
Allow-hotplug wlan0
Iface wlan0 Inet Manual
Address 192.168.0.100
Netmask 255.255.255.0
Gateway 192.168.0.1
WPA-roam/etc/wpa_supplicant/wpa_supplicant.conf
# Set WPA Authentication
Sudo nano/etc/wpa_supplicant/wpa_supplicant.conf
Modify as follows:
Network = {
SSID = "SSID name"
PROTO = RSN
Key_mgmt = WPA-PSK
Pairwise = CCMP TKIP
Group = CCMP TKIP
PSK = "password"
}
# Restart. wlan0 is automatically enabled.
# Solution 2
# WPA authentication File
Sudo nano/etc/wpa_supplicant/wpa_supplicant.conf
The modified content is as follows:
Ctrl_interface = dir =/var/run/wpa_supplicant group = netdev
Update_config = 1
Network = {
SSID = "SSID name"
PROTO = RSN
Scan_ssid = 1
Key_mgmt = WPA-PSK
Pairwise = CCMP
Auth_alg = open
PSK = "password"
}
# Modify the interfaces Configuration
Sudo nano/etc/Network/interfaces
DHCP Configuration:
Auto Lo
Iface lo Inet loopback
Iface eth0 Inet DHCP
Allow-hotplug wlan0
Auto wlan0
Iface wlan0 Inet Manual
WPA-roam/etc/wpa_supplicant/wpa_supplicant.conf
Iface default Inet DHCP
Static Configuration:
Auto Lo
Iface lo Inet loopback
Iface eth0 Inet DHCP
Allow-hotplug wlan0
Iface wlan0 Inet Manual
Address 192.168.0.100
Netmask 255.255.255.0
Gateway 192.168.0.1
WPA-roam/etc/wpa_supplicant/wpa_supplicant.conf
Iface default Inet DHCP
# Restart
By default, it will be automatically connected. You can run 'sudo iwconfig' to view the configuration or 'sudo ifconfig' to view the status.