Balena Raspberry Pi Scroll pHAT Harvest Weekly Time Tracked Display

Raspberry Pi Zero with a ScrollpHAT display showing that I've tracked 35.2 hours or work this week

At Ocasta (where I work) we have great flexible working - we do 35 hour weeks, we must be working during 'core hours' (Monday-Thursday 9:30am-12pm, 2pm-4pm and Friday just 9:30am-12pm) but the rest of the time we can work when we want.

We use Harvest to track our time against different projects. I'm normally aiming to be done fairly close to 12pm on a Friday to get that 2.5 day weekend!

A few years ago I'd bought a ScrollpHAT without really having a plan on what to do and I thought one day that it would be useful to be able to glance at the amount of hours I'd done so far this week to see if it was time to stop for the day yet. So one evening a couple of years ago I put together this little project and have had it sat on my desk ever since.

Like the weather board I have also used the Docker based Balena Cloud to deploy and manage it.

You can see the code and setup instructions on Github.

GraphQL Getting Started

This Post

This post is not meant to be an extensive tutorial about GraphQL, it is a starting point for your own exploration into GraphQL that should give you several paths to go down and links to find out more. If you just read through this whole document in one go you will not have an understanding of GraphQL. Follow the links, try things out, and keep coming back to this page.

What is GraphQL

GraphQL is a language for querying data. With GraphQL, your existing services describe the data that they have, and clients describe the data they need.

It is often an alternative to RESTful APIs.

GraphQL started as a Facebook technology but is now part of its own foundation.


This is an old video from the early GraphQL days but the concepts are still true.

Getting Started

The GraphQL website has a simple tutorial to teach you GraphQL


A significant benefit of GraphQL is the client libraries and their ability to handle a significant chunk of your data layer for you. Apollo provide excellent client libraries that make caching almost effortless. If you make HTTP requests with an HTTP library (e.g. Axios, Alamofire) then you're missing out signifcantly.

Apollo also have some excellent GraphQL resources:

Building The Back-end

Apollo provide excellent Javascript /Node.js libraries:


There are various libraries for other languages as well, a popular one for Golang is gqlgen:



Another common need in a backend is a 'Dataloader' - a utility to be used as part of your application’s data fetching layer to provide a consistent API over various backends (often databases) and reduce requests to those backends via batching and caching.

JS - https://github.com/graphql/dataloader

Golang - https://github.com/vektah/dataloaden

Federation / Stitching / Microservices

If you're using microservices and have several GraphQL services then you'll want to look into Apollo Federation which 'stitches' all of your services' graphs into one Graph. Federation is implemented in other GraphQL libraries too.

Designing Mutations

This article has some good design principles for building effective GraphQL mutation systems that can evolve over time:


Useful Tools

Insomnia is an HTTP and GraphQL client for debugging APIs https://insomnia.rest/

Learning More

https://graphqlweekly.com/ is a great email newsletter than sends you new articles and videos every week.

Balena e-Ink Weather Board

Raspberry Pi Zero with red eink display showing the weather for the next 12 hours

I've been running all sorts of little things on Rasbperry Pis for years but I recently bought an e-ink display without really having a plan for it.

I don't have my mobile phone upstairs overnight and I thought it would be useful to have the weather for the day in my bedroom in the morning so I know what to wear. An e-ink display is great for the bedroom as it doesn't give off any light.

I've been aware of Balena Cloud since it was still called Resin but I'd never deployed anything with it beyond a few little experiements. I decided this would be a good first proper use.

You can see the code and setup instructions on Github.

How I Bought An Electric Moped - An E-Rider Model 30

Previously I wrote about deciding to buy an electric moped - an E-Rider Model 30.

Update: The batteries failed after 4 months, were replaced under warranty and then failed again after another 4 months. I was then ignored and rudely told to deal with it myself. I'd highly recommend avoiding E-Rider.

This article describes what happens next, looking at the financial costs and time taken. Journeying through the licensing I needed, my E-Rider ordering experience, vehicle registration, buying equipment and the first ride.

CBT - Compulsory Basic Training

The license required to ride a motorcycle/moped is a bit complicated and depends on what sort of drivers license you already have (provisional, car), when you passed you car test, and what the class of motorcycle is. Thankfully the DVLA have a flow chart for you to follow to work out what you need to do and if you need to display L plates. The E-Rider Model 30 is classed in the UK as "AM" (moped).

I have a full car license, but I passed after 1st February 2001, so needed to do a CBT to ride the E-Rider Model 30 on the road. A CBT is basically a training day on how to ride a motorcycle, safely, on the road.

