Raspberry Pi of Goemon

Raspberry Pi3 learning blog

Beginner VNC

How to use your tablet/smartphone as screen

Post:27/09/2016 Update:

Raspberry Pi is small and portable in itself. Also you can easily carry a charger for it. However, you are unlikely to carry a screen with you. It’ll be super convenient if you can use your smartphone/tablet as screen for Raspberry Pi. Today is about how to make your tablet/smartphone screen for Raspberry Pi. Please note that this method is possible only when both of your mobile devices and Raspberry Pi are connected to a same network.

Table of contents

  1. Check Raspberry Pi IP address
  2. Set up SSH
  3. Install & set up VNC server on Raspberry Pi
  4. Install & set up VNC viewer on your tablet/smartphone
  5. Result
  6. Reference

What you need

  • PC monitor (You still need to connect Raspberry Pi with this when you check its IP address.)
  • Tablet or smartphone (Android, iOS, Windows)
Sponsored Link

1. Check Raspberry Pi IP address

You will need Raspberry Pi IP address in the following steps. In order to check the IP, you need to connect Raspberry Pi with a PC monitor and open the command line and enter ifconfig or hostname -I. Then you will get the IP. Just write or type it down.

 

2. Set up SSH client

SSH(Secure Socket Shell) is a protocol to access your Raspberry Pi with any of your devices. You need  to install a SSH client on your device. I use Serverauditor for my android tablet and phone. It’s also available for iOS devices. Here is an example of how to set up Serverauditor. You will be required to do almost same things even if you use another SSH client.

 

2-1. Tap the gear icon on the top left and select “Hosts”.

 

2-2. Select “New Host”

screenshot_2016-09-27-12-38-19_com-server-auditor-ssh-client

 

2-3. Enter the following parameters.

Alias: any name is ok.

Username: pi

Hostname: Your Raspberry Pi IP address

Password: raspberry

You can leave other fields blank. Once you enter them, just tap the check mark on the top right. You will be asked if you really want to connect your device with Raspberry Pi. Then just click “Connect”.

Note that Username and Password are those of Raspberry Pi. If you changed them from default ones, you need to enter the current username and password.

screenshot_2016-09-27-12-39-01_com-server-auditor-ssh-client

Now you have a Raspberry Pi console line on your tablet/smartphone!!

screenshot_2016-09-27-12-40-17_com-server-auditor-ssh-client

 

3. Install & set up VNC server on Raspberry Pi

As now you have SSH, you can do this either on the Raspberry Pi console on your tablet/smartphone. Of course you can do this by connecting your Raspberry Pi with a PC monitor and open a console line. Enter the following commands in order.

3-1. Install TightVNC package

sudo apt-get install tightvncserver

 

3-2. Run TightVNC Server

tightvncserver

You will be asked to enter a password and an optional view-only password.

 

3-3. Create a script file to start the VNC server.

open text editor:

nano

Put the following script in it:

“Ctrl+O” to save the file. The extension should be “.sh”. I named it “vnc.sh”. Then, “Ctrl+X” to exit the editor.

screenshot_2016-09-27-14-12-16_com-server-auditor-ssh-client

Then make the file executable.

sudo chmod +x vnc.sh 

With this file, you can start VNC server from your tablet/smartphone by sending a command via SSH:

./vnc.sh

 

4. Install & set up VNC viewer on your tablet/smartphone

There are many free VNC viewers. One from Real VNC is the most popular and available on various types of devices. Once you download and install VNC viewer app, then you want to set it up. You need to enter Raspberry Pi IP address followed by “:1” which means display number 1. Also you need to enter the VNC server password that you created in 3-2.

screenshot_2016-09-27-14-29-07_com-realvnc-viewer-android

 

5. Result

I installed VNC viewer on my tablet and smart phone. The tablet is Telclast X80 that is dual boot system of Android 5.1 and Windows 10. In this tablet, I can run VNC viewer by Real VNC on Windows 10 but cannot on Android. It crashed whenever I ran it. Some other VNC viewer apps worked such as Remote Ripple. My smartphone is Xiaomi mi5. VNC viewer by Real VNC works perfectly in this phone. Although the tablet has bigger screen, it’s more comfortable to access with my mi5 because responses of VNC viewer are better on mi5. I think usability of VNC viewer depends not only on screen size but also performance of device. Obviously mi5 has better performance than x80.

