#13 Raspberry Pi 3: Configure and Boot RPi3 for first time and Connect using SSH and VNC (using Command line)

IoT Tutorial #13 [ Raspberry Pi Tutorials #1 ]
Here, Step wise instructions are give to setup brand new Raspberry Pi 3 (Model B) from scratch.

After following all these steps, your Raspberry Pi 3 will be ready with SSH and VNC (Remote Desktop on Laptop Screen) connections...

Let’s start with Raspberry Pi3 (RPi3) (Model B)

REQUIREMENT:


1.      SD Card (Minimum 16GB)

2.      SD card Adapter

3.      USB Mouse and Keyboard

4.      Monitor / TV / Projector (With VGA or HDMI Input)
 (Needed Only for First Time)

5.      HDMI to VGA Converter (For VGA Input Monitor)



STEPS:

          1.     DOWNLOAD FOLLOWING SOFTWARES:

a.     OS for RPi3: RASPBIAN STRETCH WITH DESKTOP
https://www.raspberrypi.org/downloads/raspbian/

b.     Etcher
https://etcher.io/

c.      Putty for ssh connection (For Windows System)
http://www.putty.org/

d.     VNC Viever: (For viewing RPi3 monitor screen on your laptop / Mobile)
https://www.realvnc.com/en/connect/download/viewer/

e.      Angry IP Scanner
http://angryip.org/download/


           2.     BURN RASPBIAN in SD Card:
a.      Take SD Put it in SD Card Adapter and Insert it into Laptop.
b.     Format the SD card (File System: Fat32 or exFAT)
c.      Unzip RASPBIAN OS (from 1.a.)
d.     Burn Unzipped RASPBIAN OS (from 2.c.) into SD card using Etcher software (from 1.b.)
It will take some time...
e.      Once it’s done, Your SD card is ready to Boot.

3.     BOOT RASPBIAN OS FOR FIRST TIME:

a.      Connect Mouse and Keyboard to USB port of RPi3

b.     Insert SD card (from 2.b.) to SD card slot in RPi3

c.      Connect Monitor / TV / Projector to RPi3 using HDMI port.

                                                       i.            Use HDMI to HDMI cable (For HDMI Input TV)
                                          or 
                                                     ii.            Use HDMI to VGA converter and VGA Cable (For VGA Input Monitor)

d.     Connect Power cable (micro USB cable) to RPi3
(Use 5V 2A Adapter / Mobile charger as Power Supply)

NOTE: Don't use Laptop / PC USB port as Power Supply

You can watch on connected Monitor, RASPBIAN OS will boot for first time...

You are on RASPBIAN OS Desktop Right Now..





4.     CHANGING SETTINGS in RPi3 OS: (To See RPi3 Screen on Laptop)

a.      Enable SSH and VNC:
Click on Raspberry Button > Preferences > Raspberry Pi Configuration
Select Interfaces Tab and Enable SSH and VNC

b.     Enable Internet:
Click on Internet / WiFi Symbol on Task bar and Connect to Available WiFi.
Make Sure Your Laptop, Mobile and RPi3 are connected to Same WiFi Network.

If you don't have mouse then, Follow these steps to connect to WiFi using Command:
                                                       i.   Open Terminal, Run following commands:
sudo iwlist wlan0 scan
It will show the list of available WiFi Connections

                                                     ii.    Edit conf file:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Go to end of the file and Write following lines:
network={
          ssid="The_ESSID_from_earlier"
          psk="Your_wifi_password"
}
(NOTE: adding your settings in the quotation marks shown above)
Save the file using "ctrl+x" and then Press "Y" to Confirm and Hit "Enter".

                                                  iii.   Either It will detect and connect to WiFi automatically in some time
OR If it doesn't happen then reboot the RPi3 using following command.
sudo reboot
your RPi3 will reboot and will connect to Above mentioned WiFi Automatically.

c.      Check IP address:
Open Terminal and Type:
ifconfig
You will see your IP Address in response.

d.      Changing Display Resolution:
Open Terminal and Type:
Click on Raspberry Button > Preferences > Raspberry Pi Configuration
Select "System" Tab and Click on "Set Resolution" and
Set it to "DMT mode 23 1280x768 60Hz 15:9"

Note: Setting resolution is important otherwise When we start RPi3 without monitor (using VNC viewer) It starts with very less resolution.


5.     TRY TO PING RPi3 (To confirm the IP assigned to RPi3):

a.      Open Command prompt (on windows laptop) or Terminal (on Linux / MacOS)

b.     Type following command:
ping <ip_address_from_4.c.>

c.      Check whether it gets connected to RPi3 and you see some reply.


6.     CONNECT USING SSH:

(Make Sure Your Laptop, Mobile and RPi3 are connected to Same Wi-Fi Network.)

a.      For Windows Laptop:


                                                       i.   Install and Open Putty on your laptop Enter <ip_address_from_4.c> and click on "Open".

                                                     ii.   login as: pi
password: raspberry

Now you are connected to RPi3 using SSH

OR

b.     For Linux / MacBook User:


                                                       i.   Open terminal and run following command    
ssh pi@<ip_address_from_4.c>
Eg. ssh [email protected]
password: raspberry

(Default values: user_id: pi. password:raspberry)

Now you are connected to RPi3 using SSH


7.     CONNECT USING VNC: (To see RPi3 Screen on Laptop)

a.      Install and open VNC (from 1.d)

b.     Enter <ip_address_from_4.c.> and hit "Enter"

login id: pi
password: raspberry

Now you can see and control RPi3 Monitor screen on you laptop (like remote desktop)

NOTE: If Internet connect is slow then VNC display might be little laggy.

Next Time onward you don't need Monitor.

You can directly power ON RPi3 and can watch its screen on your laptop using VNC Software.

But Every time IP address assigned to your RPi3 might change.

For that you need to follow next steps:




8.     TO CHECK IP ADDRESS assigned to RPi3 (for 2nd time onwards):

(Make Sure Your Laptop, Mobile and RPi3 are connected to Same Wi-Fi Network.)

a.      Install and Open AngryIP Scanner (from 1.e.)

You need to install Java JDK before that.

b.     Put IP Range: to and Click on "Start"

Here you will se the list and check Which IP address is assigned to your RPi3

Use this IP to connect to RPi3 usig SSH and VNC (as shown in step 6 & 7)


             Your Raspberry Pi 3 is now ready to use and you can start with your first program on it...
----------------------------------------------------------------------------------------------

Click here to see more experiments with Raspberry Pi 3 and similar Family.
&
Click here to see more codes for NodeMCU ESP8266 and similar Family.
&
Click here to see more codes for Arduino Mega (ATMega 2560) and similar Family.

Feel free to ask doubts in the comment section. I will try my best to solve it.
If you find this helpful by any mean like, comment and share the post.
This is the simplest way to encourage me to keep doing such work.

Thanks and Regards,
-Akshay P. Daga
Post a Comment (0)
Previous Post Next Post