From Spreadsheet to Slideshow with a Raspberry Pi

As well as actually spending time playing in the theatre I also occasionally get involved in various computer related projects for one. This particular project was to help set up a rolling slideshow of “coming soon” events that we can display in the foyer of the theatre.

Of course this project lends itself to a raspberry pi so I got mine out and started work. Everybody (it seems) creates a slideshow on their raspberry pi, so there are many solutions to choose from. In this case (you’ll see why in a minute) I wanted a slideshow that looped through pictures in a directory and automatically coped with pictures being added and deleted. For now I’m using Eye of Gnome which does this admirably but this can easily be replaced in future.

So where are the pictures coming from? Well that’s where this gets interesting. The list of upcoming events is kept and managed in a Google Spreadsheet so I needed to take this information and turn it into a set of images for the slideshow. As the information in the spreadsheet is regularly updated I wanted to write a python script that could be run regularly by a cron job to pick up changes and create the new slideshow images.

Google provide an API to Google Drive that allows access to files and file information and they provide a python library to access this.
I followed the instructions here to configure a developers account and then grant access to the APIs you need (in this case Drive and Sheets). I decided to use the OAuth for Server to Server authentication to avoid the need for human interaction, so the other thing I needed to do was to make sure that the service account has access to the files it needs. I did this by sharing the relevant files and directories in Drive with the service account’s email address. I only needed to grant view access to the files as we’re only ever reading the data.

Then on the pi I needed to install a few libraries, the Google API of course, a date parsing module and Image Magick to help create the images.

sudo apt-get install python-pip
sudo pip install --upgrade google-api-python-client
sudo apt-get install python-dev
sudo pip install ciso8601
sudo apt-get install libmagickwand-dev
sudo pip install Wand

Once that’s done I could write the script to download the data. The Google API documentation is full of example code so it’s easy to get this working.
Firstly I retrieve the modified time of the spreadsheet, using the Drive API, to see if it’s changed since we last ran. If it has then I download the data from the spreadsheet and check each row to see if it’s been updated (each row has a unique identifier and a last updated time-stamp). For each updated row I delete any existing image and generate a new one.
Finally I record locally the most recently updated time of the rows so I know when to start from next time.

Note (because it surprised me) that the latest updated time of a row might actually be later than the modified time of the file as there’s sometimes a couple of minutes delay before the file modified time is updated.

That really was all there was to it. Well, okay, there’s actually a few other things going on too, but that’s for another post perhaps.

 

 

 

Advertisements

The Verse Of Sergeant Cadwallader

The Unexpected GuestSo tonight we open in Chesham with “The Unexpected Guest” by Agatha Christie.

I am playing a dreamy poetical Welsh police sergeant who is, naturally, investigating a mysterious murder. Aside from reading poetry (not the first time I’ve done that in a play recently) I am also caught writing it, but the audience is delivered no more than a couplet of this (fine?) poem.
I was given a challenge (by James of course) to finish the poem and I have done so in a way I think my character would have created it.

Of course, if you want to know who the murderer actually is…well you’ll have to see the show because I am certainly not going to tell you.

November Mists

Tis misty in November
But seldom in December,
The fogs that fill the valleys soon disperse.
After the mists of midnight
They fade away in sunlight
Only to be replaced with something worse.

The deeds of men inspected
Too dark to be reflected
Are revealed to us when the fog has gone.
We seek the true solution
To give people resolution
And let the injured parties lives move on.

© Sergeant Cadwallader (CMB)

Seaton Tramway And The Sea

Mystery trip out, getting up at silly o’clock in the morning, take my camera? Well yes, I’m always up for that.

So we went on an adventure (and a magical mystery tour) and ended up in Devon. I laughed when I saw were we were, because who doesn’t love trams. Even better this was a little tram line that runs down to the seaside (and back). You’ll see from the table below that we were determined to make good use of our day tickets.

Seaton Tramway

From Depart To Arrive Route
Colyton 12:30 Seaton 12:54
Seaton 14:00 Colyton 14:23
Colyton 14:50 Seaton 15:14
Seaton 17:00 Colyton 17:23

 

We also saw the sea (proof below), paddled in it, ate fish and chips and ice cream and had what was really a perfect day out by the seaside.Seaton Beach

Brussels Has Small Sights And Underground Trams

Brussels is a lovely city. It has beer, chocolate and lots to see. The first thing we saw (if you exclude the Atomium which we passed underneath of course) was Mini-Europe. This contains scale models of many famous sights in Europe, many of which I have seen (and usually photographed) the real one.

Brussels Tram MapIt also has trams. Some of those actually run underground, which was a real novelty for me. So here is the requisite list of tram journeys.

Saturday

