“They have a cave troll”

Not really but we do appear to have a bees nest. Looks like it’s white arsed bumbles, which I know are generally placid and need some help. Though could do without hearing the little buggers hovering around waiting for landing permission.

They’re dropping down under the steps flags where the downpipe used to go from the conservatory into a small soakaway.

On the plus side there’s near zero chance of me accidentally walking over that bit as it’s awkward to get to at the best of times, on the downside… bees… near me… bees which need all the support they can get… murder insects.

Welcome to the summer. Later in the year I get to work out where the nest is under there and close off that hole.

Another breakdown of where we are

The bottom line is that they’ve decided to “let rip” hoping that they can get the COVID surge controlled before the flu one. Potentially at the cost of wrecking many lives, not death but long term disability.

We all know that this and previous governments have protected those in need so, no worries… right?

Baking : ProtoMokatines

Sort of, working from a Mokatine recipe I have online but focusing on trying the sponge (genoise) and buttercream (egg based). The buttercream works, surprising SWMBO, who is more used to castersugar / butter recipes. The lemon essence amount used also worked (3/4 tsp) so that’s a win. No other flavours were used.

The sponge was “ok”, flatter than it should have been so probably me hammering the batter more than I should knocking the air out. Will try again.

Presentation, it is what it is. Will be working on that over time.

Next week, need to work on getting the cake right ahead of someone’s 3rd birthday requiring a Duggee which doesn’t look like he’s been in a horrible accident.

F_ck you Facebook

Apparently posting a thread unroll from a scientist who has performed a reasonable breakdown of the data around Covid in the UK. With explaination of the conclusions, data sources, and so on is apparently worth time in Facebook link posting jail.

This link to be precise – https://threadreaderapp.com/thread/1410989321394458629.html

This included links to pictures of fluffy bunnies. What is apparently acceptable is a link (no supporting text, that’s bad) to a product on amazon.

What we have learnt today is

  1. Post links so a big corp can make money, good
  2. Post links about fluffy bunnies, bad
  3. Post links which are backed up by evidence rather than woo and bullshit, also bad
  4. FB is a pile of shit
  5. My wordpress is still up and running despite being ignored for two years, expect to see more posted here.

Graphing has happened

Some hunting later and I’ve found a graphing module which suits my needs and hacked up the first version (only filters for ‘TEMP’, doesn’t accont for the sensor ID etc etc).

Oh and yes I’m reading the database as root due to some weirdness with the permissions which needs fixing.


On the todo list for the whole project

  • Make the logger & grapher sensor ID aware
  • Handle “BAR” and “HUM” data types
  • Optionally handle the “BUTTON” type
  • Graph multiple temperature sensors onto a single graph
  • Rolling 24h graph; Day, Week and Month graphs
  • Move the Pi to a central location and get wlan0 working

IoT monitor script

As promised here’s the code I’ve currently got watching for incoming messages from the slice of pi.  It’s a hacked up version of the script from Fernando Lourenco’s instructable

The code pulling from Weather Underground is gone and I’ve shuffled things around a bit for my purposes.  No judging what I’ve done to the python if you please, I’m fresh in from years of abusing perl to meet my needs but have shifted to python for pi related stuff since solstice.


#!/usr/bin/env python
# --------------------------------------------------
from time import time, sleep, gmtime, strftime
import logging
import logging.handlers
import serial
import os
import os.path
import datetime
import sys
import MySQLdb as mdb
# --------------------------------------------------
# create table things ( 
#    thistime timestamp, 
#    ID varchar(2), 
#    type varchar(10), 
#    value float );
# --------------------------------------------------
DEVICE = '/dev/ttyAMA0'
BAUD = 9600
ser = serial.Serial(DEVICE, BAUD)
# --------------------------------------------------
my_logger = logging.getLogger('MyLogger')
handler = logging.handlers.SysLogHandler(address = '/dev/log')

