Raspberry Pi Projects For Dummies. Evans Jonathan

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

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

Raspberry Pi Projects For Dummies - Evans Jonathan

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

flash process can take a long time. You’ll see some dots on your screen as the process continues. Depending on your system, it can take 30 minutes or even up to an hour. You can use your computer for other things during this process, but if you lose power or restart, you’ll have to start all over again.

      tip If you’re presented with a message immediately after typing accept, there’s a problem. Even though the message may say Transfer Complete, the immediate response means that the transfer hasn’t been accomplished. This sometimes happens if the image file isn’t located where you indicated it was or if the distribution contains just an image file rather than an image file within a folder of the same name. If it happens, create a folder with the same name as the image file, drag the image file into it, and try again.

       Flashing an SD card in Linux

      If you’re using Linux, the process of flashing an SD card for your Raspberry Pi is pretty straightforward. We assume you’re using Ubuntu, one of the most popular Linux distributions. If you’re using another distribution, the following steps will be very similar.

      When you download the Raspbian Wheezy distribution, make sure you save it where you can find it, such as in the Documents directory. Then follow these steps to flash your SD card:

      1. Remove any external drives, USB keys, or other SD cards from your system and insert the SD card you would like to flash for your Raspberry Pi.

      2. Open a Terminal window.

      This is located in the Applications menu under Accessories.

      3. Type sudo fdisk –l (the last character of this command is the letter l, not the number 1).

      This starts the fixed disk program, a tool you can use to manage, erase, and separate disk drives into different logical partitions. It also shows you which drives are available on your system.

      4. Locate your SD card in the device list.

      The list gives details about each of the drives on your system, including the size of each device in bytes and other details such as the number of heads, sectors, cylinders, and so on. Find the device that most closely matches the size of your SD card in bytes. For example, an 8GB SD card will be listed as about 8,068MB. Take note of the name of that disk’s directory. For example, on our system, the SD card is located in the directory: /dev/sdg.

      5. Use the cd command (“change directory”) to navigate to the directory where you saved your Raspbian Wheezy distribution.

      For example, if it’s in the Documents directory, type cd Documents and press Enter.

      6. Display the name of your Raspbian Wheezy image file by typing ls *.img.

      7. To write the Raspbian Wheezy image to the SD card, use the dd command.

      Here’s what we would type on our system:

      sudo dd if=mydistribution.img 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

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