Steps:
- Create the
wpa_supplicant.conffile in the bootfs partition:- Create a new text file named
wpa_supplicant.conf(or similar) using a text editor on your computer. - Add the following configuration, replacing the placeholders with your actual network details:
- Create a new text file named
Code
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="YOUR_NETWORK_SSID"
psk="YOUR_NETWORK_PASSWORD"
key_mgmt=WPA-PSK
}
ctrl_interface: Required for command-line utilities to interact withwpa_supplicant.update_config: Allowswpa_clito update the configuration.country: Set your country code.ssid: Your Wi-Fi network’s SSID (name).psk: Your Wi-Fi network’s password.key_mgmt: Specifies the authentication method (WPA-PSK for personal/home networks).
- 1. Enable SSH (optional, but recommended):
- Create an empty file named
ssh(no extension) in the/bootdirectory. - This enables SSH access on first boot, allowing you to connect remotely without a monitor and keyboard.
- Create an empty file named
- 2. Place the files on the SD card:
- Copy both
wpa_supplicant.confandssh(if created) to the/bootpartition of your Raspberry Pi’s SD card.
- Copy both
- 3. Boot the Raspberry Pi:
- Insert the SD card into your Raspberry Pi and power it on.
- The Pi will automatically move the
wpa_supplicant.conffile to the correct location and attempt to connect to your Wi-Fi network. - If you created the
sshfile, you will be able to SSH into your Pi once it connects to the network.
- 4. (Optional) Verify the connection:
- If you have a monitor and keyboard connected, you can check the network connection using
ifconfigorip addr. - You can also use
wpa_clito interact withwpa_supplicantand check connection status.
- If you have a monitor and keyboard connected, you can check the network connection using
Leave a Reply
You must be logged in to post a comment.