Raspberry Pi Raspberry Pi User Manual

Other manuals for Raspberry Pi: Quick Start Manual, User Manual

Summary of Raspberry Pi

  • Page 1

    Raspberry pi user guide getting started operating systems & installation learn the ropes linux & packages making the most of your pi pi projects element14.Com ® raspberry pi user guide.Indd 1 08/07/2014 14:43.

  • Page 2

    Contents unpack the box 3 operating systems 4 installation 6 loading the o/s 7 raspbian 8 command line: learn the ropes 10 packages: how do they work? 16 raspbmc 20 camera controller 22 sending output 26 minecraft pi 30 postscript 32 raspberry pi user guide.Indd 2 08/07/2014 14:43.

  • Page 3

    Unpack the box inside the box you will find the raspberry pi board, a 5v power supply (optional) and a 8gb microsd card. Depending on which bundle you might have purchased you might also receive a case or other accessories. Feel free to put those items together prior to starting up your pi. The pi r...

  • Page 4

    Operating systems let’s take a look at a sweet selection of tasty operating systems for the raspberry pi. The raspberry pi phenomenon appears to go from strength to strength; like a runaway train, it’s ploughing ahead and forging itself a place in the record books. It’s hardly surprising – the hardw...

  • Page 5: Raspbian

    Raspbian this is the recommended distro by the raspberry pi foundation. Unless you have good reason to use a different one, it’s probably your best bet. It’s based on debian wheezy, so you can easily install anything from the huge debian repositories. The default desktop environment is lxde, which i...

  • Page 6

    Installation do you need a phd to install the os? The noobs operating system installation is as easy as copying files onto your sd card. The installation of an operating system image is fairly well documented, as per the area on the raspberry pi site titled guide for beginners which can be found her...

  • Page 7

    Loading the o/s the memory card is affectionately referred to as noobs. Noobs is a way to make setting up a raspberry pi for the first time much, much easier. You won’t need network access, and you won’t need to download any special imaging software. Insert the microsd card in the memory slot undern...

  • Page 8

    Raspbian for the majority of people who use it, raspbian will be the graphical face of the raspberry pi. It can be obtained and installed on to an sd card by following the instructions on the previous page. Once it’s up and running, it’s a good idea to grab the latest versions of all the software by...

  • Page 9

    12 cool raspberry pi projects ■ the complete channel one temperature monitor and alarm project ■ the raspberry pi softball camera ■ the raspberry pi karaoke machine ■ the drinkmotizer: a raspberry pi drink mixing robot ■ new year’s eve countdown timer with fireworks launching ability ■ raspberry pi ...

  • Page 10

    Command line: learn the ropes get to grips with your raspberry pi’s command line interface and unleash its full power without using the mouse. As you have no doubt discovered, raspbian has a graphical interface similar to that of windows or mac os x. You can do most of your day-to-day tasks in this ...

  • Page 11

    The first thing you need to do is open up a terminal. Click on ‘lxterminal’ on the raspbian desktop. You should now see a line that looks like: pi@raspberrypi ~ $ this is the command prompt. Whenever you see this, you know the system is ready to receive input. Now type pwd , and press enter. You sho...

  • Page 12

    Knowing what commands to use at this point, you’re probably wondering how on earth you are supposed to know what commands and what flags you can use for a task. Well, there’s good news and bad news. The good news is that it’s usually not too difficult to find out the flags for a command. Most comman...

  • Page 13: How Will I Know?

    How will i know? Remember we said there’s good news and bad news? Well, the bad news is that it can be quite tricky to find commands if you don’t know what they’re called. One helpful feature is the man keyword search. This is done with the -k flag. To search for all the programs related to ‘browser...

  • Page 14: Power Up

    Power up so far you’re probably thinking to yourself, “i could have done all this in the graphical interface without having to remember obscure commands and flags.” you’d be right, but that’s because we haven’t introduced the more powerful features yet. The first of them are wildcards. These are cha...

  • Page 15: Pipes And Redirection

    Pipes and redirection the commands that we’ve been looking at so far have all sent their output to be displayed in the terminal. Most of the time this is what we want, but sometimes it’s useful to do other things with it. In linux, you can do two other things with a command: send it to a file, or se...

  • Page 16

    Packages: how do they work? Discover how raspbian’s package manager, apt-get, gets software from online repositories and manages it on your system. If you’re used to windows, you may be used to each bit of software having its own installer, which gets the appropriate files and puts them in the appro...

  • Page 17

    Apt-get is a command line program, so to start with you’ll need to open a terminal (see the command line interface section on page 10 for more information on this). Since package management affects the whole system, all the commands need to be run with sudo . The first thing you need to do is make s...

  • Page 18

    If you then want to remove iceweasel, you can do it with: sudo apt-get purge iceweasel the package manager will try to remove any dependencies that aren’t used by other packages. You’ll often see packages with -dev at the end of package names. These are only needed if you’re compiling software. Usua...

  • Page 19: Compiling Software

    Compiling software sometimes, you’ll find you need software that isn’t in the repository, and so you can’t get it using apt-get . In this case, you’ll need to compile it. Different projects package their source code in different ways, but usually, the following will work. Get the source code from th...

  • Page 20

    Raspbmc you can install a media player, such as vlc, on to raspbian, and use that to play videos. This works fine if you’re using your raspberry pi as a general computer and giving it occasional multimedia functions. However, the small size of the hardware, and the fact that it runs silently, makes ...

  • Page 21

    This is all good, but it’s a bit impractical to use a mouse and keyboard to control your telly. The good folks at xbmc thought of this and added support for remote controls. The simplest and most general-purpose way of doing this is via raspbmc’s web interface. Using this, any device with a web brow...

  • Page 22

    Camera controller back up your photos using your pi. The size of the raspberry pi means we can use it to take control of other embedded devices. This may seem a little redundant – the embedded devices obviously have some form of controller already – but it means we can script and extend them in ways...

  • Page 23

    Before getting stuck in to the project, we’ll take a look at this useful tool to see what it can do. The desktop environment can try to mount the camera, and this can cause gphoto2 a few problems, so the easiest thing to do is run without it. Open a terminal and run sudo raspi-conf , and under boot ...

  • Page 24

    Here, we’re assuming that you’re using the default user pi. If you’re not, you’ll need to adjust the script. First, we need to create a mount point for the drive. This is just a folder, and can be put anywhere – we’re going to spurn convention and put it in our home folder. So before running the scr...

  • Page 25: New Directions

    Networking the raspberry pi comes with a wired ethernet connection, which is fine for most occasions, but sometimes the cable just won’t reach. You could use a usb wireless dongle – however, if you’ve got an android phone, and your carrier hasn’t disabled the feature, you can use this as your networ...

  • Page 26

    Sending output use the gpio pins to light up some leds. The pi’s tiny size makes it ideal for making your own embedded devices. This can be a great way of creating small computing devices to solve specific problems, as we saw with the camera controller. However, there is the slight problem that it c...

  • Page 27

    We’re going to use the gpio program, which is part of wiringpi. You can find out more about this from the website: bit.Ly/rp8ukj . The software comes as source code, so we’ll have to unzip it and compile it with: tar xvf wiringpi.Tgz cd wiringpi/wiringpi make sudo make install cd ../gpio make sudo m...

  • Page 28

    The first just sets the pins to the right mode and makes sure they’re turned off: pins="7 8 25 24 23 18 15 14" for x in $pins do gpio -g mode $x out gpio -g write $x 0 done the second grabs the ip address from ifconfig , converts it to binary, then pads it out with leading zeros, if necessary. Ipadd...

  • Page 29

    We’ve shown you how to send output via the gpio, but as the name suggests, they can also receive input. With this, it’s even more important to ensure that you don’t send too much power into the pins. To get input, just set the mode to input with gpio –g mode in and then read the value with gpio –g r...

  • Page 30

    Minecraft pi minecraft on the raspberry pi minecraft: pi edition is a version of minecraft that’s designed to work on the raspberry pi. Based on the “pocket edition”, minecraft pi is smaller and faster as well as containing support for multiple programming languages. Minecraft pi runs on the raspbia...

  • Page 31: Programming Minecraft Pi

    Programming minecraft pi once you have launched the game then you can select start game followed by create new. This should take you into a randomly generated world that you can start to modify with code. You should still have your lx terminal windows open. If not then click on the lx terminal windo...

  • Page 32

    Postscript the making of pi the idea behind a tiny and affordable computer for kids came in 2006, when eben upton, rob mullins, jack lang and alan mycroft, based at the university of cambridge’s computer laboratory, became concerned about the year-on-year decline in the numbers and skills levels of ...

  • Page 33

    Command line reference navigation and fi les cd changes directory. For example, cd movies moves to the movies folder. Cd ~ moves to your home directory, cd / moves to the root directory, cd .. Moves back one directory. Ls lists files. By itself, it lists the files in the current directory. Ls movies...

  • Page 34

    Remote working ssh log in to a remote computer using secure shell (ssh protocol). Ssh pi@192.168.1.2 will log in as user pi on the computer at the ip address 192.168.1.2 . Note, this will only work if the remote computer has an ssh server running. Scp secure copy. Scp file pi@192.168.1.2 :/home/pi w...

  • Page 36

    Www.Element14.Com raspberry pi user guide.Indd 36 08/07/2014 14:44.