Your First Bite of Raspberry Pi
I have to give Kyle Rankin all the credit for my Raspberry Pi collection. I never really felt geeky enough to do anything with an Arduino, and for some reason I mentally lumped the RPi into the same world. Boy was I short-sighted! Thankfully Kyle showed me the light, and I managed to snag some of the new 512MB model B units. You'll be hearing about the Raspberry Pi from Kyle as well, but this month, I want to introduce the RPi to those folks who have been hesitant to buy one, thinking they weren't geeky enough. I had to ask a lot of dumb questions when my Raspberry Pis arrived; hopefully, I can save you that embarrassment.
Batteries Not Included
To be honest, "batteries not included" is true, but the Raspberry Pi literally can run with four AA batteries and a tiny little resistor. If your goal is to make a portable project, that might be a viable option for you. Just know the RPi needs five volts of consistent power, and it will suck about 700mAh. If you add USB devices, it will drain the batteries even faster. So while batteries will work, it's likely the Raspberry Pi will fail without warning when the batteries get too low. For that reason, it's recommended to use an AC adapter.
Luckily, the RPi is powered by a micro-USB port, which is the most common power adapter for cell phones and tablets. Chances are you have a dozen potential Raspberry Pi power supplies lying around your house. Like with the battery scenario, however, it's important to find a power supply that can provide at least 700mAh. Remember, when it comes to amperage, more is better, so don't worry about a one- or two-amp power adapter ruining the unit. It will draw only as much as it needs. If the power supply doesn't provide at least 700mAh, however, the Raspberry Pi will not be reliable. Most problems with the RPi tend to be related to a weak or faulty power adapter.
Don't Box Me In
Once you connect power to your RPi, you'll quickly find that it's awkward to handle. I didn't bother talking about a case first, because we all know building a case is not the first thing anyone is going to do. Still, if you want to keep your Pi in good shape, protecting it with some sort of case is important. Thankfully, there are more case options than stars in Hollywood.
Case Option: Buy One
You bought the Raspberry Pi, and it was only $35. It seems only logical to spend an additional $10–$15 on a prebuilt case to house it. There are clear cases, colorful cases, expensive cases and cheap cases. Most of the commercially available cases are plain, square boxes, but the RPi is a little square device, so that makes sense. Buying a case also guarantees a snug fit and proper-fitting connections. If your Pi is going to be handled a lot, a fitted case is a very good idea.
Case Option: Steal from the Nursery
The Raspberry Pi is small, and it really lends itself to a LEGO castle motif. Seriously, when it first came out, there were more LEGO-based RPi cases than anything else. If you have access to the right sort of LEGO blocks, it's surprising how sturdy those little suckers can be when properly built. Plus, if you build a custom case out of LEGO blocks, you can add wings, rockets and LEGO dudes sitting on top. Besides, who wouldn't want to have a desktop computer system that can double as a toy space station?
Case Option: 3-D Printing
If you have a 3-D printer, I can't think of a cooler way to cover your Pi. Templates are available on the Internet, but even without a template, it's possible to make a case as tight-fitting or as ventilated as you want. Now with the different color options available for 3-D printers, the sky is really the limit.
Case Option: Regular Printing
I didn't buy a case. I don't have a 3-D printer. And, my kids no longer have LEGO blocks lying around for me to steal. For me, I wanted a case that was simple, cheap and did the job. Thankfully, the folks over at http://h2database.com/raspi have provided a printable template that folds into a Raspberry Pi case. The coolest print stock is a clear mylar sheet. Figure 1 shows how cool a foldable clear case can look.
Figure 1. This foldable case is simple, cheap and pretty cool-looking (image from http://h2database.com).
Case Option: Crazy Go Nuts
You have a computer with a silly name, so why not compliment that with a silly case? The Raspberry Pi is small enough to fit inside a Pop-Tart box, an old shoe, a DVD case, a hollowed-out book or a carved Halloween pumpkin. Of course, any case that is wet likely will damage or destroy your Pi, but it's awful tempting to make a "Raspberry Pumpkin Pi", isn't it? The possibilities are endless with RPi case mods, so let your creativity lead the way.
Figure 2. I am probably the only kid on the block with a bootable box of Pop-Tarts.
Getting the Boot
First off, the Raspberry Pi will not PXE boot. It also won't boot directly from a USB device. Both of those things really bum me out, but nonetheless, the RPi does boot quite nicely from the included SD slot. Because it won't boot from USB, installing an operating system is easiest from a second computer. Several Linux distributions are compiled for the ARM-based RPi, but the most popular by far is the Debian-based Raspbian OS.
For best performance, a class 10 SD card is recommended. Once you get the SD card, instructions for copying the Raspbian OS are available at http://www.raspberrypi.org. The good news is that even if your SD card is small and slow, once the unit is booted, there's no reason the OS can't live largely on a USB drive. If you want to experiment with moving the bulk of the OS off the SD card, the Raspberry Pi Web site has some great tutorials.
Splitting Your Brain
The Raspberry Pi comes with a shared system for system RAM and GPU RAM. Because the GPU is a powerful device capable of driving a high-resolution monitor and hardware rendering several types of video, if you're using the RPi in a multimedia setting, you'll want to be sure the GPU gets plenty of RAM. If you're running the Pi in a headless server mode, you'll likely want to use as little of the RAM as possible for the GPU, reserving the bulk for the system.
The absolute minimum the GPU needs is 16MB. That doesn't seem like a lot, but because the system maxes out at 256MB or 512MB, even 16MB can be significant. As the Raspberry Pi doesn't have a BIOS, the only way to allocate RAM is to put a binary file named start.elf into the /boot directory. Due to the proprietary nature of the GPU, those various .elf files are downloaded from http://www.raspberrypi.org. If you're running headless, you'll want to grab the .elf binary with only 16MB dedicated to GPU. Otherwise, you'll have to decide how much GPU RAM your application will require. Trial and error might be the only way to figure out the best split. The good news is that the new model B units come with 512MB of RAM instead of 256, so it allows for much more flexibility with the memory split.
- Linux Kernel Testing and Debugging
- NSA: Linux Journal is an "extremist forum" and its readers get flagged for extra surveillance
- Tails above the Rest, Part III
- Wanted: Your Embedded Linux Projects
- RSS Feeds
- The 101 Uses of OpenSSH: Part I
- Dolphins in the NSA Dragnet
- Tails above the Rest: the Installation
- Are you an extremist?
- Tails above the Rest, Part II