Gadgets Geekery Raspberry Pi

Raspberry Pi as an adblock server for iPad, iPhone, Android and anything else on your network

Adblocker without Jailbreak:

On my computer I find using Adblock plus a handy way to speed up surfing and hide invasive pop-up ads.

Annoyingly you can’t install Adblock on an iPad without jailbreaking it – and I’ve yet to come across a way of installing it on Android devices easily without requiring root access.

Fortunately there’s an easy way to install Privoxy on a Raspberry Pi that can block adverts (and do a few other things as well) and that works seamlessly on iOS and more or less anything you attach to your network.

You could run this software on any PC attached to your network – but with the Pi’s low power consumption  (3.5 watts) you can afford to leave it on all the time. Plus you could combine this functionality with a fileserver or an airplay speaker for a bit of extra usefulness.

Setting up your Raspberry Pi for remote control by iPad

Raspberry Pi running as an Adblock for iOS
Nice conversation piece for geeky dinner parties

First step is to prepare an SD card for your Pi – I’ve been using the default Raspbian.

Next step is to boot up the Pi with a screen and keyboard attached, and connected to your home network with an Ethernet cable. This would also work with a wireless connection, but ethernet is a bit simpler, more stable and means the Pi will run happily off a low powered USB adapter (e.g. a kindle power supply). On it’s first boot the Pi will run the config app – if you’ve already run your Pi before you can restart the config app by typing the following into the console:

sudo raspi-config

Make sure you change the default Pi password, and enable SSH in the menu. We’ll be using SSH to control the Pi remotely.

Now find your Pi’s IP address – in the terminal type:


This will give you some information about how the Pi is connecting to the network – make a note of the inet addr – usually 192.168.1.number (I’ll use this notation to refer to this value in the guide)

Next you can connect to your Pi using an SSH client – I’ve been using Remoter Fusion on the iPad (other SSH apps are available but I was using Remoter for something else) note that you will need to purchase SSH support in app which adds £5 to it’s price.

To connect to your Raspberry Pi with Remoter Fusion, click on discovery list -> Add Session Manually. On the Server Type choose SSH.

In the box that says SSH Hostname enter your Pi’s IP address which you found out above:  192.168.1.number then choose Manual – leave the SSH Port setting at 22 and in SSH Username enter your Pi username and SSH Password your Pi password.

Remoter Fusion iPad with Raspberry Pi
Remoter Fusion

Then connect – you might get a warning message (just accept) and then you should be seeing the Linux prompt.

Now you need to change your Pi from having a dynamic IP address (given to it by the router every time it reboots) to a static IP address which will stay the same. In the prompt type:

cd /etc/network
sudo nano interfaces

this launches nano which is a basic text editor – the following settings will depend on your Router – most routers will have a configuration page which will give you this information if you visit their configuration page – usually found on your network by typing into a browser. The following settings worked for the BT Homehub version 3.

auto eth0
iface eth0 inet static
address 192.168.1.number

Press control and O and then enter to save, followed by control and X to exit.

You might want to test your settings – either by using the Ping command, or by attaching a monitor / keyboard / mouse directly to the Pi and firing up the web-browser – the Pi should be able to connect to the internet.

Installing Privoxy on your Raspberry Pi

Finally we just need to install Privoxy – with the nice simple:

sudo apt-get install privoxy

then start Privoxy

sudo /etc/init.d/privoxy start

Then you’ll need to setup Privoxy by editing the configuration file –

sudo nano /etc/privoxy/config

This is a long file with lots of options – scroll or do a search with control W and find the listen-address line. Change it to 192.168.1.number:8118

Control O to save in nano then control X to exit.

Restart Privoxy with:

sudo /etc/init.d/privoxy restart

Now on your iPad go to settings -> Wi-Fi -> your network name and then scroll to the HTTP proxy options. Choose Manual and where it says Server type your Pi’s IP address: 192.168.1.number and where it says port type 8118.

Finally go to and if it’s all working correctly you should see an enabled message.

