Raspberry Pi User Guide
Total Page:16
File Type:pdf, Size:1020Kb
RASPBERRY PI FOR BEGINNERS © 2013, Dogwood Apps Raspberry Pi ® is the registered trademark of Raspberry Pi Foundation, United Kingdom. Important note: Author has no affiliation with Raspberry Pi Foundation, United Kingdom. All rights are reserved. All trademark holders are owners of their respective trademarks. The copyright of this e-book, as well as the matter contained herein (including illustrations), rests with the author(s). No person shall copy the name of the book, its title design, matter, and illustrations in any form and in any language, totally or partially, or in any distorted form. Anybody doing so shall face legal action and will be responsible for damages. CONNECT WITH US ON FACEBOOK! Come and join our Facebook page where you will be the first to know everything about our upcoming titles. On our page, we will also share promotional information for our current ebooks. This is also a great place to ask us any questions you may have concerning our ebooks as well. Join our Facebookpage here: https://www.facebook.com/DogwoodApps Contents Chapter 1 What is Raspberry Pi? Chapter 2 Models of Raspberry Pi Chapter 3 What Do You Need to Get Raspberry Pi Up and Running? Chapter 4 Installing the OS on Raspberry Pi Chapter 5 Other OSes for Pi Chapter 6 Programming Your Pi Using Scratch Chapter 7 Arduino and Raspberry Pi Chapter 8 Awesome Pi Uses Chapter 9 Raspberry Pi as Standard Productivity Computer Chapter 10 Using Raspberry Pi to Drive a Multimedia Center Chapter 11 Using Raspberry Pi for Time-Lapse Photography Chapter 12 Using Raspberry Pi as FM Transmitter Chapter 1 What is Raspberry Pi? Raspberry Pi is an affordable, credit card–sized, single-board computer. Raspberry Pi was developed for computer science education. This flagship product has been developed by Raspberry Pi Foundation, a charitable organization based in United Kingdom. Features Raspberry Pi is a single-board computer that is about the size of a credit card. It uses a 32- bit capable ARM processor and Fedora from Linux as its default operating system (OS). It can be programmed with languages, such as Python, that will compile with ARM. Raspberry Pi is a system on a chip (SoC). It has connection ports. You can use a Raspberry Pi for basic functions like watching HD videos, working with spreadsheets, and editing documents. In other words, you can do everything that a normal desktop computer is capable of doing. In Chapter 2, we will learn about the different versions currently offered of the Raspberry Pi. Chapter 2 Models of Raspberry Pi Raspberry Pi has two models. Surprisingly, both models are available at a pocket-friendly price. Model-A costs $25 and Model-B costs $35, excluding local taxes and shipping and handling charges. Also, this does not include charges of power supply and SD card; you have to buy them separately. Difference between Model-A and Model-B Model-A Model-B Price $25 $35 SoC Broadcom BCM2835 CPU 700 MHz ARM1176JF-S Core GPU VideoCore IV, OpenGL ES 2,0, 1080p 30 Full HD HP H.264 Memory 256 MB 512 MB USB 2.0 ports 1 2 (integrated) Video outputs Composite RCA, HDMI Audio outputs 3.5 mm jack, HDMI Onboard storage SD/MMC/SDIO card slot Low-level peripherals GPIO pins, SPI, I2C, UART Onboard network None 10/100 wired Ethernet Real-time clock No clock or battery Power ratings 500 mA (2.5 W) 700 mA (3.5 W) Power source 5 V via micro USB or GPIO header Size 85.60 mm 53.98 mm Supported OSes Debian GNU/Linux, Fedora, Arch Linux Where to Buy? Raspberry Pi Foundation has made exclusive distribution arrangement with Farnell and RS; one can buy any model of Raspberry Pi from these distributors. Resellers do sell on Amazon and eBay. Resellers sell Raspberry Pi with different offers, so prices may vary. Raspberry Pi Model-A Raspberry Pi Model-B Chapter 3 What Do You Need to Get Raspberry Pi Up and Running? Raspberry Pi is not preloaded even with important peripherals like SD card and power supply cable unless you purchase Pi from a reseller and pay extra for these essential peripherals. In this chapter, you will learn about the essential peripherals that are required to get Raspberry Pi up and running. First, select a model of Raspberry Pi that meets your needs, because each model of Raspberry Pi is designed to perform different functions. Now let’s take a look at the peripherals required to start using your Raspberry Pi. SD card Raspberry Pi OS is stored on a SD card. If you have purchased from RS, you will get a SD card. In case if you have purchased it from elsewhere, you can purchase the SD card from Amazon or from any other nearest electronic gadgets outlet. Requirements: SDHC memory card (4 GB or more) SDHC card Power supply You will need a power supply for your Raspberry Pi. You can purchase it from Amazon or from any other nearest electronic gadgets outlet. Requirements: Micro USB power supply (5 V, 1.2 mA [ideal], but needs to be 700 mA) Charger for Pi HDMI cable Raspberry Pi has one HDMI port for digital video and audio connection. You will need to purchase a separate HDMI capable to view the Pi on an HDMI monitor or television. HDMI cable Important note: Raspberry Pi does not support VGA analog output. You can use a converter but we don’t recommend using one because it may cause you issues later. Using a straight HDMI to HDMI connection is best to avoid compatibility problems. HDMI to VGA converter USB keyboard and mouse You need a USB keyboard and a mouse to establish user interface for your Raspberry Pi. Since Raspberry Pi comes with limited ports, you can purchase a USB extension in case you need more than one USB ports. Since your Pi supports Bluetooth-enabled wireless keyboard and mouse, you can purchase them as well. Wireless keyboard Internet connection Using your Pi, you can connect to Internet in many ways. You can enjoy wireless Internet via a USB–Wi-Fi dongle, and if you would like to connect with high-speed wired connection, then you can use Ethernet cable. USB modem Remember, Ethernet port is only available in Model-B. Ethernet cable Before you install an OS, make sure you have assembled necessary peripherals with your Pi. Operating system (OS) OS is the soul of your Raspberry Pi. So to get your Raspberry Pi up and running, you need to install Fedora which is the standard default Linux distribution used as the OS for Pi. Most of the distributors sell Pi with preinstalled OS. But, if in case you want to install the OS yourself, then read Chapter 4. Chapter 4 Installing the OS on Raspberry Pi Installing the OS on the Pi can be challenging, so most people and newbies prefer buying a preprogrammed Raspberry Pi as a much easier solution. Installing OS on Raspberry Pi is not extremely difficult, but it does take some basic computer knowledge to accomplish on the first attempt. If you have worked on Windows or any other OS platform in your PC, you can do it yourself easily and can save a few bucks. So in this chapter, you will learn about installing the OS on Raspberry Pi. We are installing Fedora Remix distribution from Linux, but before we install Fedora, we need to download it from the Web. Select a latest copy of Fedora Remix (Fedora Remix 17 or 18); you can download it from http://fedoraproject.org/wiki/Fedora_ARM_Installer Direct download: http://fossjon.fedorapeople.org/packages/fedora-arm-installer/fedora- arm-installer-1.0.3-7.x32.zip Preparing the SD card for use Raspberry Pi needs a storage and installation media to boot; we need a single SD card. You need to use at least a 4 GB SD card. The image of the file downloaded in the previous step will be stored on this card. Note: Before we begin, make sure that no important file is in you SD card, because it will be formatted at a later stage. If you are using Windows as your host OS, then download Win32 Disk Imager utility from http://www.softpedia.com/get/CD-DVD-Tools/Data-CD-DVD-Burning/Win32-Disk- Imager.shtml Now launch the Disk Imager and extract the image you have downloaded from the Web. You will get an .img file. Make sure you format SD card using FAT32 file system. Now run Win32 Disk Imager with administrator privileges and select the extracted image and the drive letter of the SD card. Always choose the correct drive or else data on the drive will be destroyed. Click on the ‘Write’ button and wait till it finishes extracting data. Depending on your host machine speed, your writing time will vary, but will not take a long time. After completion, exit the manager and eject the SD card, which is now ready for use. You can also use PowerISO, Flashnul, or other similar utilities as well. Booting up the Pi Transfer of image file to the SD card is now successful. We can now set up the Pi. Insert your SD card containing Fedora into the slot and connect the power supply and your monitor. Now make an Internet connection using Ethernet cable connected with Internet gateway and wait while your Pi boots up. Setting up the Pi Fedora will resize your SD card automatically; hence, you do not need to make partitions manually. Connect your keyboard and mouse.