Intelligent glue

I spent a big chunk of today ripping cable trunking off the walls and trying to minimise the amount of wall which came came off with it. The trunking sections had been fitted with a special kind of glue which doesn’t grip when you want it to (the trunking kept falling down) but will hang on like grim death if you need to remove it. I wonder how they make it do that.

Debugging a Things Network Kickstarter Lora Gateway

gateway serial connection.jpg

Not sure if anyone reading this blog really needs to know this one, but I need to keep a record of it somewhere and it it is what I’m doing today. If you (or even I) ever want to debug a Things Network Kickstarter gateway you can do this by connecting a seral cable to the jumper inside. I’m using a Raspberry Pi serial connector and with that you connect the white wire (which is the input to the computer running the terminal program) to the RX connection on the pins in the top right hand corner. The black cable goes onto the ground connection. I actually used my SimpleTerrm browser terminal to view the output from the gateway:

gateway debug output.jpg

We’re trying to convert our gateways to Things Network version 3.0, which is proving an interesting experience at the moment.

Play Nomids

nomids.jpg

Nomids is a lovely little game. There is a lot of chance involved, in that a good dice throw can make you a quick winner, but it also provides a lot of very nice “shafting mechanics” (in other words there are some neat ways that you ruin the game for another player. Having said that, when we played one person just kept winning. I guess they were just very lucky.

Actually, Nomids is as much a game framework, as a game in that the ten sets of little pyramids can be used in lots of other games that are described in detail on the game website, And it is rare to find games for up to ten players that are as much fun as this. Strongly recommended.

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.