#my_logger.debug('this is debug')
#my_logger.critical('this is critical')
# --------------------------------------------------
def dumpResults( thingMsg ):
    print "Message : " + thingMsg
    readValue    = -100
    readID        = "99"
    readType    = "NONE"
    writeMe     = 0

    # Raw mesg logging
    thisTime = strftime("%Y-%m-%d %H:%M", gmtime())
    my_logger.info( "%s,%s\n" % ( thisTime, thingMsg ) )

    readID = thingMsg[1:3]
    if thingMsg[3:7] == "TEMP":
        writeMe = 1
        readType = "TEMP"
        readValue = thingMsg[7:]
    if thingMsg[3:7] == "BATT":
        writeMe = 1
        readType = "BATT"
        readValue = thingMsg[7:11]
        if readValue == "LOW":
            readValue = 0

    if writeMe:
        thisMsg = "%s,%s,%s,%s\n" % ( thisTime, readID, readType, readValue )
        with open( "logfile.txt", "a", 0 ) as thisFile:
            # Dump the information to file and setup the message
            thisTime = strftime("%Y-%m-%d %H:%M:%S", gmtime())
            thisFile.write( thisMsg )
            print( thisMsg )
            con = mdb.connect('', 'monitor', 'password', 'houseLogging');
            with con:
                # SQL stuff
                cur = con.cursor()
                cur.execute( "insert into things values ( '%s', '%s', '%s', %s )" % ( thisTime, readID, readType, readValue ) ) 

        except mdb.Error, e:
            print "Error %d: %s" % (e.args[0],e.args[1])
            my_logger.critical( 'Could not write to db - '+thisMsg )
    return( 1 )

def get_temp():
    global ser
    fim = time()+ TIMEOUT
    my_logger.debug('Attempting to get temp')
    while (time()<fim):
        n = ser.inWaiting()
        if n != 0:
            data = ser.read(n)
            nb_msg = len(data) / 12
            print "Number of message blocks " + str(nb_msg)
            for i in range (0, nb_msg):
                msg = data[i*12:(i+1)*12]
                print ">>" + msg
                dumpResults( msg )
    return {1}

# --------------------------------------------------
# main function
# This is where the program starts 
def main():
    while True:
        temperature = get_temp()

        #    print ("temperature=ERROR-Timeout!")

if __name__=="__main__":
# --------------------------------------------------

Wireless Things or “Fighting with IoT”

So I’ve been hunting around for a decent system to build out some initial “smart home” type projects, focusing to start with on temperature, humidity and pressure.

As part of the excessive digging through google and testing out my ability to keep changing search parameters until something good pops up I came across the range of radio sensors from Ciseco (http://www.wirelessthings.net/) which merrily plug into the RPi and an Instructable which at least pointed in the right direction while missing some of the key steps which aren’t entirely clear from the product docs.

2016-01-07 17.28.09 2016-01-07 21.06.42 2016-01-07 21.06.52


First things first, install the hat onto your RPi of choice, I’ve installed on a RPi B+, but the forum indicates that it should work just as well on a RPi 2.  The hat isn’t stackable so the RPi 2 might be better in the long term by keeping access to some of the GPIO pins.

Pop the lid off the sensor, you’ll need access to the configure button later on.

You must either install the LaunchPad application on the RPi and be able to run an X based display either locally on the RPi or exported back to your working system of choice (I’m using on a Win7 machine running Xming).  This is needed to setup the sensor which arrives in a deep sleep and no hint as to what the device ID is.

Disable the serial console from the raspi-config application, or go through the manual steps to remove /dev/ttyAMA0 from /etc/inittab and /boot/cmdline, reboot as necessary.  Failure to do this blocks the ability to actually access the radio device.

Follow the LaunchPad documentation (PDF Doc from github), first setting up the encryption key for the radio device (I’m using the Slice of Radio for the RPi).  Then run the LaunchPad and follow the instructions for getting the Message Bridge running and setting up the sensor for the first time.

For inital testing purposes I’d recommend setting the reporting interval at 10 seconds so you’re not spending the entire evening waiting for the next poll.

Providing that everything has gone well, you’ve worked out the permission problem on /dev/ttyAMA0 (or are running with root privs) you should be seeing something like the following in minicom


The Message Bridge appears to be there to provide a pretty interface into the serial port, however if all you intend to do is listen for information landing on the serial port I would ditch it and just run a script in your language of choice and parse the data as it comes in.

To come

I need to add in some more monitors, work out the range on the sensor and position the monitorPi appropriately in the house, then some graphing to make it actually useful.

I’ll post the script I’m using later.

Links and other useful stuff

Language of things : https://www.wirelessthings.net/language-of-things
LaunchPad : https://www.wirelessthings.net/launchpad
Alternate Instructable