The return of the Hull Pixelbot

Actually it never went away…

A few years ago I made some little robots called “Hull Pixelbots”. They have this name because they are from Hull and they have a pixel on the top. We had quite a lot of fun building them and playing with them, but then I went on to other things.

Well, I’m going back to them. I’m going to make a version with a PICO rather than the ESP devices I’ve used before, create a web based code editor and bring the robot into the “Connected Little Boxes” fold.

Should be fun.

3D Printing Meetup

This was not taken with a 3D printed camera

We had the November hardware meetup today at Hull Makerspace. There was a lot of talk about 3D printing, and we all took a look at the items in the exhibition. There is some great work. Whether you are new to 3D printing or have already burnt your fingers (only kidding) there is stuff there to learn from. I’ve just discovered “3D” printing filament. The filament contains multiple colour strands of silk PLA, rather like the stripes in toothpaste. This gives a fantastic multi-coloured finished to objects that looks amazing. I’ve ordered a roll to play with.

You should go

The exhibition is on for a while longer. New items are being added all the time. I’m going to pop in on Saturday 11th November to see what’s going on.

Redphone for Halloween

Only a bit scary

The “RedPhone” lives. The bell sounds like a real phone. But the insides are now possessed by a Raspberry Pi running JavaScript…..

This runs on the local network

It hosts a web page into which you can type messages and send them to the phone. When you send the message the phone rings and if you pick up the receiver you hear a ghostly voice dictate the message to you. If you pick up the receiver to make a call you get the dial tone. If you dial “2” and replace the receiver the phone will ring a few seconds later and deliver a ghostly message of doom:

randomMessages = [
    "I know what you did last summer",
    "Is that you, Boris?",
    "Look out of the window.",
    "They are on to you.",
    "Look behind you."
    ];

Other messages may be available later….

It’s been great fun to build. You’ll be able to find out all about it an upcoming article in HackSpace magazine.

Curse you British Summer Time

You’ll never guess where I bought this

The good news is that my Agile Octopus Tariff Display (which tells us how much electricity will cost us each day) handled the clock change yesterday with aplomb. It just worked. The bad news is that one of my clocks can’t be adjusted because the little knob that you turn to move the hands has broken. So I’ve taken the battery out for an hour.

In March next year I’ll have to take the battery out for 11 hours. Perhaps I should make a “time corrector” device. You plug it into the clock in place of the battery, tell the “time corrector” the time the clock is showing and over the next day it makes the clock correct.

Speeding up writing with ChatGPT

I’m painfully aware of the fact that AI has the potential for huge problems on lots of levels. But I don’t think ignoring it is a viable solution. Today I was writing a section of the red phone article (coming to a magazine soon). It was a bit about how JavaScript async and await works. I’d come up with some text and I said this to ChatGPT:

“Would this be a good explanation of async and await: imagine that you could create new versions of yourself at will. If you need to queue to buy something you just create a new version of yourself, put that in the queue and then go about your business. At some point the “new you” will reach the head of the queue, get what you want and then call you and say it has finished before vanishing in a puff of smoke. That’s how awaits and promises work. “

I got this response:

Your analogy is creative and can be a fun way to explain how await and promises work, especially to someone with a vivid imagination. It captures the essence of asynchronous operations, concurrency, and non-blocking behavior, but it might be a bit metaphorical for some audiences who prefer more technical or straightforward explanations.

Here's a breakdown of your analogy:

Creating new versions of yourself represents spawning asynchronous tasks.

Putting a new version in the queue and going about your business relates to the non-blocking nature of asynchronous tasks.

The "new you" reaching the head of the queue and getting what you want symbolizes the completion of an asynchronous operation.

The call and the puff of smoke represent the resolution of a promise and the continuation of your code.

