Raspberry Pi – Introduction and Setup

Raspberry Pi is a general purpose inexpensive computing platform. It is powerful, easy to setup and fun to work with. It is being used in many places and in this post I will show you have to set it up easily.

Getting Started

  • Buy Raspberry Pi (I purchased Raspberry Pi 3 Model B from amazon, see pictures above)
  • Setup an SD Card (I purchased a 32GB card with NOOBS pre-installed)
    • If you want to setup yourself check instructions on https://www.raspberrypi.org/, I will recommend to buy SD card pre-installed with NOOBS for Raspberry Pi.
    • The operating system I am using is Raspbian (which is a Linux distro).
  • Hookup Peripherals
    • Plug-in your USB Keyboard, mouse
    • HDMI video out to TV or monitor (I used TV)
    • You need these for first time setup, later we will see how to connect to Raspberry pi remotely, so you can use a different laptop to connect to it and later not always need TV, mouse, keyboard etc.
    • USB Power cable.
  • Other Items
    • If you want, you can also buy some casing, shields etc (I bought a case with heat-sink and fan,see picture above of raspberry pi in a case)

Once you hookup peripherals and switch on the pi, it will run through its installation process. You might be prompted to setup timezone, language, wifi etc and in few min you will see the raspberry desktop. Also its recommended to upgrade the packages on the raspberry pi using apt-get.

Enable SSH and VNC Server on Pi

If you want to connect to raspberry pi remotely. Then you can enable SSH and VNC server on raspberry pi (which are disabled by-default).

  • Open the terminal window on raspberry pi and type >> raspi-config
    • You will see a menu for various settings, you will find settings related to SSH and VNC server in the options, enable those, finish and then restart your pi.
  • Also, you can see the ip address of your pi by executing ifconfig in the terminal.

Here is the screenshot of VNC server after enabling it.

Remotely Connecting to Raspberry Pi

We saw how to enable SSH and VNC Server on the pi. Now if we want we can remove the keyboard, mouse, HDMI monitor etc from the Pi, kind of headless scenario, or keep those connected (they doesn’t interfere when connected from other computer). We can instead use a different computer to get into our raspberry pi and its operating system and this will help us to perform some operations on the pi very easily.

Using SSH

  • On a different computer, (I am using windows) open a powershell terminal and type following command to connect to raspberry pi:
      • >>ssh 192.168.1.11 -l pi // (IP address of the pi)

Using VNC Viewer

Another way to connect to pi, is via VNC viewer. I installed VNC viewer on my windows computer, from real vnc https://www.realvnc.com/en/connect/download/viewer/ and it worked without any issue.

Once, VNC Viewer is installed on your computer, you can use it to connect to VNC server via IP address of the raspberry pi (which we saw above, how to get)

You will be asked to provide the following information:

and moments later you are connected:

Summary

Raspberry pi is cool and we saw how easy it is to get started with it. There are very cool projects you can do with this platform, also check the official website of raspberry pi to have a look on projects people are working on. In upcoming blog posts, I will write about how to program it and control it in some fun and useful projects. Till next time, Happy coding.

References