Never mind steps forwards and backwards…

Over the last couple of evenings I think I’ve been all around the houses 🙁

I pushed my new device templates into emoncms, but they just wouldn’t work properly. The various processes didn’t get set up and I kept getting errors. Tonight I decided to mount up a development partition with the templates in so I could modify them “in real time” when the Docker container was using them, but that made things even worse. Sometimes they just didn’t work at all and I was offered no device templates whatsoever.

After quite some time I discovered that the code for reading the templates isn’t really very fussy about matching names of files. Perhaps not as fussy as it should be. It was picking up my editor temporary files and assuming they were valid templates, which of course they’re not. At that point everything bombs out. But only when I had a template open in the editor 🙂 Editing the code to make things a bit more strict made life somewhat simpler and after messing about cutting down templates and moving between a working one and my own I discovered a subtle error in mine. That’s now fixed and I think this is the final form the RFXmeter template will take:

{
  "name": "single-input RFXmeter",
  "category": "RFXcom",
  "group": "Power",
  "description": "1-input RFXmeter",
  "inputs": [
    {
      "name": "count",
      "description": "CT Power 1",
      "processList": [
        {
          "process": "scale",
          "arguments": {
            "type": "ProcessArg::VALUE",
            "value": 0.001
          }
        },
        {
          "process": "kwh_accumulator",
          "arguments": {
            "type": "ProcessArg::FEEDID",
            "value": "power"
          }
        }
      ]
    }
  ],
  "feeds": [
    {
      "name": "power",
      "engine": "Engine::PHPTIMESERIES",
      "unit": "kWh"
    }
  ]
}

I am now able to create my devices and have inputs and feeds automagically set up. Go me.

Not so fast, sadly 🙁 It turns out that the accumulator processes need to have Redis running and I don’t. I don’t really want to pull it into the Docker image I’m running either, so it looks like I need another Docker image for Redis. That’s the next job then. Get the image set up, start it from systemd, then plumb it into emoncms and see what else blows up in my face 🙂

Posted in Computing | Tagged , | Leave a comment

The cleanest seed in all the county…

I allowed some of my coriander to run to seed this year. I didn’t want the seed to replant as that particular variety seems to gallop into flower at the slightest sign of sunshine. I was interested in having some for cooking though. Before the seed fell off the plants I gathered up the tops and hung them in a plastic bag in the polytunnel to dry out.

Once dry, rubbing the seeds between my hands seemed to be reasonably effective at removing the seeds from the stalks, but I ended up with a mixture of material somewhat like this:

Real Seeds have plans for a “seed cleaner” on their website however, so I decided it was worth putting one together to see if it would work. Here’s the result.

It was all built from bits and pieces I had lying about. I could do with some sort of catch for the flap that keeps the chaff door closed and I might have to buy that, but otherwise not a penny has been spent on this specific project.

I started with a 600mm x 420mm piece of 9mm construction ply for the back. Onto that I drew all of the locations for the various parts to ensure that I got them in the correct places with the appropriate spacing. It also meant I could measure off the angles where timbers join when they’re not at 90° or 45°.

Almost all the rest of the wood is from the slats of an old double bed. It happened to be exactly 70mm wide, so fitted the requirements of the plans perfectly. All the pieces are glued and screwed onto the ply, and where appropriate, to each other. The triangular “steps” against which the seeds fall are actually made from elm that came from the roof of our converted barn, so are probably over 200 years old!

Before fitting the clear front I drilled the holes for the funnel, vacuum hose and vents using a hole saw and screwed on the legs. The perspex sheet has been sitting around in the workshop for years. I actually have no idea where it came from. It may have been left here when we moved in. It wasn’t quite long enough so I had to extend the parts covering the bottom of the channels at each side. Even the screws holding it on were left over from fitting some lights in the workshop — they were supplied with the brackets and I didn’t use them.

Finally the flap at the bottom of the chute for the chaff is made from a scrap left over from flooring in the barn conversion, which I have been told originally came from a church in Winchester so is probably quite an age too. It’s attached to the sloping side of the chute by a hinge, and for the moment I have a couple of screws on the other side that means it can be kept closed with an elastic band.

