Saturday, January 12, 2013

Raspberry Pi, episode 1

Okey-dokey, I will repurpose this blog yet again to describe trying to use the Raspberry Pi that Paul gave me for Christmas.

There's this much one can say about the happy group of Brits behind the Pi: they are teaching many, many people how to spell Raspppberry.

The actual thing is basically a single-board Linux computer, remarkable mainly because of its tiny size: about the size of a playing card. Central on the board is a single chip that comprises 512MB of RAM, a 32-bit CPU, and a graphics processor. Pretty much everything else on the tiny board is either connectors or resistors and capacitors.

The Pi all hooked up. Clockwise from top right corner: Power via a micro-USB connector; the SD card; some experimenter I/O pins; a yellow RCA connector for an analog TV signal; an audio jack; some blinky lights; two USB plugs for keyboard and mouse; an ethernet cable; the HDMI cable leading to the digital TV.

When I stop to think about it the Pi can make me rather giddy. I remember configuring my first home computer, with separate, 10-inch-wide cards for a 16-bit CPU and for 64kilobytes of RAM. So here's one fingernail-size chip comprising a CPU and memory, both four orders of magnitude more capable. (64e3 versus 51.2e7, and as for the CPU, forget it. The Pi's graphics processor can do 64 gigaFLOPs. That old 2MHz Z80 isn't in the same galaxy.)

Anyway it needs a keyboard and mouse, so I went to Fry's and found an optical USB mouse for $3.99 and a USB keyboard for $5.99. Later I had to go back and get a 2-metre HDMI cable, which cost more than the other two combined.

Getting the OS

The big hurdle in getting the Pi going is loading its OS. The Pi's only provision for mass storage is a single SD card, 8GB or larger. (I try not to think too much about having 8 or 16 gigabytes of memory on a thumbnail-sized chip.) If the SD card is initialized as a FAT-32 file system and loaded with a disk image downloaded from the Raspberry mothership, the Pi will supposedly boot up from it into a full-blown Linux system.

That's what the quick start guide claims. But the problem is getting the disk image written onto the SD card. The Pi instructions are for Windows users; my tool is a Macbook. Nevertheless, I thought I'd done it correctly, following these instructions at the "Embedded Linux Wiki".

It didn't work; or at least, when the Pi was all hooked up and plugged in, the screen went blank.

So I did it again and this time, the system booted up into a typical Linux startup screen going to a config screen.

It's aliiiiive! The Pi with the $4 mouse, $6 keyboard, and an expensive Samsung TV doing duty as a monitor.

I config'd it a bit, setting the locale and the time zone, although the latter was a bit of a puzzle: is California in Alaskan or Aleutian or Pacific time?

A Desktop!

I thoughtlessly told the configurator to update itself, but no ethernet was plugged in, so that hung. So I popped the power in and out and this time when it came up, it was in a graphical desktop!

The desktop after playing around a bit: terminal, Midori browser, debian doc open.

Fall Down Go Boom

I played with the desktop for a bit. Impressive that the Pi had instantly found the LAN and the browser could access the web without problem. I started apt-get update to update the database of installed software, and after a bit, everything hung solid. The mouse pointer still tracked but nothing responded to it.

So after a few minutes I popped the power plug out and in and when it booted now, it said PANIC.

Oh dear oh dear oh dear...

One More Time Unto the SD Card

I put the SD card in my Macbook and reformatted it and copied the image to it again. Checked that the Pi would boot and started through the configuration screens again.

After setting the timezone, there was a long pause. Then a series of file-system messages about inodes, including "This should not happen!" and "Data will be lost" and other stuff. Not helpful messages. In no way suggestive of what to do or how to recover.

Oh dear, some more. The Life Of Pi is finished, it seems.

And then it didn't respond to anything.

Anyone want a Pi?

I conclude that the Raspberry Pi is indeed a Linux platform of amazingly small dimensions. Loaded up with dedicated device-control software it can no doubt do yoeman duty as a lump of embedded smarts. People are doing amazing things with it.

However it is not a toy. It ain't for kids, at least, for kids who aren't ready to type sudo apt-get update without thinking about it. It needs constant hand-holding by an experienced user of command-lines, and that user better have a lot of patience. The software, combined with the iffy hardware qualities of SD card mass storage, is just not reliable. Or at least, this one example was not. The user experience, even for a very knowledgeable techie, is full of frustration. For a non-nerd, it would be hopeless.