file_000

 

6. Reference

1. Raspberry Pi official site is always useful: https://www.raspberrypi.org/documentation/remote-access/vnc/

2. From this site, you can learn VNC autoboot setting: http://elinux.org/RPi_VNC_Server

3. This YouTube video is useful as well: https://youtu.be/21120acDbuY

Sponsored Link


Sponsored Link


-Beginner, VNC
-, , ,


  1. Webster says:

    Is there anyway to make vnc run on startup, this would be very useful.
    Thanks

  2. Amanda says:

    Thank you for your post. I have been wanting to do this for a while! ☺️

  3. ExperiMentor says:

    All the necessary VNC functions are now built into Raspberry Pi as standard.

    For instructions how to set this up (including for access over internet as well as local network) see https://www.raspberrypi.org/documentation/remote-access/vnc/

  4. Raspi says:

    Nice! Good tutorial. One question. Is it possible to view from tablet and operate from raspberry. Because my mouse and keyboard are attached to the raspberry, but on my tablet there is a new kinda terminal so when I connect my tablet screen is not responding to mouse and keyboard which is attached to raspberry.
    Is there a way to solve this problem?

    thanks in advance

    • Goemon says:

      Well, I know what you want, but I have no idea to realize it. You need to connect it with a monitor but I know that’s pointless to discuss here…. I’m trying to improve this technique. If I find new technique, I’m willing to share with you here 🙂

  5. Al Gelman says:

    There is a typo in the text. To make the .sh file executable :
    sudo chmod +x vnc.sh

Related Posts

file_004

Blink LED on Raspberry Pi 3

Blink LED is a very first step for beginners. You can learn how to connect each electric component and control it with minimum numbers of components and a small chunk of code. Table of contents GPIO pin layout Hardware setup Code Result Reference The necessary parts and tools are here. The selection of resistor depends on LED’s Vf (forward voltage). You can usually find the value on its specification/catalog. Name Qty Resistor 1 330 Ω Red LED 1 Vf = 2.0 V Breadboard 1 Breadboard jumper wire (male-female) 2 Nippers 1 Sponsored Link 1. GPIO pin layout GPIO (General Purpose Input/Output) …

img_20160928_233036

Control LED by tact switch

In a previous post, how to blink LED with Raspberry Pi 3 was introduced (Blink LED on Raspberry Pi 3 ). In this work, I just got an “output” from Raspberry Pi. Today, I will send an “input” to Raspberry Pi by using a tact switch.By sending an input, you can get Raspberry Pi to send an output. With this work, you can turn on/off your LED with a tact switch. Table of contents Tact switch Hardware setup Code Result Reference What you need You may want a nipper to cut the legs of resister if they are long. Name Qty Resistor …

hwsetup

Install Raspbian on Raspberry Pi 3

The very first thing you have to do is to install OS on your Raspberry Pi. Today I install Raspbian on which various programs for learning are available. Table of contents Format SD card Download NOOBS Hardware setup Raspbian installation & setting Connect to Internet OS update What you need Micro SD card (larger than 8GB) *class 10 is recommended PC connected to Internet Mouse Keyboard Micro USB power supply PC monitor (HDMI or DVI-D) Monitor cable (monitor <=> Raspberry Pi 3) Sponsored Link 1. Format SD card If your SD card is new, you can skip this step. Mine …

img_20161003_023407

Utilize an internal pull-down resister

In the previous post, I checked how a pull-down resister functioned. When it’s there the system worked as expected. However once it’s taken off, then LED became unstable. Actually, Raspberry Pi 3 contains an internal pull-down resister and you can enable it by coding. Today, I’m gonna show you how you can enable an internal resister and how it works. Don’t worry, it’s very simple 🙂

toggle_switch

How to deal with switch bounce

Today, I will deal with switch bounce. Then I will toggle the switch to control LED (OFF/ON). Now let’s start! Table of contents Switch bounce Bounce time Code Result Reference Sponsored Link 1. Switch bounce Switch bounce is a phenomenon that occurs when you use a physical contact switch such as a tact switch. When you push a switch, you may think it gets immediately ON. However, that’s not correct in the micro-scale world. When a switch is toggled, metal contacts of a switch come together and close. During this time, metal contacts are bouncing and that causes noise. This …