Configure the Raspberry Pi to connect to the wifi network

1. Log in to the Raspberry Pi

Insert picture description here

2. Enter the instruction

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

nano is a document editor, you can write as soon as you enter

3. Add configuration information

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

network={
    ssid="你的无线网名字"  //你家的 WiFi 的名字
    psk="密码"          //你家的 WiFi 密码
    key_mgmt=WPA-PSK  //加密方式(可以删除)
}

Insert picture description here
Press ctrl + o to save,
prompt whether to write, press Enter to confirm,
press ctrl + x to exit

3. Restart the Raspberry Pi

1. Ifconfig before restart: no wlan access
ifconfig
2. Enter the following command to restart:
sudo reboot
3. After restarting ifconfig: IP address is available, networking is complete
ifconfig

Guess you like

Origin blog.csdn.net/lcx1837/article/details/107841212