I decided to do a CBT before ordering the Model 30 in case I really disliked being on a motorbike. I made a booking to do the CBT in two weeks.

I booked my CBT with Safe Riders, near Brighton for £115. Safe Riders were fantastic, really enthusiastic, friendly and helpful without being at all alienating to non 'biker' people.

The CBT began slightly harder than I anticipated. I opted to do it on a 125cc geared motorcycle, rather than a twist and go 50cc moped, to give me more options in the future. But by the afternoon we were out on public roads and I'd pretty much got the hang of it.

The following day I ordered my E-Rider Model 30.

Buying the E-Rider Model 30

I paid £1295. I kept an eye on the price for a while whilst I was deciding on transport options. Full price is £1595 but at one point it was £995, and it's often around £1095.

The website worked fine, and they use PayPal for payments (which is great!).

They claim that delivery will normally be in 5 working days, mine took longer than that and arrived after 10 working days. During this time Ken from E-Rider was very responsive, and replied to emails sometimes within minutes. I understand the delay was with the delivery company, Network 4, who apparently sometimes have issues moving things between depots.

It was delivered by two very friendly delivery people, who put the bike exactly where I asked for it, they even stopped to have a little chat about the bike as they were curious about it! (Side note - they were using a modern Android app to record the delivery / signature which I particularly enjoyed)

Putting the E-Rider Together

This was probably the most challenging part.

To give you an idea of my skill level: I have no problems with Ikea furniture, I generally know what I'm doing with servicing a bicycle - things like adjusting brakes and gears, changing wheels / tyres / inner tubes, and as a child I used to help my Dad fix things on cars as he used a Haynes Manual and I passed him tools and parts whilst also holding bits in place.

The assembly instructions are incredibly minimal. Here some are some examples of the lack of detail: "Fit the remaining pieces of trim, the back box, mirrors and stand springs" and "Finally, adjust the headlight and brakes so that they are operating correctly". But no detail on how to actually do that...

I managed to put the bike together, but not with any pleasure. I needed basically every size spanner, a few screwdrivers, patience, time, and probably other tools I've forgotten since. If you're not confident with the minimal level of detail in the instructions then I'd highly recommend paying the extra £95 to have it assembled for you. I think I wish I had.

This isn't slot together flat pack furniture.

Registering the Model 30

To ride the bike on public roads, you need to register it with the DVLA and get a number plate.

The first step of this is emailing E-Rider once you've received the bike with the chassis number. Ken will then email you back very quickly telling you he's put some paperwork in the post.

You'll also need to acquire a V55/4 form from the DVLA to use to register the E-Rider Model 30, you can do that on their website, where they also provide a thrilling guide to filling out the V55/4. Ken's and the DVLA's paper work arrived a few days later and Ken had very kindly included an example V55/4 form so you know what most of what needs to be filled out.

This is where you learn that the E-Rider Model 30 is actually an imported and rebranded Dayun DYTDR605z. Fun fact.

Filling the form out took me about 45 minutes and the vehicle registration cost £55. I had to write my first cheque in 8 years... And 5th cheque in my life.

My registration came back about 2 weeks later.

Other Equipment

I ordered a number plate from my local Halfords for £20, I probably could have got it cheaper elsewhere but Halford was easy, nearby and open.

I also purchased a helmet from Halford for £45. My local Halfords in Brighton were incredibly helpful, there was an older gentleman who advised me and helped me choose the right helmet, choose the right size. He was one of the most friendly and helpful people I've met in a shop.

I purchased some gloves online from SPORTSBIKESHOP.co.uk (their choice of ALLSHOUTCAPS). I ordered this pair for £30 because a friendly older gentleman in Halfords once told me that Buffalo gloves are the best.

(A little while later I also ordered a thicker pair of winter gloves, also for £30)

Insurance for a year cost me £178, I used a price comparison website and got a free Meerkat doll.

The First Ride

After a few days my numberplate arrived and I spent an hour contemplating how best to attach it, and then about 5 minutes actually attaching it. It was then quite late in the evening and dark, so I waited until the next morning to take the bike out for ride.

I chose my commute to work as it's first ride, but leaving plenty of time. I was a bit nervous as it had been almost 6 weeks since I'd last been on a motorbike. But handling the bike was much easier than I'd expected. The electric bike was eerily quiet, all I could hear birds tweeting in the trees and the tire noise. It was great fun.

However this lasted about 5 minutes, at which point the battery indicator immediately went down to zero and the bike went dead. Uh oh. The bike slowed in the road and I pulled over to let the cars go past and then tried turning the ignition on and off. The power came back for about three seconds and then died again. I did this a few times, then cried on the inside.