The vacuum is quite powerful and I possibly need another vent hole despite the nozzle not being a tight fit into the top. I didn’t have a hole saw of quite the right size, so what I’ll probably do is 3d print an insert of the correct size and stick it in with silicone sealant. I also really need a large diameter funnel and a proper set of feet rather than just resting it against the saw-horse.

As it is though, it did a fine job. I poured all my coriander mess through and ended up with these:

There are a small number of bits of stalk still attached to the seeds so I might have another go at loosening those and the put the seed through for another pass. Oh, I also found a dried-out caterpillar chrysalis too. Good job that didn’t end up in someone’s dinner 🙂

Overall though, I’m really pleased with this. I didn’t exactly spend a lot of time on it and it has done a fantastic job.

Posted in Projects, Smallholding, Veg plot | Tagged , | Leave a comment

Sloe vodka time again

My sloes have been sitting in the freezer for a fair while waiting for me to get around to doing something with them. I finally got to it.

After purchasing such a number of bottles of vodka that it’s embarrassing to be seen putting them in the recycling at the same time, I’ve gone for the following proportions of ingredients, in wonderfully mixed imperial and metric units:

  • 3 litres vodka
  • 3lbs sloes
  • 12 oz granulated sugar

All put into a demijohn and shaken up on a regular basis. I’ll keep on giving the mixture a shake until all the sugar has dissolved and then leave it for a few months. In fact I had sufficient sloes and vodka for two demijohns so it seemed a shame not to use them:

In fact, I have a little vodka and about 2lbs of sloes left over, so I might try making some sloe cordial and perhaps a different fruit vodka depending on what I can find in the freezer.

Posted in Smallholding | Tagged | Leave a comment

Swimming, 22nd December 2021

It’s getting very quiet at the pool as Christmas approaches. I think there were at most seven swimmers in the session today. I wasn’t feeling too great but my 50m set actually went quite well in the end. I had a single failure on rep 14 and skipped the next, but I also had several reps below 42s which I’m quite happy with.

Perhaps as a result my 25m reps weren’t the most stunning, though I only had one failure, on rep 10. I skipped 11 and then ran out of time just as I was about to set off on the next. I suspect I got less swimming time than I was expecting because of having to faff about paying for my son at reception rather than online as I was able to earlier this week.

Posted in Swimming | Tagged , | Leave a comment

Second take on emoncms device template for RFXmeter

I felt I needed to revisit the template for my RFXmeter devices because what’s really required is kWh consumption figures between readings rather than cumulative values. Also there needs to be a way to handle the count values rolling over. Having read through some more of the emoncms forum, I believe the following is now a better version of the template, though I’m prepared to have to change it again.

{
  "name": "single-input RFXmeter",
  "category": "RFXcom",
  "group": "Power",
  "description": "1-input RFXmeter",
  "inputs": [
    {
      "name": "count",
      "description": "CT Power 1",
      "processList": [
        {
          "process": "scale",
          "arguments": {
            "type": "ProcessArg::VALUE",
            "value": 0.001
          },
          "process": "kwh_accumulator",
          "arguments": {
            "type": "ProcessArg::FEEDID",
            "value": "power"
          }
        }
      ]
    }
  ],
  "feeds": [
    {
      "name": "power",
      "engine": "Engine::PHPTIMESERIES",
      "unit": "kWh"
    }
  ]
}

Posted in Computing | Tagged , , | Leave a comment

systemd configuration file for RFXcom to MQTT Perl script

First job of the evening (at least, first indoor job of the evening) was to come up with a unit file to start the Perl script that takes power consumption data from my RFXcom unit and publishes it to MQTT. Fortunately that wasn’t too taxing and the following looks to work first time.

[Unit]
Description=rfxcom-to-mqtt

