Go and see Shazam!

Perhaps the secret of a happy life is well-managed expectations. Anyhoo, my expectations of Shazam! were not that high. We’d been to see Captain Marvel a while back and marvelled (no pun intended) at the ease with which the Marvel empire seems to be able to turn out pitch perfect superhero movies whereas those from the rival DC stable seem to be much harder work.

However, Shazam! was really good fun. Not afraid to send itself up, but proper wholesome fun with a strong family theme. The story was very much by the numbers, but the realisation and some of the lines, along with the performances of the central characters, made for a thoroughly enjoyable experience.

Slack is not your friend

I use Slack quite a lot on various projects. I quite like it (even though I have real difficultly understanding how a such a simple program can take around half a gigabyte of memory to run). However, one thing that really irritates me is the way that every now and then it pops up a trite aphorism (something like “Don’t forget to breathe”) with the byline “Your friends at Slack”.

Every time I see this I think two things. I wonder just how much of my precious memory is being used to generate these messages and I reflect that I’ve never met anyone from Slack and I have no way of knowing if they are my friends or not.

Oh, and the other thing about Slack that irritates me is that it seems to be impossible to kill. I’ve had screencasts interrupted by Slack pop-ups even when I’ve disabled them and even quit the Slack application. It seems to me that the only way you can get a Slack free life is to stop it from running when your machine boots.

Being polite pays off

I’ve started saying please to my electronic devices. This is not because I’m super-polite (although I like to think I am). My reasoning is that if you put “please” on the end of a request the device can tell that you’ve finished your command, and that it needs to go off and work out what it means and then do it.

From my completely unscientific testing I’ve found that it does slightly improve accuracy and response. Which is nice. I might start saying thank-you next.

Amazon Echo buttons are surprisingly easy to use

You might thing it’s surprising that I’m this late to the home automation party. What with my love of gadgets and all. I guess laziness trumps gadget love in the end.

However, a few weeks ago, on the back of a really tempting Amazon offer, I got myself a batch of Teckin smart sockets. They fit into your mains socket and then you plug the device to be controlled into them. And then the device is connected to the internets.

A socket can switch up to 15 amps (it says) although I’ve not tried one with the kettle just yet. The only snag with them is that they are slightly larger than a normal mains plug which means that they tend to foul the switch on a wall socket. This is not a problem for me. I’m plugging them into distribution boards, but you might find it irritating.

They work well, once you get over the fact that the lights in your house are now being controlled by a server in China. You can control them from your phone, put them into groups so that they can all be switched at the same time and even see how much current a particular socket is drawing.

So, in no time at all I was in business. Rather than flicking an old style switch I could just get out my phone, unlock it, find the application, navigate to the required group and then tap on the screen. Much simpler. Really. Actually, that’s why I’ve been a bit late to home automation. It actually doesn’t seem to make things that much better.

I made life a bit easier by connecting them to my Amazon Echo device. So now I can just ask Alexa to turn the lights on and that works fine. But what I really want is a button that I can press to turn the lights on. And finally, I’ve got that. Amazon now makes Echo buttons. These were originally touted as a fun way of playing games with Alexa. They are not to be confused with Amazon Dash buttons, which are being discontinued.

I picked up a couple of buttons and they are nicely made, robust devices that connect to your Amazon Echo via Bluetooth. I had a go at the games and I wasn’t that impressed. They gameplay was pretty uninspiring and there was a lot of lag between actions and responses. But you can also use an Echo button as a trigger for a routine. So I’ve made a routine that turns on the lights and bound the button to that routine. It’s very easy to do, you can do it on your phone. The only snag is that there is no way of “toggling” the state of something via a skill. So I’ve had to use two buttons, one for on and one for off. If I write my own skill I can probably get around that, but for now I’m happy and a bit closer to the cutting edge than I was.

Photographing circuits

I’m writing some embedded development content and having great fun doing it. I need to take pictures of the hardware during construction. In the past I’d be reaching for a proper camera, but nowadays I use the camera on my phone. The quality is very good and a tiny phone camera has a depth of field that makes sure that everything in the picture is nice and sharp. It’s also rather nice that the pictures on the phone are sent straight up to my Onedrive camera roll where I can just pull them out and drop them into the document I’m writing.

Air Quality Fun at Leeds Sharp

Some of the audience at the start. Note my lovely Surface Go running the whole thing…

