BBQ success
/We actually managed to have our postponed barbeque today. But we didn’t end up moving the piano.
Rob Miles on the web. Also available in Real Life (tm)
We actually managed to have our postponed barbeque today. But we didn’t end up moving the piano.
Sometimes on a Saturday night all you want to do is watch a big dumb movie and eat popcorn. Tonight that is what we did. We watched Alita: Battle Angel which, as the poster says, is from the same producer as Titanic and Avatar. As if that is some kind of recommendation.
Anyhoo, it was fun. Lots of impressive computer graphics, fight scenes and whatnot. The ending is a bit of a let down though. It’s an obvious setup for a sequel that, given the performance of this movie, probably won’t be made. Worth a look as long as you have popcorn handy.
We went shopping up town in Hull today for the first time in a very long while. It was sad to see that some places haven’t made it through the pandemic, but it was great to see that McCoys is doing well. They are something of a Hull legend and benefit from a chunk of outdoor space on the side of Victoria Dock which is a great place to sit and watch the world go by as you chow down on their huge portions.
Great stuff.
I’ve just received a set of chapters for the final editing pass for my Begin to Code with JavaScript book. This is the point that I get to see what the artists have come up with for the illustrations at the start of each chapter. As usual, I’m completely knocked out by the quality.
I reckon that the book is a good buy just for the pictures. You can pre-order it here :)
Yesterday I created a command which will let a Connected Little Box send temperature values out of its serial port. Today I made a web page that will receive this data and display the values in large friendly letters.
This works by using the same browser serial libraries as I’m using for the the ESP firmware uploader. It works well. It means that it is now very easy to display serial data on a device by simply visiting a web page. You can find the temperature viewer page here.
I’ve added a new feature to Connected Little Boxes. You can now ask a box to send out sensor values as a JSON encoded string. This means that you can hang a box off a serial port and get data from it in a format that is very easy to use. It’s done using the console process and the command is called reportjson:
{"process":"console","command":"reportjson","text":"starting","sensor":"bme280","trigger":"tempsec","attr":"temp"}
The above command tells the Connected Little Box to send out the temperature value from the BME280 sensor every se4cond. The box will then produce a sequence of messages that look like this:
{"temp":"24.0"}
I bought my Lumi keys from Anderton Music. The only device they had available was an “opened box” unit which was a bit cheaper. However, when the keyboard arrived it turned out that someone had done a bit more than just open the box and look at it. They’d also used all the download voucher codes that came with the device. It is at this point my heart began to sink a bit, what with having to go back to Andertons and ask them to sort it out. However, the good news is that they owned the problem and kept me informed as they fixed it. I think the true measure of a company is how well they work in “failure mode” when things go wrong. In this test Andertons passed with flying colours.
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.
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