Lecture 6 Uli Raich UCC semester 2017/2018

Slides:



Advertisements
Similar presentations
Intel Do-It-Yourself Challenge Intel Galileo and Edison Paul Guermonprez Intel Software.
Advertisements

Pico-SAM9G45 Development Board for Envirobat Presented by Kiran G K Date : 18/06/13.
Introduction to the Raspberry Pi ® Saman Amighi 10/2013 ® Raspberry Pi Foundation.
IC3 GS3 Standard Computing Fundamentals Module
WHAT IS A COMPUTER? BY JACK SUMMERS. WHAT IS A COMPUTER? A computer basically a set of different components that when put together in the correct way.
Embedded Programming and Robotics Lesson 12 Introducing the Raspberry Pi Intro to Raspberry Pi1.
History of computers What your computer can do depends upon two things: the hardware your computer has, and the software that can be run on your computer. 
SINGLE BOARD COMPUTERS -KEVIN JOSE. WHY DO WE USE THEM? Good performance at low price GPIO capability to interact with the outside world Small form factor,
Chapter-4 Windows 2000 Professional Win2K Professional provides a very usable interface and was designed for use in the desktop PC. Microsoft server system.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Computers in the real world Objectives Understand what is meant by memory Difference between RAM and ROM Look at how memory affects the performance of.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
1 Copyright © 2015 Pexus LLC Patriot PS Personal Server Installing Patriot PS ISO Image on.
Computer Hardware – System Unit
Intro to Raspberry Pi A Southwest Florida Hackerspace Workshop Presented by: Russell Benzing & Eric Schiffli.
Introduction to ev3dev: Setup
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
Parts of a Computer Created by Carmen Garzes. An electronic device that manipulates information or data. It can store, retrieve or process data. There.
Raspberry Pi Project Control Your Home Lights with a Raspberry Pi.
Embedded Software Design Week II Linux Intro Linux Kernel.
 Prepared by: Eng. Maryam Adel Abdel-Hady
Farhin Al Masud What is Raspberry PI? o Low cost, credit card sized computer o SOC (System on a chip) o Founded by Raspberry PI foundation.
Raspberry PI 2 Installation & Demo App By Wayne Keadle.
Engineering Innovation Center
Operating System Kernel Compilation
Workshop on Raspberry Pi 3
Computer System Laboratory
bitcurator-access-webtools Quick Start Guide
Computer System Laboratory
RASPBERRY PI WORKSHOP.
Implementation of Embedded OS
Chapter Objectives In this chapter, you will learn:
Computer System Laboratory
By: Brian Johnson, AB6UI 20 Sept 2017
Computer and Information Technology for HKCEE
Chapter A - The Raspberry Pi Computer
Computer Hardware – System Unit
Course on Embedded Systems Introduction
Implementation of Embedded OS
Computer Hardware By Millie Hay.
Components of Computer
Principles of Information Technology
A microcontroller Raspberry Pi 2 Model B V1.1 RPi
Computer System Laboratory
Technology Literacy Hardware.
Computer System Laboratory
The Linux Operating System
Lecture 9 Uli Raich UCC semester 2017/2018
Engineering Innovation Center
Creating a Media Server with a Raspberry Pi
Raspberry Pi Pi 2 Model B.
Personal Computers and Applications
Computer System Basics- The Pieces & Parts
Introduction to Computing Lecture # 1
SAPC Hardware Pentium CPU (or 486) 4M usable memory
Building an Internet of Things Device
Overview 1. Inside a PC 2. The Motherboard 3. RAM the 'brains' 4. ROM
Implementation of Embedded OS
bitcurator-access-webtools Quick Start Guide
Chapter 4: Hardware for Educators
Lecture9: Embedded Network Operating System: cisco IOS
Workshop GPIO I2C SPI Panic1 woensdag 10 april 2019.
Beginning Raspberry Pi
Single Board Computers and Dev Boards
Introduction to Single Board Computer
Emphasis: Get it working and do stuff!
Course Code 114 Introduction to Computer Science
Lecture9: Embedded Network Operating System: cisco IOS
Raspberry Pi Hardware By: Mike Kwiatkowski.
Setting up a Webcam on a Raspberry Pi
Presentation transcript:

