Welcome to the QA Tech-Tips blog!

Some see things as they are, and ask "Why?"   I dream things that never were, and ask "Why Not".  
Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.  
Old Chinese Proverb

Monday, October 7, 2013

Hot Smokin' Weapon! Award for October 2013
The Raspberry Pi


Yep.  It's time for yet another Hot Smokin' Weapon award - and this month's winner is the Raspberry Foundation's pocket-sized computer, the Raspberry Pi.

Recently I was able to get my hot little hands on a Raspberry Pi board.  Built and designed in the land of British pubs and lousy beer, they're available here in the U.S. for about $35 each.  For another five or ten dollars, you can get it complete with an SD card pre-programmed with a boot loader and five or six Linux distributions to play with.




Here's what a Raspberry Pi, Model B, looks like in real-life.  Notice its size relative to the full-size SD card next to it.  The Raspberry Pi people refer to it as a "credit card" sized computer.  The red board on the right is the PI's GPIO breakout board that you can use to control external circuitry.


The layout illustration was taken from the Raspberry Pi web-site located at http://www.raspberrypi.org/faqs



And here's the layout, (minus the two flex connectors).  The difference between the Model A, and B, is that the A version does not have the LAN port, has only half the onboard memory, and has only one USB slot instead of the two on the model B.  Since, IMHO, the extra USB port and the LAN capabilities are important to me, I purchased the model B, and I am basing my review on that particular version.




This is the Ethernet / USB end of the board.  You can see the full-sized HDMI connector on the left just above the Ethernet jack, (with the brown tape on it), as well as the yellow RCA composite video connector and a blue "headphone" jack for analog audio if you are not using the HDMI connector.  Or, if you have connected it like me using a HDMI - DVI adapter plug, you need the aux audio connector for audio.




Here's a view from the other end.  In this view you can see the two flex-cable connectors, (marked with red arrows), and the GPIO header on the left, marked with the green arrow.  The bottom flex connector is for use with the Pi's camera module and the flex connector on the upper right is rumored to be for an LCD display module.  The GPIO connector attaches to the GPIO breakout board using a standard 26 conductor ribbon cable and connectors.

The big square chip just above the lower red arrow is the brains of the beast.  It is a Broadcom "System on a chip" that contains everything on the board, except the connectors, voltage regulator, decoupling capacitors, isolation resistors, and the status LEDs.  The rest is in the chip - the ARM processor, the GPU, the Ethernet and USB controllers, and God only knows what else.




Here's a full-size SD card, the Raspberry Pi, and the GPIO breakout board shown next to a 12" ruler to give you a sense of scale.




This picture has the Raspberry Pi next to a plastic case you can buy for it.  It has cutouts for all the connectors, the GPIO breakout board's ribbon cable, and a slot to put a SD card, (face down) at the back.  Since, (obviously!), the Pi is a live circuit board, putting it in some kind of a case is a smart move to prevent accidental short-circuits from ruining it.

Now, let's insert a pre-loaded SD card, and fire the beastie up!



Note that the Raspberry Pi has no onboard BIOS of any kind, so there must be a SD card, with software loaded, before the thing will do anything at all.  Especially since the SD card is the system's "hard drive" so to speak.

