Plumbing the depths

Recently our electric shower has been indicating that it is not a well machine. Last week a lever linked to the power button fell off and in recent days the shower has been making the kind of noise that X-Wing Starfighters make just before they crash into the ground. And today the noise acquired a new rumble that wasn’t there before. So I guess it is new shower time again.

I’ve been installing new showers for ages. Sometimes with jetlag. Maybe I should find a more reliable brand. For me the key thing about shower fitting for me is that putting the new shower in place is the easiest part of the process. Getting the old one off the wall can however be problematic.

The shower has these highly efficient pipe gripping fittings. One of the best parts of the installation instructions is the bit where they advise you not to push your finger into the pipe hole. (I was of course instantly seized with an urge to do just that). The pipe grips are based on a Chinese finger trap design. The harder you try to pull the pipe out, the tighter it is gripped.

In fact, they grip so well that every new shower is supplied with a “push fit release tool”. The diagram above (which has to be studied very carefully) shows how the tool can be used to release these grips. However, if you use it wrongly you just end up with a bunch of skimmed knuckles and a shower that is even more firmly attached than before.

If you ever find yourself removing an “Mira Event XS” remember that the special tool should be placed on top of the fitting and then pushed vertically down to release the grip. You should not push the release tool into the enticing little gap underneath the fitting and try to use this to force the fitting up.

Of course, if this thing fails (and it will) you end up like me, trying to solve the problem by placing an open-ended spanner on top of the fitting and hitting it with a hammer. This will either release the shower from the pipe or give you a new problem so large that you will forget about all your troubles with shower removal. Fortunately I was lucky this time.

I thought I’d won once I’d removed the shower, but it seems that fate had other ideas. I wanted to replace the hose and the shower rose too. Unfortunately the design department at the shower company had made some tiny changes to shape of the hose so that the new one doesn’t play well with the old fitting left on the wall from the previous shower. So I had to take the wall fitting off. Then I find that the design department has made another change (thanks folks) so that the new fitting only needs one support bolt, leaving me with a couple of spare holes in the bathroom wall. So I had to find an elegant way of hiding these. Wah. It’s almost as if the design department exists solely to make my life more difficult. That can’t be true. Can it?

Anyhoo, the whole thing is now sorted to my satisfaction and we can enjoy smooth and quiet showers again. For a while.

Selling books by mistake

My first and only customer….

I’ve been blogging for quite a while. And the internet continues to surprise me. A while back I wrote a silly post about a book I found in a local Waterstones bookshop. Later I get a message from Erik saying he’d like to get hold of the book that nobody seemed to want. I went back to the store, asked the assistant to find the copy and sent it off. Erik has just sent me a picture of himself with his treasured text.

I really hope he finds it useful. For me it’s really nice that something silly that I did has had a useful result.

Still some tickets for DDD North 2020

Only my mother used to call me “Robert”….

There are still some tickets available for DDD North 2020. Of course, I’m only telling you about the event now that I’ve got my ticket…..

The DDD events are always awesome, so if you are in the area you really should go along. And if you’re not in the area you drive to Hull and then go to the DDD.

I’m not presenting a session this time, but you might get to sit next to me at one…….

Hardware Group Meetup

On the way into the Hardware Meetup at c4di tonight I sprinted off to the waterfront, leaving Brian wondering what I was up to. There was a great big boat going down the estuary and I wanted to grab some pictures. Of course, but the time I got the big camera out and pointing in the right direction the boat had moved downstream a bit, but I still rather like the resulting shot.

We had some really good discussion about hardware and whatnot and Brian showed me how to get started making my own PCBs. The next meetup will be on the 20th of February and I’ll be publishing details soon.

Writing up code as you write it

I’ve found a good use for all that time I seem to be spending waiting for my programs to compile and deploy to my hardware. I’m writing up what I’m trying to do. This is what I wrote today:

  • fixed a bug whereby only the latest reading and not the average environmental values are sent in an MQTT reading.

  • changed the handling of timeout so that an incomplete reading is sent rather than just skipping a reading

  • bug in modification so that the air quality reading was not sent when only the environmental sensor was disabled. This is because the reading age was less than the reading timeout. So a reading taken at the start of the reading period would be "out of date" by the time that the reading had timed out. Fix this by increasing the reading age to 60 seconds. Also modified the reading timeout setting so this cannot be set more than 60, so that a user couldn't cause this by silly settings.

  • added a 1 second delay before powering down after a message has been sent so that we can send MQTT messages to the device when we know it is awake. Managed this delay to ensure that it is none blocking.

  • found a nasty bug in MQTT message decoding that broke the decoding of incoming messages. Put the MQTT message decode into the main thread rather than calling the JSON decoder on the callback which is running on a network interrupt because it broke the Serial.print output. Added better decoding of the message types (better as in working).