Straight out of the box Privoxy started blocking ads for me – you can edit the exact way it does this in the configuration files. So websites like this:

Lots of Adverts
Lots of Adverts

Become websites like this:

After Adblock on iOS
Less adverts. Still rubbish.

You can take this a bit further by turning your Pi into a personal VPN for secure browsing on the go with this Lifehacker tutorial.

Probably an overkill using a Pi for this, but it is handy being able to work on the Pi using an iPad and as I mentioned before there are a few other useful things your Pi could be doing at the same time.

Arduino Gadgets Geekery Raspberry Pi

Raspberry Pi + Arduino + 8×8 LED Matrix + Python = Raspberry Pi LED display

The other week at work we launched a petition to support lifesaving Aid using a Jumbotron display, so I’ve been inspired to have a go at building a (very) mini version using my Raspberry Pi and an Arduino.

This is a handy way of getting your Pi to display information from any Python app you may have written – so you could use it to make a new email notifier, flash up messages from twitter, or if you’re using your Pi as a server without a monitor – status update messages. I’m interested in using it as a ‘now playing’ message board for an email controlled spotify jukebox I’m working on (more updates to follow).

There are lots of ways you could achieve this – it’s certainly possible to drive LED displays directly from the Raspberry Pi GPIO pins, but this is method is easy to do as it uses off the shelf kits, provides a bit of soldering practice, and an opportunity to learn a bit about Arduinos, Python and serial communications. As with a lot of Arduino projects once you’ve got the hand of how things work you could easily build a cheaper version using only the parts you need. Plus these are my first steps getting an Arduino to do something more interesting than flash a single LED on and off.

I’ve been using a standard Arduino Uno which is available for around £20, and the LED Matrix Shield v.1 from Ciseco which is £5 – this is a Arduino add on board that sits on top of the Arduino. The Matrix shield is fun to put together and good for practising soldering, as a lot of the parts aren’t particularly heat sensitive.

Setting up the Arduino

The instructions that come with the Matix shield are a bit basic – for a much better step by step how to check out this tutorial which I found in the forums.

LED matrix shield Ciseco
LED matrix shield sat on top of an Arduino Duo

Next step is to prepare the Arduino with the code you need it to run. Unlike the Nerdkit microcontroller I mentioned in a previous post the Arduino has a nice user friendly graphical front end – the downside to this is that it runs quite slowly on the Raspberry Pi. I used my Mac to upload the code to the Arduino – just remember to connect it directly to the USB ports on your Mac and not via a USB hub.

First you’ll need to add frequencytimer.h to your Arduino Library – there are instructions on how to install libraries here and you can download frequency timer here.

Then you’ll need to download 8x8LEDMatrix written by Andy Lindsay who has all sorts of other interesting Arduino / Pi stuff on his blog.

The script includes a 5×7 font file which you can experiment with to get the display to show different characters. Compile and upload this to your Arduino to check that everything’s working properly.

Now you’ll need to modify Andy’s code to send the text you want your Arduino to display over the serial port. Using a tilda character clears the script (although I discovered you don’t actually need this as the Pi resets the Arduino when it communicates with it on the serial port)

 * Show messages on an 8x8 led matrix,
 * scrolling from right to left.
 * Uses FrequencyTimer2 library to
 * constantly run an interrupt routine
 * at a specified frequency. This
 * refreshes the display without the
 * main loop having to do anything.

#include "font5x7.h"

#define DELAY 80

int incomingByte = 0;   // for incoming serial data
String incomingString; // for the incomming serial data string
char message[] = ""; // define the message

byte col = 0;
byte leds[8][8];

// pin[xx] on led matrix connected to nn on Arduino (-1 is dummy to make array start at pos 1)
int pins[17]= {
  -1, 17, 8, 7, 19, 9, 13, 4, 10, 6, 5, 18, 3, 2, 11, 12, 16};

// col[xx] of leds = pin yy on led matrix
int cols[8] = {
  pins[13], pins[3], pins[4], pins[10], pins[06], pins[11], pins[15], pins[16]};