I then proceeded to push the bike back home, uphill. Upon arriving home, very sweaty and upset, I sent Ken a very disappointed email. He replied in 45 minutes. Apparently some of the E-Rider mopeds have their trip switched mounted too high under the seat, causing the seat to depress the switch slightly and break the circuit. He advised me to reposition the switch a little lower down.

If it was a known issue I'd have preferred them to have checked their existing stock and fixed any issues before sending products out to customers.

So off the garage I went (again) and took the seat off, disconnected the switch, drilled some new holes, reattached the switch and put the seat back on. All without electrocuting myself. It took a little over an hour, and this resolved the issue. The ride later than evening went much smoother.

Time & Cost Summary

Overall, from ordering the bike to having it on the road took me just under 6 weeks.

It could have been a few days quicker if I'd ordered a number plate immediately, and filled out and returned the V55/4 form on the day I received it.

The E-Rider Model 30 cost me £1295 and the total other costs came to £473, making a grand total of £1768.

I hope this will have helped people thinking about buying an electric moped, and I will follow this up in the new year with my experience of the first 1000km.

Why I Bought An Electric Moped - An E-Rider Model 30

A week before Christmas 2015 my wife and I moved from our flat in the very centre of Brighton to the picturesque Brighton suburb of Bevendean.

My commute to work became very different. Gone was the casual 10 minute stroll to the Ocasta office.

Thus ensued a few months of experimentation, starting with buses, then, cycling, a long period of walking and eventually settling on an electric moped.

If you just want to read about the E-Rider Model 30 electric moped, I've written a post about the process from buying one to getting it on the road, and will write a post about the first 1000km.


The bus was great at first. I tried out a few different bus routes and found that if I put on some sturdy shoes and walked 10 minutes along a country path, I could get a fantastic view, say hello to some horses in the morning and encounter the smell of urine and sick much less frequently.

The peace and opportunity to sit, think, and pray was great initially, but the novelty wore off and the reality of the unreliability hit. Sometimes they don't turn up, sometimes they drive past you, sometimes they are so full you have nowhere to sit - or someone sits on you (true story).

The whole journey was taking 45 minutes when everything went smoothly. A full 4.5 times longer than my previous commute. After trying this experiment for 4 months, it was time for something else.


A quick Google Maps search showed that I could apparently cycle the route in less than 20 minutes. Cycling didn't last long.

There's nowhere secure to keep the bike at work (I've had at least 3 bicycles stolen or majorly vandalised in Brighton in the past). Hills, which means arriving work drenched in sweat and smelling like the 48.


Another tap on the Google Maps app claimed that I could walk to work in 52 minutes. Normally I'm a bit quicker than than Google Maps, so this was putting walking at only marginally more than getting the bus.

I walked for many months, got slightly fitter and developed some nice muscle definition on my lower legs. This was great. Physical fitness is also great for mental well-being, so there were benefits there too.

But maintaining a 45ish minute walk meant keeping a quick walking pace up the whole time, twice a day, five days a week. Even after a long day at work, or when feeling tired in the morning.

Walking experiment over. Time for some sort of powered vehicle. Google Maps reckons 20 minutes journey time.

Options that aren't electric mopeds

What about an electric bicycle? I still had the issue of where to store it when at work. Despite this, I borrowed a friend's electric bicycle to try it out. Brighton's hills were still a problem. The electric part of the electric bicycle would frequently conk out on steeper (but common) inclines, leaving you with a very very very heavy bicycle to haul up the hill.

A car? Don't be silly. Parking, petrol, traffic.

A petrol moped? I didn't really consider this option, once I decided on an electric one.

So why an electric moped?

Tesla cars are cool and I hadn't even thought about electric motorcycles until I read an article in 2015 about Gogoro electric scooters.

Electric vehicles seem like the future. Less maintenance needed as there's less moving parts. They can be charged at home. The electricity used to charge can be generated in many different ways, some using finite fossil fuels, but some not. Petrol etc will run out eventually.

Why an E-Rider Model 30?

Cost, and Google search result ranking.

When you search for "electric moped" the first result was the E-Rider website. Their forums have just enough people talking about their bikes to make them seem legit.

When you break down the total cost of ownership over three years (which I'll do in another post), including buying the bike, equipment, MOT, CBT etc it works out only slightly more expensive than three years of Brighton bus tickets. And at the end of the three years you're left with an asset.

Now my whole commute takes just over 20 minutes. That's from walking out the door to arriving at my desk!

(Only 2x as long as before my move, but now I get to live in more beautiful part of the city, and afford a house)