Categories
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.

Categories
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?’

Categories
Gadgets Geekery Raspberry Pi

Raspberry pi XBMC media server (nearly)

One of the exciting possibilities of the Raspberry Pi is using it as a media server – potentially providing a cheap as chips way of watching online video at home (for almost the same cost as a PS3 game) or serving as a cost effective video booth for displaying content. I suspect this is one of the factors that lead to the excitement of the Raspberry Pi’s launch and the 600,000 or so pre-orders.

Raspbmc running on my lego pi
Raspbmc running on my lego pi

I’ve used XBMC before on low-end systems – it works quite well on the (now ancient) Asus EEEpc 701 and I originally installed it on an old Xbox 1 – which soon became it’s most used feature. 

I’ve recently been playing with a version of XBMC for the Pi called Raspbmc created and maintained by Sam Nazarko, an 18 year old student from London, and it’s impressive. I’ve been able to play 720p video from YouTube and Vimeo smoothly. So I thought i’d post up some instructions in case anyone wants to give it a try.

For starters I’m using a Mac as my main PC, and my Raspberry Pi is connected to a Samsung TV via a HDMI to DVI adapter. The following worked for me!

I’ve been using a Samsung 8 GB class 6 card from Amazon which seems to work fine.

First was to download the Raspbmc installer – once you get this up and running it connects to the internet and installs Raspbmc. As I’m on a Mac I modified the Raspiwrite script to include a link to the installer. If you open the python script you can either rename one of the existing links or add it as an option. You can use my edit of the Raspiwrite script here (right click and save). 

Raspiwrite is easy to use – make sure you have a blank SD card mounted on your desktop then open the terminal in your mac and type cd – then drag and drop the folder that contains your copy of Raspiwrite onto the terminal – this saves you having to write the full path (just make sure there’s a space after cd).

Then type sudo python raspiwrite.py – it’ll ask you for a password and start the script which guides you through the process. It will take a while to write to the card, so be patient. Go and have a cup of tea, or try baking some cookies.

Once it’s finished writing, you might need to add a config.txt file to the card. I had to use this to get my display working – so for reference if you’re using a Samsung SyncMaster 940MW LCD TV monitor with a HDMI to DVI adapter made by Nikkai the code you need is:

disable_overscan=1
config_hdmi_boost=4

(if you don’t have any display issues you can ignore this bit – if your display blanks after booting it’s worth checking out the threads on the config.txt file on the Raspberry Pi forums)

Then you can put the card in the Pi – either you’ll see the installer or you’ll get a command prompt. You can login to this using root and root, after which you’ll need to use shutdown -h now to shut the system down and reboot.

I think I saw this step as my Pi connects to the internet through network sharing on the ethernet on my mac – when I encounter issues with this, stopping and restarting internet sharing usually works to fix it. When I did this step I found it worked ok for me and booted into the installer – which I was able to leave to do it’s own thing, and then hey presto! Raspbmc is up and running.

It works well – some of the menu transitions are a little bit slow but video plays smoothly at 720p (which is as much as my monitor can handle). I got sound up and running by changing the settings to analog output.

Pretty HD videos to try from youtube are First Orbit which re-creates Uri Gagarin’s flight around the earth, the trailer from BBC’s Planet Earth or on Vimeo the quirky Plan of the City.

You can donate to the Raspbmc project here.

Update: there’s now a new version of the installer script which includes scripts for mac and windows – making these instructions redundant. I have got the iplayer plugin working so i’ll post up instructions on how to do that shortly.

Categories
Random

EU opt-in cookies

Here’s a recipe for EU opt-in cookies

EU opt-in cookies
EU opt-in cookies. Yummy.

You can control the level of gooey-ness by altering the amount of condensed milk. You might also need to bake for a bit longer than 20 minutes as the blueberries make it a bit soggy (and I got carried away as I love blueberries).

I wasn’t able to find any blue food colouring that wasn’t nastily artificial, and my attempts with yellow and purple ended up looking like weird alien food from a mid seventies episode of Dr Who. Still tasted good though.

Categories
Gadgets Geekery Random Raspberry Pi

Geeking out with a Raspberry Pi lego case

I like Lego, and I like miniature ARM based low cost PCs, so I’ve combined both with a Lego Raspberry Pi case:

Lego Raspberry Pi Case
Version 2 – slightly taller

I wanted to mount the Pi vertically to show off the intricately beautiful circuit board (and possibly to take up less space, but this thing is tiny!) and I’ve used window bricks that line up with the Pi logo. For my first attempts I tried designing a case using the lego designer – but beware, many of the bricks aren’t available from the pick-a-brick store. I’ve had to use 1×1 tiles stacked in groups of 3 to make the corners, and 2×1 tiles for the top.

