Imagine if Minecraft was the trigger to get a new generation of kids programming?

Walter thinks that the next big Social Network will be Minecraft. I think he might be on to something. Our kids either love playing it or watching their older siblings do so.

Over the weekend, it was announced that the Pocket Edition was being ported to the Raspberry Pi. I was excited but our eldest son pooh-poohed the news since he has tried Pocket on his Android phone and it doesn’t compare to the full thing.

But then came the kicker: you’ll be able to access it programatically in any language over a network connection! As they point out in the blogpost today:

The more creative programmer will only be limited by their imagination. Want to build a digital clock into the wall of your house which displays the real time? Easy. Want to get back at a friend who stole your precious diamonds? Remove the floor from underneath their feet and let them fall into a pit of lava. The possibilities are endless.

If the future is mobile, then is Pocket Minecraft on Raspberry Pi = the Tween replacement for Twitter?

This is a big deal. I can’t wait to try it.

UPDATE 1: I just realised the GPIO pins on the RPi mean that it should be possible to connect haptic/gesture/wiimote/any interfaces to Minecraft. Or have people been doing that already on the PC version? I’ve just ordered a Makey Makey and you could have huge fun with that.

 

Conor’s 2012 @Raspberry_Pi Christmas Gift Guide

This post was prompted by @mollydot asking me last night on Twitter what accessories make sense if you are buying a Raspberry Pi as a Christmas Gift and @jkeyes rightly suggesting that a post with links would be useful.

I really think this Christmas could be a lovely replay of 1982 for a lot of people, like me, who got their first home computer that year. You could have so much fun on Christmas Day messing with the RPi rather than falling asleep in front of the fire. Just don’t fight over who gets the telly when Doctor Who is on.

Whilst the bare-bones nature of the Raspberry Pi is wonderful, it is unusable out of the box unless you are a house with smartphones, digital cameras and existing PCs already that you can raid for components.

What you want to avoid is a repeat of me that December in 1982 with my brand-new 16K ZX Spectrum which didn’t work on our Nordmende TV until two weeks later when the RTV Rentals guy came and replaced the TV Tuner. Two weeks typing Beep 1,2 to make sure it wasn’t broken.

For most parts, check the list of verified compatible devices here. This is what you need:

  1. The Raspberry Pi itself
    1. You can get it online from Farnell Element 14. Also most of the accessories I mention below. They are quoting a 3 week delivery time so get your skates on.
    2. And available online from RS Components. They have lots of accessories too.
    3. Orrrrr, you can skip everything I have written below and just get the Maplin Starter Kit for Raspberry Pi. Unusually for them, it’s actually decent value and you know all of the components have been tested for compatibility. There weren’t any in Blackpool in Cork the last time I was there so ring-ahead or order online.
  2. An SD Card
    1. I got these very cheap 16GB ones from 7DayShop in Jersey but the casing on one has shattered after very little use. They have branded ones which should have better quality plastic.
    2. Micro-SD cards in an adapter work fine too.
    3. Get the fastest one you can. Class 10 for full SD works great as does Class 6 on MicroSD.
    4. Any size from 4GB up should be fine initially.
  3. A Micro-USB phone charger
    1. I’m currently using the one from my HTC Sensation.
    2. Anything above 700mA should be fine but that excludes most cheap 500mA chargers that come with Chinese electronics.
    3. I’ve had success with a some of the cheap ones from DX.com in China but many of the so-called 2 Amp ones can barely do 1 Amp so it might be best to avoid. Also, be warned, delivery times from DX can range from a week to many months.
    4. I was very surprised to see an entire shelf of power supplies in a small Maplin in London but not one Micro-USB charger. As a place where a lot of people go to get emergency replacements for things, they should surely have tons of these?
  4. TV Cables
    1. If the person you are buying for has an LCD/Plasma TV then any HDMI cable will be fine. I have used ones from DX and Lidl with no problems.
    2. If they have a older CRT TV then they will need a video cable with RCA at both ends and an audio cable with 3.5″ headphone jack at one end and RCA at the other end. If the TV takes RCA then that’s all they need.
    3. If the TV only takes SCART, then you need an RCA to SCART adapter. Most TV shops have these. Maplin definitely do.
    4. If they have a monitor with DVI then there are HDMI-DVI adapters. Neither of the adapters on DX worked for me. See this page for a list of compatible adapters.
    5. If they have a monitor with VGA then this adapter on eBay _may_ work. Note that it works for me on two monitors here but totally failed on a projector at an event during the summer.
  5. USB Keyboard and Mouse
    1. I haven’t found a wireless one which doesn’t work. Lidl and Aldi both great for these at the right time of the year. Otherwise anywhere online or PC World.
    2. Not all wired keyboards will work as they may draw too much current. I have one roll-up rubber one (don’t ask) which shuts the RPi down when I connect it.
    3. I found a dirt-cheap Microsoft wired Keyboard/Mouse for about €15 last year in Dixons
  6. Powered USB Hub
    1. USB remains a very frustrating experience on the Raspberry Pi. Unlike a PC, it seems to be a crap-shoot as to whether something will work on it or not. The problem is the tiny amount of power the two USB ports can provide (150mA compared to 500mA on most PCs) and some ongoing problems in the drivers.
    2. The best way to avoid this is to get a USB hub that can be externally powered and connect all devices to that. Unfortunately, many of the dirt cheap ones out there that have a power connector don’t actually work with power connected.
    3. This extremely cheap hub ($5!) that I got on DX last week seems to be working really well so far. It doesn’t come with a power supply but accepts one. You’ll have to find a 5V one yourself with that smaller size of power jack.
    4. To be absolutely sure, just check this list of compatible hubs.
    5. If you continue to have problems then you may be forced (as I was) to hack the USB cable from the hub to the RPi and disconnect the power lines so that the Hub isn’t sending power back up to the RPi
  7. Wireless Adapter
    1. Whilst the RPi has an Ethernet port, it’s not really that useful for many people whose broadband routers are in the hall. One of our RPis is wired but that’s because we run GigE cabling everywhere.
    2. I have a ton of Wifi adapters collected over the years. Most of them work on the RPi.
    3. I’m currently using some random Wireless-G one to stream a webcam internally.
    4. Again, check the list of compatible ones here
    5. And again, connect it using the hub to avoid power problems
    6. The current version of Raspbian for Raspberry Pi comes with a nice Wifi GUI config tool to make setup very easy indeed.
  8. The Raspberry Pi User Guide
    1. Get it here on Amazon
    2. Because I still have my ZX Spectrum manual and still remember drawing my first circle on the screen using the instructions in it.
  9. A nice case
    1. If you are feeling very generous.
    2. Some lovely ones on the Adafruit site in New York
    3. And this awesome Pibow in the UK

Any questions at all? Pop em in the comments. Not on Twitter or Facebook :-)

My 4 years of Android today and Ireland’s first Android App

Today is the 4th anniversary of me paying $499 on eBay for a HTC G1, the first Android phone. Whilst some of my tech predictions over the years have been a little off (*cough* iPad) I couldn’t have got it more right with Android.

When I heard about the Android project mid-2008, it was obvious Google wasn’t going into things half-heartedly. The G1 itself was a mixed bag. Ugly as sin but with a slide-out keyboard that I still love. Android 1.5 was rough but very functional for someone like me who spends their time on Google products like GMail. I still have the G1, running Android 2.3 and waking me up every morning.

The reason I got the G1 was not for pointless bragging rights, it was because we had decided to build an Android App to show-off the LouderVoice API to some Enterprise customers we were trying to land in the mobile space.

I created the spec and wireframes for the App and also figured out what extra features our API would need. The basic idea was “Review Anything Anywhere”. Essentially what Kevin Rose tried to do with Oink several years later. We both failed because no-one wants to do that :-)

Marino Software in Dublin did the App coding for us and we finally launched Ireland’s first Android App in May 2009 for Android 1.6. It never had many users but it was a fantastic tool for showing potential business customers what our system could do.

The same back-end API is now used to power the reviews in the Riverdance Android and iPhone Apps.

Last week I installed the old App again on my HTC Sensation running Android 4.1.2 and whaddyaknow, it still works! Sure the graphics-scaling is horrific on that big screen but you can still browse and submit reviews to our API.

In those 4 years I’ve gone through a HTC G1, HTC Desire and HTC Sensation. I’ve also bought a ZTE Blade and Eken T02 tablet for others. There is no doubt that my next phone will be Android but sadly not HTC, as I insist on my phones having replaceable battery and SD card. At some point next year I’ll get a decent Android Tablet too.

There are two upcoming areas I find exciting in the world of Android:

  1. Ultra-cheap single board Android computers in the style of Raspberry Pi. Most of these are being sold as 1080p media players but they can do a hell of a lot more for very little money. Which feeds into point 2.
  2. Hardware interfaces like IOIO. Once I finish a couple of my fun Raspberry Pi and Arduino projects, I want to do some car projects using IOIO. Rather than your phone/tablet just being for calls/music/GPS in the car, imagine if it was connected to a wide range of sensors and interfaces. Every car on the road acting as a generator of a wide range of interesting IoT data, all location-tagged and uploaded live over a mobile data connection.

We’ve come a long way baby.

Sibéal’s Halloween Eye of Deatttttttttth

Myself and Sibéal put together a really simple but effective spooky eye for Halloween recently. It caused great interest in her school during Halloween dress-up day just before mid-term.

It simply consists of an old ping-pong ball with a hole dremeled into it and large bright red LED inserted into the hole. That’s connected via a resistor and long wires down her arm to her wrist which has a PP9 battery taped to it. That leads to an on-off switch in her hand so she can catch people unaware.

It is genuinely scary in the dark and the bright LED created freaky concentric circles which were missing when we used a smaller duller LED.

The main things it made us think of were Terminator, the Daleks and Davros.

Time to start planning next Halloween.

The @RaspberryPi Doorbell of Dooooooooommmmmmmm

We had some good fun last night with the neighbourhood kids making use of our Doorbell of Dooooooooommmmmmmm.

I’ve had a bigger doorbell project planned for quite a while but 2 weeks ago decided we should do a simpler Halloween one. Using various bits bought from Sparkfun and Maplin along with a great tutorial from Adafruit (more below), I finally got something we were happy with, working late last week. Then yesterday evening I put it in place on the door. Unfortunately, with all the pulling, taping and general movement, one of the five buttons stopped working. But the other 4 were fine.

The sounds used were pulled from various online sources. Sibéal came up with the Mr Burns idea and Oisín thought of the Home Alone one. I used Audacity to clip some of them and ffmpeg to convert some of the YouTube videos to audio. The cheques are in the post :-)

Originally I was going to use Arduino for this but considering a Waveshield for playing audio costs more than a Raspberry Pi, I changed direction. I then thought I’d use the Arduino for the button detection and communicate over USB to the RPi but I finally realised I should just use the GPIO pins directly on the RPi itself. My worry about killing it accidentally were unfounded.

The first version was done on a breadboard to make sure I made no mistakes. It worked well. But it was never going to work stuck to a doorframe so I moved to a strip of veroboard and soldered it together. This had a few, ahem, glitches, which took a while to sort out due to my soldering incompetence.

The final setup was really simple:

  1. One button per sound
  2. Each button connected to a GPIO pin on the RPi along with connection to 3.3V and GND on the RPi (pull up resistors there too but apparently not necessary?)
  3. An old 40-core IDE cable from a dead PC used to safely connect the wires from the buttons to the pins on the RPi.
  4. Extremely simple Python code running in a loop on the RPi which checked to see if any of the connected pins were pulled low by the button being pressed.
  5. If so, it made an external call to mplayer to play one of our selected audio clips

The only real change from the Adafruit tutorial was to use mplayer instead of mpg123. This allowed me to use any audio format including WAV, rather than just MP3s. Also some of the instructions are a little redundant with the latest version of Debian on RPi, but they do no harm.

This is the trivial script to set the volume and call the Python script:

#!/bin/bash
amixer cset numid=3 1
nohup ./raspi-audio-button.py > /dev/null 2>&1 &

This is the code, it uses the RPi.GPIO library (the latest version works fine):

#!/usr/bin/env python
from time import sleep
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(25, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
    if ( GPIO.input(22) == False ):
        os.system('mplayer /home/pi/haunted_sounds/Howl.mp3 &')
        sleep(3);
#    if ( GPIO.input(17) == False ):
#        os.system('mplayer /home/pi/haunted_sounds/HomeAloneCountOf10.mp3 &')
#        sleep(3);
    if ( GPIO.input(23) == False ):
        os.system('mplayer /home/pi/haunted_sounds/ReleaseTheHounds.wav &')
        sleep(3);
    if ( GPIO.input(24) == False ):
        os.system('mplayer /home/pi/haunted_sounds/Scream.wav &')
        sleep(3);
    if ( GPIO.input(25) == False ):
        os.system('mplayer /home/pi/haunted_sounds/CastleThunder.wav &')
        sleep(4);

This diagram of the RPi pin-out was invaluable:

Once everything was setup at the door yesterday, we then found that the volume on the Lidl iPod Dock was far too low. I had to put a tiny battery powered speaker outside, taped to the postbox. But even that wasn’t great so I added a Fiio amplifier. Of course then we couldn’t hear it inside, so I split the audio and used one audio device inside and one outside.

I didn’t have time to setup wireless on the RPi so I used a wired network connection. This enabled me to SSH to the RPi from my PC and start the Python program. It also allowed me to remotely change the Home Alone clip to the howl from An American Werewolf in London after it got a bit tiresome, 2 hours later.

I made a video of it all in action but the bloody version of CM10 on my phone corrupted it. To give you a taste of what it was like, I extracted the audio from it. Enjoy:

Changes? Instead of externally calling mplayer, it’d be better to use some sort of audio library that would allow a follow-on button-press to interrupt whatever is playing. Also, approx 75% of kids pressed the top button so the next time we’ll randomise what is played.

Next steps? Well that’d be our Social-Enabled Doorbell. It’ll probably be Christmas before I finish it tho.