Raspberry Pi Projects For Dummies. Evans Jonathan

Читать онлайн.
Название Raspberry Pi Projects For Dummies
Автор произведения Evans Jonathan
Жанр Зарубежная образовательная литература
Серия
Издательство Зарубежная образовательная литература
Год выпуска 0
isbn 9781118766712



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

of=/dev/sdc bs=2M

      You need to substitute the name of your distribution file where it says mydistribution.img. Substitute the directory where your SD card is located where it says /dev/sdc.

      warning The sudo command stands for “super user do” and tells Linux that you’re issuing the dd command as the administrator of the system. The operating system assumes you know exactly what you’re doing, and there are no protections for making any grave mistakes. The dd command is short for “data description,” but some people have joked that it stands for “destroy disk” or “delete data,” because if you aren’t careful, it can erase your system’s hard drive. When these two commands are combined, you can imagine the consequences of making a mistake. So, be sure you’ve typed everything precisely!

      8. Press Enter to start flashing the image file your SD card.

      It should take about two or three minutes to do this operation. You won’t see a progress update, but you may see the light next to your SD card slot flickering. When it’s finished, you’ll be advised how much data was copied and how long the operation took to complete. Pat yourself on the back. You’re ready to fire up your Raspberry Pi!

      Connecting Your Hardware

When you’ve got the essential accessories and the operating system, you can set up your hardware. This is simply a matter of connecting the right bits together. Figure 1-5 shows you how things are connected using a Raspberry Pi Model B.

       Figure 1-5: Hooking up all the hardware.

      Follow these steps to set up your hardware:

      1. Locate the SD card slot on the bottom of your Raspberry Pi and insert the newly flashed SD card snugly, with the label facing down.

      The card will stick out from the side of the circuit board a little bit.

      2. Connect your computer monitor or TV to your Raspberry Pi.

      If you’re using a monitor or TV with an HDMI connection, just connect the two with an HDMI cable. If your monitor has a DVI connection instead, insert the HDMI cable into an HDMI-to-DVI adapter and then plug it into your monitor. If you’re using a TV without an HDMI connection, connect a yellow RCA connector cable to the round RCA jack on the top of your Raspberry Pi and plug the other end into your TV’s composite video input.

      tip You may need to manually select which input your monitor or TV is using. Check the manual if you aren’t sure how to do this. Also, make sure the power to your display is switched on.

      3. Connect your USB hub into one of the two USB sockets on the right side of your Raspberry Pi.

      If you’re using a Raspberry Pi Model A, there will be only one socket. Your hub should have a power adapter – plug it into an electrical socket.

      4. Plug your keyboard and mouse into the USB hub.

      If you’re using a keyboard or a mouse with an older PS/2-style connector, you’ll need a PS/2-to-USB adapter. You can also connect them directly to your Raspberry Pi’s remaining USB socket, but it’s a good idea to use the hub, which has more available power.

      5. Connect your audio.

      If you’re using an HDMI monitor with audio, the audio will go through your HDMI cable. If you’re using external speakers or a TV, your audio output is the black 3.5mm socket on the top-right edge of your Raspberry Pi. Connect your speaker cable there.

      6. Connect to your network.

      If you’re using a Model A, you can skip this step. There is no network connection available for it.

      If you’re using a Model B, connect an Ethernet cable to your Ethernet socket on the right side of the board. When your operating systems starts up, it will automatically connect to your home router, as long as it supports Dynamic Host Configuration Protocol (DHCP). (Most home routers do.) If you have trouble connecting to the network, see your Internet service provider’s instructions for setting up new devices using DHCP on your home router. In rare cases, DHCP may be switched off.

      7. Connect your micro USB power supply to your power socket on the bottom-left corner of your board.

      Some power supplies have standard-size USB ports. You connect a USB–to–micro USB adapter cable from the standard USB output on these power adaptors to the micro USB input on your Raspberry Pi. There is no power switch. To cycle the power, you remove the adapter plug and put it back in, which is a little awkward. If you have an extension lead with a switch, you can connect your power adapter and use the switch on the lead to cycle to turn the power on and off more easily.

      warning Don’t connect your Raspberry Pi to your computer’s USB port via a USB–to–micro USB adapter cable. Your computer’s USB port isn’t designed to deliver enough power for your Raspberry Pi, via the USB port.

      When you power up your Raspberry Pi you should briefly see a rainbow-colored screen, which confirms that the hardware itself is working. Then the Linux operating system on your SD card will start to run and you’ll see an avalanche of text on your screen as all the various parts of the system are started. It can be pretty fun to watch. This will take a little time to complete. When it’s finished, you’ll be able to move on to setting up the system in the next section.

      You’ll also see a little status light on the board next to the audio jack. The PWR light should be on. When your Raspberry Pi accesses the SD card to load the operating system, you’ll see the ACT light activated.

      tip If you’re using an earlier Revision 1.0 board, the ACT light is labeled OK.

      The FDX light indicates that you have a good Ethernet connection. The LNK light will flash whenever there is network traffic on the wire. The 100 light indicates a high-speed (100 Mbit) Ethernet connection.

      Setting Up with Raspi-config

      Raspi-config is a little program that automatically loads to help you to get your Raspberry Pi ready to run, the first time you start up. It gives you a list of the basic system options in case you want to change them. After it’s set up the first time, it won’t run again unless you launch it manually. You use the keyboard arrows to move up and down the menu of options and the left and right arrows to select options. Pressing Enter confirms your selection.

      The options in the menu change from time to time. You may encounter an older version of the software with different menu items, but here’s a rundown of what they are and what they do (as of this writing):

      ✔ Expand Filesystem: When you flash your SD card with your operating system, it makes an exact copy (an “image”) of the Linux distribution files, and the formatting of the disk itself is likely to be smaller than the actual available space on your card. The image files don’t take up much space, and if you have a large SD card, it will look like your SD card has much less capacity than it actually does.

      To overcome this problem, it’s very important to use this option to expand your root file system to use all the available space on the card. Otherwise, you could run out of room! When you press Enter with this option, it runs immediately. The next time you start your Raspberry Pi, the command will resize your file system to use all the available room. This can take a few minutes; the screen won’t respond until it’s done. After it’s finished, all the space will be available to you.

      ✔ Change User Password: Lets you set the password for the default user of your Raspberry Pi, which is the user pi. You don’t need to change this. If you do, make sure not to forget it because there’s no way