[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/rfxcom-to-mqtt.pl

[Install]
WantedBy=multi-user.target

I copied that to /etc/systemd/system/rfxcom.service at which point

sudo systemctl daemon-reload
sudo systemctl start rfxcom.service

was sufficient to get it running. Then

sudo systemctl enable rfxcom.service

should make sure it starts on a reboot.

There are a few things that would be neat to sort out at some point, such as the direct reference in the code to /dev/ttyUSB0. I guess the correct thing to do would probably be to arrange for a symlink to something like /dev/rfxcom to be created in the udev rules when the relevant device is plugged in, and also add

TAG+="systemd"

to the same rule. Then adding

BindsTo=dev-rfxcom.device
After=dev-rfxcom.device

to the unit file in the Unit section might do the trick. Need to research that last bit a little more though, as I’m not certain that’s correct.

Posted in Computing | Tagged , | Leave a comment

Two steps forward, one step back

This evening I made rather better progress with emoncms than I did a couple of days ago. I decided to go all-in and set up supervisord to control the processes running in the Docker container and that seemed to work fine up to the point where the process importing from MQTT died 🙁

Further investigation revealed a bug or two in the import script which I bodged up to the point where the script ran happily and imported no data whatsoever. In fact as far as I could see, it wasn’t even being sent any data despite the fact I could see it with a standalone client.

It wasn’t for some time that the possibility occurred to me that perhaps an authenticated user might not be allowed to subscribe to topics that are available to unauthenticated users in Mosquitto. I added a specific entry in the ACL file for my emoncms user and data started arriving straight away!

There’s still a bit of work to do now however, hence the step back. First I need to find out which of the two near-identical scripts for importing data from MQTT I should actually be using and test/fix it appropriately if it doesn’t work.

I also need to understand how to import my Watt-hour figures properly. I suspect that to be able to get daily usage graphs then I need to push the data through some more feed processing, which means modifying the device templates that I already have.

Finally I need to create systemd configurations to start the Docker image and the process that reads the data off the RFXcom unit. At that point I should hopefully be able to document it all.

Posted in Computing | Tagged , , , | Leave a comment

Swimming, 20th December 2021

I didn’t get to swim on Sunday which was a disappointment. Apparently Everyone Active’s booking system “lost” the session details so they couldn’t be booked. They’d have let me in to swim if I’d turned up though. Shame the receptionist didn’t tell me that when I phoned up to check what was going on 🙁

Anyhow, today I got to swim with my son now he’s back from university for the holidays and for most of the session we had the fast lane to ourselves. I was really struggling for pace today though and didn’t really get on it until halfway through my 50m set. I have absolutely no idea why 🙁 At least it wasn’t too bad once I did get sorted, but I shall hope for better on Wednesday.

Posted in Swimming | Tagged , | Leave a comment

Why do Hermes still exist?

The world being the way it is, we’ve probably had more deliveries than usual this winter. Quite a number of them have, sadly, been misdelivered by Hermes. Some have merely been several days late on a “next day” or “48 hour” delivery. Others have been weeks late, or failed to arrive at all. And this evening I received an email saying that a parcel I was expecting had been delivered, but none of the six people in the house at the time had actually seen it. Obviously I checked the tracking information and found the proof of delivery photo. Here it is:

Now I realise that some delivery drivers may be a bit weak when it comes to speaking the English language and don’t really understand what the word means, but to my mind that doesn’t constitute proof of delivery. More proof of being dumped in a hedge, really. Moreover, it’s no part of my property that I recognise and I do know it fairly well having lived here the better part of eighteen years now.

I assume that many organisations use Hermes because they’re cheap, but I do wonder if their up-front cheapness isn’t offset by having to deal with the persistent fuck-ups.

It really must take some special kind of effort to manage to be reliably this shit.

Posted in Random | Tagged | Leave a comment

One step forward, two steps back

I’ve spent a happy (hah!) evening trying to work out why emoncms wasn’t recording any data from MQTT. The documentation seems to claim it “just works”, but I just couldn’t see anything happening, even when I’d checked that the code is all starting with the correct configuration.

It’s taken quite a few hours to realise that the reason it doesn’t work in the Docker image is that there’s a second process to manage the incoming data feed that isn’t enabled. What’s more, Docker is really only set up with the intention of running one main process per container.

There are a couple of potential ways around this. The first is to run a script that starts both processes as the main command in the image. That might be ok, but it’s probably not good if one of them dies. In fairness, Apache itself seems pretty unlikely to die, but the php code for handling the MQTT data might. So whilst I might do this just to get a bit further with testing, it doesn’t seem like the right way to go long-term.

The other possibility is to use supervisord to start everything off. That means adding it to the image, but I think in the long run it’s the better bet.

It’s late now though, so this is something to look into tomorrow.

Posted in Computing | Tagged , | Leave a comment