[Logo for The C Shore Landing Page]
The C Shore

Headless Pi

Table of Contents

Headless Pi

Why We’re Doing This

  1. So that you can program the robo-cars — it’s rather difficult to add a monitor, keyboard, and mouse to a Pi when it’s mounted on a robo-car chassis.
  2. So you can stop the robo-car program if it’s getting into trouble — you don’t want the robo-car to keep going if all it’s going to do is keep crashing into things and get damaged.
  3. So you can start the robo-car on demand.

What We’re Doing

  • Accessing the Pi from a laptop as if we were on the Pi itself

The Steps You Need to Know

Don’t worry — we’re going to show you how to do this.

  • Find the address of your Pi (we’ll explain how to do that)
  • Start a special program on the laptop
  • It will ask for the Pi’s address
  • You give the program the Pi’s address and click ‘Connect’
  • After a bit of time you will see the same desktop you’ve been using on the Pi all along.
  • You’ll notice you’re on the laptop instead of a directly attached keyboard and mouse.

Advanced (Extra) Explanation

Overview
  • We’ll be using a protocol called VNC (Virtual Network Computing).
  • It that allows a stationary computer (laptop) to access the desktop of a remote computer (the Pi on the robo-car).
  • We’ll use the remote desktop to use Mu to create, run, and stop a program to control the robo-car.
  • There a program already loaded onto the Pi which you will be able to modify to put the robo-car through it’s paces.

How This Works

  • Run a server on the Pi that ‘listens’ for remote connections — this is already done and configured for you.
  • Configure the Pi so that when the Pi is booted (started up) that it registers with a server we know how to access (this is already done too).
  • The Pi will give this server the Pi’s ‘address’ (called an IP address) that is how we can find the Pi on the network.
  • We will query (ask) the server for the Pi’s address.
  • Once we know the address we will use a program on the laptop you’re using to connect to the Pi.
  • This program is known a VNC ‘client’.
  • The VNC client will connect to the VNC server and show you a desktop that is running on the Pi.
  • From there you’ll use this ‘remote desktop’ just as if you were using a keyboard, mouse, and monitor attached to the Pi.

The Main Action

If you haven’t already done so, boot the laptops.

Make sure they are connected to the ‘MakerPlace’ Wireless Network


If you haven’t already done so, boot the Pi by turning on the power switch.


On your laptop, double-click on the icon labelled ‘Pi Address List’

\[Screenshot of 'Pi Address List' icon\]


Your browser should shown a list of information.

\[Screenshot of the actual 'Pi Address List'\]


Look for the name of your Pi in the list (for example, if you have Pi #2, the name would be mpl-pi-2).

\[Screenshot of the mpl-pi-2 circled in the Pi Address List\]


In the same row as the name of your Pi, find the ‘address’ for your Pi, which begins with 10.20.19.

\[Screenshot of the mpl-pi-2 IP address circled in the Pi Address List\]


On your desktop double-click on the icon that is labelled ‘vncviewer’ and has eye of tiger.

\[Screenshot of Tiger VNC Viewer on desktop\]


In the address field enter the address of your Pi

\[Screenshot of Tiger VNC Viewer 'Connect' dialog \]


Cick ‘Connect’.

\[Screenshot of Tiger VNC Viewer 'Connect' dialog 'Connect' button circled\]

NB Tiger VNC Viewer should have the necessary settings already configured for you so you can just click ‘Connect’ without changing anything in the options.


The dialog will disappear and there will be noticeable period of time before you will see your Pi’s desktop on the laptop screen.

\[Screenshot of Tiger VNC Viewer showing remote desktop\]


You can now use the desktop as if you were connected with a keyboard, mouse, and monitor.

Note that patience is often required because using a network connection is slower than a direct physical connection to the Pi.

Next open Mu for the next section where we will test the robo-car build (aka smoke test).

\[Screenshot of Tiger VNC Viewer showing Mu on remote desktop\]