Lecture 6 Uli Raich UCC semester 2017/2018 The Raspberry Pi Lecture 6 Uli Raich UCC semester 2017/2018

A first glimpse There are several versions of Raspberry Pis available on the market: Raspberry Pi 1 Model B released in 2012 There is also a simpler and cheaper model A Raspberry 2 with more memory Raspberry Pi zero a stripped down version for 5 US$ Raspberry Pi zero W same as zero but with WiFi and Bluetooth for 10 US$ Raspberry Pi 3 fully equipped model that we will be using For more information look up the Wikipedia page

Photo of Raspberry Pi 3

Raspberry Pi specs Again, more information can be found here

Official source of information The Raspberry Pi has been sold at more than 8 million pieces! The user community is huge and is now increased by another 30 users! An enormous wealth of information on all sorts of subjects using the Raspberry Pi can be found on the WEB The official site is https://www.raspberrypi.org

Operating systems on the Pi From the specs we can see that the Raspberry Pi 3 is a full blown computer. With its 64 bit quad core processor, 1 Gbyte of RAM, 32 Gbyte of SD card it by far outperforms the 80 kUS$ mini computer I had used to control a full particle accelerator and it is also much more powerful than the computer system that allowed the moon landing! This allows a great deal of flexibility when it comes to operating systems to be installed on the machine

Currently available OS Raspbian, a Debian variant of Linux tailored to the Raspberry Pi. It contains most of the software packages you also find on Ubuntu The Desktop is however stripped down to make it more responsive on a processor that cannot cope with the speed of a PC This is what we are using! Ubuntu Mate is a Ubuntu variant for the Pi Windows 10 IOT core, a windows variant. I have never tried this but Windows gurus may give it a try if they cannot live without Windows on the Pi Android: There are several Android versions for the Pi floating around on the WEB. Your success on these may vary Kodi is a multimedia server that will allow you to listen to music, look at photos or watch films. Connect your Pi to a TV set (through the HDMI connector) and a stereo and off you go!4 If this is not enough for your then search the WEB for more

BCM2835 CPU The CPU has got an ARM processor core with 4 64 bit CPUs The operating system and the Linux kernel are still 32 bit versions (After the course you may try to compile and install a 64 bit kernel yourself. This is a very good exercise to understand how the OS is built!) Around the CPU there are plenty of interfaces To know the details (the interfaces only!) have a look at the data sheet explaining them (205 pages!)

BCM2835 peripherals Here are some of the Raspberry Pi peripherals: UART SPI BSC (serial controller) DMA controller External mass media controller PCM/ I2S Audio Pulse Width Modulation Timer USB I2C GPIO

Raspberry Pi and the real world You can easily connect General Purpose Input Output signals These are 3.3 V single pin signals used e.g. to drive a LED, a relay or any other device needing a digital signal level You can program it input or output With pull-ups or pull-downs To read switch state To drive a 3.3V output level (and light a LED)

Connection to bread board The cobbler

Other RPI connections I2C is a serial bus often used in computer systems of for short distance interfacing. Many devices having a I2C port are available and we will program a few: ADC DAC Real time clock EEPROM We also have a 2-line LCD display needing some 8 signals (+ power and gnd). A serial to parallel interface (shift register) with I2C interface eases the connection to the Raspberry Pi as only 4 serial signal lines are needed: SDA, SCL,Vcc, gnd

More interfaces There are more interfaces which we will not necessarily use during the course. Students who think that they do not learn enough during this course are invited to come forward. We can easily give you more exercises, e.g to make The camera The touch screen interface The audio system Or the video system work

