pyVision
A Machine Learning and Signal Processing toolbox

Download .zip Download.tar.gz View on GitHub


Remote Accessing Raspberry PI

Introduction

In this article we will look at accessing Raspberry PI remotely

Testing SSH

openssh-server is insalled by default on raspbian installation ssh client is installed by default on most linux distribution

test the ssh connection

ssh -X 192.168.1.4 -l pi

where 192.168.1.4 is IP Address of Raspberry PI

This will give remote terminal access to Raspberry PI

Graphical Access

X is an architecture-independent system for remote graphical user interfaces and input device capabilities

X uses a client–server model: an X server communicates with various client programs. The server accepts requests for graphical output (windows) and sends back user input (from keyboard, mouse, or touchscreen). Each person using a networked terminal has the ability to interact with the display with any type of user input device.

X provides display and I/O services to applications, so it is a server; applications use these services, thus they are clients.The X client sends commands to the X Server about what kind of things to put on the screen and the X server does it

The X server will run on the host machine while X server client will run on the Raspberry PI Let us consider a hostmachine running Ubuntu12.04 and Raspberry PI running raspbian OS.

The X window system introduces a abstraction for graphical display and input devices .One can run a program on the X client and have all the graphical bit appear on the screen of the X Server somewhere else on the network. As long as X window communication protocols are followed display for any client can be rendered on any server irrespective of whether host/client machine run the same operating systems,have same architecture etc

This is particularly useful because this removes a large amount of processor demand from the Raspberry PI for rendering.Also Input devices need not be connected to the PI directly as input device commands are passed for host X Server to the X Client machine.

The most common X Window standard used presently is called X11.

The X11 Server needs to be installed on the server (Ubuntu12.04 ) while X11 client needs to be installed on the Raspberry PI .

By default X11 server and clients are installed on most linux and Raspberry PI compatible linux distributions.

X11 Forwarding for GUI Application over SSH

The first method is to use X switch

To enable the use of X commands forwarding,we need to enable the feature on Raspberry PI

Open sshd config file with a text editor.

$ sudo vi /etc/ssh/sshd_config

Add the following line in the bottom line of the configuration file.

X11Forwarding yes

Restart sshd

$ sudo /etc/init.d/ssh restart

connect to Raspberry Pi over SSH with “-X” option.

ssh -X 192.168.1.4 -l pi
leafpad

The command uses the X switch to tell ssh to send the X commands to the X server on your host.

The window corresponding to the application leafpad will be rendered on Ubuntu12.04 Thus we can access graphicall application on Raspberry PI remotely

X11 Forwarding for Desktop over SSH

Another option is to get the complete desktop instead of Window for specific application

On ubuntu the desktop session is running on virtual terminal 7 which can be accessed by typing CTRL+ALT+F7

we can run the remote RPi desktop in the a virtual terminal via X11 forwarding change to root user.

$ sudo su

The xinit program allows a user to manually start an X display server.

$ xinit – :1 &

This will start a X display server session on virtual termnial 8 on Ubuntu 12.04 OS which can be accessed by typing CTRL+ALT+F8 .You can switch back to the original terminal by pressing CTRL+ALT+F7.

$DISPLAY=:1 ssh -X pi@192.168.2.5 lxsession

After switching to virtual terminal 8, the following command will launch the Raspberry PI desktop remotely.

You can move between first and second virtual terminals by pressing CTRL+ALT+F7 or CTRL+ALT+F8.

blog comments powered by Disqus