Nice pictures
/Every now and then I take a picture I’m actually quite pleased with. See above.
Here’s another.
Rob Miles on the web. Also available in Real Life (tm)
Every now and then I take a picture I’m actually quite pleased with. See above.
Here’s another.
If you are interested, we’ve got a Hardware Meetup planned for Wednesday (14th May) this week. Usual place, Hull MakerSpace above Central Library. Usual time, from 5:00pm.
If you are not interested, I hope you like the picture.
..and if you don’t like that picture I hope you like this one…
You know that feeling when you put a teacake in the toaster, push down the lever and everything goes out. I do. It happened at teatime today. Turned out that a wayward raisin had bridged the gap between the element and the case of the toaster causing a current flow (yay!) which tripped the circuit breaker. It took me three goes to fix it, but now I can make toast again.
I’ve made my box of lights do this. So I can go to bed now.
I’ve been making Connected Little Boxes for ages. Up until now they’ve been powered by a large a complicated C program that I wrote a while back. I thought it might be fun to convert the code to Python and run it in a Raspberry Pi PICO. So last week I started putting it together.
The code controls an embedded device and is based around pluggable manager components which are automatically discovered and loaded when a device starts. Managers can have dependencies so that the MQTT manager won’t do much until WiFi is working, etc etc. There’s setting management, messaging and a console command interface too. It’s all coming along splendidly at the moment. I’ll have everything on GitHub once I’ve made it work.
Red and Yellow were playing Blue and green
Blokus is a nice looking game with bright “tetris-like” pieces that players take it in turns to place on a grid. There is only one rule. Any piece you add to the grid must touch one or more pieces of that colour that you already put down - but only on corners. The winner is the player who gets the greatest number of pieces on the board before getting stuck. You start in the corners and then play inexorably moves towards the centre as folks try to carve out areas of their own. If you have two players each player controls two colours.
It’s a quick but highly tactical game. I’ve played it twice and won it twice so far. I’m running out of people to play it against. I might explain the rules to ChatGPT and see if it can rustle up an opponent for me.
We had another great Tech Session tonight at Hull University. Free food and drink followed by a couple of thought provoking presentations. First up was Ben Foster who posed the question “What happens if you take a Language Model and connect it to your central heating?” It seems that the answer is that you end up in a room with an audience who are trying to persuade a haiku spouting AI to make all the rooms in your house into ovens.
I’m taking pictures of all the speakers using the big camera. Ben was kind enough to pose for me.
It was a splendid description of how you can take a programmer interface (in this case the one for the Tado range of heating controllers), give it to a large language model and then map natural language commands onto heating control actions. Ben has put a full description of how he got it to work on his blog.
I’ve got a heating control system a bit like Ben’s, so I might have a go at something similar at my house. I might not tell the system to reply to all commands in haiku format though, although it was fun seeing the way his system generated a poetic negative response when we asked it to give us the API keys for its connection….
Toim did a great job at short notice
The next session had a last minute change of speaker, with Tom Jackson from The Rybec Group standing in for an indisposed Alistair Kennedy. The topic was very, er, topical, being that of Cyber Security. I thought I knew all about this. Turns out I was wrong. Data is now the most valuable commodity in the world. We now have cars selling information about our driving habits to insurers. That’s why you sometimes have to click loads of consent forms before you can start the engine.
We have people who want to use your data, hide your data or just fiddle with it to see what happens. They could be a state agent, in an organised crime syndicate or attending the sixth form of your local school. Every technical innovation can be bent backwards to target us. Deep fake voices can persuade your colleagues to do things you haven’t asked them. Malign devices can be embedded into everyday objects (my favourite was the “free” usb power supply which came with a scary little extra). And some people seem to have a liking for single character passwords (with 50 password retries allowed).
If I think back to the software engineering courses I did as a student (and to my shame, perhaps a few of the earlier ones that I taught as a lecturer) the amount of time we spent discussing security was minimal. Nowadays it needs to be front and centre of everything we do. Tom did a very good job of making that point with lots of apposite examples he’d seen over the years.
This was another excellent pair of talks presented in a lovely university environment to an appreciative audience. Here’s to the next event.
I don’t know much about art. But I do know what I like. Liz Dees makes great art. And she’s got a show on at the moment in Hull. You can find out more here. We went along yesterday to take a look.
This is the venue.
Ian put the artwork on the walls. I think the fire extinguishers were there already.
Art as a Puzzle
They have free sweets too!
The work is up for sale at very reasonable prices, bearing in mind that you’re getting something that is individual and unique. If you are in the Hull area over the next couple of days you really should go along and take a look. And don’t forget to ask why one of the pictures appears to have graffiti all over it………
A few weekdays of lovely weather and then the weekend brings this. Oh well, at least the clouds make the sky look interesting.
How was your day?
If you want to find more Python Shorts you can find them here.
Making a CircuitPython program talk to a usb serial device is quite easy to do:
import usb_cdc
# Send a line of text to the host
usb_cdc.data.write(b"Hello!\n")
# Wait for a line of text from the host
while True:
if usb_cdc.data.connected:
try:
line = usb_cdc.data.readline()
if line:
print("Received:", line.decode("utf-8").strip())
except Exception as e:
print("Error reading:", e)
Howwever, when using CircuitPython on boards like the Raspberry Pi Pico, it exposes two USB serial ports over USB:
usb_cdc.console
→ used for the REPL (interactive shell)usb_cdc.data
→ intended for raw programmatic communicationWhen you use a browser that supports Web Serial (like Chrome or Edge), it might show both ports as separate choices. It's easy to accidentally connect to the console
port instead of the data
port. Your CircuitPython code ends up listening on usb_cdc.data
, but the browser is sending to usb_cdc.console
.
There are two ways you can fix this:
# boot.py
import usb_cdc
usb_cdc.disable(console=True)
Note that if you disable the console port you will not be able to interact with the device using tools such as Thonny. You will have to erase the EEPROM in the PICO and the re-flash it to get back control of the device.
We had a great hardware meetup tonight. Not much hardware, although I did bring my light panel. However, a lot of great techy chat. The next meetup will be in two weeks.
Another nice part of Scarborough
Just a reminder that we are doing the hardware thing this Wednesday starting around 5:00 pm in Hull MakerSpace in the Central Library. It would be lovely to see you there.
Perlin noise for the win!
I mentioned a while back that you could get 3 8x8 neopixel panels from Amazon for nine quid. You still can (at least until I’ve bought them all). I’ve started building a 24*8 pixel panel with them. I’ve got the box printed and wired up one panel.
Excuse my soldering
I’ve got it working and it turns out that you can get over 30fps driving all the panels flat out. This means that smooth fades are very doable. The next step is to buy six more panels and see how fast I can drive them in a 16*24 array. The plan is to use separate processor output pins to drive each panel which should make for super-smooth updates too. Such fun.
I’m doing this for an article I’m writing for Raspberry Pi Magazine. The article is about device setting storage. I thought I’d make a device which needs setting storage and it seems to have got a bit out of hand……..
We went to Scarborough today to visit Sci-Fi Scarborough. It was super. I took the big camera and grabbed some pictures.
What a welcome committee
The town was looking good too
They had some amazing film props and costumes
The spa is a great place
They had stuff for sale, authors, illustrators, props, cosplay, talks and tabletop gaming. We had lunch at the restaurant at the Spa and it was superb. Pro tip - have the fish and chips.
The event is open tomorrow (Sunday 27th). You really should go..
I’ve always liked Visio. It’s a great drawing tool. If you want a copy of your own for the mouth-wateringly low price of 17 pounds (or 20 dollars) you can get it here. The installation is a network download. Your purchase from stack social is a licence key that you can use to run the program. I’m using alongside my Office 365 installation - I’m not sure if it would work if I didn’t have Office 365. You’re tied to the 2021 version, but I don’t see that as a huge problem.
They also do Windows 11 Professional licenses for 15 dollars. This is an upgrade licence, you have to be running Windows 10 or 11 at the moment, but with the imminent demise of Windows 10 this might be worth a look. It is also worth buying this if you are running Windows 11 Home on your machine, because the Pro has some features which are very useful, including virtualization.
The latest issue of Raspberry Pi Magazine is now out. You can find it here. It’s got a couple of articles by me in it, which is rather nice. The first one is all about maximising your coding skills by learning new things about Python and taking a look at other languages - JavaScript and Rust. The second one describes how to build a Raspberry Pi PICO powered cable release with built in self-destruction detector. The magazine is a great read, and the new layout is really nice. Well worth a read. You can buy it online or you can find it in newsagents.
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.