You can load software on the Pi in one of several ways:
  • If you are a total masochist, (or need special capabilities not available any other way), you can dig up the specs, an ARM assembler/compiler, and write "bare metal" code for the thing.  There's a whole forum at the Raspberry Pi site devoted to just that kind of insanity.  Since I've done that kind of thing before, (and no, I've never claimed to be sane), it sounds rather interesting.  I'm planning to go wander around there, just as soon as I work up the nerve and get a couple of minutes to spare.

  • You can spool a byte-for-byte image of various distro's directly onto the SD card.  Note that these images are bit-images, just like an ISO file for a CD, so they have to be written as a bit-image using special raw byte transfer software like "dd" in Linux.  There are several software image writers for Windows, and you can use them as well.

  • Even though spooling a bit-image onto your SD card isn't really that difficult, it is a bit tricky, so the developers of the Raspberry Pi created a special boot-loader called NOOBS.  (New Out Of Box Software)  And yes, the pun is deliberate, since it is primarily intended for those of us who are not Certified Raspberry Engineers; to help us get up, running and productive with a minimum of grief.

Here's an image of the initial screen you see when NOOBS version 1.3.0 boots for the first time.




The first thing you notice is the list of distributions you can load, ranging from the very capable Raspbian re-spin of Debian Linux, all the way to the more esoteric RISC OS, while not for beginners, it's a full-blown re-spin of IBM's RISC operating system.  It's funky, but fast.  Unlike a Linux distribution, this thing boots all the way to it's GUI in less time than it takes your hand to move away from the power connector you just plugged in.  Like I said, it's a bit wonky if you're not familiar with RISC systems, but its scary fast!

If you're looking carefully, you will notice a number of selection icons across the top of the dialog window.  And yes, Virginia, that round thing that looks like a globe is the icon that launches the loaders built-in web browser.

Yep, you heard me right, the OS loader selection screen has a built-in web browser that can be used to surf the web in case you need any supporting information to get you started.  And to make things better, the browser's home page is set to link directly to the Raspberry Pi help forum.  And it's not just a crufty text-based browser either.  It's the Real Deal.  So far, the only things it doesn't do is allow you to download something, (though I might be wrong here), and play Flash video.  Oh, in case you wondered, it does fully support PDF files, and they can be viewed directly within the browser itself.

In case you really need to get down-and-dirty, ALT-F2 brings you to a text based login screen - the user is "root" and the password is "raspberry" - where you can do pretty much everything you could do in a "normal" text based startup - or a terminal window - in Linux.




Here's a closer look at the distro selection screen showing the various distributions you can install.  Oh, and by the way, the check-boxes are there for a reason.  A new feature in NOOBS 1.3.0 is the ability to install more than one distribution at a time - limited only by the space on your SD card.  And just to make sure you don't goof up, the area down at the bottom, labeled "Disk space" shows you both how much space you have to play with, and the total space needed for the selections you've made.  If you select more than can fit - the total space number becomes a bold-faced red to warn you. I don't know if it prevents you from trying - I did not try it - but it is a thoughtful touch.




If you install Raspian, you see this configuration screen at first-boot where you can set a whole bunch of useful and important parameters - like your localization settings since everything defaults to settings appropriate for Great Britain.  Unless you live there, you will have to set the system locale to one appropriate for you, your time zone, and your region's particular keyboard-map.  Note that the locale settings also set the default language for the system, as run.  And yes, they have support for just about every weird character set and language out there.  I didn't try Arabic or Hindi, but they do a darn good job with Russian.

Once you're done, the system reboots and - if you have selected the option to boot directly to the GUI - you are presented with the Raspian desktop.




Of course, the background image is the Raspberry Pi logo, in living color, larger than life.  Once you get tired of looking at that - which doesn't take long - you can substitute any image your little heart desires.

The desktop manager is LXDE, one of the "lightweight" desktop managers.  Though it might be "lightweight" desktop in size, it's a fooler since it's most definitely not lightweight in capabilities.  If you can do it in Gnome or KDE, chances are you can do it here too.  Though you won't see all the "eye candy" that's in the larger desktops, (Face it, do you REALLY need bouncing desktop icons that spin and change colors?), it does a very competent job of doing what it does, being a desktop that lets you get work done.

Since the original design philosophy of the Pi was to use it as a teaching tool, it comes pre-loaded with a couple of programming environments:  Scratch for the rank beginner who has never even thought of programming in his life, as well as Python, the "official" programming language of the Raspberry Pi in Raspian.

In case you're curious, Scratch is a very elementary programming language - not unlike the "turtle graphic" languages that were in vogue during the '90's, and it works a lot like a Lego building set.  Each kind of statement, conditional, expression, or whatever has a particular shape.  Syntax is taken care of by how the shapes fit.  If they fit, it will work.

Another part of the language is a large catalog of "sprites" - graphical images that can be placed in the primary display area known as the "stage".  Depending on the steps you put together, you can make the sprite do any number of things on the stage.  You can put more than one sprite on the stage, change their position or direction of travel, and detect if they touch each other, or touch one of the stage's side walls.

I played with it for about 30 minutes or so, and I was able to get the main sprite - a cat - to walk around the stage, changing color as he walked.

Oh!  I almost forgot to mention; what happens if you get heartily tired of the distro(s) you originally picked and want to do something different?




Every time the system boots, you get about five seconds of this - a way to abort the boot and return to the original NOOBS loader screen.

The good news:  If you've gotten so tired of Raspian that you are about to scream, you can swap it out for any of the other distributions.

The bad news:  Making new distribution selection(s) on the NOOBS loader screen is a destructive process.  Any settings, files, and God Knows What Else you may have created are lost and gone forever, oh my darling Clementine. That is, unless you had the foresight to plug in a thumb-drive and copy your settings and files off the system before selecting a new distribution set.



The bottom line:

Though originally conceived as a teaching tool, the Raspberry Pi is a competent system in it's own right.

You can use it as a self-contained media center connected to your huge screen HDMI TV / Display - a job that it totally KICKS ASS at, making my larger computers with wicked nasty video cards look like pikers by comparison.

You can use it as a miniature, (in size only, not in capabilities), RISC "mainframe" system with multiple users logged in at the same time.

With a suitable distro installed - like Raspian - you can use it as a full-fledged workstation.  So much so that there are a multitude of forum threads devoted to people who have decided to toss their big, noisy, power-hungry beasts and just use the Raspberry as their main computer system.  And if you're like me, and won't miss the dancing bears, roving eyeballs, and bouncing icons, you will feel right at home sitting in front of your cigarette-case sized computer, kicking ass and taking names, right up there with the Big Dogs.

Don't take my word for it.  Go out and get one - they're dirt-cheap by comparison - and give the beast a spin.  Just be careful.  It might be love at first sight!

Read all about it at http://www.raspberrypi.org

What say ye?

Jim (JR)