18

This is blog is now officially old enough to drink, so dogwonder.co.uk is off to the pub for a shandy.

Where did all the years go eh? That also means this is 18 years of WordPress – although this wasn’t my first WP site but not far off. I think this started on version 1.2, and here I am publishing this from a ‘smart phone’ using ’the block editor’ (back in my day it was all fields etc).

Anyhoo we’re (?) off to raise glass.

Till 19.

Lockdown project 3 – phonebox.photos

So after lockdown project 1 and project 2 I wanted a new project for tiered semi-lockdown and lockdown 3.

During and since art college I’ve always been fascinated by the mundane and how in society and culture we have objects that are present but we don’t really ‘see’ them.

For the new project I turned to photography, last year I purchased a secondhand Fujifilm X100s (approaching 10 years old but still a cracking camera). I wanted a certain look to my shots and the almost filmic quality of the X100s really appealed. Also something that I could do locally whilst taking in some exercise on walks during lockdown.

The subject I wanted to focus on was phone boxes. Not the classic London ones designed by Sir Giles Gilbert Scott (although I have made some exceptions), no I am talking about the more ‘modern’ ones. The ones that have become part of the street furniture, but ignored, looked through, abandoned. No-one seems to use them anymore (certainly not through choice or necessarily for their original purpose), the almost ubiquitous proliferation of mobile phones has rendered them obsolete and relics of the past. But they remain, unloved, mistreated, empty, lonely and I’ve found an almost melancholy beauty in their ugliness.

These decaying fixtures of the streets are probably not going to be around for ever, British Telecom and New World Telephones are gradually replacing them with electronic posters with a phone attached. However due to a High Court judgement in 2018 it is not a decision they can make now without local authority permission.

As such many remain in stasis, gradually deteriorating, occupying a little pocket of land on which they slowly atrophy. They remind us of a time before modern technology, a time of reversing the charges for calling home to ask for a lift. Prank calls. Sheltering from the rain. Turning into a superhero. They hold memories. As the uncaring march of technology relentlessly moves on they recede from our consciousness and the physical realm. Some of the phone boxes I have taken photos of have already been removed and many more will have their reign bought to an end soon. We probably won’t miss them, or even notice they have gone. But they are here, sure they have seen better days, but for me there is a quiet, determined, fading connection to a different epoch.

So through a desire to catalogue these fading objects I formally present to you:

phonebox.photos

Lockdown project 2 – wooden Pi Camera

So after reading this article about building your own camera with a Raspberry Pi 4 by Becca Farsace from The Verge I was sold. It was still (sort of) lockdown, I had waaay too much Raspberri Pi stuff. So i went about making my own.

First off I got the core components.

  • Raspberry PI 3A+ (already owned)
  • Raspberry Pi camera module
  • C-Mount lenses (Pentax 25mm, Raspberry Pi 6mm Wide Angle Lens)
  • Puck.js button (to remotely control the device – essentially the shutter release button)

I then tried to get a suitable case, I first bought a couple of second hand broken camera bodies off of eBay, an old Pentax film camera, but it was too small to house the Pi, then a Olympus underwater camera housing which very nearly worked after hacking at it, but I couldn’t then screw the lenses in! Finally I decided I needed to make the case. So bought some 3mm plywood…..

Et voila.

View of camera from the front

Now for the programming, I am a web developer, but my craft is HTML, CSS, Javascript so not really a l33t python dev. So this was mostly trial and error, oh and a shit load of googling (a.k.a. The Web Developer’s Handbook ™ ® ©)

I use rmate because I *still* can’t use VI/nano

The first file is the command we want to run, based around raspistill, well use this later. So I created a file called camera.sh which will take the photo and save it to an Apache server instance to you can remotely access it, e.g. http://192.168.0.*

#!/bin/bash

# Unix time and date filename
sudo raspistill -f -ts -o /var/www/html/photos/PI_CAM_%d.jpg

Now to set up the Puck.js button, we can use the web based IDE to flash code the device, this code (below) will allow the Puck.js button to act like a bluetooth keyboard key, e.g. F7, (note the Puck needs to be paired with the Pi)

//For Puck.js 8b1e

var kb = require("ble_hid_keyboard");
NRF.setServices(undefined, { hid : kb.report });

//F7 key - https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
function btnPressed() {
  ledBlink();
  NRF.sendHIDReport([0,0,64], function() {
    NRF.sendHIDReport([0,0,0]);
  });
}

// trigger btnPressed whenever the button is pressed
// consider repeat:false
setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50});
function ledBlink() {
  LED3.write(true);
  setTimeout(function() {
    LED3.write(false);
  }, 250);
}

Now we need to set up a multimedia keyboard daemon that can intercept the Puck.js button click (which for our purposes is going to act as a bluetooth keyboard – a one key keyboard). I found something called esekeyd and here are the various commands to get that firing

sudo apt-get install esekeyd
sudo keytest /dev/input/event1

// sudo learnkeys /etc/esekeyd.conf /dev/input/event1
// where eventX == result from above, e.g. event1

sudo learnkeys /etc/esekeyd.conf /dev/input/event1

// Press F7 (), esekeyd will create the configuration file you need (esekeyd.conf). You then need to edit it with your editor of choice. You’ll see a line like this: `#F7(press):` Delete the #, and add your desired command directly after the : (no spaces!). Your new line might look something like this:

F7(press):/home/pi/camera.sh

// Make sure the sh file is executable

chmod +x camera.sh

// Now let's set up the config
touch esekeyd.conf
rmate esekeyd.conf
sudo cp esekeyd.conf /etc/esekeyd.conf

//run the file
sudo esekeyd /etc/esekeyd.conf /dev/input/event1

//to run on startup
sudo nano /home/pi/.bashrc
sudo esekeyd /etc/esekeyd.conf /dev/input/event1

//or
mkdir -p ~/.config/autostart
cd /home/pi/Desktop
touch terminal.desktop 
rmate terminal.desktop
sudo cp terminal.desktop ~/.config/autostart

This file, terminal.desktop, will launch terminal and the esekeyd service so the camera is ready to take clicks from the button however this didn’t work for me, terminal opens up but I get an error ‘Failed to open /dev/input/event1 (Permission denied)’ I think this is because bluetooth hasn’t enabled yet, I dunno.

[Desktop Entry]
Version=1.0
Name=Test        
Comment=Test the terminal running a command inside it
Exec=/usr/bin/lxterminal -e "bash -c 'sudo esekeyd /etc/esekeyd.conf /dev/input/event1;$SHELL'"
Icon=utilities-terminal
Terminal=false
Type=Application
Categories=Application;

And there we have it a (mostly) working camera. Here is it:

And here is a time-lapses I took with the wooden pi Camera.

And some of the camera in action / build process

View of camera mounted to balcony
Me building the wooden case

2023 2022 2021 2020 2019 2017 2016 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004