This case is 4 bricks wide as the GPIO pins stick out slightly too far to fit with 2 bricks wide. Windows and arch bricks form the holes for the various plugs, with the USB and Ethernet cables emerging from the top. I’ve used the mini USB power supply from Amazon Kindle combined with a remote controlled socket for power.

The latest version has the coloured bricks at the bottom, and more clear bricks at the top to refract the light from the various power / activity indicators. It also stands a little bit taller to allow for the USB mini power plug and a grip to hold the Pi motherboard in place.

Total cost is about £30, but I do have plenty of bricks left over for other Lego projects…

I’ve now recreated the Raspberry Lego design in the Lego digital designer:

RaspberryLego case
It’s a raspberry pi case in Lego

 

I’ve coloured the bricks on the model above since they were easier to see than transparent bricks. Inside the case there’s a little c-shaped hook that the Raspberry Pi sits in. I was able to find all the bricks with the colour-scheme as used in the transparent version of the model in the pick-a-brick store.

Download the lego designer files.

If you’re building this, you need a Pi to hand to check the alignment of the ports – I have fully tested this with a Pi, but you need to build the Lego around it or it’ll get a bit fiddly.

Categories
Activism Random

My Dad does some e-campaigning!

See the below from my Dad:

Dear All
I was shocked when I took a small amount of lead tubing  to our local scrapyard last week.
The metal fetched £2.50 / Kg now and I came away with over £60 in cash.
I was shocked that it is so easy to get cash – just a name and address and vehicle registration number.
They didn’t check that the vehicle number I gave was correct, let alone look it up on the national database.
Would you consider signing the ePetition that seeks to force a change in the rules, please?

It is a government website and quite safe:

http://epetitions.direct.gov.uk/petitions/406

Yours sincerely

Stephen Taylor

They’re at about 25,000 signatures – reforming the legislation is a relatively easy thing for ministers to do, and it’s particularly upsetting when things like this are stolen for a few quid (about 0.05% of it’s actual value). Plus it would be nice to see an epetition succeed that’s not a Daily Mail repatriation / anti-europe / king canute type subject.

Categories
Gadgets Random

Very old school photography

Film photography is slow, expensive, limited and prone to mistakes, errors and fogged film. However it’s also a rather joyful experience with random surprises thrown in from time to time. Being able to take only 10 or 11 precious shots at a time and then having to wait ages to get your photos back makes a contrast to the instant gratification of taking thousands of digital pictures.

Although I love the ease of digital photography I miss the magical moment of watching the perfect image appear on a print in the dark-room developer tray, often after many failed attempts.

Recently I picked up an old Kodak brownie camera in a junk shop – it was a “Number 2 Cartridge Hawk-Eye Model b” – proof that the practice of giving your product an impressive complicated sounding technical name is not a new one. It’s a very basic camera, consisting of a leather covered cardboard box with a mechanical shutter and a single element meniscus lens, which is inside the camera (giving it a confusing look of having lost it’s lens). It dates from  between 1926 – 1933 and takes 120 roll film – still available from the Lomography people and ebay.

The tradition of giving budget gadgets impressive sounding names is an old one
The tradition of giving budget gadgets impressive sounding names is an old one

Once I’d worked out how to get it open (you rotate and  pull out the film winder and then release the 2 fastener hooks) I thought I’d have a go at taking some pictures. Since the safe light window on the back of the camera was showing it’s age and was a faded orange I covered it up with a blu-tacked penny. After a bit of experimentation with a roll of paper I was able to work out how much to wind the film on – for reference 4 turns of the winder are enough to load the film, and 2 turns to advance to the next frame. The camera has a shutter speed of 1/30 second. I’ve no idea of the aperture, although the rotating shutter has a fairly small hole. The mechanism is similar to that found in the Lomo Holga.

Next step was to get some pictures developed. I initially opted for develop only from the lomo store, as I wasn’t entirely sure if I’d see anything back. My first film only had a few photographs on it as I hadn’t then worked out the proper winding / picture ratio.

To get the negatives into the computer I built a shoebox slide copier.

Attempt 1:

A tree
A tree

Well it works. I’m not sure of the shoe-box photo method for colour negatives, although the ghost like quality of the images presents an interesting creative opportunity.

Anything closer than 6 feet from the camera is a bit blurry. Landscapes came out better, although colour was quite interesting (the photos already look old) either as an artifact of the lens, or as a result of the film and processing.

