Raspberry Pi For Dummies. McManus Sean

Чтение книги онлайн.

Читать онлайн книгу Raspberry Pi For Dummies - McManus Sean страница 6

Raspberry Pi For Dummies - McManus Sean

Скачать книгу

Raspberry Pi perform unreliably. It’s worth checking to see whether you have a 5V charger that might do the job (it should say on it how much current it provides), but for best results, we recommend buying a compatible charger from the same company that you buy your Raspberry Pi from. There is an official Raspberry Pi power supply available, which works in the U.K., Europe, the U.S./Japan, and Australia/China. For mobile applications, it's possible to power the Raspberry Pi using a battery pack designed for mobile phone charging. Don’t try to power the Pi by connecting its Micro USB port to the USB port on your PC with a cable, because your computer probably can’t provide enough power for your Pi. You can also power the Pi through the GPIO pins, but you could damage the Raspberry Pi if there is a spike in current or the wrong voltage is applied. If you want to provide power through the GPIO pins, a safer approach is to use a HAT device (Hardware Attached on Top) designed to sit on the GPIO pins and provide the consistent power you need while protecting the Pi underneath. The Raspberry Pi Foundation advises that you should only use batteries to power your Raspberry Pi if you know what you’re doing, because there’s a risk of damaging your Raspberry Pi. For more details on the power requirements of various Raspberry Pi models, consult the FAQ at www.raspberrypi.org/help/faqs/.

❯❯ Case: It’s safe to operate your Raspberry Pi as is, but many people prefer to protect it from spills and precariously stacked desk clutter by getting a case for it. You can buy plastic cases on eBay (www.ebay.com), many of which are transparent, so you can still admire the circuitry and see the Pi’s LED lights. These cases typically come supplied as simple kits for you to assemble. The Pibow Coupe (https://shop.pimoroni.com/collections/pibow) is one of the most attractively designed cases, assembled from layers of colored plastic. (See Figure 1-4.) It’s designed by Paul Beech, who designed the Raspberry Pi logo. There are also official red-and-white cases for the Raspberry Pi 3 (compatible with the B+ and later models) and the Raspberry Pi Zero. The case for the Pi Zero includes three different tops, so you can either seal it, leave a camera hole, or have access to the GPIO pins. You don’t have to buy a case, though. You can go without or make your own using cardboard or Lego bricks. Whatever case you go with, make sure you can still access the GPIO pins so that you can experiment with connecting your Pi to electronic circuits and try the projects in Part 5 of this book.

      ❯❯ Cables: You’ll need cables to connect it all up, too. In particular, you need an HDMI cable (if you’re using an HDMI or DVI monitor), an HDMI-to-DVI adapter (if you’re using a DVI monitor), an RCA cable (if you’re connecting to an older television), an audio cable (if you’re connecting the audio jack to your stereo), and an Ethernet cable (for networking on models with an Ethernet port). Note that current Raspberry Pi models send the RCA video signal through a 3.5mm jack (headphone socket), and earlier ones had a dedicated RCA socket. You will need a different cable, depending on which version of the Pi's design you have. If you have a Raspberry Pi Zero, you will also need a converter for the Mini HDMI socket, and for the Micro USB socket. You can get these cables from an electrical-components retailer and might be able to buy them at the same time as you buy your Raspberry Pi. Any other cables you need (for example, to connect to PC speakers or a USB hub) should come with those devices.

       FIGURE 1-3: A NOOBS card. The MicroSD card fits into the SD card adapter. The MicroSD card works on the current Pi models, and inside the adapter it also fits the older Model A and Model B.

       FIGURE 1-4: The Pibow Coupe case for the Raspberry Pi 3, Pi 2, and Model B+.

      warning The Raspberry Pi has been designed to be used with whatever accessories you have lying around, to minimize the cost of getting started, but in practice not all devices are compatible. In particular, incompatible USB hubs, keyboards, and mice can cause problems that are hard to diagnose. USB hubs that feed power back into your Raspberry Pi through the Pi’s USB port (known as backpowering) could potentially cause damage to the Raspberry Pi if they feed in too much power.

      A list of compatible and incompatible devices is maintained at http://elinux.org/RPi_VerifiedPeripherals, and you can check online reviews to see whether others have experienced difficulties using a particular device with the Raspberry Pi.

      If you’re buying new devices, you can minimize the risk by buying recommended devices from Raspberry Pi retailers.

      In any case, you should set a little bit of money aside to spend on accessories. The Raspberry Pi is a cheap device, but buying a keyboard, mouse, USB hub, and cables can easily double or triple your costs, and you might have to resort to that if what you have on hand turns out not to be compatible.

Chapter 2

      Downloading the Operating System

      IN THIS CHAPTER

      ❯❯ Introducing Linux

      ❯❯ Downloading NOOBS

      ❯❯ Preparing the MicroSD or SD card

      ❯❯ Copying NOOBS to the MicroSD or SD card

      ❯❯ Flashing your MicroSD or SD card

      Before you can do anything with your Raspberry Pi, you need to provide it with an operating system (OS). The operating system software enables you to use the computer’s basic functions and looks after activities such as managing files and running applications, like word processors or web browsers. Those applications use the operating system as an intermediary to talk to the hardware, and they won’t work without it. This concept isn’t unique to the Raspberry Pi. On your laptop, the operating system might be Microsoft Windows or Mac OS. On iPads or iPhones it’s iOS, and on other devices it might be Android.

      In this chapter, we introduce you to Linux, the operating system most frequently used on the Raspberry Pi, and we show you how to create an SD or MicroSD card with an operating system on it. You’ll need to use another computer to set up the SD or MicroSD card. It doesn’t matter whether you use a Windows, Mac OS, or Linux machine, but you need to have the ability to write to SD or MicroSD cards using it and a connection to the Internet.

      Introducing Linux

      The operating system used on the Raspberry Pi is GNU/Linux, or often just Linux. The Raspberry Pi might be the first Linux computer you’ve used, but the operating system has a long and honorable history.

      Richard Stallman created the GNU Project in 1984 with the goal of building an operating system that users were free to copy, study, and modify. Such software is known as free software, and although this software is often given away, the ideology is about free as in “free speech” rather than free as in “free beer.” Thousands of people have joined the GNU Project, creating software packages that include tools, applications, and even games. Stallman aimed to make his operating system compatible with Unix, an operating system that was created by AT&T’s Bell Labs and that started to gain popularity in the 1970s. That would make it easy for existing Unix users to switch to using the GNU Project.

      In 1991, Linus Torvalds released the central component of Linux, the kernel, which acts as a conduit between the applications software and the hardware resources, including

Скачать книгу