What you need to bring a RPI to life This is what you will need to bring a Raspberry Pi to life: The Raspberry Pi board A case (this increases the chances the Pi will survive for more than a week) A 5V, 2.5A power supply with micro USB connector A USB keyboard and USB mouse A screen with HDMI connection of HDMI to VGA adapter Once the Raspberry Pi is up and running you can replace the screen, keyboard and mouse with your laptop or other computer and access the Pi through a remote desktop.

The software Go to the Raspberry Pi download page and download the Raspbian image. It comes in 2 versions NOOBS which contains the system itself + an installer Raspbian proper. This version may be slightly more difficult to install because it does not have the installer, which you would keep on your SD card even though after its first use you don’t need it any more This will get you a zip file, normally downloaded to your $HOME/Downloads directory. Since at Internet speeds that we experience at UCC this takes more than 1 hour to download we will distribute the zip file to all the PCs.

How to extract the file system on Ubuntu? Once downloaded we must first unzip the file: Create a folder: /opt/ucc/micros/raspberry and copy the zip file into it cd /opt/ucc/micros/raspberry cp ~/Downloads/2017-09-07-raspbian-stretch.zip . unzip 2017-09-07-raspbian-stretch.zip which will give you 2017-09-07-raspbian-stretch.img This is the file system image which will be copied to the SD card bit by bit using the dd command

Structure of the image file Can we know what is inside this image? We see that there are 2 disk partitions: FAT32 (Windows type) partition. This is the boot partition a Linux (ext4) partition which is the root file system

Looking inside the partitions This is something only root (the superuser) can do We loop mount the file system: Now we can copy the contents to whatever directory we want This is the boot partition Then we can do the same thing for the root partition

The root partition Once we mount the second partition the same way we see that it contains: Have you seen this before? The boot partition we have seen before is mounted on /boot in this partition

How to get the OS onto the Raspberry Pi? Now we have the OS on the PC where it does not help us much! We must put it onto a media that can be read by the Rpi. Traditionally this was the micro SD card but you can also use certain types of USB memory sticks (Be careful, not all sticks will work! I use a SanDisk cruzer)

Copying the OS to the SD card If your PC has an SD card reader then you put the micro SD card into a normal SD card holder. Otherwise there are microSD to USB converters First check which disks you have on you system: Then you plug in your microSD adapter or your USB adapter and do the same thing again You should see 2 additional partitions, in my case probably /dev/sdc /dev/sdc1 /dev/sdc2

Copy the OS Now we are ready to copy the operating system to the SD card (or USB stick) Where X is the disk letter (in our case “c”) This may well take several minutes (the image is some 1.6 Gbytes!) To see the progress:

The moment of truth Safely remove the SD card from your system. Put it into the SD card slot of the Pi Power on th machine With a little bit of luck, it should boot For more details of installing Raspbian on the SD card using a Linux system see https://www.raspberrypi.org/documentation/installation /installing-images/linux.md

First login Raspbian has a default user named pi with password raspberry (which must be changed immediately for security reasons) Create your own user and add him to the sudo group: adduser uli and follow the instructions on the screen usermod -a -G sudo uli Then login with this new user name and upgrade the system to the latest revision of all programs: apt update apt upgrade or apt dist-upgrade

Adding software packages Once you have come this far you may want to add additional software packages, emacs being one of them You will continue adding packages as you use the system and you will see what is missing.

Configuring the system We have seen that the system image takes 1.6 Gbytes our SD card however provides 32 Gbytes. How to use it to its full capacity? Start raspi-config Go through all the options of the program and see if they make sense to you.

Accessing the RPI remotely 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

ssh 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 (2) Here you see a screen dump from the PC with a remote terminal that started an emacs session on the Pi

scp To copy a file from the PC to the Pi this would be the command: scp myfile.c uli@rpi-10: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: rpi-10 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 It exists also as an Ubuntu package to be installed with apt.