From Depart To Arrive Route
Heysel 16:10 De Wand 16:20 7
De Wand 16:21 Gare du Midi 16:27 3
Gare du Midi 17:20 Merode 17:53 81

Monday

From Depart To Arrive Route
Merode 17:47 Germoir 17:57 81

Tuesday

From Depart To Arrive Route
De Brouckère 11:05 Gare du Midi 11:12 4
De Brouckère 13:15 Port de Hal 13:25 4

Much to my surprise (some of) the trams are made by Bombadier.

Learning Language As A Game

duolingoSo sometimes my Twitter feed points me to something really interesting. Recently it pointed me to an application called Duolingo. It can be used via the website but there are mobile applications for Android, Apple and Windows. It’s an application for learning languages (the name may give you a clue there) which encourages you to spend five minutes a day learning a new language.

The idea is simple. Play the game, translating simple words and phrases in both directions and gain experience points (‘XP’) which allow you to level up through the language. Learning new skills and (more importantly) completing ‘streaks’ of continuous days played gains you ‘Lingots’ an in-game currency which can buy you useful things (a timed test, or a streak-preserver for instance) or just a new outfit for the games mascot, a rather cute green owl. You can follow friends too, thus allowing you to see who has practised most this week and cheer them on when they are doing well.

There are a wide variety of languages available depending on the language you’re starting from. For English speakers not only are there the obvious candidates (French, Spanish and German) but more unusual options like Esperanto, Swahili or Klingon. The courses are effectively crowd sourced, people volunteer to create the content which means that enthusiasts create courses (hence the more unusual options).

I decided to give it a go and learn Welsh. The first lesson was surprisingly easy (possibly helped by the fact that my six-word grasp of Welsh already included “bore da” and “nos da”) and I was hooked. It is surprisingly addictive. Got five minutes to kill? I’ll just strengthen my skills a little then…

The mobile version is the most accessible way to use it but the notes on the lessons when you visit the website contain some useful grammar tips which I’m not sure how well I’m going to learn. I’m hoping the later lessons will use more complicated constructions and perhaps I’ll learn them by absorption then.

Nine weeks in though and I’m still having fun. “Dw i’n hoffi dysgu Cymraeg”* in fact. I can’t do anything useful with it yet, like read a book or watch S4C, but for now it’s still a fun little game to play.

* I like learning Welsh.

 

 

Me, The Stage Manager?

Already CalmI’d never expected to ever be a stage manager. When you work on shows with someone who is an experienced and awesome stage manager then it’s a job that is definitely not available. Plus I’m actually quite happy just moving chairs and tables, making pictures crooked or cleaning blood* off the set and leaving the responsibilities to somebody else.

But when James couldn’t go to the Loxwood Joust this year, and it was suggested that I could stand in for him as stage manager, looking after a few artists on a little stage in the middle of  a woodland, I found myself saying “Yes”. After all, I know the festival already, know my way about a stage and best of all I could get advice and instructions direct from the expert.

So nervously I set off on a Friday night with a new tent, a clock and a clipboard with the running order and detailed instructions attached. My instructions said I needed to acquire a broom and inspecting my domain on arrival I could see that I did, as the stewards were laying out straw bales in the woodland and using the stage as (sorry) a staging post. Still, it was getting dark, so I put my worries aside (mostly) and went to the bar for some mead.

Early the next morning I hung up my clock backstage with a copy of the running order and went in search of the broom. That found, I made a start by sweeping the copious amounts of straw off the stage. Feeling I had now claimed my territory, I settled in to do my job. By midday I had met everyone performing on my stage that weekend and the sound guy (who had the harder job), made a “No Entry” sign and told countless (not many, I just wasn’t counting them) people not to come backstage and, most importantly, got the first act on stage successfully. With some surprise, I realised I actually could do this and somehow my earlier nerves had evaporated. Perhaps I was just too busy keeping track of the time.

Still like all theatre jobs, it evolved over the four days of the festival until I was also plugging in microphones, laying out tambourines and hunting for the juggler’s balls**. All this in a (surprising) glow of calm confidence, and no, it wasn’t just the result of the mead.

Next year I have no doubt James will be back to reclaim his stage and of course he’ll do an even better job than I did, but for once I have been the stage manager and I loved every second.

*Fake obviously. Unless someone really upset the SM…

**Crystal balls. He threw them off stage when he’d finished juggling with them. What did you think I meant?

Goodbye

GoodbyeThis poem was written for a very special lady. I had felt the need to write something anyway but when I learned that she too used to write poetry then it seemed even more important to put something into words.

When someone dies, the funeral is a chance to say goodbye. When it is the funeral of somebody you have never had the chance to meet, then goodbye becomes something more.

Goodbye

Today I have to say goodbye,
A life so precious has gone by.
I’ll meet folk they used to know,
Today goodbye means Hello.

