Farm Gate Hold-Back Latch

There used to be an old wooden gate at the boundary of the property, where the access track enters at the West end of the site, but that fell apart several years ago and ended up on the bonfire. While there doesn’t really need to be a gate there, having one provides a ‘spare’ for the matching gate at the entrance from the lane (which is more at risk of accident damage) – and helps stop the sheep running into the wildflower meadow when they’re being moved between the fields either side of the track.

This gate will spend most of its life held open so needs some sort of ‘latch’ to hold it in place. There are few options – ranging from traditional forged steel models to more modern designs – but I settled on the Gate Hold-Back Catch Hot-Dip Galvanised – ABL from Locinox which was £23 inc VAT from local steelwork supplier FH Brundle. This provides 50mm of vertical adjustment and is 500mm tall so there’s plenty of length in the ground to anchor it in place. (Other variants are made from aluminium so are slightly more fragile and also slightly more expensive – though they do offer more adjustment options and can be configured to latch either ‘over’ or ‘under’ a gate or door.)

Locinox ABL Gate Hold-Back Catch in Galvanised Steel

The galvanised steel bolts visible at the left of the photo above were my addition; the unit came with three large holes but adding bolts and nuts provides a much better ‘key’ into the concrete footing to maintain the vertical alignment. (There’s a third bolt-and-nut not visible in the photo.)

The gate sits quite low to the ground so only about 100mm of the latch is left protruding when it’s installed.

Gate latch mounted in the ground, with the majority of its length embedded in a concrete footing

The bottom bar of the galvanised steel gate is a 44mm diameter round tube, which isn’t ideal for ‘catching’ on the latch hook, so I decided to add a 3D-printed rectangular block to clamp around the tube. This took a couple of attempts to get right but worked out pretty nicely using some silver-grey PLA filament I happened to have available.

3D Model of Gate Tube Clamp modelled in OpenSCAD

One refinement I’d add if printing this again (and PLA isn’t expected to last more than a few years when exposed to the weather) is to radius the corner of the block at the back of the gate, to help the latch bar ‘rise up’ when latching it – right now it needs a bit of ‘help’ to lift.

The finished result of the latch holding back the gate using the rectangular clamp block

Home Assistant Hosting; Raspberry Pi 4; SD Card Failure

When I first started to properly explore Home Assistant with a view to moving to that, from openHAB, as the Home Automation ‘hub’, I wasn’t certain things would work out so I decided to host it on a Raspberry Pi 4 that I could re-purpose if required. I was aware the lifetime of the Pi’s Micro SD card storage would be limited, having had issues with SD cards wearing out when hosting databases previously, but I left that as a problem for my future self.

About 15 months later it looks like the SD card has worn out. While Home Assistant’s control functionality is still working, Backups are failing and History data and graphs are missing. There are errors in Settings > System > Log like: Unrecoverable sqlite3 database corruption detected: (sqlite3.DatabaseError) database disk image is malformed

Now I’m settled on using Home Assistant, one option would be to host it on a more robust platform. (For example, I used to run openHAB in a Docker Container on an HP MicroServer.) For now though, I’m going to keep it on the Raspberry Pi 4 – albeit with a couple of improvements to the storage set-up:

  • I’m going to use a SanDisk “High Endurance” Micro SD card in the hope that will last longer
  • I’m going to use an External Data Disk – a separate USB 3.0 Flash Drive – to move the write-heavy transactions onto that other drive, which should cope a bit better (and possibly perform better too)
    • A proper USB-connected SSD would be ideal but would need more power which could be an issue for the PoE-powered Pi 4 – and I’d prefer to keep using PoE so the power comes via the UPS

I downloaded the last successful automated backup. I did try Restoring to that but it didn’t work, tending to confirm the theory of the SD card being the issue.

Installing HAOS on the new SD card then booting with that and importing the good backup when first prompted with the option to do that worked fine.

We’ll see how long the new SD-card-and-USB-storage combination lasts this time. I do like the principle of running Home Assistant on a standalone machine – and I like the built-in “App” feature that comes with that – so as long as it lasts for a few years I’ll probably stick with the standalone configuration.