This code works. I've tested it with a Raspberry Pi Zero 2 W.
- Create a new text file, copy the code from below, paste it, and replace the following:
- country= with your country Alpha'a code (e.g., US, IN, list here).
- ssid="your WiFi name" (remove any spaces).
- psk="your WiFi password" (remove any spaces).
- Save the file, rename it to wpa_supplicant.conf, and move it to the root of your freshly installed Pi.
That's it!
country=IN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="yourWifiName"
psk="yourWifiPassword"
key_mgmt=WPA-PSK
}