Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Single Board Computers & Raspberry Pi Basics

Single Board Computers & Raspberry Pi Basics

Lab #3 - Single Board Computers & Raspberry Pi Basics
ET-3010 Connected Services and Cloud Computing
http://eueung.github.io/ET3010/raspi

Eueung Mulyana

April 10, 2016
Tweet

More Decks by Eueung Mulyana

Other Decks in Technology

Transcript

  1. Outline Single Board Computers Raspberry Pi - Short Introduction RPi

    Pinout Raspbian - Getting Started Node-RED & Python 2 / 59
  2. A Single-Board Computer (SBC) is a computer built on a

    single circuit board, with microprocessor(s), memory, input/output (I/O) and other features required of a functional computer. SBCs typically provide a fanless, low-power computing solution. Current SBCs come with a wide variety of processor types, most with GPUs on-board. These processors range from X86 based processors from the traditional PC space (AMD and Intel) to ARM processors which have traditionally been used in the industrial and more recently mobile spaces. The most prevalent form of software used on SBCs is Linux with numerous derivations including Android, Ubuntu, Fedora, Debian and Arch Linux as well as FreeBSD. Many of today's SBCs have become so powerful that they are beginning to have the capability of modern day PCs and tablets. This trend will continue as more powerful processors make their way into the embedded computing market as ever-increasing performance/price ratios rise, as well as additional manufacturers enter into this "Wild West" frontier of supporting open source hardware and software for both DIYers and professionals alike. SBCs In 2006, a group based in the University of Cambridge's Computer Laboratory, decided to address the need for a low cost computing platform that would allow kids to learn how to program without the need for a full-¯edged home computer. The result was a $35 single board computer named Raspberry Pi. While initially designed as a tool for students to learn programming, the Raspberry Pi was adopted by makers, designers, students and even professional engineers and helped to launch the current boom in interest in SBCs. Ref: Electronic Design, Then and Now A Brief History of Single Board Computers 4 / 59
  3. 5 / 59 Nine Sub-$50 SBCs that Challenge the Raspberry

    Pi and BeagleBone Black 86Duino, A10-OLinuXino-Lime, Arduino TRE, Banana Pi, BPi D1, HummingBoard-i1, Odroid-C1, Orange Pi, and pcDuino3 Nano Ref: hackerboards.com
  4. 6 / 59 Top 10 Sub-$100 Hacker SBC List for

    2015 (in Order of Importance) Ref: hackerboards.com
  5. What is a Raspberry Pi? The Raspberry Pi is a

    low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. It is a capable little device that enables people of all ages to explore computing, and to learn how to program in languages like Scratch and Python. It's capable of doing everything you'd expect a desktop computer to do, from browsing the internet and playing high-de nition video, to making spreadsheets, word-processing, and playing games. What's more, the Raspberry Pi has the ability to interact with the outside world, and has been used in a wide array of digital maker projects, from music machines and parent detectors to weather stations and tweeting birdhouses with infra-red cameras. 9 / 59
  6. 10 / 59 Credit card sized single board computer Teach

    computer science in schools at an a!ordable price: Grade School, Middle School & High School Design and Development started in 2006 Raspberry PI Foundation founded in 2009 Release to Market Feb 2012 3 Million sold by June 2014 5 Million by 03/2015
  7. 11 / 59 Early Models A, B Raspberry PI Model

    A $25 - 256 MB RAM, 1 USB, No Ethernet, GPIO 26 Raspberry PI Model B $35 - 512 MB RAM, 2 USB, Ethernet , GPIO 26 Raspberry PI Model B+ $35 - 512 MB RAM, 4 USB, Ethernet, GPIO 40 All have HDMI Out with Audio All have Audio Jack out
  8. Model A/B: Broadcom BCM2835 (CPU & GPU) 256/512MB SDRAM 1/2

    USB 2.0 Ports None/Ethernet Port HDMI Audio SD Card Slot Micro USB for power 13 / 59
  9. 20 / 59 CPU Overview BCM2835 ARM11J6JZF-S (ARM11 Family) ARMv6

    Architecture Single Core 32-Bit RISC 700 MHz Clock Rate 8 Pipeline Stages Branch Prediction
  10. 22 / 59 RPi 2B BCM 2836 ARMv7 Architecture Quad

    Core 32-Bit RISC 900 MHz Clock Rate 1 GB RAM
  11. 26 / 59 RPi 3B BCM 2837 ARMv8 Architecture Quad

    Core 64-Bit 1.2 GHz Clock Rate 1 GB RAM
  12. The Raspberry Pi is a 3.3V device The GPIO pins

    are unbu!ered and unprotected, so if you short something out, you could fry your whole Pi, so be careful! 37 / 59 Notes On Raspberry Pi, all GPIO banks are supplied from 3.3V. Connection of a GPIO to a voltage higher than 3.3V will likely destroy the GPIO block within the SoC.
  13. 38 / 59 Physical Computing RPi vs. Arduino Arduino boards

    are micro-controllers, not full computers. They don't run a full operating system, but simply execute written code as their rmware interprets it. You lose access to the basic tools an operating system provides, but on the other hand, directly executing simple code is easier, and is accomplished with no operating system overhead. The main purpose of the Arduino board is to interface with sensors and devices, so it's great for hardware projects in which you simply want things to respond to various sensor readings and manual input. Ref: Digital Trends via Kopcak
  14. 1. Plug the SD Card loaded with the Operating System

    into the Raspberry Pi. 2. If required, plug the USB keyboard and mouse into the Raspberry Pi, perhaps via a USB Hub. Connect the Hub to power, if necessary. 3. If required, plug the video cable into the display and into the Raspberry Pi. 4. Plug in your Network cable, or Wi-Fi dongle, if required. 5. Ensure that your USB Hub (if any) and display are working. 6. With your screen on, plug the other end of the power source into the Raspberry Pi. 7. Plug the power source into the main socket, and switch it on. 8. If connected to a display, the Raspberry Pi should boot up and display messages on the screen. 9. If running headless, it should boot up. When the leds have stopped ¯ashing, connect to the Raspberry Pi from the remote computer. Whether this works will depend on the operating system you are using; the Raspian Linux operating system is con gured to allow SSH connections by default. 42 / 59 General Steps It is always recommended to connect the MicroUSB Power to the unit last (while most connections can be made live, it is best practice to connect items such as displays and other connections with the power turned o!). Ref: Basic Setup
  15. Remote SSH Session # c r e d e n

    t i a l : p i / r a s p b e r r y $ s u d o r a s p i - c o n f i g # a f t e r r e b o o t $ d f - h $ u n a m e - a $ l s b _ r e l e a s e - a TightVNC Server $ s u d o a p t - g e t i n s t a l l t i g h t v n c s e r v e r $ t i g h t v n c s e r v e r # a c c e s s p a s s w o r d , m i n 6 c h a r s $ v n c s e r v e r : 1 - g e o m e t r y 8 0 0 x 6 0 0 - d e p t h 2 4 $ s u d o s e r v i c e l i g h t d m s t o p 47 / 59 Some CLIs
  16. Node-RED is a tool for wiring together hardware devices, APIs

    and online services in new and interesting ways. Node-RED provides a browser-based ¯ow editor that makes it easy to wire together ¯ows using the wide range nodes in the palette. Flows can be then deployed to the runtime in a single-click. JavaScript functions can be created within the editor using a rich text editor. A built-in library allows you to save useful functions, templates or ¯ows for re-use. Ref: Node-RED 51 / 59 Node-RED A visual tool for wiring the Internet of Things
  17. 56 / 59 Python via IDLE i m p o

    r t R P i . G P I O a s G P I O i m p o r t t i m e G P I O . s e t m o d e ( G P I O . B C M ) G P I O . s e t w a r n i n g s ( F a l s e ) l e d = 4 G P I O . s e t u p ( l e d , G P I O . O U T ) d e f b l i n k ( p i n ) : G P I O . o u t p u t ( p i n , 1 ) t i m e . s l e e p ( 1 ) G P I O . o u t p u t ( p i n , 0 ) t i m e . s l e e p ( 1 ) f o r i i n r a n g e ( 0 , 1 0 ) : b l i n k ( l e d ) G P I O . c l e a n u p ( )
  18. Refs 1. Top ten sub-$100 hacker SBCs for your holiday

    pleasure 2. Ringing in 2015 with 40 Linux-friendly hacker SBCs 3. Cli! Ortmeyer, Then and Now A Brief History of Single Board Computers, Electronic Design, Issue 6, December 2014 4. RPi Low-level peripherals - eLinux.org 5. Introducing the Raspberry Pi 3 | Hackaday 6. Adafruit Learning System 7. Je!rey Kopcak, An Introduction to the Credit-Card Sized Computer 8. The MagPi Magazine - The oþcial Raspberry Pi magazineThe MagPi Magazine 9. Mike Linnen, What can I do with a Raspberry Pi 10. Jon Holton and Tim Fratangelo, Raspberry Pi Architecture 58 / 59