Headless Raspberry Pi Setup

by Dec 21, 2018Raspberry Pi

In my previous article, I had written about Raspberry Pi and the use of the GPIO pins. You can set up the Pi using a monitor connected to the Pi using an HDMI cable and the keyboard, mouse connected to RPi’s USB port. Just download the Raspbian OS in an SD card and put in the slot given in the backside of the Raspberry Pi and BAM!! Do not worry, if you don’t have a monitor, keyboard, etc for this. It is so simple to set up the Raspberry Pi and access on your laptop. Only thing, you must have a LAN (Ethernet) cable and modem with the internet. When you do not use a monitor or keyboard to run a Pi, it is called as headless.

About Raspbian

Raspbian is a free operating system based on Debian optimized for the Raspberry Pi hardware. An operating system is the set of basic programs and utilities that make your Raspberry Pi run. However, Raspbian provides more than a pure OS: it comes with over 35,000 packages, pre-compiled software bundled in a nice format for easy installation on your Raspberry Pi. The Raspbian is free software and a community funded.

Things you needed to setup Raspberry Pi

  • Raspberry Pi
  • Ethernet cable
  • Router
  • SD card (maybe 16 GB)
  • SD card reader
  • Micro USB 2.0 Power source Connector ( smartphone charger to power RPi)

Softwares needed

Follow these steps to install the headless Raspberry Pi successfully.

Step 1 : Formatting the SD Card using the SD Card Formatter

Install the SD card formatter from the link given above. Insert the SD card in the card reader and format it.

Step 2: Download the Raspbian Image

Download the Raspbian Image from the given link. You can choose either Raspbian Stretch Lite version or with the desktopĀ from the options. If you are choosing Raspbian stretch with desktop, you will have access to desktop and icons ie. you will have access to GUI. If you are choosing the Raspbian stretch lite version, you will be able to boot the command line. Also, the size of this file is less and uses fewer resources. But for beginners, use the desktop version.

It will be downloaded in a Zip file, unzip it and you will find an image file. Meanwhile, download the Win32 DiskImager in your laptop.

Step 3: Write the Image file to the SD card using Win32 DiskImager

Open the Win32 DiskImager and click the icon (1). Select the image you need to write to the SD card and click Write (2) option. This takes 5 – 10 minutes to be done.

Step 4: Adding SSH file to the SD card

ssh

So now you have written the image file into the SD card and you will numerous files. In the recent Raspbian OS, SSH is not enabled so you have to create a file and add to that. Simply you can create a new file in the notepad and save it as “ssh” and copy it to the SD card. This flags the Pi to enable the SSH system on the next boot.

Step 5 : Start Booting the Pi

Boot the Pi

Right now you have the Raspbian OS installed in your SD card. Put it in the slot given back of of the Pi and connect the Power connector and the Ethernet cable to the modem with internet. Both the green and red LEDs should be blinking. Now download the TightVNC viewer, Putty and Advanced IP Scanner.

Step 6: Find the IP address of you Raspberry Pi

You can find your Raspberry Pi’s IP address by using an app called Fing or you can download Advanced IP Scanner.

Important note: The network of which your software / app using to find the IP address of your Pi should be same as the network of the Raspberry Pi which is connected via Ethernet cable to the modem.

Advanced Scanner

Step 7: SSH into the Raspberry Pi

I use putty for enabling the SSH in the Pi. The default credentials are

  • username : pi
  • password : raspberryĀ (thisĀ canĀ beĀ changedĀ inĀ theĀ configuration)
putty

Enter the IP address of the Raspberry Pi in the putty and enable the X11 forwarding. Click Open. Give the username as pi and password as raspberry.

Update the Raspberry Pi with the following linux shell commands. Install the tight vnc server in the Raspberry Pi.

sudo apt-get update
sudo apt-get install tightvncserver

Step 8 : View in the tightVNC viewer

