How to use an Android tablet as a Raspberry Pi console terminal and internet router

From eLinux.org
Revision as of 03:52, 18 July 2015 by Geertivp (talk | contribs) (Additions)
Jump to: navigation, search

Use a tethered Android tablet as console and internet router for your Raspberry Pi.

What you need

Advantages

Very universal solution:

  • The Raspberry Pi uses very low power (no or inactive ethernet port)
  • Your Android tablet can be powered via the Raspberry Pi USB port
  • You have a virtual keyboard, mouse, and video display (KVM) for your Raspberry Pi
  • Only 1 single Raspberry Pi USB port is required to deliver ethernet, and KVM access
  • Both devices can easily share an internet connection
  • The Raspberry Pi can have Wi-Fi or mobile network access through tablet tethering
  • You do not need any special hardware; except for a few standard micro-USB cables
  • It also works e.g. in a car using a 12V outlet
  • Only standard software needed
  • Autoconfiguration (plug and play)

How to

Install ConnectBot

Install ConnectBot on your tablet which is an Android terminal emulator available from Google Play. It allows to SSH into the Raspberry Pi.

Configure the Raspberry Pi

Add the following lines into your network configuration:

vi /etc/network/interfaces
allow-hotplug usb0
iface usb0 inet dhcp

Connect your devices

Connect your Android Tablet to a Raspberry Pi USB port via a micro-USB cable. Power your Raspberry Pi with a standard USB power supply. You can use any DC USB power supply.

Enable Android USB tethering

Enable USB tethering on your Android tablet.

Settings → Connections → Tethering and Wi-Fi hotspot → USB tethering

Now the Raspberry automatically gets an IP address via its USB0 port. The Android tablet behaves like a NAT router. This should work both when your tablet is connected to Wi-Fi or to a mobile 3G/4G network.

Initiate an SSH login to the Raspberry Pi

  • Start the ConnectBot App on Android
  • Login to the Raspberry Pi via SSH

The only problem is that you have to know the IP address of the Raspberry Pi; it seems to be (always?) 192.168.42.159...

Other ideas

  • This could work as well with other USB devices having no built-in network connection...
  • You could run X Window System applications from your Raspberry Pi