Windows MVP for another year - and I feel terrible about it....

mvp.PNG

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.

PICO RGB Two button game

PICO RGB 2 Buttons.jpg

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.

Windows 11 looks rather nice but I probably won't be upgrading to it

windows 11.jpg

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.

Buying random numbers

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.

Restoring Arduino servo movement

clb turner.png

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:

  1. Not move as far as you might want it to.

  2. 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.

ESP32 DOIT reset procedure

esp32.png

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.

Read Ask Iwata

iwata.jpg

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.

Debugging with Magic

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.

Bye bye to the piano

insidepiano.jpg

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…

Ratchet and Clank - A Rift Apart

ratchet and clank.jpg

I’ve just spent nearly seventy quids on a video game. Oof. That ‘s a lot of money. And I haven’t got anything to show for it. Just an entry on a server somewhere in the land of Sony noting the fact that they have just made me a bit poorer. My PS5 is one of the ones that doesn’t have a disk drive. I was very happy to get it back last year when they were very hard to source. I don’t buy many video games. This is the first one I’ve purchased since the first week of ownership. I find that the PlayStation Plus monthly subscription gets me enough new toys to play with. However, I’d been planning to get this game since the console came out.

It is very good. The only jarring note for me was the way that the first screen I saw after downloading (a 45G download in about 12 minutes or so - thanks KC) was one offering me a chance to spend an extra 10 quids on the “deluxe” edition of the game. As if. However, the gameplay, the writing and the effects are very impressive. Movie impressive. They’ve used all the colours in their paint box, plus a few new ones, to make a bright and vibrant environment for you to blast your way through. I’ve not played it for that long, but I know enough to want to play it through to the very end. Then I want to go back through again and spend more time looking at the scenery.

And I seem to remember that when the first PlayStation came out all those years ago some of the games were nudging 60 pounds or so a pop which, allowing for inflation must have been a sizeable chunk of change back in the day.