RPi-03: Connecting RPi to Wifi


For these tutorials we will not use the Emily Carr Wifi network as it is problematic, but I recommend using your own hotspot or your own home network:

  • SSID: wifi network name
  • Password: wifi password

To connect to this network from your Raspberry Pi, we’ll need to edit the /etc/network/interfaces file.

We’re going to use nano to do this. Nano is a text editor for Unix-like computing systems or operating environments using a command line interface.

To edit the file type:
sudo nano /etc/network/interfaces

Modify the file so it looks the same as below:

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
        wpa-ssid "workshop"
        wpa-psk "internet"

Now save the file by using the key combination ctl+O (press the control button and the o button at the same time) Press ‘return’ to confirm the file name. Finally, to exit nano press ctl+X.

We’ll need to restart the network interface in order for it to connect to the network. We can do that with:
sudo /etc/init.d/networking stop

and then
sudo /etc/init.d/networking start

Now that we’re connected to Wifi let’s connect our computer to the RPI

Leave a Reply

Your email address will not be published. Required fields are marked *