Ricky Moorhouse

Blog

QE Park and Butser Hill Sunset

. . . . . .

Lunchtime walk at Hursley

Lone Tree

Bee visitors

Here are a few of the bees that have visited our garden so far this weekend:

Bee from rickymoorhouse on Vimeo.

Raspberry Pi Weather Station

For a while I've been meaning to write up the details of the Raspberry Pi weather station that I have built with my eldest daughter. This project builds on a number of examples I've seen across the internet, particularly sensing the weather. This details how our system is put together.

Temperature monitoring

We took two temperature sensors and mounted them in a garden post with one pushed down to the bottom for soil temperature and one in the cap for the air temperature. The one-wire sensors can share the same three wires, so are both connected to a wire leading back to the Raspberry Pi through a hole drilled into the side of the post. For waterproofing we surrounded the whole with hot glue. The post is situated in a shady spot and pushed about 30 centimeters deep in the soil.

Wind speed

You can see my graphs of the data, and the code is on github.

Places Visited Map

For a while I've had a variation on my map of the places I've visited - here's a summary of how my current version is working.

The whole site is currently generated by hugo, a static site generator with no server side component. The map is powered by MapBox GL which lets me choose any of the mapbox styles to use for my map. I create a markdown file for each place on the map, with the latitude and longitude in the 'front matter' for the post which looks something like this:

    ---
    title: "Salto"
    layout: travel
    datePosted: 2003
    photo: "/travel/image.jpg"
    lat: -31.387022
    lng: -57.968802
    ---

I then have a list layout for travel items which will generate GeoJSON data from the list of places. In my current version of the map this is inline within the page and fed directly into the Mapbox javascript method like this (roughly based on the Mapbox GeoJSON points tutorial):

        ...
        map.addLayer({
            "id": "places",
            "type": "circle",
            "source": {
                "type": "geojson",
                "data": {
                    "type": "FeatureCollection",
                    "features": [
        {{ range .Pages }}
                    {
                        "type": "Feature",
                        "geometry": {
                            "type": "Point",
                            "coordinates": [{{ .Params.lng }}, {{ .Params.lat }}]
                        },
                        "properties": {
                            "title": "{{ .Title }}",
                            "description": "{{ .Content }}"
                        }
                    },
        {{ end }}
                    ]
        ...

Introducing hem

hem is a synthetic monitoring tool which monitors HTTP resources on a regular schedule, storing details of the time taken and the reponse code returned.

I've been using Uptime at work for a while for endpoint monitoring and over the time we've been using it made a few tweaks or plugins for it - in particular being able to send metrics from Uptime to Graphite. There were also some more substantial changes we were considering making and we'd built up a number of supporting scripts to populate the checks via the Uptime API when hosts changed. We also have all our other monitoring dashboards in Grafana. In this context I decided that what would be nice is a simple tool that could replace the checking piece and feed that data into our graphite data store to be viewed and alerted on from Grafana.

hem runs from a simple config file with three main sections in it - discovery, tests and metrics. Both discovery and metrics have been designed as pluggable to give hem versatility - so far I've built discovery drivers for dns, consul and json/yaml and metrics drivers for graphite, kafka and the console. hem will iterate over the tests on a custom interval performing discovery each time to ensure it has the latest list of hosts for that test.

hem stats in Grafana steps

Getting started with hem

To start using hem, you can install it from PyPI with pip:

pip install hemApp

Then create a config file - it will look something like this:

    discovery:
      type: dns
    metrics:
      type: graphite
      server: 127.0.0.1
      port: 2003
    tests:
      homepage:
        path: /index.html
        secure: false
        hosts:
           - example.com
           - example.org

Run hem and start to see metrics flowing to graphite

hem -c config.yaml

In grafana I have the Discrete plugin installed to give the coloured bar look you see above.

Reducing our plastic use

Over the last few months we've started to try and reduce our use of plastics - especially single use plastics. Here are some of the areas where we've made changes.

Reusable drinks containers/straws

We've been making an effort to take our reusable cups, bottles and stainless steel straws with us when we're out and about - and if we don't have them asking for drinks in non-plastic cups.

Refillable Splosh cleaning

Splosh is the great new way to buy essentials like washing up liquid, laundry detergent and surface cleaners. It’s great value, more convenient than the supermarkets and miles better for the environment.You can read all about it on their website. If you use this special code 151F69 when you buy from Splosh you’ll get money off your first order.

Milk bottles

We've started to have milk (and occasionally juice) delivered by milk and more in glass bottles, which can then be returned for reuse.

Present wrapping

For birthdays and Christmas we’ve tried to wrap presents with tissue paper and string or reusing paper - for any wrapping material we’ve bought we tried to avoid the foil and laminated papers.

Soap instead of shower gel

Another area we seem to end up with a lot of un-necessary plastic is shower gels and shampoos so I've been attempting to reduce this with bar soap. The soap works well in place of shower gel and also can replace shaving foam but I've not found one thats a good shampoo substitute yet. The other issue with soaps is a lot of the soaps themselves are packaged in plastic as well so avoiding that adds another complication to it.

Supermarket awareness

Not buying drinks in plastic bottles. Choosing individual vegetables over prepackaged ones and not putting them in bags for weighing. Choosing drinks in glass bottles or cans instead of plastic.

View API Error detail

To view the details of the steps in an API in Analytics to assist in debugging you can do the following:

animated steps

2018 Reading Log

  • Legion (Talon #4) - Julie Kagawa
  • Roads of Madness (Island of Fog #5)- Keith Robinson
  • Chamber of Ghosts (Island of Fog #6) - Keith Robinson
  • Valley of Monsters (Island of Fog #7) - Keith Robinson
  • Summer Crush (Tournament, #4) - B. B. Griffith
  • The Mysterious Affair at Styles - Agatha Christie
  • Against the Inquisition - Marcos Aguinis
  • The Nostradamus Equation (Sam Reilly #6) - Christopher Cartwright
  • Rising Force (Jesse McDermitt #13) - Wayne Stinnett
  • Wicked (Wicked Years #1) - Gregory Maguire
  • Son of a Witch (Wicked Years #2) - Gregory Maguire