int rows[8] = {
  pins[9], pins[14], pins[8], pins[12], pins[1], pins[7], pins[2], pins[5]};

void setup() {

  // sets the pins as output
  for (int i = 1; i  0) {

                // read the incoming byte:
                char incomingByte = (char);

                incomingString += incomingByte;

                if (incomingByte == '~') {
                  // using a tilda ~ clears the string

                incomingString = "";


                // check string for command variables

                incomingString.toCharArray(message, 160);


  scrollMsg( message );


void clearLeds() {
  // Clear display array
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      leds[i][j] = 0;

void setChar(char ch) {

  for (int i = 0; i < 5; i++) {
    unsigned char bt = pgm_read_byte(&amp;amp;amp;(smallFont [(ch-32)*5 + i] ));
    for (int j = 0; j < 8; j++) {
      leds[j][i+1] = (bt &amp;amp;amp; 0x01);
      bt = bt >> 1;

void slideChar(char ch, int del) {
  for (int l = 0; l < 5; l++) {
    for (int i = 0; i < 7; i++) {
      for (int j = 0; j < 8; j++) {
        leds[j][i] = leds[j][i+1];
    unsigned char bt = pgm_read_byte(&amp;amp;amp;(smallFont [(ch-32)*5 + l] ));
    for (int j = 0; j < 8; j++) {
      leds[j][7] = (bt &amp;amp;amp; 0x01);
      bt = bt >> 1;

  for (int i = 0; i < 7; i++) {
    for (int j = 0; j < 8; j++) {
      leds[j][i] = leds[j][i+1];

  for (int j = 0; j < 8; j++) {
    leds[j][7] = 0;

// Interrupt routine
void display() {
  digitalWrite(cols[col], LOW);  // Turn whole previous column off
  if (col == 8) {
    col = 0;
  for (int row = 0; row < 8; row++) {
    //    if (leds[col][7 - row] == 1) {
    if (leds[col][ row] == 1) {
      digitalWrite(rows[row], LOW);  // Turn on this led
    else {
      digitalWrite(rows[row], HIGH); // Turn off this led
  digitalWrite(cols[col], HIGH); // Turn whole column on at once (for equal lighting times)

Once you’ve uploaded this you can test its working properly by clicking on the serial monitor icon (the magnifier glass on the right hand side) and typing some text – if everything is working OK you’ll see the text appear on your Arduino’s matrix display.

Arduino software
Click on the magnifier icon on the right hand side

Setting up the Raspberry Pi

Now you need to connect the Arduino to the Pi. I’ve used one of the Pi’s USB ports rather than via a USB hub – you could also use the serial pin on the GPIO port to do this as well. Make sure the Arduino is connected before you power up the Raspberry Pi.

You can test the Pi -> Arduino control with minicom (thankyou

Install minicom on the pi via the console:

sudo apt-get install minicom

then run minicom and connect it to the Arduino:

minicom -b 9600 -o -D /dev/ttyAMA0

Hopefully everything you type into the console will be appearing on the Arduino Matrix.

Next is to get Python to send data to the Arduino over the serial port. Install the python serial libraries:

sudo apt-get install python-serial

Now you’re ready to write some Python code to control the Arduino’s LED display. I’ve been using the IDLE app on the Raspberry Pi. The following code is a super simple python script that can send some text to the LED Matrix:

import time
import serial

#configure the serial connection

ser = serial.Serial("/dev/ttyACM0",9600)

# add some time delays to stop the Arduino resetting




ser.write("Raspberry Pi")

Hit f5 and you should see this:

Arduino LED MAtrix Shield v1.0 IOT Research 2012
Bingo! or whatever you want it to say…

And that’s it – you now have a neat way of controlling an LED display with Python. The LED display always shows the last message it received until it gets a new one.

Update: Cisco – the company who made the lovely shield kit, are now doing a kickstarter for a Pi version with a lot more red or white LEDs that plugs directly into the GPIO. 

Gadgets Geekery

Mk802 Android 4.0 PC + Motorola lapdock = Android Laptop

I’ve written before about the usefulness of the (now sadly discontinued) Motorola Lapdock as a screen and keyboard/touchpad interface for the Raspberry Pi.

This week I’ve been playing with the Mk802 Android 4.0 PC – which is an ultra cheap A10 Arm powered computer on a stick, and have discovered it works nicely with the lapdock to make a portable Android laptop. You can pick up one of these versatile sticks for about £40 available from amazon or ebay, although you might need to hunt around for the lapdock as they’re now increasing in price (I was lucky to get one for £50 – I’d suggest ebay or looking for one with a non-english keyboard).

The Android 4 PC came with a US 5v power adapter but there’s no need to use it – you can power the mini PC via the mini USB port on the side – presumably if you want to use this with a TV which has a powered USB port you can use the same method.

I used the cable adapter I originally put together for my Raspberry Pi – this converts the micro HDMI on the lapdock to normal HDMI (the android stick has a mini HDMI in so an additional adapter was required) and splits the lapdock micro USB to USB power-only and USB data-only cables. For added convenience there’s a power switch to click the Mini PC on and off – which is handy as the lack of a power switch is one of the Mini PC’s criticisms.

Mini MK802 Android 4 Mini PC fitted to a motorola lapdock convertor
Slightly unwieldy as the adapter was designed for a Raspberry Pi

The setup above is slightly unwieldy as I built the original adapter to fit the Raspberry Pi, but the Mini PC stick itself is very small and light so it doesn’t but a lot of strain on the connectors on the dock itself. There’s a wiring diagram on my original blog post along with a list of parts. It would be quite easy to lighten the assembly above with thinner cables – I kept the original USB female connector to make the adapter more versatile.

All together the resulting Android 4 tablet isn’t bad:

Android 4 mini PC Laptop
Most of the time the wires are hidden round the back

The lapdock’s keyboard is recognised – keys like function-home work and I’ve not encountered any mapping errors. You can also adjust the volume with the keyboard hot keys. The only drawbacks I can see is that all sound comes through the speakers – the lapdock lacks a headphone out socket –  and the overscan adjustment doesn’t quite work – there’s a narrow black border around the screen, although fullscreen video playback works right up to the edges.

The android laptop works well with most of the apps I’ve run with it – the play store is installed by default although google reports it as an ‘unrecognised device’. Some 3d apps don’t work and I imagine other more complicated apps might struggle with the single core 1.5ghz processor – but it does run angry birds.

It is also possible to hack the android mini pc to run other operating systems like Ubuntu – and to upgrade it to android 4 jelly bean, as well as adding support for bluetooth which might solve the headphones issue. It’s not going to replace my Raspberry Pi as an experimental mini PC any time soon, but as a handy web-browser and media player that I can chuck in a bag it’s quite handy.

Update: works with Windows 8 tablets too

I’ve tested the ever-useful Motorola lapdock with a Toshiba encore tablet – connected with a micro USB male to micro USB female cable, and a micro HDMI male to Female cable. The lapdock is recognised, every key works, and I can extend the desktop across both screens.

Gadgets Geekery

MaKey MaKey + Moleskine notebook + Graphite pencil = sketchy controller

As part of my ongoing kickstarter addiction I’ve recently acquired a MaKey MaKey – a sort of universal keyboard adapter gadget based on an Arduino-type microcontroller, that lets you turn virtually anything that conducts electricity into a USB keyboard or mouse.

MaKey MaKey board
It even lights up when you plug it in..

The board comes supplied with a pack of crocodile clips and a nice long USB cable – on the MaKey MaKey website there’s a list of ideas to try (apparently bananas work well as a piano). All you have to do is find something suitably conductive, connect them up with the clips, and away you go.

The simplest interaction is creating a space bar input – this Olympic hurdle game from the ONE Campaign works well as something to try.

I’ve done a bit of experimenting to see what conducts with the aim of making controller doodles in my moleskine notebook. Conductive paint from these guys works – interestingly metalic effect paint and ink doesn’t work (I suspect as the metal is in a suspension).

The easiest and most sketchable I’ve found is using a big chunky graphite pencil like this one KOH-I-NOOR Jumbo Woodless Graphite Pencil 6B available from amazon for a couple of quid:

image of moleskine jump button and MaKey MaKey
hitting the gap between the U and the M creates a space bar press

You have to press quite hard with the pencil to get a good circuit – shorting the gap between the U and the M with your finger is enough to register as a space bar press:

Playing the race against hunger game with a MaKey MaKey
Ignore my score, it’s hard to hit jump and hold a camera at the same time..

So there you are – a sketchable, moleskine portable control interface! (even if it does get a bit smudgy after extended play).

Check out the ONE Campaign race against hunger game here.

Family Gadgets

Video from the Dad-lab

Well my Dad’s been busy – I build him a blog for his birthday, and then he’s on the email asking me about online video.

Here’s his first foray, the shake-n-sieve mk2 (I really want to see what happened to the mk1!)

Gadgets Geekery Random Raspberry Pi

Raspberry Pi wi-fi cheat

Or ‘how to stop worrying and love WiFi’ or how to get WiFi if nothing else works – read on:

I’m calling this a Wi-Fi cheat – with the Raspberry Pi – Motorola lapdock combination I’ve been having problems getting the Edimax micro wireless adapter to work. I think it’s a power issue – the adapter gets quite hot when plugged into the USB ports on the lapdock, and I get a lot of errors on bootup – so here’s a solution:

vonets Wi-Fi bridge

It’s a Vonets VAP11G WIFI Bridge – powered off the USB on the lapdock it works fine. It doesn’t support n wireless, just b and g but it is quick enough for iplayer, most normal software installation and web surfing. I’ve had no problems getting online with my BT homehub. It’s bulkier than most of the cheap WiFi dongles available and at about £17 a little bit more expensive, but once set up it provides a portable ethernet connection to more or less anything you plug it into.

It’s handy having something to use around the home – particularly for Linux distributions where setting up WiFi is a bit complicated, or for operating systems that don’t support WiFi yet like Risc OS.  The newest release of Raspian has addressed a lot of these issues though so I’d recommend trying that first and using this as a last resort.

The bridge itself is configured through a windows app available from the Vonets site, so you’ll need a PC on hand to switch access points, and the software isn’t available for Mac or Linux.

Edit: TheSov on Reddit has suggested this: Asus WL-330N 5-in-1 150Mbps Wireless Mobile Router which is much better (supports n and has web based configuration), but twice as expensive.

Update: there is a python app for configuring the wifi bridge available here.

Gadgets Raspberry Pi

Raspberry Pi + ModMyPi case + Motorola Atrix Lapdock = Raspberry Pi Laptop

Much has already been written about using the Motorola Atrix Lapdock (essentially a portable HDMI monitor with a built in powered USB keyboard, trackpad and hub) coupled together with a Raspberry Pi. The Pi being powered by a micro USB makes it a suitable candidate for using it as a low powered portable computer.

You can still pick up a Motorola Atrix Lapdock for a lot less than it’s original £300 or so selling price, although I’ve noticed that prices have started to creep up – expect to pay between £60-£80 for one. There is a newer Motorola Razr Lapdock available which I believe uses the same ports, so hopefully these very useful devices will continue to be produced and supported in the future.

This week my ModMyPi case finally arrived – it’s an injection moulded click together case which is beautifully made –

ModmyPi case

I have already hacked together a cable to connect the lapdock and pi together – but I wanted to make a more portable and neater version. Plus using an HDMI micro adapter would provide a mount to hold the Pi in place, in the same way that a phone would be docked:

Here's the pi laptop mount

The lapdock provides a USB micro male, and HDMI micro male connector (note – micro not mini!). The USB provides power and data over 4 wires, and the HDMI video and sound. To marry this to your Pi you’ll need to take the power connection to a male micro USB plug, and data to a male USB plug. Most people who’ve done this modification have also broken the power connection to the data plug as a precaution. In my version, I’ve included a power switch to make it easy to turn the Pi on and off – opening the lid of the Lapdock also cycles the power. Obviously this is all entirely at your own risk.

Here’s my wiring diagram:

Wiring diagram

To do this you’ll need in addition to the Lapdock:

Edit: I’ve noticed that some of the items are listed as being out of stock – the crucial thing to search for is HDMI micro female and micro USB female to get the connectors you need  for the lapdock.

  • A micro HDMI female to HDMI male adapter / MicroHDMI = HDMI “D type” (also available on ebay)
  • Optional: this HDMI adapter pack came in useful as well
  • A micro USB female to male adapter (these are surprisingly difficult to find – ebay is often your friend here)
  • A regular USB female to Male cable (or you could use a micro USB male to USB male cable – I wanted the flexibility to use different lengths of cable)
  • A switch (Maplin or ebay) two or three pin on / off – just not momentary.
  • Something to use as a wiring box – the HDMI adapter holds the Pi in place quite nicely, so you could just wrap a bit of insulation tape round everything. I made a box out of a plastic screwdriver holder that came from poundland)
  • A wire stripper – these ‘automatic’ wire-strippers work well
  • Soldering iron and solder (soldering isn’t too hard, but a lot of people are put off by the idea of it – a bulkier but soldering iron free alternative would be to use terminal blocks)
  • Craft knife
  • Epoxy glue or (better) some Sugru to hold everything together

First off you need to get the two micro adapters to fit together – check with the lapdock and carefully trim away the surrounding plastic until they both fit together. Then glue the two adapters together, whilst they’re plugged into the lapdock. Be very careful not to glue them to the lapdock itself. Then expose the wires from the micro USB adapter – you might have to trim into the plug itself to do this. USB cables consist of red, black, white and green cables sometimes with a metal sleeve around them – you can cut the sleeve away and discard it. Be careful not to go through any of the wires themselves.

Here’s the underside of the adapter – showing the two trimmed plugs side by side, glued together with epoxy Edit: I’ve now used Sugru to hold this together – the wires from the USB adapter on the left feed into the box where all the connections are made:

underside of the adapter

Then cut your usb cable in half and expose the individual wires. Strip the ends of all your wires together. Then solder them together as per the diagram above. The power USB cable needs red and black connected – the data USB cable needs white, green and black connected. Put the switch on the red wire between the lapdock and USB power cable.

Once everything is soldered together, you can give it a quick test by plugging in the Pi to the lapdock. If everything goes ok, once the lid is open and you can boot and test the keyboard. If it doesn’t work, check the connections and that the HDMI adapter is fully plugged in.

The final result is the Pi sitting on the lapdock behind the screen.

For extra neatness you could always mount the switch on the case itself and route all the cables internally, but there you go – a practical portable Pi Laptop you could just chuck in a bag and take with you, and that doesn’t alter the lapdock in any way.

Raspberry Pi Laptop

Thanks to Chipmonger on the Pi forums for the source of the cables and Arc Software for the wiring diagram.

Update: a few tweaks

After a few weeks of use I had a few connection issues with the wires inside the adapter and the quality of the epoxy – so I resealed the unit with some Sugru self-setting moldable rubber and resoldered the connections – the Sugru also helps to avoid the potential of short circuits.

I’ve also swapped the modmypi case for the more colourful Pibow case – this is a little bit larger than the modmypi case so I needed to use a right angle HDMI adapter to get it to fit. The Pi now sits at an angle between the lapdock and the desk – thus:

Lapdock with Pibow

And finally I’ve added a Edimax EW-7711UAN USB wifi adapter (with lovely antenna) which now works out of the box with the latest (September 2012) version of Raspbian.

Updated update:

Yes this works with a Pi Zero – you can easily power the Pi and connect the keyboard and pointer using the USB rather than Power / USB port on the zero.

Gadgets Geekery Raspberry Pi

Control your Mac with a sonic screwdriver

I recently got very excited about the news that a company is working on a Dr Who Sonic Screwdriver remote control – a device that translates your over excited wavy gallifreyan gestures into channel changing activity on your tardis scanner or home television.

Hang on, I'll just bypass the door/system password/monster/macguffin

This got me thinking about possible ways to control a computer using a sonic, and how I might go about building an infra-red detector for my Raspberry Pi.

But it seems I don’t need to do this: there’s a cheaper and more versatile device already available –  a Sonic Screwdriver Wii-Remote (for about 7 quid) from amazon

To get this working on a Mac you just need to download a program called Darwiinremote

Switch on Bluetooth, click on discover device, and hey presto! you have a sonic controlled mac. You can map the device to any key or use it as a mouse. Powerpoint presentations will never be the same again. The only thing it’s missing is the sonic sound effect – although I have a broken sonic screwdriver which I’m going to have a look at to see if it can be a suitable donor. Next step is to try and get this working on a Raspberry Pi which could work nicely as an IR emitter for sonic controlled home / tardis automation.

Fortunately there are already a few bluetooth project related posts in the Raspberry Pi forums and IR control is possible already with the Arduino, so I’m quite optimistic. I’ll post results on here.

I have to remind myself that I’m 33 sometimes.

Gadgets Random Raspberry Pi

Dad-Tech: Wooden Raspberry Pi prototype board

This year for father’s day I bought my Dad a Raspberry Pi – as I was lucky enough to grow up in a house filled with computers,  it was nice to return the favour!

He’s working on a project to drive a solenoid-activated pipe organ using the GPIO pins on the Pi. To this end he’s started on a wooden Pi case and prototype board – since most breadboards come with a sticky-backed plastic mounting pad it’s nice to have something to mount them on, and keep everything tidy.

Here’s version 1:

Prototype Raspberry Pi development board

(I’m trying to encourage him to keep a blog of his progress!) 

And here’s the board varnished with the breadboard in position (and some very tidy cabling from the GPIO pins)

Raspberry pi development board with breadboard and some LEDs

 Ultimately these should be available to buy on ebay, he also makes excellent clocks.

Gadgets Geekery Raspberry Pi

Play Zork on the Raspberry Pi

If you’re looking for a bit of old-school text adventure nostalgia, you can play Zork (and many other classic text adventures) on the Raspberry Pi. Some of my earliest memories were of playing text adventure games on the clicky-clacky keyboard of the BBC Micro – in particular Twin Kingdom which featured early AI characters who would come and annoy you.

Zork was one of the original adventure games, written back in the 70s by a team who went on to form a company called Infocom, creator of numerous computer game hits of the 80s and 90s. It was an extension of the crystal cave adventure game, written for the colossal PDP10 computer.

Zork spawned numerous sequels, and arguably inspired a whole genre of ‘interactive fiction’. Today there are many interactive fiction titles you can download and play, and it’s even possible to create your own using the Inform programming language.

You can play Zork using a piece of software called Frotz – this is a ‘Z-Machine’  (the Z referring to Zork) which compiles and plays Z-code or story files. The beauty of the Z-machine approach is that the same story files can be played on almost any computer.

To get started you can download Zork 1-3 for free from the Infocom site here. Just download the zip files and extract them to a directory on your home folder.

And to play on the Raspberry Pi, enter the terminal and type:

sudo apt-get install frotz

To download Frotz, then once you’ve downloaded some inform files you can start them with the command:

frotz ZORK1.DAT

and that’s it!

Frotz is fairly self explanatory, you can save and restore game files, and use all the usual ‘look at mailbox’ ‘talk to dwarf’ ‘take key’ type commands.

Tip: if you’re using the X desktop you can navigate to the folder containing the Zork1.dat file by using the file manager and selecting open this folder in the terminal from the menu. This saves typing the cd/long/directory/structure stuff.

If you get stuck there’s a map of the Zork empire from 1979 here.

Next step is to create a Raspberry Pi text adventure game, perhaps along the lines of ‘Waiting for Pi?’