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
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
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
Gadgets

Surfing with a Kindle: web mode, article mode and publishing for blogs compared

I recently did a bit of impulse gadget buying recently by getting hold one of the new third generation Kindles. Although the apple slate is very tempting, with an ipad 3g costing £589 I couldn’t quite justify the outlay, and as an avid book reader who has a habit of setting up numerous book groups the Kindle’s £149 price tag hits the sweet spot of a gadget I can buy and still pay the rent.

After playing around with the Kindle for a week I’ve come to the conclusion that it’s a brilliant ebook reader. The screen is uncannily like paper (even if it is grey paper rather than white). The black flash when refreshing isn’t as annoying as I thought it would be, and I don’t miss having a touchscreen, although sometimes the buttons feel a bit clunky. It’s a simple, if not super-fast machine to use. In some ways it reminds me of the minimalist word-processing applications that are available; by removing distractions like fonts, formatting, and that bloody paperclip, you can get on with the task of concentrating on your writing, or in this case reading.

What’s of particular interest is the bundled web browser software. With the 3g Kindle bundling in free web access you can surf wherever, whenever – even globally.  Amazon do downplay this feature, labelling it as experimental and sticking it in a menu away from the homepage, and it is a bit slow to put it mildly. The following is my previous post viewed on a Kindle in web mode:

Kimondo.co.uk viewed on a Kindle
Surfing the web, early 1990s style

But for a free ‘extra’ it’s not bad. Sites render properly and you can either choose the slow click and zoom option as above, or read a site in article mode:

Screenshot of kimondo.co.uk viewed in article mode on a Kindle
Surfing the web, early 1900s style

Article mode plays to the strengths of the Kindle as a ereader by removing a lot of the formatting and displaying text at a comfortable size. Amazon also offers a web blog subscription service where (for a fee) you can subscribe to a blog which has already been formatted neatly for the device – offering a way for Amazon to cover the costs of 3g and authors to make money. This service is only available with a US bank account so for the time being here’s a generated preview of publishing for blogs mode:

Screenshot of Kindle publishing for blogs preview
Surfing the web, 1890s style

There’s not much between article mode and publishing for blogs mode, although the latter may be the price we have to pay for free universal 3g access.

What’s also interesting about this is that it opens up the mobile web for a new generation of people who perhaps would have never considered it before.  Of the 68% of the people in the world with a phone, 17% have a smartphone of which 2% are iPhones –  yet mobile web design and optimisation is usually aimed at the these devices. I know personally several people who own a smartphone, but I also know many more who don’t own one and have no interest in getting one. Moreover, a Kindle doesn’t require that you own a computer at all; it’s a completely self reliant machine – thus opening up the web to previously unconnected people. Only time will tell if ereaders challenge mobile phones as kings of the mobile web.

NB you can take a screenshot on a Kindle with shift-alt-G, although Minesweeper is more fun with shift-alt-M.

Categories
Gadgets

How to turn the eeePC into a media centre (and get iplayer to work in fullscreen)

I must admit to being a bit of a fan for the Asus eeePC. I have a black 701 model which I impulse bought after the price hit £150, and i’ve found it to be a really superb machine.

Although the default Xandros boots up very quickly and is handy for checking emails on the fly, I eventually installed Ubuntu eee onto a removable SD card. It took me a while to work out how to get it to work, so I’ve added some instructions to the Ubuntu eee wiki to make the process easier.

I remember when I first got my eee one of my friends commented on using it to watch BBC’s iplayer – now one of the most popular ways to watch telly in the UK. However when I tried the video was very choppy – and only worked when not running in the full screen mode.

Initially I put this down to the eee’s fairly paltry celeron processor – at 600 mhz it’s fine for a simple bit of web surfing and word processing, but for anything more taxing it’s a bit underpowered, so I assumed that full screen video was beyond the reach of the eee. However after a bit of digging I found a discussion of Linux v Windows on the eee Forum here, which indicates that it a problem with the firefox / linux flash plugin. Rather than install Windows XP – which once i’d spent additional money on buying anti virus would be almost as much as I spent on the machine itself, I wanted to find an open source way of getting round the problem.

I’ve been running XBMC (X Box Media Centre) on my old modded xbox for some time now – hooked up to a telly it makes a handy way of watching DVDs, online media and networked media off a NAS drive. Given that XBMC works flawlessly off a machine with 64megs of ram and eeePC should be no problem.

So a visit to http://xbmc.org/ later and an install I got xbmc working – and it works really well.

Note that there are a few steps to go through rather than rely on Ubuntu’s built in add new software tool – you have to add the sources to the software sources control panel:

deb http://ppa.launchpad.net/team-xbmc-gutsy/ubuntu gutsy main

deb-src http://ppa.launchpad.net/team-xbmc-gutsy/ubuntu gutsy main

then type the following into the terminal application:

sudo apt-get update
sudo apt-get install xbmc

but once I’d got that over with XBMC appeared in the applications folder like normal.

Next step is to install the iplayer plugin:

See http://code.google.com/p/xbmc-iplayer/

The iplayer plugin works by using the BBC stream intended for ipod / iphone users .

(See comment below) The iplayer plugin uses the same streams as the Flash interface on the iPlayer website, in all it’s VP6 quality (higher-res than the iPhone stream), and with future improvements to the XBMC RTMP client, may also be able to stream the high-quality H264 streams also offered via the Flash interface instead.

Which explains why it looks better on the eeepc than on my iphone.

And I can report that it works in full screen no problem with the eee. Which makes the possibility of the eee becomming a handy ultra portable media centre. There are a few issues – very occasionally it freezes after watching a programme, and it doesn’t work smoothly with compiz, but these are really minor – the more I play with XBMC the more it impresses me.