Setting up my Raspberry Pi

Yesterday I got my new Raspberry Pi, which I ordered a couple of weeks back. Raspberry Pi, is a credit card sized computer which costs roughly $35, and runs on Linux operating systems. It cost me a total of INR 2400, and here is the link to book your device.

Raspberry Pi Model B Box

Since, I booked the device, I had been going through many videos to setup the R-Pi. One of the first things I did, was download the OS

for the R-Pi (Raspbian “wheezy”) from the official site.

I had an 8 GB Micro SD card to which I wrote the image using the Win32DiskImager. I had a spare SD card adapter, which I could use for the R-Pi.

Raspberry Pi, with basic connections

The R-Pi is powered with a micro-usb charger. Anything that rates 5V, 750mA or above should do good. I used my Lumia phone charger to power it up. I have a very old and small tv which I rarely use, and was the only option for me (for first time setup). I used the AV cable which was connected between my Airtel DTH set-top-box and the TV, for connecting the R-Pi to the TV. I plugged in my USB keyboard and mouse, and connecting the power booted up the device automatically.

 

Unfortunately, the TV didn’t display any color. This is how it looked.

The GUI of wheezy

I hardly could read text from the TV screen. Until, I could go out and get myself a HDMI cable to plug into my LCD monitor, I decided to control the Pi using my laptop.

I needed a LAN cable for this, which I had earlier bought for playing multiplayer games between my desktop and laptop.

Before I actually connected the Pi to my laptop, I had to do quite a few things.

1. Update the raspbian distro (this was not really required) using the command

sudo apt-get update

2. Then I installed the VNC server, while I still had connection to the internet with TV being used as display. Command

sudo apt-get install tightvncserver

3. Set up a static IP address for the Pi. For this I had to make changes to the /etc/network/interfaces file, using the command

sudo nano /etc/network/interfaces

and changed the file like this

auto lo
iface lo inet loopback
iface eth0 inet static
address 169.254.87.2
netmask 255.255.0.0
gateway 169.254.87.1

also make relevant change in the /etc/resolv.conf file.

Then, came the actual connecting part. Connected the R-Pi with the laptop via the ethernet cable, and then ran the Advanced IP Scanner tool to make sure the R-Pi could be pinged from the laptop. Then downloaded PuTTY, and ran the tool. Entered the static IP address of the RPi, and connected to it, with the default credentials. (username pi, password raspberry), and voila, connected to my Pi.

But wait, I still haven’t done anything to get the desktop version (i.e GUI). This is when I needed to download the UltraVNC and install it on my laptop, to virtualize the GUI of the R-Pi.

Then used the Putty tool to start the vnc server on my R-Pi, using the command

sudo vncserver :1 -geometry 1366×768 -depth 16 -pixelformat rgb565

To automate this on startup of the raspberry pi, I did the following.

sudo nano /etc/init.d/tightvncserver (this creates a new file)

Pasted the following code

# First configure the user you want to run this under – this will generally be pi, unless you’ve created your own users
export USER=’pi’

eval cd ~$USER

# Check the state of the command – this’ll either be start or stop 
case “$1″ in
  start)
    # if it’s start, then start vncserver using the details below
    su $USER -c ‘/usr/bin/vncserver :1 -geometry 1366×768 -depth 16 -pixelformat rgb565′
    echo “Starting vncserver for $USER “
    ;;
  stop)
    # if it’s stop, then just kill the process
    pkill Xtightvnc
    echo “vncserver stopped”
    ;;
  *)
    echo “Usage: /etc/init.d/vncserver {start|stop}”
    exit 1
    ;;
esac
exit 0

Save the file and exit. Then modify the permissions of the file with

sudo chmod 755 /etc/init.d/tightvncserver

Then add the file to the startup sequence

sudo update-rc.d tightvncserver defaults

Then restart the pi, using the command

sudo shutdown -r now

Now, I can open UltraVNC when the R-Pi is booted up and enter the IP address along with the display in the VNC Server field (in my case it would be 169.254.87.2:1). And it prompted me for the password, after which I could see my R-Pi desktop screen.

All this was the initial configuration so that I could connect to my R-Pi without having to connect it to the TV, and have a separate keyboard and mouse for it.

In the meanwhile, waiting for my USB Wi-Fi Dongle to make my R-Pi remotely available.

Planning for something interesting to do with the Pi. :) . Open for suggestions though.

 

 

The sites which were very helpful to me in setting this up were:

http://www.penguintutor.com/linux/raspberrypi-headless

http://myraspberrypiexperience.blogspot.in/p/setting-up-vnc.html

http://myraspberrypiexperience.blogspot.in/2012/08/start-vnc-automatically.html

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=26&t=15923

About these ads

One thought on “Setting up my Raspberry Pi

  1. Pingback: Setting up my Raspberry Pi | Raspberry Pi | Scoop.it

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s