Fun with KiCad

After spending a chunk of today with KiCad I have managed to make a schematic. I managed to go from this error…

..to this error…

… to no errors. Now I just have to figure out how to make this design into a PCB.

Note that if you are into hardware development you should probably think about getting into KiCad. It really is a wonderful program. It’s free and it lets you design your own circuit boards.

Close all but this file in Visual Studio

This is awesome. It might have been in earlier versions of Visual Studio, but I’ve only just noticed it. One snag of using the lovely code navigation features is that you can end up with lots of windows open that you don’t need any more. So, now you can right click on the tab for an open file and this very useful menu pops up. Close all but this does just what you want. It gets rid of all the other windows and just leaves you back where you want to be. If you’ve got several panes open (a great idea if you have a wide monitor) it only closes the tabs in that pane.

Very useful.

Fuses from history

Ian gave me these ages ago. I did a blog post about how I’d put a 3 amp fuse in the microwave with predictably hilarious results. Next time he saw me he gave me a couple of packs of fuses with great big labels on them (as if their different colours weren’t enough).

Anyhoo, today I actually used one of them. The bulb in my lovely magnifying lamp failed and as a parting shot it took out the fuse in the mains plug. So I finally had a use for a 3 amp fuse.

Thanks again Ian.

18th Hull Raspberry Pi Jam

I went to the 18th Hull Raspberry Pi Jam today. It was great. They had loads of Raspberry Pi machines set up and a lovely exercise wiring up neopixels. Everyone who did the lab was knocked out by how easy it is to create and control coloured light displays from software. I was showing off the work in progress for my LED Cube, which is presently two of my older panels connected to a Raspberry Pi and displaying demo images. I’m using this software to drive the panels and it works a treat.

I was telling anyone who would listen (there were a few) that the panels I really wanted to use were stuck in UK customs. I’m really hoping that soon they will be released, I can pay whatever hefty duty they figure out that I owe and I can get on with building the device.

Then I got to talking to Jon about his recent project which involved making an awesome piece of artwork. For his next one he’s going to be using a coin mechanism. These are the devices that you find on fruit machines and the like. Apparently you can buy them from Ali-Express for not much money. So I’ve bought one.

You configure the mechanism by setting it in “learn” mode and then inserting loads of a particular kind of coin. It can remember three different types of coin and the output is a simple sequence of pulses that should be easy to pick up with an Arduino or Raspberry Pi.

I’ve absolutely no idea what I will use it for. I was thinking of taking it to a hardware meetup and offering people the chance to see if it recognises their coins:

“Lets see if it can recognise your two pound coin. Oh, bad luck. Sorry, no I can’t get your money back again.”

If nothing else, this could be a nice little earner. The device has cost me considerably less than a computer game and I think I’ll have at least as much fun with it.

The next Raspberry Pi Jam (which I think will be the 19th), is on the 14th of March. This upsets me, because I would really like to go but I won’t be able to make it. Kudos to Jon and Matt who organised the event, provided the coloured pixels and then helped everyone to make them light up.

Using Arrays in OpenSCAD

I was doing some work today on a new chassis for our environmental sensor and I discovered how to use arrays in OpenSCAD. So I thought I’d write it down for me for later.

OpenSCAD is a language designed specifically to express 3D designs. I’ve been using Python inside the FreeCAD tool, but I’m trying to learn OpenSCAD too. Let’s just say I like a challenge.

Anyhoo, today I was placing the holes for the particle sensor mounting. I know where the four holes need to go, but I don’t want to have to create four separate cylinders that describe the holes to be cut. I’m lazy. And besides, next time I do this I might want to place 100 fixing holes. So I looked into how I could put the hole coordinates in an array and just write some code that works through them and makes the holes. That way, if I need to place 100 holes I just have to add to the array.

sensorMountingHoles = [[19,0],[41,0],[0,55],[60,55]];

for (a = [ 0 : len(sensorMountingHoles) - 1 ]) 
{
      point=sensorMountingHoles[a];
      translate([point[0],point[1],0])
      {
          cylinder(r=1.4,h=10);
      }
}

