Setup a Headless Raspberry Pi

by yhdesai in Circuits > Raspberry Pi

37 Views, 0 Favorites, 0 Comments

Setup a Headless Raspberry Pi

Raspberry_Pi_3_2_of_4_2fe9737c-ff10-4b05-97fa-66e956393b9c_1024x1024.jpeg

This is a Step-by-Step guide on how to setup your raspberry pi as headless, that is, to access it via wifi without any input device (keyboard) or a display. This guide uses Raspbian Stretch Lite, Minimal image based on Debian Stretch.

Prerequisites

Raspberry-Pi-3-Ports-1-1833x1080.jpg
DSC_0289-800x609.jpg
Official-Case-no-Pi-1-462x322.jpg
61JJiCDc0JL._SY355_.jpg
41a7-xI139L._SY355_.jpg

You will need

  1. Raspberry Pi
  2. Power Adapter, preferably 5V 2A
  3. Raspberry Pi Case (Optional)
  4. A Computer
  5. An SD card
  6. Some means to read/write an SD card (built-in or USB adaptor)
  7. A router with one spare ethernet socket / A Wifi router which you can login to

Downloading the Image

Screenshot from 2017-12-19 17-47-46.png
Screenshot from 2017-12-19 17-51-11.png
Screenshot from 2017-12-19 17-52-31.png

Unless you have some special preference, Raspbian Stretch Lite is the recommended os image to install.

To download the latest Raspbian Stretch Lite, Visit this link.

Once the file is downloaded, Unzip it using your favorite unzipper and you shall have an .img file.

Flashing the SD Card

Screenshot from 2017-12-19 17-55-30.png
Screenshot from 2017-12-19 17-55-42.png
Screenshot from 2017-12-19 17-59-47.png
Screenshot from 2017-12-19 17-59-57.png
Screenshot from 2017-12-19 18-00-15.png
Screenshot from 2017-12-19 18-00-33.png
Screenshot from 2017-12-19 18-00-46.png
Screenshot from 2017-12-19 18-00-53.png
Screenshot from 2017-12-19 18-04-09.png

You will need to use an image writing tool to install the image you have downloaded on your SD card.

Etcher is a graphical SD card writing tool that works on Mac OS, Linux and Windows, and is the easiest option for most users. Etcher also supports writing images directly from the zip file, without any unzipping required. To write your image with Etcher:

  1. Download Etcher and install it.
  2. Connect an SD card reader with the SD card inside.
  3. Open Etcher and select from your hard drive the Raspberry Pi .img or .zip file you wish to write to the SD card.
  4. Select the SD card you wish to write your image to.
  5. Review your selections and click 'Flash!' to begin writing data to the SD card.

Enabling SSH

To enable ssh, Create an empty file called ssh in /mnt/sdc1/ folder of the BOOT disk. (i.e. /mnt/sdc1/ssh).

Booting Pi Up

Connect the Raspberry Pi with the power adapter and ethernet cable.

Login to your router and find the ip address of the pi. It should have the hostname raspberrypi.

Now you can use putty to ssh into the pi.

If you are a Linux User, Type in the terminal "ssh pi@ip-address-here"

The default password is raspbian. It is recommended to change the password when you boot the pi. To change the password, type the commeand sudo passwd.