While this analogy can be engaging and illustrative, it's essential to gauge your audience and their familiarity with programming concepts. Some may find it relatable and memorable, while others might prefer a more technical explanation. In many cases, using both a metaphor and a technical explanation can be a helpful way to cater to different learning styles and levels of understanding.

I think this was generally useful critique. It turns out that you ChatGPT doesn’t just answer questions, it can also make sure your text makes sense. Although I can’t help wondering what it would have said if it didn’t like what I’d written.

Speed up Visual Studio Code Remote Development

These are the two you need to disable.

I’m writing all the code for the red telephone project in JavaScript as a node application. This is because it makes it very easy to host a website on the phone. Also I need a lot of multi-threading and events stuff and JavaScript’s await and async stuff makes this so easy to write. Also, I like writing JavaScript.

I’m writing the code on the Raspberry Pi W that is powering the phone. This is a really useful thing to be able to do. I can set breakpoints which are triggered when hardware events occur. Then I can step through the code. I’m using Visual Studio Code, but the environment is running on my PC and I’m using the amazing Remote Development feature to develop on the Pi. But it is not without its problems. When I started doing this, things would work fine for a while and then suddenly the Raspberry Pi would lock up and progress would grind to a halt.

I did some searching and thanks to this wonderful post I discovered how to fix it. It turns out that some of the language plugins for Visual Studio Code consume humungous amounts of computer power. And when they wake up on the Raspberry Pi it is pretty much game over for development on the machine. If you search the extensions for “@builtin type” and then disable the two shown above you’ll find that things work swimmingly. You miss out on a few useful goodies, and you’ll have to re-enable these to get them back, but in the meantime at least you’ll be able to do useful work on a device costing less than a couple of burgers and fries.

Soldering Idiocy

The only person I allow myself to get really cross with is me. Today I had a perfect opportunity. I’d just received the rather nice MOSFET power switches you can see above. They are rather nice because you can connect them directly to a 3.3 volt signal and they will switch a high power load (in this case 35 volts going to a telephone bell). So I soldered a pair to a prototyping board. They’re the funky blue things with the terminal blocks.

We’ll leave aside the quality of the soldering on the connector terminals at the front of the board. I was finding it hard to make any kind of soldering work when I did those. I really did think I was losing my touch. But it turned out that it was because the solder bit had broken inside the soldering iron and the temperature had got set way too low.

The reason I got really annoyed was because the MOSFET board on the left hand side has been soldered into the wrong column. It should be one position to the left. This means that all the wires (several of which are underneath the board) are in the wrong place. Idiot. And especially idiot because I thought to myself “Careful not to solder this in the wrong place” as I actually soldered it into the wrong place.

Oh well, I’ve got spares.

Agile Octopus Tariff Display in HackSpace magazine

I get my copies of the magazine from Readly

If you’re wondering what that distant rumbling noise is, it might be crowds of people rushing to the newsagents to buy their copy of HackSpace magazine so that they can read my article in it.

Or it might be a bus going past.

Anyhoo, the article is out there. You can find the project on GitHub here.

Minox Scanning Report

The height steps are in .2mm because that’s the print layer height

The story so far: “Rob has become mildly obsessed with getting the best possible results scanning the tiny negatives produced by his Minox camera. He’s 3D printed a holder for his scanner which had different negative heights. The idea is to scan a negative and determine which height works best”. Now read on…

It wasn’t taken for testing, but it works really well

I took the picture above down at “the dock” in Hull. It is of the C4DI building and a tiny bit of the tidal barrier. The railings going off into the distance are a very good test for resolution. I used my “different height scanner thingy” (really must think of a better name) and got the following results:

A print of the entire image at this magification would be around 24 inches or so across

It was interesting to see the difference that 0.2mm height makes to the image quality. The best way to see it is to look at the lamppost at the end of the walkway. That is better defined against the background in the -0.2mm height scan. The next thing to do is to print a complete scanning frame for that height.

Next Hardware Meetup is all about 3D printing

YOu could have one of your very own….

