Agile Octopus Histograms

This is a very nice lcd panel

I spent some time today working on my Agile Octopus price display. Agile Octopus is an electricity tariff where you get a different price every half-hour during the day. A while back I made a device that would get the current price and display it, but now I’ve added a little histogram that displays upcoming prices for the rest of the day. The picture above was taken at 7:14 pm. The solid lines in the histogram are the hours and the dotted lines the half hour prices. On the right you can see the minimum and maximum prices. It looks like the prices will be going down over the evening. We’ve found this quite useful when deciding when to put the washing on or bake a cake. The display is powered by a Raspberry Pi PICO-W driving a rather nice LCD panel from Pimoroni.

It’s actually rather pleasing to make something that folks actually find useful and might even save us money.

The return of the sticky lenses

A while back I sent a couple of lenses to have them fixed. They both kind of worked, but one had a bit of fungus growing inside (never nice) and the other had super-slow iris blades so it was impossible to pictures at anything other than maximum aperture. I think someone had thought they could improve its performance by adding oil. Which is never a good idea where lenses are concerned.

They came back today and they seem to be quite splendid now. I’m looking forward to taking them out and grabbing a few pictures with them.

Dominion Calculator

Turns out I’m good at drawing hovels…

We had a great game of Dominion last night. The scores were very close, the last turn was played, the game ended. And then crashed. Everything locked up and we didn’t get the final score. Much unhappiness, because everybody thought they’d won. Fortunately I had the presence of mind to take a copy of the entire game log (you can cut it out of the window in the page) and saved it as a file.

So today I created “DominionCalc”. It takes in a log and figures out the player scores based on their actions. I don’t think it is perfect. But it did work out that I’d won. Not that anyone believed me.

Anyhoo, if you fancy having a go with it you can find it here:

https://www.robmiles.com/dominioncalc

Found a camera...

It’s a very neat device

I think my camera collection has grown to the point where it has its own gravitational pull and attracts other cameras. Which is a good thing. This morning I was tidying up the garage so that we could find the car (or something) and I found the camera above. It is a very neat little thing, but I’ve no idea where it came from. It has a nearly completed film in it, so I’m going to have it processed and see what we get.

Working with old film

I only did a tiny bit of post processing

A few years ago I bought some cheap film. It was cheap because at the time film photography was in what looked like terminal decline. Things have changed. Film is now popular and also super expensive. So I’ve dug out some of my old cheap stuff and I’ve been using in an old Pentax that I also bought a few years ago.

Today I took the exposed film into Max Spielman in Beverley to get it processed. When I picked it up they told me that the printing hadn’t worked too well for some of the shots and gave me a CD-ROM with the pictures on it by way of apology. I had a look at the negatives and they were very, very “thin”, which means that they didn’t get enough light to expose properly. This might be because the film is old, or perhaps my ancient Spotmatic has got the exposure wrong. Kudos to the Max Spielman folks for being so helpful. Back in the day all you used to get was a sticker on badly exposed prints telling you that it wasn’t a processing problem….

I’m getting to really like film photography.

Bye bye BLTouch

It seems we are not quite out of the woods yet…..

I was showing off my 3D printer last week and it promptly buried its head in the print bed and dragged it around. Wonderful.

I’ve had this problem for a while. The BLTouch sensor on my machine has got very unreliable. This is the little probe that tells the printer when the had is close to the bed. Or not.

Anyhoo, I’ve spent the afternoon removing it. I’ve been manually adjusting the print height for years and I don’t mind doing it again. I’ve loaded up the Jyers firmware which has a very nice automated levelling function which moves the head to the different corners so you can set it up by hand. This works very well. Now all I need to do is solve the bed adhesion problem I had while printing some more Tags of Fun. The good news is that the print quality is excellent. The bad news is that half way through the print process the thing I’m printing tends to want to go off for a walk…..

Driffield Steam Fair

There were loads of engines like this

Last week we couldn’t make our annual trip to the Whitby Steam Fair because bad weather got in the way. So today it was excellent to be able to go down to the Driffield Steam Fair and look for some traction action (sorry).

I was worried that the Driffield event might be smaller than the Whitby one, but it turned out (at least to me) to be a bit bigger. There were loads of engines, large and small bustling about the showground. There was a funfair, pizza and amazing bubble waffles. The weather had a little go at spoiling this show too, but there were only a couple of showers during the four hours we were on site. It was great. I’m definitely going again next year.

Agile Octopus for tariff fun and games

I think we’ll have salad for tea

I’ve just added another monkey to my back. I’ve signed up for Agile Octopus. This is an energy pricing scheme that uses green energy which can change in price depending on the weather. I now really like the idea of strong winds...

The tariffs are set on a half hourly basis and you get them the day before. I’m keen to have a go with it because it would be nice to get paid for charging the car (if there is a lot more power than demand you can actually get prices to go negative). If I had a battery in the house and/or solar power it would be even more interesting.

We’ve been on it for a couple of days and it is quite fun. I’m not sure if we’ll be on it for ever, we’ll have to see what effect it has on the bills.

Fun with Bitzee

You can interact with the pet by tapping the moving leds. A bit scary but it seems strong enough.

One of the many nice things about having kids around for a while is that you get to look at their toys. For example there’s the Bitzee digital pet. It comes in a little case like a ring-box and when you open it you see a little vibrating bar which has OLEDs on the end. These use persistence of vision to display your little pets. The picture above was the best I could get after several attempts. It has slightly cut off the head of the little bird.

