1

I want to connect my raspberry pi to wi-fi and this wi-fi uses ip address. I use raspberry pi model 2 (B+), I have wi-fi dongle. How do I connect? I have connected to pi using ssh, and I'm only able to access the command line of pi and don't have access to it's GUI.

EDIT::

>> cat /etc/os-release

PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

1 Answers1

1

The Raspberry Pi Foundation has a guide on setting up WiFi without a GUI.

To summarize:

Use the following to scan for available WiFi networks:

sudo iwlist wlan0 scan

This will bring up a list of available networks, make a note of the ssid of your network. Then open and edit the wpa-supplicant configuration file with:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Once open, add the following to the end of the file:

network={
ssid="The ssid"
psk="The router password"
}

The ssid is the network name you found earlier, the password is the normal WiFi password. You may need to reboot.

You can check that this is running:

ifconfig wlan0

There should be an IP address under inet addr.

Deleuze
  • 236
  • 2
  • 10