In my previous post I’ve explained the method  of connecting Raspberry PI with  Laptop through Ethernet.

https://alselectro.wordpress.com/2017/02/17/raspberry-pi-3-how-to-connect-with-your-laptop/

At times , the PI is not recognized , or unable to contact over SSH in this method.

Let us see the DIRECT NETWORK LINK method In this post which is 100% reliable.Cons is that network internet is not shared.But this is not an issue , as PI3 is WIFI capable through which you can connect to internet.

IMG_20180724_110102

 

To start with , place the SD card ( class 10 type recommended ) with Raspbian OS on to a Card Reader

 

Image 1

 

The card will be shown as boot drive.Open it.

Under View , un tick the option “ File Name Extension”

 

Image 2

Now Right click on empty space & create a new text document.

Rename it to ssh & save it.

Now a file named ssh is created without any file extension

When the card is now used on RPI, on first boot the OS will look out for the ssh file name.If it finds one , it enables secure shell & then delete the file named ssh.

This is how SSH is enabled in a Headless mode operation of RPI.

Image 3

Place the SD card on to PI & power it up.

Now Open Network& Sharing center on your Windows PC.

Image 4

 

Connect the Ethernet port of RPI to the Ethernet port of your PC using a STRAIGHT RJ45 Cable.

An Unidentified Network is created for the Ethernet adapter where PI is connected .

 

Image 7

 

Click on the Network connection type ,( here mine is WIFI.)

Click properties

 

Image_a

 

Under SHARING Tab un tick the options so that Network sharing is DISABLED.

 

Image_b

 

Click on the ETHERNET connection & then Properties on next window.

Double click Internet Protocol 4 & ensure that DHCP is enabled i.e, Obtain IP address automatically is selected.

Image 8

 

For a network link to work between two computers they need to be using the same address range.
The allowable address range is determined by the subnet mask.

255.255.0.0  means all octets in addresses should be same except for the last two in the IP address,otherwise they will be filtered.

Most PCs connected directly to another computer will allocate an IP address in the range 169.254.x.x ( with subnet mask of 255.255.0.0)

For RPI to be able to communicate through the direct link it needs to have a fixed IP address in the same address range 169.254.x.x

We can set this in the cmdline.txt file

To know the IP allotted to the ETHERNET adapter

Open Command Prompt ,CMD

Type in ipconfig /all

Image 9

Scroll down to find the IP under Ethernet adapter.

Here it is 169.254.192.43

which is the Gateway IP of Ethernet adapter.Any device connected to this port should have the IP in range 169.254.192.x

As we’ve connected the PI to Ethernet adapter  let us assign the IP toPI as

169.254.192.150

Note that the last octet can be anything up to 255.

Image 10

The static IP to PI is assigned as follows :

Switch off power to PI ,remove SD card & place it on a card reader.

Open cmdline file found in the SD card

Image 11

Move to the End of file.

Please note that you must not hit Enter .

Just at the end type in

ip=169.254.192.150

Image 12

 

Image 13

Save the file .Remove SD card from card reader & plug it to PI & power it up.

Let us use the free SSH Client PUTTY  to log intoPI.

Open PUTTY &  under Session , type in the IP address 169.254.192.150

Ensure that SSH is selected.

 

Image 14

 

Click open

Now you get the LOG IN window of PI

login as pi & password : raspberry

 

Image 15

Now ,let us see how to log in Graphical user interface.

For this a XMING X Server is required.

Download XMING from here

Install XMING & start the server.

Image 16

 

Image 19

Open Putty & as done previously enter the IP address 169.254.192.150

Under SSH click X11

& then Tick mark Enable X11 forwarding.

 

Image 17

Click Open to get the login window of PI.

To get Graphical interface , type in

startlxde

Image 18

Now you get the graphical screen

To get internet access :

Under  SYSTEM TOOLS  click LXTerminal

Image 20

Type in

sudo raspi-config

Image 21

 

Select Network Options

Image 22

Select WI FI

Image 23

Then enter  SSID of your WIFI to connect with

 

Image 24

 

Provide the password for thee SSID

Image 25

 

Hit FINISH

Image 26

Now you get the internet accesswhich can be tested by

sudo apt-get update.

 

Image 27

VIDEO DEMO  :

 

blog_image