Tuesday, 29 July 2014

Using SSH for Display for Raspberry Pi

Don't  have any display unit ?

*The steps below are not valid for 'noobs' installed sd card,if you need this to work out with noobs installed sd card you need a monitor  and a hdmi cable atleast once to install Raspbian OS and then follow the same steps.

What you have:
  1. Raspberry Pi running the latest Raspbian Wheezy
  2. PC/Laptop with WiFi Internet connection and a Ethernet Jack (LAN Connector / RJ45)
  3. A working SSH connection with Raspberry Pi (direct access, explained here)
What you don’t have:
  1. Display Device for the Raspberry Pi (HDMI enabled display unit / Old TV)
  2. Direct Internet connection for the Raspberry Pi (LAN or WiFi)
Extra Stuff you need:
  1. Standard Network Cable (Cat 5, Standard or Crossover)
  2. PutTTY Software (will be used to SSH into the Pi)
  3. SD Card Writer
Please follow the below steps to have a working SSH connection:
  1. Install and burn the latest Raspbian Wheezy OS onto the SD card for the Raspberry Pi
  2. While the Raspberry Pi is switched off, connect one side of the Ethernet cable to Raspberry Pi and other side to the RJ45 jack of the PC/Laptop
  3. Open LAN properties and make sure that IPV4 properties are set to Obtain IP address automatically.
  4. We now need to determine the IP of our PC/Laptop when it’s connected to the Raspberry Pi
  5. Now power on the Raspberry Pi while making sure that the network cable is connected on both ends
  6. Wait for a min or two. You’ll notice that the PC/Laptop will scan and then show a small warning indicating the presence of an unidentified network.
  7. Now, open command prompt and type ipconfig. Note the IP of the Ethernet Adapter Local Area Connection as shown below:
Image


8. Now, power off the Raspberry Pi and take out the SD Card. Plug in the SD card into a card reader and open it. You should see a couple of files

Image

9. Open the cmdline.txt file and append this to the end of it:


Image

ip=169.254.39.71

Please change the IP accordingly and assign a unique value (while making sure you don’t go beyond the subnet mask). Preferably, change only the last parameterFor example, if your LAN’s ip is 169.254.0.1, we recommend using 169.254.0.3 as the IP for Raspberry Pi in cmdline.txt

  1. Save the cmdline.txt file without making any other changes
  2. Plug this back into the Raspberry Pi and with the Ethernet cables connected, power on the Raspberry Pi
  3. Wait a couple of minutes while the Raspberry Pi tries to establish a local network connection with our PC/Laptop
  4. Once you see the network warning message as shown above, ping the Raspberry Pi to see if it’s live on the network as follows
    1. Open CMD prompt
    2. Type ping ipaddress_of_raspberry-pi
Ex: ping 169.254.39.71
If all went good, you should see the Pi responding back to the ping requests.
  1. Now its time to SSH into the R Pi. Open PuTTY client and type in the IP address of the Raspberry Pi (169.254.39.71) and hit OpenImage
You should get a certificate trust warning message (if SSHing for the first time) which you should accept. Once done, you’ll see the login terminal:
Image
Enter pi
The password should be raspberry.
Now, moving on to access the Raspberry Pi’s desktop, we first need to install Xming X Server for windows from this link:
Make sure you install the SSH components also when prompted to do so.
Once that gets successfully installed, simply click the Xming icon and make sure it’s running in the background.
Now, open PuTTY terminal and first enable X11 forwarding as shown below:
Image
Now, direct SSH into the Raspberry Pi as explained previously
Image
Hit in lxsession or startlxde and that should pop up the desktop of the Raspberry Pi.
Image
Have fun :)