Go England...
/Nothing like a bit of success to turn you into a football fan….
Rob Miles on the web. Also available in Real Life (tm)
Nothing like a bit of success to turn you into a football fan….
I feel terrible about this. After writing a blog post saying that I won’t be upgrading to Microsoft Windows 11 (which is looking even nicer the more I look at it) because my computer won’t run it I discover that Microsoft have renewed me as a Microsoft MVP.
Thanks so much to Microsoft for putting up with me. And there have been some very interesting chats over email between MVPs and Microsoft folks who have patiently explained the reasons why Microsoft will not be allowing machines like mine to run Windows 11. Having thought about it properly I agree with their policy. It is all about containerisation and security. What you really want is strong, hardware based, protection for your processes that the operating system can use to make sure that stuff that appears on your machine is managed in a proper way and that badly behaved code is detected and kicked off before doing any harm. The threats to vulnerable software and hardware are only going to get greater over time and if a device has flaws that make it impossible to secure you really shouldn’t be using it in the long term.
In the olden days people used to drive around in cars that had no safety features at all. These cars were perfectly good for moving you around but they were inherently dangerous to the people inside and those around them. Nowadays we don’t do that. Cars are built with crumple zones and air bags to make things safer for drivers and pedestrians. Me saying that I want to stick with my old PC because it still works is a bit like a driver saying that they are quite happy to zoom around in a car with no seatbelts and a really pointy bumper.
Maybe there is a place where systems like my existing one can be used in a secure way. Perhaps playing a server role behind a secure firewall. I’m going to look into that. I’m also going to start saving my pennies for a Windows 11 box. Rather looking forward to it now.
Did my final review of the entire “Begin to Code with JavaScript” text today. I found a few little mistakes that had slipped through, but overall it’s looking great. The book goes into the printing presses tomorrow and will be in the shops (whatever a shop is these days) at the end of August. Rather excited.
This is the “Two Button Game" running in Python on Raspberry Pi PICO inside a Pimoroni PICO RGB Keyboard base. The game engine is exactly the same as the earlier ones, which is rather nice.
The idea of the game is that you press the red button if there are more red lights and the blue button if there are more blue lights. The buttons are at the bottom of the keyboard (keys C and F). On this occasion I think that the thing to do is press the Blue button.
Here we have two Connected Little Boxes using an MQTT server to play the Two Button Game.
I really think we should press the red button……
Another lovely father’s day gift I got on Father’s Day (what a coincidence) was a box of biscuits from around the world from the Biscuit Baron. They came in a box with a book about each biscuit and even a scoring form that you can fill in. The ones above were wonderful.
The Two Button Game that I made for a Raspberry Pi Jam way back is about to achieve fame. I’m writing an article for Hackspace magazine about creating portable games that run across different platforms and I’m using the game engine as the basis of the piece. Quite fun.
Conversation at the Meetup last week turned to magic wands. As it does. We managed to find this project so I’ve ordered one of the devices. I wonder if I could magic up some time to play with it.
A while ago I bought 100 coloured dice. I’ve no idea why (although I do want to teach number one granddaughter about probability at an early age). However, they are nice to take pictures of.
Windows 11 looks rather nice. Lots of neat changes to make things easier to use. Not sure if I’ll ever want to install an Android app on my PC, but it is nice to know that I’d be able to if I want to I suppose. And the graphical enhancements are beautiful.
The only snag for me is that according to the testing tool that has been released alongside this announcement, none of the PCs that I own will be able to run the operating system. It’s all to do with processor versions and Trusted Platform Modules.
I was hoping to keep my existing machine, which is five years old and does exactly what I want with a minimum of fuss, for a very long time. Perhaps I’ve been lulled into a false sense of security by the way that I’ve been able to put Windows 10 onto 10 year old machines. Anyhoo, I’m not in any hurry to get rid of my present platforms and so it looks like I’ll be sitting out of this upgrade. Which is a shame because I think that some of the new features are really, really nice.
In an age when electronic waste is a huge environmental problem, forcing people to get rid of working devices so that they can have the benefits that Windows 11 offers seems a bit out of touch. I really hope that as we get closer to the release date this situation changes for the better.
Update: I’ve had a proper think about this. Find my proper thoughts here.
The Connected Humber CIC company has just made a substantial (for the company) investment in meaningless numbers. We’ve bought 150 tiny little memory chips, each of which comes loaded with a unique 32 bit number. We’re going to use the numbers the chips contain as IDs for devices we want to connect to the LoRa network.
The rules are changing in version 3.0 of the Lora wide area network, so that if you want to give your devices unique numbers they are not made for you, you have to get your own. And not just any old unique numbers, they want ones with some provenance. This is fair enough. It is rather important that we don’t have several devices sharing the same ID. When the chips arrive we’ll have to read the numbers out of them for us to use in our devices. Alternatively we could wire the chips in and have the hardware read them.
If we have any left over we can always sell them on to the highest bidder. There seems to be quite a market for meaningless unique numbers at the moment.
Servos are a great, cheap, way of giving your devices a bit of physical movement. You can pick little ones up for around a pound each and a single Arduino can control quite a few servos. You can make a Connected Little Box control a servo. In the example shown above you turn the knob on the left and the servo on the box on the right turns, tracking it. However, there are two bad things that a servo can do:
Not move as far as you might want it to.
Burst into flames trying to move to a point that it can’t get to.
The writers of the Arduino servo library have decided that point 2 is actually more important than point 1. So they’ve changed the way that the servo libraries work. This caused some of our servos to misbehave. How did we fix them? Read on…..
When you want a servo to move you give it a pulse of a particular length. The servo converts this pulse into a value which is matched against one that represents the position of the servo output shaft. The servo attempts to turn the shaft so that the two values are the same, causing it to move to a particular position. If something tries to move the shaft away from this position the servo will push back. If the pulse size changes the servo will move the output shaft in response. So far, so wonderful.
But what happens if the computer gives a pulse that is converted to a value that the servo shaft can’t match? The answer is that the servo will try to move to that position and get stuck on the way, stubbornly pushing until coils heat up and melt, gears break and so on. And then you have to buy a new servo.
The original Arduino libraries for the servo assumed a range of movement that some servos can’t match. So they’ve reduced this range. The range boils down to two values that used to be 544-2400 but are now 1000-2000. The new range makes servos a lot safer, there is less chance that they will move into dangerous positions, but it does significantly reduce the amount of movement that you get. The good news is that you can override the pre-set values when you attach to your servo:
servo = new Servo();
servo.attach(2,544, 2400);
The statements above show you how to do this. The first statement creates the servo. The second attaches the server to GPIO pin 2 and restores the range of movement to the values used in the bad old dangerous days.
One of the things I like about WEMOS ESP devices is that they can be reset into boot mode via their usb serial connection. However, I’ve also bought a bunch of these ESP32 DOIT devices which are really cheap, which is nice, but you need to boot them by hand whenever you want to transfer new code into them. I thought I’d write down the process, since I seem to keep forgetting it:
1. EN down
2. BOOT down
3. EN up
4. BOOT up
Do this while PlatformIO (or Arduino) is trying to load a program into your device and it should connect and work.
Satoru Iwata was a corporate president who disproved the notion that heads of large companies must have egos to match their salaries. After running his own software company for a while he became Chief Executive Officer of Nintendo at a time when the company was not at its best. He transformed their fortunes by launching a bunch of ground breaking products including the 3DS and the Wii.
He was taken from us at the tragically young age of 55, but not before he had inspired a whole generation of engineers with his constructive and empathic leadership. The good news, for us, is we can get a copy of Ask Iwata, a set of essays and musings from the man himself. I got one today as a Father’s Day present and it is a lovely read for anyone interested in working with people and achieving great things.
I’ve just released the latest version of the Connected Little Boxes software. You can load it into your device here.
One little tip for developers. Keep track of what your project can actually do. Otherwise you will find yourself trying to implement the same feature twice. Although I guess this might just be me.
Trying a new blogging approach. Blogging when I have something to say, rather than fretting about making a post every day……
Only a code magician can fix a program by renaming a variable. That’s me.
I’ve just encountered an hilarious (and by hilarious I mean horrible) bug with an upgrade to the ESP8266 compiler. I’ve been building my Connected Little Boxes software for quite a while now and it just works. Today I noticed that I had upgrades to the Espressif SDK in Platform IO. So, like a fool (and I do mean that) I pressed OK to upgrade them.
And suddenly my newly built program broke. It would start running and then spontaneously explode with Exception(29). Which means that my program is twiddling a memory location that is not where it should be.
First step was to recompile the code for the ESP32 processor (my code works on both). That worked fine. OK, so it is not necessarily something stupid that I’ve done. Back to the ESP8266.
It’s hard to debug code running in a separate device, but after a few minutes (I am pretty good at this - although I was slowed down as bit by the way that the bug vanished when I enabled debug mode) I’d isolated it to this statement:
RegistrationProcessDescriptor.status = REGISTRATION_OFF;
It runs during startup and turns off the registration process. But I guess you’d already worked that out because my commenting game is so good. Anyhoo, when this statement runs the device explodes.
OK. Welcome to planet weird. First thought is that RegistrationProcessDescriptor is not pointing to the right place. But it is. Otherwise the call to the exploding function would not have worked. So, second thought is that REGISTRATION_OFF is a silly value. It isn’t. It’s 1004 since you asked. And status is an integer property in case you were wondering, so everything make sense and the code has been working perfectly for ages…..
Of course I’ve fixed it. I’ve renamed the variable RegistrationProcessDescriptor to RegistrationProcess. Something deep in the compiler must be getting upset about long variable names and dropping dodgy code. There were a few clues:
It works with a different compiler
It worked when I changed the code a bit (by adding debug)
The variable name was a bit longer than ones I normally use
I’m not happy that the problem occurred, but I’m pleased I was able to fix it.
We’re getting new carpet. Well, after over 20 years it is probably time. Anyhoo, we wanted to get something very similar to what we already had, only with more of the carpet stuff. We solved the problem by taking a corner of old carpet to the shop. I think we got quite a good match….
I said goodbye to over 50 years of my past today. Two men came and took away the piano. Our family got it in the 1960s and I, and my sister did our piano practice on it. Then it found its way into our house and we inflicted piano lessons on our kids too. It has been a fixture in our house every since.
It’s been rather neglected for the past few years though. It was heralded as an interesting instrument when it was launched because it used a novel, weight-saving design to mount the keys. Unfortunately this design also meant that after a while all the plastic key mountings fell to pieces giving the instrument a rather snaggle toothed appearance and making the keys not work properly. Then the felts all got sticky so that notes would play forever so for the last while it has been a nice ornament but not really useful. So we decided to get rid of it and get something more up to date that we might actually play. This was done with a heavy heart, but you have to keep moving forwards in this life.
I asked the man who took it away if it would go to a good home. I had a vision of some kind of retirement home for pianos where they could see out their days with plenty of tunes and whatnot. “Well”, he said “we’ll melt down the frame and turn the case into firelighters”. Oh well…
Blimey. Long blog posts are fun to write if you have nothing else to do. I may need to rethink this….
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.