MrRoboto - May 13_MrRoboto - May 13.qxd 4/3/2013 1:30 PM Page 15
Discuss this article in the SERVO Magazine forums at http://forum.servomagazine.com
fast as hard drives and the Pi is not as fast as your Intel i7
computer! I’ll tell you a little more of what happens when
you first boot your Pi with your newly-minted OS SD card.
Raspi-Config will come up to get you to do a few
housekeeping tasks. Do the following:
1. expand_rootfs: This is so you get your full 4GB of
2. configure_keyboard: This is so your system
understands your keyboard.
3. change_timezone: This is so your system time will be
4. ssh: This enables ssh so we can log in from another
After you do these things, go ahead and reboot. Your
journey has just begun ...
Before I answer your first question and start you down
the path of an hour or two of waiting for updates and
upgrades, I want to answer your second question first. How
do you know that your Pi board is really 512 MB? I
searched the Web for an answer to this question and found
many false leads and downright incorrect answers, but
eventually, I found “gold.”
Look at the big chip in the middle of the board. Mine
says “K4P4G324EB-A6C1” — I have a 512 MB unit. This
apparently is only the Samsung RAM part number, or “top
of the stack” or something like that. Hours of Googling has
not really shone a bright light on part number translations.
Regardless, after the “K4P” are the digits “4G;” this
means 4 Gigabits of RAM, which translates into 512 MB
(bits/8). A “2G” would have meant 2 Gigabits, or 256 MB
of RAM. Now you know you have 512 MB of RAM. The
next step is to enable it!
As I had mentioned before, I spent many hours
searching the Web for the definitive means by which I could
enable that extended RAM in the Pi. I found many answers
to the question. I found several that just plain didn’t work;
some that partly worked; and a couple that trashed my SD
card or left me in a state where my OS got “glitchy” and
caused me to rebuild it — which wasn’t that difficult
Before we know we have gotten to the place we want
to be, we need to know where we are now. So, after your
Pi has booted and you’ve logged in, execute the following
command. Here is (more or less) what you should get:
pi@raspberrypi free -h total used free shared buffers cached Mem: 183M 49M 134M 0B 7.5M 23M -/+ buffers/cache: 18M 165M Swap: 99M 0B 99M pi@raspberrypi
The total RAM available to our Pi is 183 MB. Remember
that the Pi processor is actually an ARM processor and a
graphics co-processor. The Pi system defaults to giving
64 MB of RAM to the Graphics Processing Unit, leaving
the OS with the rest. There is about 9 MB that doesn’t
seem to show up. I’m not sure just where it goes, but it
isn’t in this output. We want more RAM, and this shows
us where we start.
To show how we accomplish this, I’m going to borrow
from a few sites and some readings from man pages. (In
Linux-land, “man” pages are “manual” pages which tell you
what commands are and how to use them.) Man pages are
not for the faint at heart and are filled with UNIX hacker
jargon. If you are going to use Linux, get used to it; they
are your first step to take to get something done. Man
pages are filled with facts and are typically correct — unlike
many places on the Web (smile when you say that!).
The site http://hubcitylabs.org/
came the closest to working for me, but it left out a few
“gotchas” with the scripts and descriptions. I’ll try to fill in
those spaces for you, since I’ve stumbled over every mistake
possible while implementing them!
WARNING: Getting these wrong means starting
over and making a new OS install, so don’t do this
without saving your work and documenting what you
have there! If you have the option, practice on a new,
fresh install first!
The next Linux command you need to know and use is
sudo. This allows a user — like pi — to access root
administrator processes and settings. You’ll do everything in
this update sequence with sudo.
The first Linux utility that you need to become
comfortable with is apt-get. This command is how you
update your OS, add programs, programming
environments, optional functionality, drivers, you name it.
Linux apt-get is an amazing piece of software. It is able to
check any dependency that the package may have, and
suggest the correct install to satisfy it. I’ve grown almost
religious in my trust of this well designed program and its
Ready? Let’s go!
Type the following command (results shown):
pi@raspberrypi sudo apt-get update Get:1 http://archive.raspberrypi.org wheezy InRelease [7,737 B] Get:2 http://http.debian.net wheezy InRelease [224 kB] Get:3 http://archive.raspberrypi.org wheezy/main armel Packages [4,332 B] Get:4 http://http.debian.net wheezy/main armel Packages [5,720 kB] Get:5 http://http.debian.net wheezy/contrib Translation-en [34.9 kB] Get:6 http://http.debian.net wheezy/main Translation-en [3,854 kB] Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB Ign http://archive.raspberrypi.org wheezy/main Translation-en Get:7 http://http.debian.net wheezy/non-free Translation-en [66.0 kB] Get:8 http://http.debian.net wheezy/contrib
SERVO 05.2013 15