meddyliol
Posts: 118
Joined: Thu Mar 20, 2014 8:28 am
Location: South Wales

SSH or VNC

Thu Apr 02, 2015 2:10 pm

I want to control a Raspi from another one and was wondering which is the easier to use, SSH or VNC. What I want to do is run a robot which will be connected to one Pi and control it from another Pi. Or is is easier to use a Macbook or PC?

Thanks

Brian
Raspberry Pi B, Raspberry Pi 2, monitor, powered hub, mouse, keyboard and Volvo V50 car

beta-tester
Posts: 1382
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: SSH or VNC

Thu Apr 02, 2015 2:21 pm

try it, then you know it!
i would preffere SSH first. easy to get work on RPi and PC - moste for textbased control or X11.
VNC is complicater to get run, but then you have a full desktop remote session - but that is maybe too heavy for your need.
(depends, waht exactly you need)
RPi to RPi, SSH
RPi to PC/MAC, SSH (via PuTTY or MobaXTerm for example)
Last edited by beta-tester on Thu Apr 02, 2015 2:23 pm, edited 1 time in total.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

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

Re: SSH or VNC

Thu Apr 02, 2015 2:22 pm

How do you want to control the Raspberry Pi that is connected to your robot? VNC provides a method (there are others) of displaying a desktop on a client machine (another Raspberry Pi, PC, Mac, Linux machine ... you get the picture) that is running on the server, so a complete remote desktop. I can't imagine you would need this for a Raspberry Pi that is controlling a robot. Using SSH you get a remote terminal connection into your Raspberry Pi. You can use X11 forwarding with SSH so that you can run desktop applications remotely (i.e. running on your robot, but displayed on your second Raspberry Pi or an X server on your PC or Mac).

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: SSH or VNC

Thu Apr 02, 2015 2:34 pm

VNC works great if you want to look at the screen of a Windows PC. But Linux doesn't work the same way. The screen is nothing special, just a place to run X11-aware programs. X11 is designed to run over a network and have its windows on a different machine to the one running the program.

Whereas VNC requires that the entire content of the screen is copied from one machine to the other, pixel-by-pixel, with X11 all that gets transmitted are instructions to create the windows in one direction and mouse and keyboard events in the other. It is much faster, especially over the internet.

With no Windows machines in the mix, you already have everything you need to use SSH with X11 tunneling, it's a better solution than VNC, and you can use the robot's display for other things. You don't even need it to be running the GUI.

meddyliol
Posts: 118
Joined: Thu Mar 20, 2014 8:28 am
Location: South Wales

Re: SSH or VNC

Thu Apr 02, 2015 3:09 pm

Maybe I should have been a little clearer. I will put a Python programme on the Pi which is directly connected to the robot. I would then 'run' the programme from another Pi. The only way I can think of doing it (please bear in mind I am posting this in the beginner section) is to use either SSH (which is what I will probably use) or VNC. I only want to use the command line to access the robot Pi. Sorry if this is confusing. I know what I mean :?

Brian
Raspberry Pi B, Raspberry Pi 2, monitor, powered hub, mouse, keyboard and Volvo V50 car

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

Re: SSH or VNC

Thu Apr 02, 2015 3:13 pm

That is clearer yes, but don't be sorry. To run a Python program at the command line then SSH is the way to go. It is easy enough from another Raspberry Pi, or a PC or Mac. VNC would be overkill.

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: SSH or VNC

Thu Apr 02, 2015 3:14 pm

You can run it using ssh:

Code: Select all

ssh pi@yo.ur.ip.address python script.py
And replace the IP address and the name of your script.
There are 10 types of people: those who understand binary and those who don't.

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: SSH or VNC

Thu Apr 02, 2015 3:22 pm

You need to define "control" with more detail.

MQTT is a good protocol for sending Internet of Things command and control messages from one RPi to another.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

meddyliol
Posts: 118
Joined: Thu Mar 20, 2014 8:28 am
Location: South Wales

Re: SSH or VNC

Thu Apr 02, 2015 3:31 pm

Thanks everyone, I think I know what to do now. If I cannot get things to work I will ask for more help.

Regards

Brian :)
Raspberry Pi B, Raspberry Pi 2, monitor, powered hub, mouse, keyboard and Volvo V50 car

Return to “Beginners”