You get to feed and clean up after your pets. There are also some simple mini-games and you can attract new pets over time. I really like the display - it’s much more interesting than a panel and the different animals have distinct personalities. It doesn’t look like it will take over your life either, as when you’ve done playing with it you just close the box and everything stops. It’s a bit pricey but I think it is worth it given the display.

Sewerby Hall for the win

I should probably use some smart technology or other to remove the bin on the right..

Today finds us at Sewerby Hall for the day. If you happen to have a six year old to amuse this is a great place to visit. They’ve got a zoo with penguins, mini-golf and a land train that takes you down to Bridlington sea front where you can find loads of arcades containing penny falls machines. Great place.

Radios in tins = bad idea

Perhaps they might make a nice birthday present…

I’m making a new embedded device. It’s going to be a Bluetooth remote control. I’m on an upcycling kick at the moment, and in a tradition going back a while I thought I’d put the device in an Altoids tin. I bought the mints and then I realised that Bluetooth uses radio to work, and putting the PICO W in a metal box (i.e. Faraday cage) might not be for the best. Oh well.

ESP resources from Rob

Sprockets are apparently in…

I got a nice comment from Dave which also asks about any resources for the ESP8266 or the ESP32 devices. I thought I’d pop the answer in a blog post.

You can find all my ESP32 blog posts here. You can find all my ESP8266 posts here. I’ve written a bunch of articles for HackSpace magazine which include ones about ESP devices which you can find here. I’ve got a bunch of project repositories which include those devices on my GitHub pages here. I hope you find them all useful. Or at least one or two.

What is DNS?

A survey released today reveals that not many people know what “DNS” stands for. It’s a computer networking term that specifies the system used to convert internet names into the physical address of a computer. They say that this is bad, but I think they were asking folks the wrong question. If they’d asked folks “what is robmiles.com?” most of them would probably have said it’s an address on the web. Which is just about all you need to know about DNS.

What folks do need to know however is that robmiles.com costs me a few pounds a year to keep active, and that when I set it up nobody checked that I was really Rob Miles. A Domain Name (which is what robmiles.com is) can be bought for a tiny price and there is no process of checking that the names represent what they imply. Today I can buy the domain name “bbcradio.media” for less than two pounds. I can then set up websites with that address and pretend to be the BBC

You could be the BBC for less than a couple of Quid!

So the important thing to know is that internet addresses are easy to get and very cheap, which means you need to be seriously careful when you go onto the internet and start looking for things. You also need to be careful when you get emails from people claiming to be from a particular organisation or company.

Chunking your ESP32 Web responses

Note that this is not actually how computer memory works

Great title for a blog post eh? One of the wonderful things about modern embedded devices is that they can host web sites. You can use your phone to browse content served by a device that cost less than a pint of beer. Although some people prefer to buy the beer.

Anyhoo, I’ve been making devices that host web pages as part of the configuration process for my Connected Little Boxes. You turn the device on, scan a QR code with your phone which connects to a WiFi hotspot served by the device and then scan another QR code to get to a configuration page so that you can enter your local WiFi credentials and generally set the device up. This is how lots of connected devices work, and I wanted to make my own system for doing this. And I ran into problems with memory. Not forgetting what I’m supposed to be doing (ho ho) that happens all the time. More like the way that once I’ve got everything running on my little ESP device I’ve got hardly any memory left for large things (comparatively) like web pages.

Now, one way to serve out a web page is to put the page content into a string and then send that string out. This works, but you need enough memory to hold the entire string. Which it turned out I didn’t have. So a better way is to send the page a chunk at a time. The ESP8266 web server has a way of doing this:

server->chunkedResponseModeStart(200, F("text/html"));
server->sendContent(settingBuffer);
server->chunkedResponseFinalize();

The first statement tells the server I’m sending a bunch of chunks. The second statement sends a chunk of text from the settingBuffer string. You can send as many chunks as you like. The third statement ends the chunking. Very useful, particularly when you discover that you can send out chunks of text that are stored in program memory rather than ram.

So I got all this working and then I wanted to move the code to the ESP32 device. This chip is a bit more expensive than the ESP8266 but it is a lot more powerful. And it doesn’t do chunking. Wah!. Fortunately I found this wonderful post which told me how to extend the ESP32 web server to make chunked responses work in the same way as the ESP8266. It will be part of the latest version of the Connected Little Boxes embedded code (tentatively titled HULLOS-X) soon.

When in doubt - rebuild everything

Working work in progress

I’ve spent the last week trying to get an ESP8266 device to host a configuration web site for my Connected Little Boxes. It’s proved to be quite a challenge (see Monday). I had the worst possible fault. One that only appears every now and then. And causes the whole thing to just crash.

In the end I decided to go back to first principles and run one of the example applications in a brand new project. And it worked a treat. That’s good because I now know that what I’m trying to do is possible (always useful knowledge) but bad because my code still doesn’t work. In the end I migrated all my code into the working example and went from there. In the process I discovered that, for whatever reason, the code I had been using was based on very old driver code for the device. Early versions of the ESP8266 libraries were known to be a bit buggy and unreliable. I thought that mine had been updated as part of the normal behaviour of PlatformIO (which I’m using to build and mange the app). This turned out not to be the case.

So - if you’ve got problems that you don’t think are your fault, it might be worth checking to see if you are using the latest version of the libraries for your product. Of course, new versions also bring new bugs of their own, so make sure that you keep copies of the old version too…..