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|
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)
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”
2-3. Enter the following parameters.
Alias: any name is ok.
Hostname: Your Raspberry Pi IP address
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.
Now you have a Raspberry Pi console line on your tablet/smartphone!!
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.
sudo apt-get install tightvncserver
3-2. Run TightVNC Server
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:
Put the following script in it:
vncserver :1 -geometry 1920x1080 -depth 24 -dpi 96
“Ctrl+O” to save the file. The extension should be “.sh”. I named it “vnc.sh”. Then, “Ctrl+X” to exit the editor.
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:
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.
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.
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