Sunday, December 11, 2016

Raspberry PI setup in Headless Mode


Today i received my Raspberry PI 3 ultimate kit, The Raspberry Pi (RPi) is a single board computer based on the Broadcom BCM2835 System on Chip (SoC) it comes equipped with a General Purpose Input/Output (GPIO) connector, that can be used for connecting peripherals such as sensor, LEDs, motors etc.
 
I dont have monitor and keyboard to make it workable for me as i only have MAC laptop, After searching and reading different blogs and lot of different tries and failures following are steps which make my Raspberry PI accessible from my MAC without using any cable. Only requirement is you should have WiFi LAN, mostly we have for Internet connectivity

Unbox kit and assemble Raspberry PI as per Quick start guide provided by Vilros.

The microSD card that comes with kit already contains NOOBS(New Out of Box Software), When Pi will start and load the NOOBS tool, you can install Raspbian(its Linux distribution based on Debian, another popular version of linux) using NOOBS GUI.

To perform above steps we need Monitor and Keybooard but as we don't have so its recommended to prepare your MicroSD card using steps mentioned on this link http://elinux.org/RPi_Easy_SD_Card_Setup

So just put Card in your laptop Card reader and follow steps mentioned on above link. Keep card in card reader and do following configurations

edit following configuration on your card like

vi /etc/wpa_supplicant/wpa_supplicant.conf

add below line make sure values are in quotes don't remove it
network={
    ssid="wifi user name"
    psk="wifi network password"
}
To insert SD card, Make sure raspberry power is off and locate SD Card socket under side of Pi's board. Push SD card gently in socket.

Now when you Power On your PI you would be able to SSH but how to get IP of raspberry PI?

In my CISCO routers its like
status --> local network --> DHCP Client Table

I can see raspberrypi IP.

Now simply from the Laptop which is connected on same router just do

ssh pi@

and now Raspberry PI is in your control. :)

You can configure VNC Server if you still want to access raspberry PI in desktop environment.

To configure VNC Server from command line of same ssh do following

pi@raspberry:/ sudo raspi-config

Your command prompt would be like


Navigate to Advanced Options
scroll down and select VNC and select Yes

Then run vncserver, Make note of the IP Address/display number like 192.168.1.6:1

Now from your laptop use VNC Viewer and provide above mentioned info. You Can access Raspberry PI in GUI mode.

No comments: