23 March 2018

How to Use an Android Tablet as a Screen for Raspberry Pi


The Raspberry Pi is a great computer, but it’s not always the most convenient device to access. Unless you have it permanently connected to a display, you probably access it via SSH, VNC or RDP.

But what if you don’t have a suitable display? How will you use it? One solution is to use an Android tablet (or smartphone) as a Raspberry Pi display.

What Works and What Doesn’t

Looking to set your Android device up as a display for your Raspberry Pi? It’s simpler than you’d think.

All you need is to have both devices on the same network, a keyboard and mouse connected to the Raspberry Pi (cabled over USB, or wirelessly), and a stand for your Android device to use it as a monitor.

This works.

Sadly, what doesn’t work is directly connecting your tablet display to the Raspberry Pi. Neither the GPIO nor the DSI port are compatible with tablet displays. This means using and old tablet screen for a Raspberry Pi display is impossible. Even if you manage to connect the devices, there won’t be any pleasing images. (You might need a new Raspberry Pi too!)

use android tablet as screen for raspberry pi

Let’s stick to the options that work. Here’s what you’ll need:

  • A Raspberry Pi 3 (older versions are fine, but will need a wireless networking dongle)
  • An Android tablet
  • A tablet stand or suitable case
  • A keyboard (you probably won’t need a mouse, thanks to the tablet’s touchscreen)
  • Access to a wireless network

Using an Android Tablet as a Screen for Raspberry Pi

You have two options available for using an Android tablet or phone as a display for your Raspberry Pi.

  1. RDP: Microsoft’s Remote Desktop Protocol
  2. VNC: Virtual Network Connection

Each of these options can provide full desktop access to your Raspberry Pi via Android. Fortunately, neither of is difficult to set up. Both have been tested with a Raspberry Pi 3, but should work with older versions, including the Pi Zero.

To use either of these solutions, you’ll need to ensure that your Raspberry Pi and the Android tablet are on the same network. It won’t work if you use the Android device as a wireless access point, sadly. In that scenario, you would need two Android devices; one for the WAP, and another for the display.

For both options, it’s worth ensuring that SSH is enabled on your Raspberry Pi first. This will make “headless” set up simpler, allowing you configuration of RDP and VNC from your PC. Then you can establish the connection from your Android device.

You can enable SSH in three ways:

  1. Via the command line: use the raspi-config screen, and select Advanced Options > SSH > OK. Reboot when prompted.
  2. Via the Raspbian desktop: go to Preferences > Raspberry Pi Configuration > Interfaces and select SSH. Click OK to confirm.
  3. With your Pi powered down, eject the SD card and open it in your desktop PC’s file browser. In the boot directory, create a new file called “ssh”, with no file extension. Safely remove the card and replace in your Raspberry Pi. When you power it up, SSH will be enabled.

use android tablet as screen for raspberry pi

You can connect to your Raspberry Pi via SSH using an app like PuTTY for Windows. Linux and macOS users can establish SSH connections via the terminal. You’ll need to know the IP address of your Raspberry Pi, which you can find by entering

ifconfig wlan0

Make a note of the IP address, as you’ll need it later.

Connect Android to a Raspberry Pi via RDP

First, let’s try it with RDP. This is the better option, as you can do more with the remote device. For instance, graphic-intensive sessions will run over RDP, but may struggle with VNC. Linux has its own RDP software, known as xrdp.

You’ll need:

  • RDP software installed on your Raspberry Pi
  • An RDP app on your Android device

use android tablet as screen for raspberry pi

Connecting to your Raspberry Pi via SSH, enter the following to update the package list and install xrdp.

sudo apt update
sudo apt install xrdp

Next, find an RDP app for Android. Microsoft Remote Desktop is a good option.

Download: Microsoft Remote Desktop for Android (Free)

use android tablet as screen for raspberry pi

Run the app, tap the + button, select Desktop, and input the PC name of your Raspberry Pi. This might be the host name (typically “raspberrypi”) or the IP address. Under the field User name, you have the choice to input your credentials with each connection (Enter every time) or create an account in the app (Add user account). Some additional options are also available, but at this stage you won’t need to access these.

use android tablet as screen for raspberry pi

Click Save when you’re done, to add the connection to your collection. When you’re ready to start a connection, tap the tile. You’ll be warned that the remote PC cannot be verified, but this is due to your Pi’s Linux operating system. You’re safe to click Connect.

use android tablet as screen for raspberry pi

You’ll then see the login screen for xrdp. Simply input your usual Raspberry Pi account username and password (the default is pi:raspberry, but you should change these) and click OK.

Add a VNC Connection for Remote Access

The second option you have is to use VNC software on your Raspberry Pi and Android device to get desktop access. With a keyboard connected, it will feel like you’re connected directly to the Pi!

VNC is a popular option for remote connecting to a Raspberry Pi from a PC, but how does it work on Android?

For this to work, you’ll need:

  • VNC server software installed on the Raspberry Pi 3
  • VNC viewing software installed on your Android device

When you’re ready, install a VNC server. Although the Raspbian Stretch operating system ships with RealVNC installed, it isn’t as reliable as TightVNC, which we’re using here, and has long been favored by Pi enthusiasts. On your Pi, update your repositories, then install TightVNC Server:

sudo apt update
sudo apt install tightvncserver

Wait for this to complete, then use the command

tightvncserver

to configure the VNC connection.

use android tablet as screen for raspberry pi

This is usually automated, although you’ll be asked to provide passwords; don’t forget these! Make a note of the session IP address.

Next, find a VNC client for Android. Several are available, the VNC Viewer from RealVNC is perfect.

Download: VNC Viewer for Android

use android tablet as screen for raspberry pi

With the app installed and the Pi booted up, open VNC Viewer and click + to create a new connection, using the IP address and session number. For example, using the network configuration in the previous section, you might enter

192.168.10.21:1

The IP address here is followed by the session number. Note the options that appear on the right when you click Create.

If you choose to proceed, you’ll be informed that the connection is unencrypted. Accept the connection (you should be safe on your home network) and then input the password. Click Continue when you’re ready, and the connection will open. When you’re ready to end the connection, click X.

use android tablet as screen for raspberry pi

Enter a password when prompted, and enjoy access to your Raspberry Pi via keyboard and your Android tablet as a display!

Add a Simple Raspberry Pi Display With Android

Using an Android tablet as a display for a Raspberry Pi is a great way to use an old device. It’s simple to set up, and as long as the battery remains charged, it should be reliable.

Better still, with a keyboard and mouse, and a handy battery recharger, you have the opportunity to make your Raspberry Pi fully portable. Having an internet connection via your Android’s 4G connection could also prove invaluable. And combining a Raspberry Pi with a tablet touchscreen gives you even more portability.

Want to know more about using your Raspberry Pi? See our unofficial Raspberry Pi manual.


Read Full Article

No comments:

Post a Comment