I’ve dug out my old 120 black and white film stash and processing spirals to have a go with black and white.

Update: my old school photography got a mention on the BBC!  as part of an article about the sad demise of Kodak.

Categories
Gadgets Geekery Random

Hacking a cheap as chips camera

CHDK – the Canon Hack Development Kit is a very neat bit of software that allows you to add lots of new and exciting features to Canon compact cameras, and is something I’ve been wanting to try out for ages.

I’ve been on the lookout for a cheap as chips digital camera for a while now, with the purpose of using it for things like underwater photography / space program / CHDK hacking. I was able to buy a nice PowerShot A480 for about £30 on ebay (they’re about £100 new on Amazon). It’s small, light, and works off AA batteries – although is a bit fussy about what type of AA battery it takes (prefers NiMh). Imagine a box brownie type camera for the noughties – cheap and super simple to use.

The A480 has a ten megapixel sensor and was launched in 2009 – although newer cameras are now in the 14 megapixel+ range a lot of this is besides the point since lens quality starts to become a limiting factor. It even has a 3.3 zoom, although with a camera like this it’s generally easier to take a few steps forward. It’s still infinitely better than the camera in my mobile phone.

CHDK is a download that sits on the SD card in the camera – the software loads off the SD card when you switch the camera on. It sits fairly neatly alongside the existing camera firmware (you can still access all your normal menus), and if you switch to an SD card without CHDK your camera reverts to it’s default state.

There’s a really easy to follow guide on the CHDK website – the only hitch I encountered was having to use a loader script since I’m using a mac – other than that everything worked smoothly.

The difference it’s made to the camera is incredible – it can shoot in RAW format, and you have complete control over aperture, exposure, ISO and a whole load of more advanced things like colour balance and flash power. There’s a huge array of settings to discover and play around with, but for me the real killer feature is the scripts.

Accessed through  CHDK you load a script from the Scripting parameters -> load script from file menus, and then run the script by hitting the shutter button whilst the <alt> text is displayed. I did a bit of experimenting with the time lapse script and created the animation below.

This is the sort of movie camera functionality that I always dreamed of when I was little – back then the only option was cine film / video, and even with that it wasn’t really in the budget of a 10 year old. It’s a blurry first attempt, but I’m quite into creating doodles.

CHDK alone is a really good reason to invest in a simple Canon compact, and although the site comes with lots of disclaimers, as I’m sure it voids warranties / Canon will come and hunt you down etc etc it’s a fairly easy way to dip your toe into the world of hardware hacking. Long may it continue!

Categories
Social Media

Twitter’s not just for elections…

I’m often looking for ways to engage with my MP – usually online, since that’s how a lot of things are done in the 21st century (banking, paying bills, booking travel etc). However sometimes I get a little bit despondent about writing to elected representatives who then don’t respond.

Neither my last MP Vince Cable, or now (since I’ve moved to Kingston) Ed Davey seem to do the online thing, with not much response to email and no tweets since May 2010.

In fairness, both seem to blog quite a bit and I haven’t yet tested their response rate to a dead-tree format letter.

But this got me thinking – is twitter and social media truly a way for MPs to reach out and engage with their electorate? or is it just a handy tool for some publicity every 4 years when they want our votes.

It would be a shame if the latter were true, since it’s a relatively easy way to publish information, particularly to a younger audience.

So I’ve compiled a list of MPs who haven’t tweeted in the last 6 months (most haven’t since the last election), along with a count of their followers:

Twitter MP followers
@vincecable
22094
@Vaizeyculture
3863
@Mike_Fabricant
2639
@HazelBlearsMP
2522
@DavidWrightMP
2507
@VirendraSharma
2505
@AlanDuncan4MP
2494
@leighmp * – now moved to @andyburnhammp and updated!
2004
@markdurkan
1946
@KarenBuckMP
1780
@naomi_long
1766
@eddaveykands
1543
@gildernewmp
1518
@Linda_Riordan
1489
@acarmichaelmp
1462
@Moore4Borders
1443
@nicolablackwood
1328
@kwasikwarteng
1026
@JDjanogly
885
@DavidEDrew
823
@Michael_Ellis1
658
@rosie4westlancs
634
@AMcDonnellMP
616
@George4MVMP
562
@NickSmith4BG
516
@PhilipDavies422
507
@C4NWestminster
452
@MaryMacleod4MP
449
@StocktonNorth
378
@edwardleighac
76

With over 22 thousand followers Vince Cable is missing a trick. Perhaps he’s lost the password?

