UNPKG

snips-sam

Version:

The Snips Assistant Manager

60 lines (41 loc) 2.48 kB
--- layout: article title: "Connecting a Raspberry Pi to the local network" subtitle: A guide to get your Raspberry Pi connected to the local network over Wi-Fi. permalink: /tutorials/networking/ toc: Configuring network access|Enabling SSH|Accessing the Pi|Changing the hostname --- If you need help setting up a Raspberry Pi from scratch, check out the [Raspberry Pi Setup Guide]({{ site.baseurl }}/tutorials/raspberry-pi-setup). # Configuring network access <div class="notification light-notification"> If your Pi is connected to the Internet via an ethernet cable, you can skip this section. Your device will be available on the network under the default hostname <code>raspberrypi.local</code>. </div> Insert the SD card into your computer and create a file called `wpa_supplicant.conf` at the root of the boot volume of the SD card (e.g. `/Volumes/boot` on macOS). Paste the following: ```ini ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="<Your wifi network name>" psk="<Your wifi network password>" } ``` Do not forget to update the `ssid` and `psk` keys. If you're looking for more details about this step, please refer to the [Official Raspberry Documentation](https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md). # Enabling SSH In order to access your Pi via SSH, you need to enable SSH. To do so, add an empty file, called `ssh`, at the root of the boot volume on your SD card (same location as `wpa_supplicant.conf` from the previous step). # Accessing the Pi Now, insert the SD card into the Pi. It will take roughly 20 seconds to boot. You can then access your Pi from your computer using the following command from a console prompt: ```sh $ ssh pi@raspberrypi.local ``` The default password is `raspberry`. If you are unable to connect, make sure your Pi and computer are connected to the same network, as specified earlier in `wpa_supplicant.conf`. # Changing the hostname If you wish to name your device something else than `raspberrypi`, in particular if you have several Pi devices on your local network, you may change the hostname by running `raspi-config` from your Pi: ```sh (pi) $ sudo raspi-config ``` Go to the "Hostname" menu, type in the desired name, for instance `raspi-basement`, and reboot. Next time you want to access your Pi via SSH, use the new hostname instead of `raspberrypi`, appended with `.local`: ```sh $ ssh pi@raspi-basement.local ```