As you had already downloaded and installed the tightVNC viewer in your system. Now install in the Raspberry Pi using the above command.

  tightvncserver

It asks to set up a password for tightVNC server.

Open the tightVNC viewer in your system and give your password. You will be getting a dialog box like the image given below where you have to give your IP address and the number which is given in your putty. For example–> IP address:X. In this case, the IP address is 192.168.0.101 and the number is 2. So it is, 192.168.0.101:2. Click Connect.

Finally!!

You will get a display like this, but you can change that to wifi mode. You can simply do that by clicking on the data symbol on the right top corner and select your wifi name and enter password.

Configure the Raspberry Pi

You must configure the Raspberry Pi and set up the location in order to access the WiFi.

sudo raspi-config

Final Step

So now you have enabled the WiFI. You can remove the ethernet cable from the Pi and start from the Step 6. Scan for the IP address and you will find a new one.

You can find the new IP address of the Raspberry Pi without the LAN cable. Use the IP address for Putty and the TightVNC viewer.

Everytime when you are opening the putty, check for the updates by applying the command:

sudo apt-get update 

When you are disconnecting the Pi, apply the command;

sudo reboot

Summary:

  1. Download and install Putty, TightVNC viewer
  2. Download and install SD card formatter and Advanced IP Scanner
  3. Download Raspbian Image
  4. Write the Raspbian image in SD card using Win32 DiskImager
  5. Insert the SD card in the Pi and power up
  6. Connect the ethernet cable to the router
  7. Open Advance IP Scanner and search for the Pi’s IP address
  8. Open Putty and enter the IP address
  9. Install tightvncserver in putty

That’s it! You can access your Pi headless. For any questions, feel free to contact me or you can comment below.

Creating a multiplication Skill in Alexa using python

Written By Monisha Macharla

Hi, I'm Monisha. I am a tech blogger and a hobbyist. I am eager to learn and explore tech related stuff! also, I wanted to deliver you the same as much as the simpler way with more informative content. I generally appreciate learning by doing, rather than only learning. Thank you for reading my blog! Happy learning!

RELATED POSTS

How to Setup an NGINX Server on Raspberry Pi ?

How to Setup an NGINX Server on Raspberry Pi ?

What is NGINX ? NGINX is a popular lightweight web server application you can install on the Raspberry Pi to allow it to serve web pages. In its initial release, it functioned for HTTP web serving. It is a web server that can also be used as...

FM Radio Transmitter with Raspberry Pi

FM Radio Transmitter with Raspberry Pi

Weā€™ve all listened to the radio and sang along to the songs, atleast in the car. But have you ever found yourself switching through several channels because you couldnā€™t find even one song that YOU like? In this article we will learn how to build a FM radio...

Raspberry Pi Camera and its Variety

Raspberry Pi Camera and its Variety

Choosing a suitable raspberry pi camera for your projects can get really difficult. RPI camera v1, RPI camera v2, RPI NOIR camera, and the list continues. Each one has different properties and should be used according to them. They have been used in various fields and...

WiFi extender using Raspberry Pi

WiFi extender using Raspberry Pi

It is always useful to know how to use your Raspberry Pi in pet projects that are actually useful around the house. Especially when you arenā€™t building something new ā€“ using your dormant Raspberry Pi to build useful devices around the house is a fun idea. If you are...

Using Raspberry Pi as various Servers

Using Raspberry Pi as various Servers

Raspberry Pi is a widely popular SoC, that is versatile and easy to use for even beginners. If you are new and are unfamiliar with Pi, take a look at these articles. Regardless of the model of Raspberry Pi you have, I am sure you have discovered a plethora of projects...

SQLite Database on Raspberry Pi

Welcome to another tutorial on Raspberry Pi. In this tutorial, we will see how to use the SQLite Database on Raspberry Pi. Apart from the installation and a few basic commands, in the end, we shall look at a simple project to log sensor data into an SQLite database....