As always corrections and feedback most welcome.

Update – @leighMP is now @andyburnhammp which is regularly updated – thanks to @CollectorManiac for pointing that one out.

Updated update: check out more MP twitter information at tweetyourMP.com

Categories
Comment Random Work stuff

What the government got wrong with the new epetition system, and how they can fix it

Today the UK government launched an online e-petition system. You can sign up, create an online petition and if you get 100,000 signatures your campaign could get a debate in parliament.

How epetitions work (from government site)
How epetitions work (from government site)

There are a few provisos: the petition has to be approved (by the relevant department) and the petition can’t relate to appointments – presumably to avoid things like the ‘sack Gordon Brown’ petition which gained lots of names during the last government’s attempts at digital democracy. There are also a few rules about joke petitions, and the slightly catch all “the issue is not the responsibility of the government”.

As someone who does a lot of online campaigning, and has an interest in hacking together ideas for running online petitions, this is potentially really exciting.

But, there are a couple of issues:

  1. It’s a closed system.This is a massive issue. Charities and other organisations rely on online activism to recruit new members to their lists and encourage them to take a more active role in their campaigns (and yes, to fundraise from – but fundraising is activism too – see how the Obama campaign publicised it’s large number of donations as committed support).

    Take for instance a hypothetical example: a small campaigning organisation launches a campaign for the UK government to do something about a UK company supporting a dictator. The petition captures the public imagination, hundreds of thousands of people sign the petition. It has it’s day in parliament, but then the campaign moves out of the public eye. The small campaigning organisation can’t contact the petition signers to ask for help in moving the campaign forward.

     

    One of the big criticisms of online campaigning is that it’s low value ‘clicktavism‘, but if you have no way of capturing the details of the people who sign your petition, how can you get in touch with them and encourage them to be more involved, have tea with their MP and do some high-effort campaigning? Online petitions are often seen as the first step in engaging people with issues, and getting them more interested in politics.

    This leads me to think that a lot of campaigning organisations will ignore the system, and instead it will be used by the likes of the Sun to run campaigns like ‘Lets have the Red Arrows at the Olympics’.

    Worse still, it seems that newspapers like the Daily Mail are intent on using the petition system to launch campaigns like bringing back the death penalty. Given the current structure of the e-petition system it actually favours tabloid campaigns, since they have high circulations and don’t have to think about engaging in long term campaign work.

  2. It doesn’t tackle the big issue of how MPs respond to online campaigning.There is a massive variance in how MPs respond to being lobbied online. Some ignore email completely, others respond just to individual emails, and a few more respond to identical emails in the same way they would to letters. Recently a number of MPs have been very vocal in their opposition to online email petitions.

    Personally I believe that as our elected representatives, MPs have a duty to respond to their constituents, but at the same time appreciate that trawling through a lot of emails that are all the same might tax the resources of the average constituency office, and cause the kind of annoyance that can alienate MPs from otherwise worthy campaigns.

A proper online petition system would enable campaigners to do the things they need to do to work effectively, and at the same time give the politicians reasonable ways to gauge opinion and thus hopefully respond.

So how could it be done better?

  • Involve civil society: Involving the people who write the software that campaigning organisations use would be a good start. The e-petition system was written by a civil servant department bizarrely named ‘Skunkworks’ for £82,000.
  • Build out the e-petition system as an API – an ‘API’ allows other pieces of software to access a system – twitter uses this very effectively to allow all the tools like tweetdeck and hootsuite to send tweets. Organisations could feature the petitions on their websites and recruit activists to their own email and supporter databases at the same time.
  • Create a set of guidelines / protocols for lobbying MPs, ministers and departments and for people wanting to lobby them:

    It could be as simple as specifying something in the subject line of an email e.g. PETITION_mycampaigntitle for identical emails, and
    PERSONALQUERY_mycampaigntitle for individually-written emails. Or perhaps sending an MP a daily / weekly email informing them the number of constituents who have signed a particular petition, and inviting them to respond  (essentially taking over the task of managing the petition).

    This is a two way process: for it to work politicians would have to agree to respond if the ‘rules of engagement’ are met, and online campaigners would need to respect the rules.

  • Give campaign targets a platform to reply on – if it would encourage reluctant MPs to engage with online campaigning it would be worth offering the opportunity to put their views across.

In today’s modern world we carry out more and more of our daily activities online, banking, paying bills, buying insurance, shopping etc. It seems that providing the option to engage properly with politicians on the web is long overdue.

Thoughts? disagree with me completely? leave comments below!