- find the wifi adaptor name
lshw
ls /sys/class/net
it was wlan0 in my case
- edit /etc/netplan/50-cloud-init.yaml
network:
ethernets:
eth0:
dhcp4: true
optional: true
version: 2
wifis:
wlan0:
optional: true
access-points:
"SSID-NAME":
password: "your_password"
dhcp4: yes
- Test the config
netplan try
netplan --debug try
This command will make the above changes for 120seconds if anything wrong it will be reverted back. OR you can hit Enter to make the changes.
- apply config
netplan generate
netplan apply
#enable wifi module
modprobe brcmfmac
#disable
modprobe -rv brcmfmac
nano /etc/modprobe.d/raspi-blacklist.conf
blacklist brcmfmac
blacklist brcmutil