How to make ubuntu auto connect to wifi in raspberry pi 4?
Google said…#
When you google 「raspberry pi 4 ubuntu auto wifi」…
Most people said:
Find the file /etc/wpa_supplicant/wpa_supplicant.conf
, edit it, add the following setting:
1network={
2 ssid="Your-Wifi-SSID"
3 psk="Your-Wifi-Password"
4}
Then save it, put the sd card back into raspberry pi, turn on the power, it’s working!
If not working#
If the solustion above working to you, then conguatulations.
But if it’s not working on your case as mine, try the following method, that is working in my case:
Find the config file /etc/netplan/50-cloud-init.yaml
, edit it to the following setting:
1network:
2 ethernets:
3 eth0:
4 dhcp4: true
5 optional: true
6 version: 2
7 wifis:
8 wlan0:
9 dhcp4: true
10 optional: true
11 access-points:
12 "Your-Wifi-SSID":
13 password: "Your-Wifi-Password"
Don’t forget to save, then try again.