Another Harlow Carr picture
/Here’s another Harlow Carr picture. Because I like you.
Rob Miles on the web. Also available in Real Life (tm)
Here’s another Harlow Carr picture. Because I like you.
Today finds us at Harlow - Carr gardens in Harrogate. These are awesome. If you live near enough, get down there and have a walk around. If you don’t live near enough, make a special trip. They even have a “Betty’s” tea room on site. Wonderful.
Lumi Keys are great fun. I’m trying to persuade myself to do more piano practice and a keyboard that lights up as you play it sounded like a great idea. Particularly if the keyboard supports aftertouch (you can press the the keys down harder to affect the sound of a playing note) and you can change the sound of the note by wobbling the key from left to right after you’ve played it. All this is sent out using MPE (Midi Polyphonic Expression) messages which work with a lot of modern sequencers. So of course I bought one. The package that I bought is called the Studio Edition and comes with drum and player applications that make really nice sounds.
The keys are not quite full sized, but they are big enough. The aftertouch and wobble effects do work, but they are not totally consistent across all the keys. Some keys need more wobble than others. However, they do allow for a lot more expressive playing. And the lighting effect is awesome. It really makes playing a keyboard a performance. There are a variety of different colour schemes and you can get the keys to highlight different scales and keys. You can also change the response curves of the various inputs.
There’s a learning app for IOS and Android devices that lights up the keys that you need to play to knock out a tune. This turns piano playing into a game a bit like Guitar Hero. I’ve had a quick go and it looks like fun, although I’m not sure how it would help you to read music, which is a key skill for a piano player.
At the moment I’m really enjoying playing with the keyboard. I’m even thinking of getting a second one. The keyboards have cunning connectors on the end so that you can double the number of keys available by just snapping another keyboard into place.
I had plans for today’s Hardware Meetup. I wanted to show off my ESP uploader. However, fate had other ideas. I’ve spent the day paying off technical debt.
You run up technical debt when you think “I’ll fix/document/investigate that later”. I keep a list of my “debts” and try to remember to go back and clear it every now and then. This morning I thought I’d spend ten minutes sorting out a few things. Five hours later I was still at it. Along the way I discovered:
the ESP32 random number generator uses WiFi noise as a random seed.
you need to download several files into an ESP32 device when you initialise it. These must include the partition table.
you can find out the precise commands that are used to deploy a program in PlatformIO by enabling verbose mode for the build process. I’ve done this twice and forgotten how to do it after each time. I really should write that down (which of course is another piece of compound technical debt)
Not withstanding my lack of demo, we did have a very good meetup though.
It turns out that there is a gap between “making it go” and “making it useful”. Today I’ve been filling this gap for the ESP uploader software I got to work yesterday.
Today I managed to take a brand new ESP 8266 device out of a bag, plug it into my PC and then go to a web site using the Edge browser. And from that web site I managed to download a program into the device. I didn’t have to install any software onto my machine. Very pleased with this, it is going to make getting started with Connected Little Boxes much easier.
One of the things that I’ve learned over the years is that if you are really, really angry about something the best thing to do is to try and channel that anger into something constructive. I started today very cross about the way that a silly virus is making such a mess of everything. And then I thought I’d channel that into sorting out problems with the code that I’m writing to deploy programs from the browser into ESP devices. It’s not been working properly for a while, and that has been annoying me too.
So today the problem got both barrels of rage. I simply was not going to let it beat me. And fortunately for everyone I managed to get it to work. At the end of today I’ve managed to transfer a stub program from the browser into a device. This is not the same as a “proper” program, it is a chunk of code that forms the bootloader element that will accept the uploader commands. However, It has proved the underlying process can be made to work, so I might have started the day angry, but I’m ending it happy.
Today was supposed to be the day that I lured a bunch of hapless family members to the house with the promise of free food and then got them to move a piano into the garage. Thanks to a nasty little virus that’s not how it turned out. Fortunately nobody is actually ill, which is the only part of good news in the whole thing.
I didn’t even know that black tulips were a thing until number one wife planted some….
I think I might actually be a writer now. I’ve spent the day working on another Hackspace article, along with a bit of editing.
I spent a happy couple of hours today disassembling program code as part of an article I’m writing for Hackspace magazine. I love seeing the individual instructions that are actually going to be obeyed by the hardware. As an example, consider this statement:
i = i + 1;
This adds 1 to the contents of a variable called i. This is the assembler that is produced for an ESP32 device.
The statements fetch the value, perform the addition and then put the value back in memory. Folks, this is what computers do. There is another layer underneath this called “microcode” which takes the value “881b” and works out that this means “add 1 to the value in A8”. The best description that I’ve ever found of how this works can be found in the book “Soul of a New Machine”, which is a fantastic read whether you are computer person or not.
eZtime is a splendid library for Arduino time keeping. I use it in Connected Little Boxes to manage all the clock data. Up until now it has worked perfectly. Then today I noticed that one of my clocks was out by an hour. Not getting the time at all is one thing, but getting a time so precisely incorrect seemed strange. I eventually tracked it down to this call in my program:
homeTimezone.setLocation(clockSensorSettings.timeZone)
This asks eZtime to set the time zone for the given area, which in my case was “Europe/London”. To do this eZtime has to send a message to the time server and get a response. If the network (or server) is busy the response might never come, and that’s what was happening to my code.
The interesting thing about this problem is that I only observed it when I had several devices powered from a distribution board, and turned them all on at once. A sudden cluster of requests for location setting information from lots of devices seemed to result in some devices not getting the proper response and consequently being out by one hour.
The good news is that the setLocation function returns a value indicating whether it succeeded or failed, so I’ve updated the program to retry until it gets the location setting it wants.
We’re getting some new furniture. To go with our new curtains. This means that we have to get rid of our old sofas. Today some lovely people from the British Heart Foundation came and took them away. Of course, it wasn’t without incident. When it was delivered they had to dismantle the big sofa to get through our “quirky” (read that as small) front door and into the house. When the collectors arrived I thought I’d taken everything into the right number of pieces but then we found that one chair would not pass through the opening without further surgery.
And one of the four bolts (have you noticed that it is always the last one) holding the base on just would not come out. It was quite fun, two folks holding the chair up in the doorway while I grappled with a mole wrench and a spanner, all the time trying to observe appropriate social distancing.
In the end I prevailed and hopefully someone else will be able to make use of what are really comfy chairs.
Every now and then I take an old camera for a walk. Well, it hasn’t any legs of its own. Today I took out one of my old Signa cameras. These are interesting because they use a Foveon sensor. Rather than having adjacent red, green and blue receptors and using software to interpolate their values and come up with colours, the Foveon sensor stacks red, green and blue receptors on top of each other. This means that the primary colour intensity values all come from the same place and it should make for a more accurate image. They do still look rather good.
Apparently it is a good thing if your software behaviour lines up with the documentation. So I’ve spent a lot of today making sure that this is the case for Connected Little Boxes.
I had my first Covid vaccination a while back. And today I had my second. I see myself as a squeamish and self-centred person (I only faint at the sight of my own blood) but I got by just fine.
At the hardware meetup last night Lydia suggested that I get into Rollup. It’s a way of taking an npm project (which would normally run on a server) and packing it up so that it can be downloaded from a web site and run in a local browser. The rollup application runs on your PC and does the packaging. Which, if you have a PC, is a problem because Windows 10 is very unkeen to run programs that have been downloaded from the internets.
You can fix this, and get the program to work, by asking Windows to be a bit more relaxed for a while. The command to do that is:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Enter the command into the terminal in your Visual Studio Code session and you should be good to go.
We had a great hardware group meetup this evening. One thing that these meetups have really brought home is just how useful it is to have other folks play with stuff that you’ve made. I got some lovely insights into the way that the MQTT topics should be organised for the Connected Little Boxes.
I spent today editing chapters 7 and 8 of Begin to Code with JavaScript. They are a lot better now.
Some things are hard to do just because you don’t know how to do it. Today I wanted to move some music off my PC onto my iPhone. I’ve got Apple Music but some of the stuff I like doesn’t exist there. Or it exists for a while and then vanishes. Anyhoo, it turns out to be very easy, at least for me. I just had to open iTunes on my PC, import the folder containing the music files onto the PC and then wait a while. Eventually they appear on the phone. Now I can play the copy of my “OK Chicago” single. Or I could just watch the YouTube video:
Rob Miles is technology author and educator who spent many years as a lecturer in Computer Science at the University of Hull. He is also a Microsoft Developer Technologies MVP. He is into technology, teaching and photography. He is the author of the World Famous C# Yellow Book and almost as handsome as he thinks he is.
Begin to Code with JavaScript is now available for purchase and download. You can find it here