Raspberry Pi Model 4

raspberry pi 4.PNG

I remember when the Raspberry Pi was first announced. A credit card sized proper computer which cost 25 quid? A likely story.

Twenty five million sales later, the story is looking more likely than ever. And now we have version 4.0. This version is interesting for a whole bunch of reasons. They reckon it has around twice the speed of the previous version, and you can now get it in memory sizes that go from 1 to 4 Gbytes. It now supports two monitors and 4K video output (although its a bit tricky if you try to use both at the same time). It also has two USB 3.0 sockets and the specs speak of much faster data transfer. The mounting holes look to be in the same place, and the pin-out for the “hat” connector is the same, although the pins can be re-purposed to get some extra I2C and serial ports which is very welcome.

The bad news is that there are a few “breaking” changes from the previous device. The video sockets are now micro-HDMI and there are two of them, which means that case designs will have to change and you’ll need to change your video cables. The power is now supplied via a USB-C socket and you need a bit more of it. The days of hanging a Raspberry Pi off a USB socket on a PC may be over. And if you want to get full speed all the time (or play with overclocking) you’ll need to add cooling to prevent the processor slowing down when it gets too warm.

But this does mean that you can consider using the Pi as a desktop replacement. I know they say that with every new release of the platform, but this time it might actually be true. The extra ram will make it possible to multi-task with ease, and the faster USB sockets mean you can connect fast hard drives too. However, having said that, I reckon that the extra power is interesting because it makes it easy to use a Pi as a proper “edge computing” device. It should be very possible to run some proper AI on this platform, allowing you to put a lot of computing power right next to your sensors, which makes things very interesting.

I can’t find any word from Microsoft as to whether the IoT version of Windows 10 will be ported to the Raspberry Pi 4. I really hope that it will be. Windows 10 on this platform would be awesome.

I’ve ordered myself a device, I’m looking forward to it coming and having a play.

A Lora Gateway of my own


I’ve been playing with LoRa for a while, and I’ve even got a tiny single channel gateway at my house that mostly works.

But last week Adam loaned me a proper The Things Network LoRa gateway to play with.

It’s awesome.

For a start it has a proper 8 channel receiver. This means that it can receive all the messages. For another thing, it has a proper antenna. The result has been that over the air authentication (which used to be hit or miss) works first time. And I can reliably send messages back to the LoRa device when it checks in.

Suddenly all my sensors are reporting results with rock solid quality of service.

I really hope Adam doesn’t ask for it back in a hurry…

Cables for a pound each


If you’re looking for some cheap cables I can recommend you wander down to your local pound shop. I’ve been using their cheap usb cables for a while and they work a treat. They are especially useful if you want to connect up a Wemos or Heltec device to a power supply. They have a good length, 1.5 m, the connectors are sturdily attached, they are packed in a nifty little bag and they only cost one pound each.


I’ve also been using their one pound HDMI cables and they seem to work fine. It seems that electricity doesn’t mind the price of the wires that it travels down…..

Try Microsoft Edge Insider

If you like Google Chrome I think you’ll like what’s happening to the Edge browser. The latest versions are being based on the same rendering engine. I’m using the latest dev build as my “daily driver” browser at the moment. It seems snappier than Chrome, has some interesting new features and I’m fairly sure it is not sending details of all my browsing back to Google high command. Which is nice.

If you want to have a go, and I think you should, you can download different flavours from here.

Azure IoT Devkit

Image shamelessly stolen from the IoT Devkit site…..

Image shamelessly stolen from the IoT Devkit site…..

At the talk yesterday I mentioned the Azure IoT Devkit. This can be used as an IoT Endpoint for Azure among other things and has the benefit of a properly secure architecture including proper security to prevent details being stolen from the device or the device being compromised by naughty firmware. It also has a nice little OLED screen and a whole bunch of useful sensors.

You don’t develop for this device using C# and Visual Studio, but you can use the awesome Visual Micro or Visual Studio code to work in C++.

It’s a great place to start creating proper cloud connected devices.

Insider Dev Tour Hardware Mayhem

Picture of a missing train

Picture of a missing train

I should have expected trouble when I discovered that my first train to Manchester didn’t exist. Even though the station display confidently predicted its arrival, and the app on my phone showed a dot moving down the rail line the actual bit lump of moving metal failed to turn up. Not impressive.

Fortunately, I was able to catch the next train (which did exist) and then make it to my connection with literally seconds to spare. Then all I had to do was walk through a cloudburst to the venue in Manchester.

