Slide 1

Slide 1 text

LTKA Labs SBCs & Raspberry Pi Basics Eueung Mulyana http://eueung.github.io/ET3010/raspi ET-3010 | Attribution-ShareAlike CC BY-SA 1 / 59

Slide 2

Slide 2 text

Outline Single Board Computers Raspberry Pi - Short Introduction RPi Pinout Raspbian - Getting Started Node-RED & Python 2 / 59

Slide 3

Slide 3 text

SBCs Single Board Computers 3 / 59

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

6 / 59 Top 10 Sub-$100 Hacker SBC List for 2015 (in Order of Importance) Ref: hackerboards.com

Slide 7

Slide 7 text

64-bit SBCs: DragonBoard 410c & Pine A64 7 / 59

Slide 8

Slide 8 text

Raspberry Pi / RPi / RasPi Short Introduction 8 / 59

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

12 / 59

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

14 / 59 RPi Model B Power

Slide 15

Slide 15 text

15 / 59 RPi Model B Audio & Video

Slide 16

Slide 16 text

16 / 59 RPi Model B Connectivity

Slide 17

Slide 17 text

17 / 59 RPi Model B Internals

Slide 18

Slide 18 text

18 / 59 RPi Model B Storage

Slide 19

Slide 19 text

19 / 59 RPi Model B Parts

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

21 / 59

Slide 22

Slide 22 text

22 / 59 RPi 2B BCM 2836 ARMv7 Architecture Quad Core 32-Bit RISC 900 MHz Clock Rate 1 GB RAM

Slide 23

Slide 23 text

23 / 59

Slide 24

Slide 24 text

24 / 59

Slide 25

Slide 25 text

25 / 59

Slide 26

Slide 26 text

26 / 59 RPi 3B BCM 2837 ARMv8 Architecture Quad Core 64-Bit 1.2 GHz Clock Rate 1 GB RAM

Slide 27

Slide 27 text

27 / 59

Slide 28

Slide 28 text

28 / 59

Slide 29

Slide 29 text

29 / 59

Slide 30

Slide 30 text

30 / 59

Slide 31

Slide 31 text

31 / 59

Slide 32

Slide 32 text

RPi Pinout 32 / 59

Slide 33

Slide 33 text

33 / 59

Slide 34

Slide 34 text

34 / 59

Slide 35

Slide 35 text

35 / 59

Slide 36

Slide 36 text

36 / 59 Interactive Pinout Diagram https://pinout.xyz

Slide 37

Slide 37 text

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.

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

Raspbian Getting Started 39 / 59

Slide 40

Slide 40 text

40 / 59 RPi Operating Systems Ref: Software for the RPi

Slide 41

Slide 41 text

41 / 59 Raspbian Jessie Release 2016-03-18 Full Desktop vs. Lite

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

43 / 59 Flashing SD Card Rufus

Slide 44

Slide 44 text

44 / 59

Slide 45

Slide 45 text

45 / 59 SSH via PuTTY

Slide 46

Slide 46 text

46 / 59 SSH Console raspi-config

Slide 47

Slide 47 text

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

Slide 48

Slide 48 text

48 / 59 VNC Client

Slide 49

Slide 49 text

49 / 59

Slide 50

Slide 50 text

Node-RED & Python 50 / 59

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

52 / 59

Slide 53

Slide 53 text

53 / 59

Slide 54

Slide 54 text

54 / 59

Slide 55

Slide 55 text

55 / 59

Slide 56

Slide 56 text

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 ( )

Slide 57

Slide 57 text

Refs 57 / 59

Slide 58

Slide 58 text

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

Slide 59

Slide 59 text

END Eueung Mulyana http://eueung.github.io/ET3010/raspi LTKA Labs | Attribution-ShareAlike CC BY-SA 59 / 59