I’m travelling to a far off city
Unknown to me, but quaint and pretty.
This is the place that they called home,
Today goodbye means Hello.

I’m learning now about their life
Poetess and devoted wife,
Friends who miss her kindness shown,
Today goodbye means Hello.

A lady I never got to meet
But who has shaped one close to me,
And so for their loss I will cry,
Today Hello must mean Goodbye.

© CMB

The Humber Bridge

I’d never seen the Humber bridge before. It’s an amazing structure. The main span is 1410 metres. The towers are 155 metres tall and they are 36mm further apart at the top than the bottom to allow for the curvature of the Earth (at least that’s what the information boards around the area tell you).

We stopped for a look on our way into Hull.

We saw it again on Sunday when we returned for a second photo-shoot with Spencer Tunick, and before we went home we managed to find time for a walk across it too.Humber Bridge

 

Hull Museums – More Tram Logos

Kingston-upon-Hull has an amazing set of City Museums. Entrance is free so there was no reason not to take a look. We managed to find time to visit The Streetlife Museum of Transport and the Hull and East riding Museum (briefly). I certainly hope when we go back we’ll find time to visit some of the others.

The transport museum was amazing with a period street, a carriage ride and a couple of lovely trams. A couple of new tram logos I’d not seen before:

Romans Go Home!

Romans Go Home!

The Hull and East Riding Museum was a little jaunt through history and certainly has some wonderful Roman mosaics and the best Roman street scene I’ve ever seen, complete with graffitti! Slightly more authentically, I should point out that “Cave Canem” made an appearance too.

The Ferens Art Gallery is of course temporarily closed, but we have plans to visit that when it reopens and hopefully then we’ll get a chance to visit some of the other places we’ve not yet seen.

Seeing Hull

When you come to a city the first challenge is finding your way around. We were lucky when we visited Kingston-upon-Hull recently to be part of a group of fellow tourists and friendly locals who went on a walking tour of part of this lovely city.
We met up in Queen’s Gardens, leaving unneeded possessions for safekeeping and from there we all walked through to the Rosebowl fountain.
“It looks like a ship’s wheel”, we were told.
Then we marched up Alfred Gelder Street to Lowgate.
“What’s this big building?” asked one person*.
“It’s the Guildhall” the locals helpfully replied.
From there we walked towards the old town and up to the Scale Lane Bridge; notable for being the only bridge where pedestrians can stay on it while it opens. We were a large group but some of us were fortunate enough to be able to make our way on to the far end of the bridge and how kind of them to open it especially for us.
Our tour then done we made our way back to Queen’s Gardens to collect bags before heading back to our hotel for a shower and then searching out some breakfast.

...leave nothing but footprints (in B3 paint).

…leave nothing but footprints (in B3 paint).

Perhaps I forgot to mention though, that this tour started at four o’clock in the morning and we were naked and painted a rather fetching shade of turquoise (in our case ‘B3’) throughout; for we were part of the “Sea of Hull”. A nude art installation by photographer and artist Spencer Tunick commissioned for Hull as part of the UK city of culture 2017. The largest so far in the UK, with 3,200 participants.

I know there are lots of pictures on the internet, so many accounts already describing how it felt. So how did it feel for me? I hadn’t worried about getting naked but I had worried (laugh if you know me) about my lack of worry. I wondered if I’d find I’d misjudged myself when it came to it. It turns out I hadn’t.

I wasn’t oblivious to the careful way the whole thing was set up either. We were repeatedly asked not to get naked until told to. Partly I’m sure in order to avoid public order offences, however also it meant that once final instructions on painting ourselves had been given and we’d been given clear instructions to be as quick as possible, when the order to strip came there was a mass scramble to get out of our clothes. We were given no time to think about what we were doing. By the time we had leisure to look round we were part of a sea of naked blue people filling the park.
It felt perfectly normal to be honest. For once I felt completely at home in a crowd, accepted, we were all together. Even leading the march down Alfred Gelder street chatting to Spencer’s assistant Steve (“Steeeve”) was surreally normal.

It was a truly fantastic experience; to be part of something amazing, beautiful and so, so much fun. I’m glad to have discovered a wonderful city, full of friendly people. I certainly learned some new things too. For instance:

  • Hull has some fantastic city clocks (and when nobody is wearing a watch they are the only way to keep any sense of time).
  • Penguin huddles work to keep people warm too.
  • Body paint is surprisingly hard to remove from some places (but coconut oil helps).
  • Also, if you ever wondered what it felt like to be the little mermaid then try walking barefoot on the Scale Lane Bridge. Ouch.

We’ll be back of course, when the art gallery reopens to see the art we helped create. Until then…

We are #SeaOfHull

Embed from Getty Images

*that was Spencer Tunick of course. He was giving us directions relative to it.