Mosquitto MQTT Broker on Raspberry Pi

This tutorial will show you what is Mosquitto MQTT Broker and how to install it on Raspberry Pi. Contents What is MQTT?Installing Mosquitto MQTT on Raspberry PiCreating an MQTT Broker on Raspberry PiSubscribe to a TopicPublish a message to a TopicSample...

Evolution of the Raspberry Pi – A Comparison

Evolution of the Raspberry Pi – A Comparison

The Raspberry Pi is an inexpensive credit card-sized micro-computer. The Raspberry Pi was originally designed as a way to teach how computers work and the rest of computer science in general. It was originally developed in the UK by a team that included Eben Upton,...

Recording audio on your Raspberry Pi

Recording audio on your Raspberry Pi

Raspberry Pi can record and playback fairly good quality audio through its USB 2.0 ports. For recording audio and playback we need two peripheral devices, a USB microphone, and a speaker. You can choose to use a USB speaker, or a speaker with a 3.5mm sound jack....

Tutorial: Dropbox with Raspberry Pi

Tutorial: Dropbox with Raspberry Pi

Many Raspberry Pi projects require synchronization of files over more than just one device. Dropbox, which is a popular file-hosting service, can be used for this with ease. Synchronizing data between different devices may seem a little tricky, especially since the...

VIDEOS – FOLLOW US ON YOUTUBE

EXPLORE OUR IOT PROJECTS

IoT Smart Gardening System – ESP8266, MQTT, Adafruit IO

Gardening is always a very calming pastime. However, our gardens' plants may not always receive the care they require due to our active lifestyles. What if we could remotely keep an eye on their health and provide them with the attention they require? In this article,...

How to Simulate IoT projects using Cisco Packet Tracer

In this tutorial, let's learn how to simulate the IoT project using the Cisco packet tracer. As an example, we shall build a simple Home Automation project to control and monitor devices. Introduction Firstly, let's quickly look at the overview of the software. Packet...

All you need to know about integrating NodeMCU with Ubidots over MQTT

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

All you need to know about integrating NodeMCU with Ubidots over Https

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

How to design a Wireless Blind Stick using nRF24L01 Module?

Introduction Let's learn to design a low-cost wireless blind stick using the nRF24L01 transceiver module. So the complete project is divided into the transmitter part and receiver part. Thus, the Transmitter part consists of an Arduino Nano microcontroller, ultrasonic...

Sending Temperature data to ThingSpeak Cloud and Visualize

In this article, we are going to learn ā€œHow to send temperature data to ThingSpeak Cloud?ā€. We can then visualize the temperature data uploaded to ThingSpeak Cloud anywhere in the world. But "What is ThingSpeak?ā€ ThingSpeak is an open-source IoT platform that allows...

Amaze your friend with latest tricks of Raspberry Pi and Firebase

Introduction to our Raspberry Pi and Firebase trick Let me introduce you to the latest trick of Raspberry Pi and Firebase we'll be using to fool them. It begins with a small circuit to connect a temperature sensor and an Infrared sensor with Raspberry Pi. The circuit...

How to implement Machine Learning on IoT based Data?

Introduction The industrial scope for the convergence of the Internet of Things(IoT) and Machine learning(ML) is wide and informative. IoT renders an enormous amount of data from various sensors. On the other hand, ML opens up insight hidden in the acquired data....

Smart Display Board based on IoT and Google Firebase

Introduction In this tutorial, we are going to build a Smart Display Board based on IoT and Google Firebase by using NodeMCU8266 (or you can even use NodeMCU32) and LCD. Generally, in shops, hotels, offices, railway stations, notice/ display boards are used. They are...

Smart Gardening System – GO GREEN Project

Automation of farm activities can transform agricultural domain from being manual into a dynamic field to yield higher production with less human intervention. The project Green is developed to manage farms using modern information and communication technologies....