Had a great time at the Leeds Sharp meetup tonight. I was there to talk about Air Quality, Azure Functions and Lora. With a guest appearance of my Air Quality top hat. I’m pleased to be able to report that every demo worked. Even the impromptu one that I wasn’t expecting to…If you want a look at the slide deck you can find it here.

One of the lovely things about the night was that the first two folks that I saw at the venue were a couple of Hull alumni, Joshua and Andrew . They were there to make a video of the event. So they did. It’s really good, they’ve caught the presentation content along with some shots of me prowling around looking nervous. I think I’ll hire them for all my events. They’ve put the video on YouTube, you can find it below.

Simple Bluetooth BLE between ESP32 devices

There are lots of things in life that are supposed to be difficult. One of them is getting Bluetooth to work between devices. However, this is now not the case. Because I can do it.

It’s not quite a simple as you might expect though, the BLE server and client examples for the ESP32 devices distribution don’t work straight out of the box (they really should) because they use different service and characteristic ids and (and this is the tricky one folks) the device name for the server is more than three characters long (which for some reason stops the client from recognising it).

Anyhoo, to make things really useful for you I’ve slightly fettled the samples and dropped them on GitHub for you to just grab and go. They make it super-easy to send messages from one ESP32 to the other.

You can find the library here: https://github.com/CrazyRobMiles/SimpleESP32BluetoothBLE

ESP32 Bluetooth BLE to Windows 10 Universal Apps

So I’ve got this lovely little M5Stack device with an ESP32 processor on it and it is supposed to support Bluetooth BLE. So I thought I’d see if it did. So fired up the example Bluetooth BLE program in the Arduino SDK and then I fired up the Bluetooth sample from the Windows-Universal-Samples and tried to get them to connect.

And they just did. Astonishing. In no time at all I was sending messages from the PC to the M5Stack, and with a bit of fiddling I managed to get data values going the other way as well. I find this amazing and wonderful. Previous attempts to get Bluetooth working like this have always been fairly horrid and fraught. With this I just hit the pair button inside the app on Windows 10, accept a security prompt and then I’m sending packets of data backwards and forwards. I’m definitely going to build something based on this,

Air Quality, Lora and Azure Functions at Leeds

I’m treading the boards again on Thursday evening this week in Leeds. I’m talking about our work with Air Quality sensors and whatnot. With a special guest appearance of the Air Quality Top hat. Should be fun.

If you live in Leeds you can register here. If you don’t live in Leeds you can still travel there and attend if you wish, but I’d probably draw the line at intercontinental flights to get there…..

Please note that, in a break with recent tradition, this session will not be rhyme. (unless they offer me money)

Adventures in Colour at the Connected Humber Hardware Group

We had a great time at the Connected Humber Hardware group meetup tonight. We talked air quality, transistor design, top hats (of course) and making colours.

There’s nothing like playing with something to build your understanding of what is happening. Jay has been making remote controlled lights and has built a remote controlled a three colour led. Individual colours worked fine, but mixing them didn’t give the colours that we were expecting. This turned out to be because the individual red, green and blue light sources in the led were all very different in brightness. However after a bit of experimentation with series resistors he managed to get a reasonably balanced result, as you can see above. What’s more this serves as a lovely illustration of how primary colours can be combined to make others.

Great fun. If you want to take part (and why wouldn’t you), our next meeting is on the 3rd of April at 6:00. You can find our more about our meetups here.

Laser Cutting at Hull Makerspace

I really like it when I head out of the house with the intention of achieving something and then actually manage to complete the task. Today I headed down to the wonderful Hull Makerspace with the intention of completing my air quality sensor mount design and maybe even cutting it out of perspex.

And that’s exactly what I did.

Fair enough, some of the holes are in the wrong places and some are completely missing. But a little drill work and my first prototype is now ready to be fitted.

The holder has our custom circuit board on one side and the SDS011 sensor on the other.

Using an Edge Triggered Serial Interface with the ESP8266

The Air Quality sensor that I’m working on uses a GPS receiver and particle sensor. Both these devices use a serial connection to deliver their values into the processor. This poses a problem, in that the esp8266 (the chip that I’m using) doesn’t have very many serial connections. The usual solution is to use a software simulation of a serial port instead of a “proper” hardware one. The difficulty with this approach is that software serial ports slow down the processor because the processor has to stop and wait for each incoming character.

To solve this problem I’ve written an interrupt driven serial port that uses the edges of the serial data stream to trigger readings, which means that it doesn’t hold things up as much. You can find out more in the video above. You can download the code and play with it here.