This method is suitable if you don't have access to the graphical user interface normally used to set up WiFi on the Raspberry Pi.
Note also that no additional software is required; everything you need is already included on the Raspberry Pi.
You will need to define a wpa_supplicant.conf
Put this file in the boot Volumes
cd /Volumes/boot
then create file
touch wpa_supplicant.conf
and edit the file
sudo nano wpa_supplicant.conf
country=<Insert country code here>
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="<Name of your WiFi>"
scan_ssid=1
psk="<Password for your WiFi>"
}
example
country=ID
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="FIFI LT_3"
psk="F1F1*12345"
}
example with multiple network priority
country=ID
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="FIFI LT_3"
psk="F1F1*12345"
}
network={
ssid="wakwaw"
psk="abcdabcd"
}