Thursday, December 2, 2021

Enable WiFi on a headless Raspberry Pi

Enabling WiFi on a headless Raspberry Pi is really simple. Here are the steps:
  1. Take out the SD card from Raspberry Pi and insert into a computer/laptop using a SD card reader in write mode.
  2. SD card will be named as "boot" on a drive on your computer.
  3. Open a text editor and create a file named "wpa_suppplicant.conf" on the root of "boot" or directly on the SD card.
  4. Add the below contents into the file and save it.
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="NETWORK-NAME"
    psk="NETWORK-PASSWORD"
}

Remember:

  • country should have a two character country code of your country.
  • ssid should be your Wifi Network Name in double quotes
  • psk should be the your Wifi Password in double quotes.
  • After saving the file check that the extension of the file is .conf and not .conf.txt. If so, then change it to .conf.
Now, eject the SD card and insert it in Raspberry Pi and it will automatically connect to the Wifi.


No comments:

Post a Comment

How to install node using Brew

This article talks about some simple steps to follow to install node using Brew . Though there are many other ways to do it but the method ...