This little snippet of code creates an array called SensorMountingHoles which has offsets from 0,0 of the holes that we want to make. The array is actually an array of arrays (that’s why the square brackets are nested) and each “inner” array has just two elements, the x and y coordinates of the point. The for loop works through the “outer” array and pulls out each point in turn, translates to that position and puts a cylinder there. In other words I’m going to get holes at (19,0), (41,0) and so on. If I want more holes, I just add more elements. If I use the resulting collection of cylinders in a “difference” element I can use it to cut holes.

Rather nice.

Raspberry Pi Jam in Hull on Saturday 1st Feb

The next Raspberry Pi Jam is in Hull on Saturday 1st Feb. It looks like all of the coding slots have been booked up, but if you want to go along as a spectator, or to show off something you’ve made it looks like there are spots available. You can sign up here. I’m going to take along some LED panels and talk about building a LED cube. I’ve just discovered that my LED panels are actually in UK customs at the moment, which is rather exciting.

Amazing Radio: Conversations from a Long Marriage

Yesterday I asked the question “Does anyone listen to radio drama any more?”. And I made the point that if you don’t you should. I’ve been listening to Conversations from a Long Marriage on BBC Radio 4. It’s what you get if you have a couple of actors and a write at the top of their game and you turn them loose.

It’s exactly what it says in the title. The bickering of a married couple (probably a tiny bit older than me) about life, the universe and how they get on with each other. There’s a story of sorts, with stuff happening along the way, but for me the really great bit is the way that the actors inhabit their roles, and the delightful detail that brings it all to life.

I guess it works best for someone like me who happens to have been married for rather a long time, and can relate to a lot of the content. But I reckon it would work for anyone. It’s very funny, and you build up a real affection for the characters. It’s hugely impressive that the production can build up a whole universe out of just two people talking.

At last, I’ve found a reason to run the BBC Sounds app that they keep going on about on every TV and Radio program. Seek it out.

Root Letter: Last Answer for Switch

What did I do today? Well, I went to a small town in Japan, checked into a hotel, met a strange old bloke in the communal baths, had a meal in a nice restaurant and discovered my fortune in love at a local shrine. Not in real life of course (I wish), but in the game Root Letter: Last Answer which I found in town today at a very nice price. It came in a box with some nice artwork too.

It’s an interactive graphical novel. I expected that the graphics would all be hand drawn, but that is not the case. Instead there is a lot of photography, plus a smattering of video. The locations look like lightly processed images of real places and all the characters are all pictures of different people. I’m not sure if the production process actually involved going to a town, taking pictures of the library, museum etc etc along with local postmen, chefs, bartenders and creepy old men, but it looks like it could have been.

The plot is rather slow moving, but for me it is all about the journey anyway. You do get a quite nice glimpse of Japanese life along with the gameplay. What you do affects the outcome, so I’ve already decided that a few dodgy decisions that I made at the start of the game may have doomed me a bit, but I’ll be happy to come back again and have another go. You can save your game progress at any point, so you can always save before a momentous conversation and then re-do things. You can’t really compare the gameplay to that of a fast moving video game, it is more like reading a book or listening to a play on the radio (does anyone do that any more - you should).

For the price of entry I reckon I got a good deal, and I’m looking forward to finding out just what happens.

"Secret Hitler" is an amazing game

We spent a very happy few hours last night playing the game “Secret Hitler”. Its a role playing game where fascists (plus Hitler) take on liberals. The job of the liberals is to find out who they are and then band together and use their superior numbers to pass liberal policies. The job of the fascists is to disrupt all this and get their policies passed. If fascists get Hitler elected as chancellor they win. If the liberals get to shoot Hitler they win. The gameplay seems rather complicated when you start, but after a while the process of holding elections and passing policies gets to be second nature. Then you can get on with the lying and chicanery.

It’s not really a comment on politics. It could just as easily be Sharks vs Jets or ketchup vs mayo. However, it does set up some very interesting gameplay which kept us very engaged. If you fancy having a go you can even download and print your own copy. Well worth a look.

Bring back good stuff: Humax PVR

By rights the personal video recorder should be a dead device. It was in our house for a few months. I had thought that the rise of streaming services would remove the need for you to own a device that records programmes off air. I was wrong though. The FreeView user interface on our TV is not just bad, I think it is actively hostile. Finding programmes on the different platforms is uniformly horrible. The iplayer site deserves a special mention here, in that it seems able to work out exactly what I want to watch and then hide it.

In contrast the YouView programme guide is a masterpiece of simple design. You just scroll back into the past and get the programmes that you have told it to record for you. And you can skip past the adverts.

So today I went up into the loft, found the required shiny box and plumbed it back into our system downstairs. It’s a very old device, but I don’t think it has been bettered.