Once I was inside and dried out, things improved a lot. Free coffee and some great sessions. I’d bought a whole bunch of hardware with me and I planned to spend my lunch hour setting it up and making it work.

I got all the way to the end of the setup and then my demonstration Raspberry Pi decided to fail completely. No idea why. Life I suppose. Perhaps last night fate heard me thinking “No need to take a spare device, it all worked fine in London”. Anyhoo, even rebuilding the entire operating system failed to bring the machine back to life and anyway, it seemed that the rather picky video display at the venue refused to talk to the Raspberry Pi at all.

Fortunately I had a plan for this too. It involved my LogoBlaster. In the end I was able to do the Raspberry Pi presentations using the projector on the LogoBlaster to show everyone how a Windows Universal Application can interact with hardware and Azure services. Thanks to Luce and Pete for holding up various devices and helping me get it all to work.

A very patient audience. Thanks folks

A very patient audience. Thanks folks

If you want to play with my demos, you can find them all here.

You can find all of the Insider Dev Tour lab conten (there’s tons of good stuff) here.

Insider Dev Tour London

A happy audience at the start of my session. Aren’t they always…

A happy audience at the start of my session. Aren’t they always…

We took our Manchester Insider Dev tour to London today. I was there with a Raspberry Pi, the Logo Blaster, and my trusty Surface Go. I’d made all kinds of plans for network and video contingencies, and I was very pleased to find that they had two (yes two!) wired connections and a really fancy video switching system, along with a bunch of fantastic tech folks who knew how to make it all work.

All the sessions I saw were great. I always leave these events with lots of thing to try and ideas for building stuff. When it came to my session I managed to get everything to work eventually. The Surface Go got there in the end, and left me plenty of time to tell all (both) of my wonderful jokes.

Many thanks to the XamlLlama for stepping in when I realised I’d forgotten my mouse to trigger the cognitive services demo and even providing a winning smile for the camera (that was even recognised correctly).

For those who were there yesterday I’ve put all my code up on GitHub here.

On to Manchester on Thursday.

Bandwidth idiot


So, today I’m doing the final tests for my sessions this week at the Insider Dev tour. My plan, such as it is, involves hanging all my devices off the mobile hotspot in the phone. I was testing the whole workflow, including creating a new Windows 10 image for the Raspberry Pi. While I was doing this I noticed that the network was a bit slow. Not painfully so, just slower than I expect in my Lighstream powered house.

Of course, it turned out that I’d done the entire exercise, including fetching the Windows 10 image, on my phone. This is both impressive (it’s nice to know that you can do this kind of thing over a phone network) and potentially expensive (I’ve no idea how close this has taken me to my limits for the month).

Soak testing air quality sensors


For the last few weeks I’ve had four air quality sensors sitting on the windowsill in the house that faces the nearest LoRa gateway. I’m soak testing the devices prior to putting them on lamp posts around Hull.The air quality in that room must be one of the most highly measured in the county.

Anyhoo, one of the devices decided to try and spoil Fathers Day today by falling off the LoRa network. It was one of those situations where I really hoped that it was properly broken. There’s nothing worse than something that goes wrong every now and then. Unfortunately the darned thing came back to life at the end of the day, and so we are going to replace the CPU. My number one suspect is the antenna connection, but we’ll have to do some tests to prove this.

And no, it didn’t spoil the day. Had a lovely meal out and got some splendid presents.

Making a PAX counter

PAX counter and plastic pig

PAX counter and plastic pig

PAX is an abbreviation for “passenger”. A PAX counter is a device that counts passengers, although you could use it to count people in lots of other situations too. One way to count people is to detect the devices they are carrying. I’ve built the PAX device above from the code here. It’s based on the Heltec WiFi Lora device and I’ve printed a rather neat little case for it too.

It listens to Bluetooth and WiFi. It doesn’t eavesdrop on anyone, or log data packets, it just counts the number of different device addresses that it sees and then sends the totals over LoRa to an application.

If you want to build it my strong advice is to use Visual Studio Code running under Windows 10 and with the PlatformIO framework installed. I used this and followed the instructions carefully and the program built and deployed without much fuss. I did get one warning about a missing configuration for the LMIC but this doesn’t seem to matter. The device works fine and I’ve even managed to send control commands back into the device over LoRa.

If you want to get a rough idea of passenger traffic at a particular location then I can see it being a very useful device. I’m a bit worried about privacy issues though, in that while it would be very hard to go from the MAC addresses of my devices to actually identify me directly, it would be trivial to detect that the same person has been to a particular place multiple times. This might be considered an encroachment onto privacy.

