Difference: Lecture7:AccessingTheRealWorld (3 vs. 4)

Revision 42017-10-16 - uli

Line: 1 to 1
 
META TOPICPARENT name="LectureSlides"

Start Presentation

Slide 1: Accessing the Real World

Lecture 7


Uli Raich


UCC semester 2017/2018

Deleted:
<
<

Accessing the RPI remotely

 
Deleted:
<
<
Of course we can use the interfaces on the Raspberry Pi

to connect a screen, keyboard and mouse and use it

in stand-alone mode but we can also make use

of the PC resources and access it remotely.


There are several ways to access the RPI remotely:

  • Using the VNC server on the Pi you can access
    it with a remote desktop from the PC
  • The secure shell (ssh) allows you to get a remote terminal in the Pi
    With scp you can copy files back and forth between the Pi and the PC
  • With nfs you can mount part of the Pi file system into the
    PC file system tree and access the PI SD card as if it was a local PC disk.

The remote Desktop

piRemoteDesktop.png

Remote Desktop (2)

When running the remote desktop you are working on the Raspberry Pi

with the screen, keyboard and mouse replaced by the devices on the PC.

You have the same functionality as if the screen was connected

to the Pi’s HDMI port and keyboard and mouse were connected

to the USB ports on the Pi.

nfs the network file system

With nfs you can mount part of the Pi’s file system tree

onto your PC file system.

This allows you access to the Pi’s files as if you were

using a local disk. You cannot run any Rasberry Pi

programs this way however.

It is interesting if you cross-compile Pi programs on your PC,

which will be immediately visible on the Pi.

ssh the secure shell

In the case of ssh you have a single terminal window

that is connected to a shell on the Pi.

The command is:

ssh userOnPi@piIPaddress

Where piIPaddress can be the Pi’s IP address of hostname.


If you specify the -X option you can run X-11 based programs

where the X protocol is run over the ssh connection.

ssh session example

Here you see a screen dump from the PC with a remote terminal

that started an emacs session on the Pi.

ssh-X.png

scp

To copy a file from the PC to the Pi this would be the command:

scp myfile.c uli@raspberry10:exercises/solutions/exercise_2


This will copy the file “myfile.c” into the sub-directory

exercises/solutions/exercise_2 on my home directory on the Pi.

Of course user uli must exist on raspberry10.

Instead of specifying the machine name:

raspberry10 you can also give its IP address.

Compiling C programs for the Raspberry Pi

Just like Linux on the PC, Linux on the Raspberry Pi uses the GNU C compiler gcc.

The

  • front end:
  • Lexical Analyzer
  • and the parser for the grammar
are the same.


However, the code generator is different since now we compile

for the ARM processor and not the Intel processor used on the PC

Cross-Compilation for the Pi

As explained in a previous lecture we can also compile

C programs for the Raspberry Pi on the PC Linux

system using a cross-compiler.

The cross compiler we will use is named

arm-linux-gnueabihf-gcc

and it is part of the tools package for the Pi.

 

Access libraries

As we have already seen, the Raspberry Pi flat cable connector

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback