Tech talks, small gauge film and retro computing.

I had some free time this weekend so I took out the Picade kit I have been saving and finally assembled my new console. This is my third Raspberry Pi project, so setting up the linux installation was no problem, however the wire loom was another kettle of fish.

Luckily the Pimoroni guide includes a colour-coded wiring diagram which takes some of the pain out of the process.

I wanted a JAMMA cabinet like most people who grew up when the arcades were still around; then I looked at custom Mame cabs and finally I had to settle for a more pragmatic solution. The Picade is small and runs off a 2.5A@5V phone charger but it has a proper stick and buttons and feels rugged enough to hammer it like a real arcade machine.

The case is solid and all the parts are carefully prepared and labelled. All you need are a Philips-head screwdriver (I used the one on my penknife), a small flat-headed screwdriver, a Bluetooth keyboard (I use this Logitech one for all Raspberry Pi projects) and a HDMI-connected monitor.

The console is a little tight on space but the parts are so well designed you could probably do it without the guide. Definitely something that is pleasant to put together with a beer in hand.

I ran into some problems with speaker interference, so best keep the USB and speaker cables apart (see circled cables above). Also, the guide doesn't really cover the Raspberry Pi installation, so make sure that you hook up the 3.5mm jacks on the Pi and Picade board as well as USB.

This is the box when finished. There were a number of glue-backed rubber tabs, four thick black ones are obviously feet for the unit but the others I couldn't figure out - maybe they sit between the PCBs and the chassis? Make sure you don't screw the Pi or Picade board down too tightly - they will warp as they do not have flat bottoms.

You can test the buttons when you power on the unit. Each one will activate the Tx LED on the Picade board. Don't worry about the volume buttons - they don't trigger the light. The default wiring diagram assigns volume to the two black buttons on the front of the unit. I would probably change this to have the buttons at the side if I open it up again.

I also tried the top panel flipped in a left-handed position. This actually works pretty well but I discovered that I am now much more comfortable with a right-hand joystick layout and I wanted the printed flyer, so I flipped it back.

In terms of setting up the OS - I pulled down the latest RetroPie image. Once that had finished setting up, I plugged in the Bluetooth dongle and installed Unrar and Transmission.

There's a lot of faffing about with configuring the inputs in Emulation Station that I'm not entirely finished with, but my final change will be to switch the input over to my old CRT TV for a more arcade-like experience. That can be accomplished with the following steps;

I have long been fascinated by a peculiar chapter in recent Irish history; a set of experiments conducted in the early 1970s to record the voices of the dead. Not only does this illuminate the unusual nexus of science and religion that existed at the time but it also appeals to some distinctly Irish traits; the sense of time being thin, the communion with the dead and the love of a good ghost story.

Thanks to Darn and Mella at Darkroom, I finally captured some of the story of Electronic Voice Phenomenon in Ireland on film last week. The footage is now with Crystal Media for telecine but Darn organised a rough screening before I sent it, so I know it is in good order. Here's a cameraphone photo from the test screening.

In 1971 a group of Vatican-sanctioned researchers teamed up with electronics experts from Pye Laboratories to pore over tapes recorded in Faraday cages on high-end audiophile equipment, listening to the howling ether, as Aleander Graham Bell's assistant Watson did, in the hope of picking out voices from across the Great Divide.

The reconstruction was filmed in 7 Henrietta Street on the 28th of November. We used a 16mm Bolex and Fomapan black and white stock. Other than a problem with the smoke machine triggering the fire alarms, everything went off without a hitch.

The film opens with Tim Hawkins, playing a priest in the 18th century, experiencing a paranormal phenomenon that causes his death. Not that this actually happened, but it does give our real investigators an interesting haunting to work with.

The equipment we used included a Bang & Olufsen Beocord 2000 reel-to-reel (as specified in the book) and a Compaq Portable II Computer. This experiment has a precedent in Ireland; WB Yeat's attempts to make radio contact with the deceased (as described in Roy Foster's biography as well as connections with a whole host of Irish parascientific endeavors, such as time travel outlined in J.W. Dunne's 'An Experiment with Time', 1927.

We also got to do a lot of work on Tim's short film, 'The Inheritance'. An unlucky beneficiary of a will (played by me) discovers odd things in the walls of his new house, all the while watched over by the previous inhabitant's spectral widow (Nodlag Houlihan).

I was given the opportunity by Xavier from the AngularJs Dublin group to present at Google's auditorium on Barrow Street yesterday.

The talk I gave was on scaling Angular Apps for large development teams to work on. The slides are here

The other talks were by Danilo Castro from Media One, on creating bullet proof directives that can be used on any website, even those not running on AngularJS and Filipe Silva from KonnectAgain, about the importance of using Angular Style Guides in your next project. All the talks are archived here.

This might be useful if you are finding Wordpress and the LAMP stack a little slow on the Raspberry Pi.

Hardware

The first step is to get a Pi2 - this will require you to purchase a new 2.1w power supply and possibly new memory if you're using one of the old, large format cards. You'll know pretty quickly if the old power supply is not up to scratch - the Pi2 will start rebooting when it tries to do anything substantial, like installing new packages.

The second optimisation you can make at the hardware stage is buying a high-speed USB key. This will be much faster than running from an SD card and is better suited to frequent read/writes. It's simple enough to do, open cmdline.txt on the SD card and change root=/dev/mmcblk0p2 to root=/dev/sda2.

Preparation

Before you tear down your existing site, make sure you install the Ghost Export plugin to download all your posts as JSON. You'll also need to run the Categories-to-Tags plugin first because Ghost can't deal with categories yet.

I also found that the plugin needed some help to work. I had to add this line to /var/www/wordpress/wp-content/plugins/ghost/class-ghost.php;

add_theme_support('post-thumbnails');

and there was also some clean-up required in the output. In the end, the easiest thing to do was export an empty blog from Ghost and replace the <posts> section with the output from Wordpress.

You'll also need to handle your images outside Ghost. You can use the recommended Cloudinary solution but for now it is probably just best to take a copy of your wordpress/wp-content/uploads directory for safe-keeping.

Installation

Next you'll need to install NodeJs and GhostJs. Not so easy on the Pi2. First of all there's a problem with the latest version Node with GhostJs, specifically how it links to SqlLite, and I had to downgrade to version v0.10.38 to get it to work.

You will need to customise the config.example.js file and rename it to config.js. I found that using Forever worked best for keeping Ghost up and running. The command line to add Ghost looks like NODE_ENV=production forever start index.js

Now you should be able to access Ghost via http://localhost/ghost/debug - this is where you import the JSON file you carefully exported earlier.

Congratulations! You now have a rather plain Ghost installation.

Load Balancing

One of the main reasons for having a blog hosted on a Raspberry Pi is to avoid having to use cloud storage but there is nowhere to host images or static content with Ghost occupying port 80. This is where Nginx comes in;

apt-get install nginx
service nginx start

This should get things started. Nginx is extremely fast at rewriting urls and serving static content.

You can point Nginx at your directories with a configuration that looks something like this (presuming you left Ghost running on port 2368);

Statistics

So what are the results like? Well here are the raw stats accessing my site;

Wordpress 13.2 MB 22.02s (onload: 21.56s)

GhostJs 105.6 KB (onload: 607ms)

This is very misleading though; the default Ghost skin only shows a preview of the first few posts and includes no plugins. The Wordpress pages is loading widgets, flash movies and video clips. Still, by removing the webserver, database and the php engine and then precompiling the pages, serving with Node and delivering static files with Nginx, you are guaranteeing a massive boost to page delivery.