Whether or not you use the data like this is really down to self-discipline as an individual programmer, but then again they are already doing this kind of thing in shopping centres…

Spotting a smile with Windows IoT


I’ve been working on my demos for the Insider Dev tour. One of the examples shows how to use Azure Cognitive Services to analyse a picture, find faces and see how happy they are. I’d like to use this in my demo, but I want to use the camera rather than a fixed image.

Anyhoo, I’ve got it working. The Raspberry Pi snaps a picture, sends it to the cloud and then gets back the location and happiness of anyone in it. I’m looking forward to showing it off next week.

I don’t intend to point the camera at the audience though……

Deal or Duel Game

deal or duel.PNG

I bought Deal or Duel on a whim. It seemed like a good price for a game with lots of moving parts and I liked the idea of setting up a pistol fight between King George III and Napoleon Bonaparte. We’ve had two goes at playing it now, and I must say it is growing on me a bit.

It is fiendishly complicated. And the rules don’t help much. There’s lots of details on some aspects, but others are left delightfully vague. There’s a knack to writing good game instructions and the people behind this game don’t have it. We had quite a few situations where it just wasn’t clear what should happen and we fixed the problem by making something up.

Having said that, it was quite fun to play, and you do get rather attached to the characters in your “roster”. The gameplay is peppered with American Independence facts that are interesting in a pub quiz kind of way and I’d like to have another go at it to try out a strategy that will involve picking fights with everyone.

If you’re prepared to put the time in, you can have fun with this game.

Heltec serial port problems fixed


One of the great things about working with other people is that if you get stuck you can simply hand the problem over to someone else. For ages I’ve been having problems with the serial connection between my Heltec device and the PC failing. I’ve tried all kinds of remedies and even thought one or two might have fixed it, but no. It’s a really frustrating problem because when the connection fails I have to re-boot my PC to make it work again. This rather slows down development.

So, I asked Robin to take a look. He put an oscilloscope on the power supply and looked at what happened when the air quality sensor was turned on. This sensor has a little fan on it and it turns out that this draws quite a bit of current as it begins to rotate. This causes the 5 volt supply to drop to 3 volts for around 50 microseconds, which breaks the USB connection on the Heltec.

Putting a 470uf capacitor across the Heltec power supply fixes this. So we now have fully working serial ports. Yay!

IoT at the Insider Dev Tour


I’m doing some IoT sessions for the Windows 10 Insider Dev Tour. I’m in London on the 18th of June and Manchester on the 20th. If you fancy going I’m afraid they are all booked up, but there should be some recordings.

Anyhoo, I’ve been brushing up on my Windows 10 on Raspberry Pi skills. It’s come on a bit since I started playing with it a few years ago. You can create SD card images and deploy them from a single program. The Windows IoT Dashboard also lets you search for devices and there is now a neat device portal that you can use to remotely manage them. Deploying and debugging programs from Visual Studio is as easy as I remember. This is going to be fun.

Vader Immortal for Oculus Quest

vadar immortal.PNG

Well, that was embarrassing. Fortunately number one wife was out so nobody saw. Yesterday evening in the middle of light sabre training I managed to wallop one of the lights in the living room with my “sabre”. Quite scary to have the real world intrude on the virtual one. And I think I’ve broken the bulb in the lamp.

I was having such fun too. Once in a while you do something and think “This is the future”. Playing Vader Immortal is like that. The quality of the experience is first rate. The use of the controllers is very clever. The “sense of place” is very well realised. I particularly like the bits where you climb hand on hand up ladders and look down at where you’ve come from. And get a bit of vertigo. Once people have had a dose of this they will all want their own virtual reality. And quite right too.

I think the game doesn’t take that long to play. I’m deliberately rationing myself because I don’t want it to end. The first episode of the game is only 8 pounds or so, and great value at that price. If you have a VR device you should have a copy of this game. It really is the future.

Self destructing Apple Pencil

I’ve not used my Apple pencil much. And that turns out to be a problem. Apparently the circuitry is such that if a pencil isn’t charged and used regularly the battery can be irreparably damaged. Not cool.

For a while I’ve been convinced that this has happened to me. The power supply where I leave my pencil plugged failed and I had a pencil that didn’t work, even after charging with a working supply.

However, the good news is that all I needed to do was delete the pencil from the iPad and then re-pair it. The bad news is that anyone could make something which was so easy to break. I’ve turned on Nintendo DS machines after years of none-use and they have fired up without a problem. Sometimes in mid-game.

I think that sometimes Apple need to focus a bit less on making stuff that is awesome and more on making stuff properly.