We’re having our next Hardware Meetup in Hull library in the Makerspace on Wednesday 1st November starting at 5:30pm. It’s all about 3D printing. There’s an exhibition of 3D printing on at the Makerspace at the moment and lots of stuff worth looking at, whether you own a printer or are thinking of getting one.

It would be lovely to see you there. If you have something you’ve printed that you want to show off, bring it along. There will be a small (3D printed) prize for the object that everyone likes the most. I’ll be talking about the fun you can have making 3D printable objects from Python code - which is something of a thing for me.

We’ll also have free tags of fun to give away, and we might have a Tag Joust championship. It would be lovely to see you there.

If you are around earlier on Wednesday I’m going to be in the Makerspace fiddling with stuff for the entire afternoon if you want to drop round for a chat about hardware.

3D printing exhibition at Hull MakerSpace

This picture was taken with my 3D printed film camera

Today I went down to Hull MakerSpace to hand over some bits and bobs for an exhibition of 3D printing. Lee-Ann is organising the display and some events to make folks more aware of what 3D printing can do. I’ve contributed a Hull Pixelbot, some Connected Little Boxes, tags of fun and a few other things. If you’re in Hull over the next few weeks you can take a look at the stuff. There are some amazing printed models using some fantastic types of filament. Great fun.

"The Ding of Death"

Perhaps I can sell it on ebay as “untested”

Things were going well today. I was working on my clever telephone and I had the code doing just about what I wanted with the hardware. So I thought I’d pop the whole thing back in the phone to make it easier to work on.

I shoehorned the Pi Zero and the power supplies and MOSFET controllers into the case and it seemed OK. Then I discovered that some of the hardware interfaces (notably the switch that is triggered when you lift the handset) didn’t work. So I took the lid off and started tracing circuits. At one point I must have let one of the GPIO input wires touch a terminal on the telephone bell coil. At this point a rather unfortunate sequence of events occurred:

  • The bell terminals are close to ground voltage level, because the bell coils have low resistance. Touching the bell terminal with the wire caused the GPIO input to be pulled low, making the software think that the handset switch has been triggered.

  • The phone program rings the bell when the handset changes state. This is because when you lift the handset on an old phone you hear a “ding”. So turns on the bell coil to start the ding. This sends 35 volts to the coil……

  • This 35 volts goes up the GPIO input and blows away the Raspberry PI. Completely dead. Could be used as a heater but not much more.

The good news (if there is any) is that I happen to have got a spare device in stock just in case something like this happens, so I just have to wire it into the circuit. I’ve also put all my software on GitHub already, and so I’ve only lost around 20 minutes worth of coding.

I’m going to redesign the hardware connections to reduce the chances of this happening and insulate the bell terminals properly. A thing like this is only a problem if you don’t learn anything from it……

ChatGPT can be really useful

There’s a lot of muttering about the dangers of AI but there is also no denying that there are situations in which it is genuinely useful. Today I wanted to make sound on a Raspberry Pi from a JavaScript application. So I asked ChatGPT:

How do I play audio using a JavaScript program running in node on a raspberry pi? I want the sound to come out of the Raspberry Pi device.

ChatGPT came up with an npm module called Speaker which looked like it was just the job. I tried to install it and the installation failed. And this is where it gets proper. I asked ChatGPT:

The npm speaker command fails with an error locating alsa/asoundlib.h. Any ideas?

ChatGPT recognised the error and told me to install the ALSA development headers. I did that and the installation worked fine.

Now, none of this is really rocket science. ChatGPT “knows” this stuff because it has linked things together and can establish the context of a conversation and use this to find the correct items. But it is still darned useful.

My advice with things like ChatGPT is that if you have a context in which you think it might be useful you should try it. If it works, good for you. If it goes wrong you will learn more about problems with the way the technology works. Either way, you will be brushing up on your AI interaction skills, which is something you need to do.