Skip to main content

Configuring VNC server for your raspberry pi 1,2,3

Raspberry pi is finally a linux running in a small hardware and running a vnc server on it wouldn't be a problem. Well, I wanted to use my laptop's screen and and keyboard to control my raspberry pi. The only method I found viable is by running a VNC server on my raspberry pi and connecting to it via a VNC client. VNC servers allow remote access to GUI of a given computer.

To start a VNC server on your Raspberry pi you first need to install a VNC server on it:

     $ sudo apt-get install tightvncserver

Now run the service by typing the following:

     $ tightvncserver

Type a password (keep it simple). To run the server type:
   
     $ vncserver :1

Just keep it at :1 because :0 is occupied by the default screen.

Now, install a VNC client on your laptop (e.g. RealVNC or TightVNC). To connect to the pi type the IP address of the pi followed by :1 and enter the password you gave to your pi. 

But, you'll have to type the last line every time you wanted to connect to the pi via a laptop. By automating this line every time you boot your raspberry pi you don't need to do that. You can just supply power to the pi and wait for some time and try to connect to the pi via the VNC server on your Laptop. This issue has been handled by the raspberry pi organization as well. But, they make you create a service that starts at boot which runs another program which runs another file which contains your command to start the server. Well, this was a mess.

So, my dad came up with the idea to start the vnc server by placing the last scripting line in a file called '.bashrc' (ignoring the quotes). This file runs each time you login into your pi. So, just configure your pi to enter into the desktop environment or text environment after automatic login. The pi can automatically login as pi with the default password. So, this would run the vnc server at boot and so you can connect to your pi directly after powering it up.

Comments

Popular posts from this blog

Running Oracle Outsidein Technology (OIT) in Docker

Oracle Outsidein Technology provides a set of tools and SDKs to convert many forms of data to readable documents. It also holds data extraction and reduction capabilities. Used by multiple firms and tech fronts for more than 3 decades, OIT is a vast product here to stay for a long time. Here, I made a starting attempt on using OIT's Image export using docker. Created a small docker file with the oracle-java8 base image, loaded the image export jars and dependencies, created a few mounting volumes and ran it on a single sample pdf file. An enriching and learning experience for me and my father all the same. This blog shows the steps I took to get image export working on my machine. Prerequisites Docker (to be installed on your machine, you can go to docker's website and download it for your OS windows/linux/mac) OIT Image Export SDK (Get it here ) The image export SDK also contains some sam...

Arduino with 7-Segment Display (LT542)

A 7-segment display is a LED-LCD display with 8 LCD cells are controlled by 8 pins. Usually a 7-segment display has 10 pins, 2 are common pins and the rest 8 control each LCD cell. Now, a 7-segment display is of 2 types, common cathodic and common anodic display. While the common cathodic display has its common pins hooked up to the ground(GND), the common anodic display has its common pins hooked up to high voltage(+5). A diagram explaining this is given. I have used a display numbered LT542 which is a common anodic display. This project is aimed to control the LT542 to display each number from 0 to 9 at a second's gap. MATERIALS REQUIRED: Arduino Uno LT542 Jumper wires (male-to-male) Breadboard STEPS: Wire the setup as shown in the schematic and pictures. Copy the code given and paste it into the arduino IDE. Plug in your board tho the computer using a USB cable. Upload the code. CODE:  /**   PINOUT DIAGRAM FOR THIS CODE   ...

NAS (National Achivement Survey) data extraction

I had recently been to a datathon (A hackathon related to data science) in PES University, Bangalore. There my team was given a task to extract data from the National Achievement Survey - 2017 conducted by NCERT. NAS collects data about CBSE schools across states and districts of India to collect data about student achievements and their overall reports. This data is present in PDF formats. We were tasked to extract data from PDF and tabulate it. $ pdftotext is a linux utility to convert pdf to text. By supplying a -layout option the default layout of the data is mostly preserved. I made a python script (pdf_convert.py) to convert the pdf data to text files sequentially. Next I made a script to convert the text files to csv data. So each text file was turned to a record (row) in the csv file. Here is a snapshot of the directory structure of PDF file that we got. . ├── Andaman & Nicobar Islands │   ├── Andaman │   │   ├── Andamans Class - ...