shypiguy
Posts: 1
Joined: Wed Mar 25, 2015 1:39 pm

Using android device as Pi monitor

Wed Mar 25, 2015 1:58 pm

Hi all,

I'm trying to setup my Galaxy S4 as a monitor for my Pi 2. Using the VX ConnectBot android app and usb tethering, I have successfully logged into the Pi over ssh, displaying terminal on my android screen and accepting command inputs from it. Trying to take things a step further I try startx but the gui will only display on the hdmi monitor connected directly to the pi, while the android screen shows:

X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-2-mx5 armv7l Debian
Current Operating System: Linux raspberrypi 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=592 bcm2708_fb.fbheight=448 bcm2709.boardrev=0xa21041 bcm2709.serial=0x543333e2 smsc95xx.macaddr=B8:27:EB:33:33:E2 bcm2708_fb.fbswap=1 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait
Build Date: 11 February 2015 09:31:17PM
xorg-server 2:1.12.4-6+deb7u6 (Julien Cristau <[email protected]>)
Current version of pixman: 0.33.1
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Feb 16 20:20:42 2015
(==) Using system config directory "/usr/share/X11/xorg.conf.d"

My understanding is that X over ssh is not straightforward, and that an xserver is needed. I have installed XServer XSDL on android, but I am unsure how to proceed now. When I launch this app on my phone it says:

'Launch these commands on your Linux PC:
env DISPLAY=192.168.1.156:0 metacity & env DISPLAY=192.168.1.156:0 gimp
To tunnel X over SSH, forward port 6000 in your SSH client'

when i enter these commands on the Pi it says that env: metacity and gimp so not exist. As for forwarding port 6000 in the SSH client, not really sure how to do that (is this done from the Pi?)

Any help would be greatly appreciated.

fruitoftheloom
Posts: 21343
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Using android device as Pi monitor

Wed Mar 25, 2015 3:45 pm

Retired disgracefully.....
......to a more gentile life !

User avatar
ILikePi99
Posts: 54
Joined: Fri Jan 02, 2015 11:00 pm

Re: Using android device as Pi monitor

Sun Apr 26, 2015 9:46 pm

I'm having exactly the same problem except i'm using a nexus 7! Im going to do some research and see if I can find anything.
I appreciate all help! I'm a self-taught Java/Python programmer and I'm always ready to learn more! :)

Check out my blog at http://coderjoeblog.blogspot.com

User avatar
ILikePi99
Posts: 54
Joined: Fri Jan 02, 2015 11:00 pm

Re: Using android device as Pi monitor

Sun Apr 26, 2015 10:13 pm

Ok, so check out https://bbs.linuxdistrocommunity.com/di ... one-tablet it has a pretty good tutorial. I haven't tried it yet but I will very soon. Hope this helps!
I appreciate all help! I'm a self-taught Java/Python programmer and I'm always ready to learn more! :)

Check out my blog at http://coderjoeblog.blogspot.com

User avatar
AndyD
Posts: 2333
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Using android device as Pi monitor

Sun Apr 26, 2015 10:25 pm

shypiguy wrote:My understanding is that X over ssh is not straightforward, and that an xserver is needed. I have installed XServer XSDL on android, but I am unsure how to proceed now. When I launch this app on my phone it says:

'Launch these commands on your Linux PC:
env DISPLAY=192.168.1.156:0 metacity & env DISPLAY=192.168.1.156:0 gimp
To tunnel X over SSH, forward port 6000 in your SSH client'
I haven't tried this on an Android device, but the theory is the same. When you tunnel X11 through SSH you will get a different DISPLAY number. This should be set automatically when you log in via SSH with X11 tunneling. The examples probably won't work. They are for a specific IP address and are relying on the X11 Server being open for remote connections. Also, neither metacity nor gimp are installed in Raspbian by default. If I was trying to get this working myself I would do the following.

1) Start the X11 server on your Android device
2) SSH to the Raspberry Pi from your Android device. Make sure the X11 forwarding is enabled. I normally use trusted X11 forwarding at home.
3) Once your SSH connection is established to the Raspberry Pi (I am assuming you are using Raspbian or Raspbian via NOOBS) run the command

Code: Select all

startlxde-pi
If you are running Raspbian, but it is not up-to-date, it may say command not found. Only if that happens try

Code: Select all

startlxde
If that doesn't work, come back here and let us know any error messages you see.
If it does work, please report back so that if other people have the same question we can point back to this thread.

User avatar
ILikePi99
Posts: 54
Joined: Fri Jan 02, 2015 11:00 pm

Re: Using android device as Pi monitor

Mon Apr 27, 2015 8:52 pm

So I got the whole desktop gui to display. This is how i did it: First im using a nexus 7 to usb tether like you did. I'm using vx connectbot for ssh and Xserver XSDL for the x server. On connectbot tap and hold on your ssh connection (make sure it's not running) and then tap port forwards. Add a new one and make sure it's a remote type and from port 6000 to localhost:6000. Then connect to the pi (make sure the x server app is running). Then enter the command the x server app tells you to enter but leave off the "metacity" part. It should be something like "env DISPLAY=<some ip address>". Then enter lxsession to start the gui. THen switch to the x server app and there you go! On the x server app I adjusted the settings so I control the mouse WITHOUT the gyroscope. Hope this helps!!
I appreciate all help! I'm a self-taught Java/Python programmer and I'm always ready to learn more! :)

Check out my blog at http://coderjoeblog.blogspot.com

drretro
Posts: 1
Joined: Sun Jun 07, 2015 7:51 am

Re: Using android device as Pi monitor

Sun Jun 07, 2015 9:54 am

It works :D

Thank You !

Return to “Troubleshooting”