Tuesday, November 6, 2012

Fun Things Still Happen

At the end of last week I came across the Raspberry Pi project. The Raspberry Pi Foundation developed this little device to encourage people to learn to tinker with computing, both in software and hardware. The exciting bit from a hardware point of view is that the board has 26 GPIO pins. ( Pins that can be programmed to do stuff. ). The boards cost around $35.

The foundation is supporting Python as the official educational language. It looked like too much fun to be left to Python to me, so I did some preliminary investigation about support for Perl. If this thing turns out to be popular it would be nice if educational users were exposed to Perl on it.

The first thing to check was that programming the GPIO is possible in Perl and sure enough , Device::BCM2835 is available on CPAN.

The board is an ARM based device with 512mb of RAM using SD cards for storage. But how can I have a play before actually purchasing a board?

The Raspberry Pi foundation provides a 2gb disk image of 'Raspbian' - a Debian - Wheezy based Linux distribution compiled for the Raspberry Pi. The idea is that you download the image and write it to an SD card. The Raspberry Pi supports a 32GB SD card so I would guess that in practice you would write the image to that and resize the partitions to take up the additional space.

I wanted to find out if I could run Raspbian in a Qemu emulated ARM environment on Windows to do some initial playing around with. It turns out that you can. Some Googling and use of virtual disk tools on Linux got me a 32GB Raspbian image that I can load as the root partition of a Qemu ARM environment on Windows with 256mb of RAM. As the memory of a real 512mb Raspberry Pi doesn't all go to the ARM processor, this environment seems a reasonable emulation for some initial playing.

This is screenshot of the Wx::Demo for wxPerl running in my Raspbian on Qemu.

So now I await delivery of a board whilst dreaming about what to do via those GPIO pins. ( in Perl, of course )


  1. Great... Happy hacking. And thanks for the information.

    Any chance you can list the link for the Raspbian image?

    1. I posted a 'howto' on the blog which should give all the info / downloads necessary for the basic setup.

  2. Don't forget to join hardware.pm http://hardware.pm.org/ if this sort of thing interests you :-)