
Goal: Be able to use my android device as the head of my raspberry pi.
I researched high and low and tried different solutions that have worked for other people but for some reason or another it didn't for me. So after finally finding a solution for my problem I decided to post it in case it helps someone else. Now I used an android device but any device that you can install a VNC client on and connect it to the rPi via USB should work.
Physical Materials I Used:
1: Raspberry Pi B
2: 16GB memory card
3: Android Device (Nexus 5)
4: Standard Cables & Adapters (micro usb, power adapter for pi, hdmi to vga, keyboard & mouse)
Software Used:
1: Raspbian Jessie ver. Nov 2015
2: SD Formatter
3: Win32DiskImager
4: x11vnc (for the Pi)
5: bVNC Free (for the Android Device)
Step 1: Install Raspbian to SD card
The rPi Foundation has already created a great guide to install Raspbian so here are their resources:
Download Raspbian Image: https://www.raspberrypi.org/downloads/raspbian/
Install Image to SD Card: https://www.raspberrypi.org/documentation/installation/
Step 2: Configure Standard Settings on rPi
Once again the rPi Foundation has great documentation for this as well.
Configure rPi: https://www.raspberrypi.org/documentati ... -config.md
*Note that all I did was expand the file system and set the localisation settings, nothing else.
Step 3: Configure USB port with a static IP
This piece of the guide is thanks to Joshua Woehlke's post, with a little change:
http://joshuawoehlke.com/android-raspbe ... -over-usb/
Log into the rPi and get to a terminal window either via SSH if already using the Pi headless, starting the GUI by typing
Code: Select all
startx
We will configure a USB interface to have a static IP, which we will later use to connect to the rPi from our android device. To do so type the following and press enter:
Code: Select all
sudo nano /etc/network/interfaces
Code: Select all
allow-hotplug usb0
auto usb0
iface usb0 inet static
address 192.168.42.42
netmask 255.255.255.0
network 192.168.42.0
broadcast 192.168.42.255
Step 4: Install x11vnc on the rPi
This piece of the guide is thanks to a post by "emg" in the following thread on the forums:
viewtopic.php?p=108862#p108862
To install x11vnc type the following and press enter:
Code: Select all
sudo apt-get install x11vnc
Code: Select all
x11vnc -storepasswd
This piece of the guide is from the same post referenced in Step 4.
We need to have the vnc server run automatically when we give power to the rPi so that all we really need is to connect our android device. To do so type the following lines of code and press "Enter" after each line.
First Line:
Code: Select all
cd .config
Code: Select all
mkdir autostart
Code: Select all
cd autostart
Code: Select all
nano x11vnc.desktop
Code: Select all
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=
Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer
StartupNotify=false
Terminal=false
Hidden=false
Step 6: Install VNC client on Android Device
Go to the Play Store and install the free app bVNC:
https://play.google.com/store/apps/deta ... bVNC&hl=en
Shutdown the rPi, DON'T JUST UNPLUG IT, connect your android device to the rPi using a USB cable, make sure no other usb devices are connected to the pi and you can unplug video source (monitor, tv, whatever you were using to configure the Pi).
Power up your rPi and wait about 20-30 seconds for it to boot.
Turn on "USB Tethering" on your Android device. On Android Marshmallow I had to go to "Settings", "More", and "Tethering & portable hotspot" to find the setting.
Open the bVNC app and enter the following IP in the "VNC Server" field:
Code: Select all
192.168.42.42
If everything went smoothly then you should now see the GUI interface for Raspbian.
Now you can use your android device to control your rPi!