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

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.

Home the weary traveller and his Surface Go

Another day, another six hour train journey. But then again it is quite a long way from Dundee to Hull. Fortunately I’d taken my Surface Go with me, so I could be properly productive on the journey. Even when it turned out that the mains sockets at my table on the train were broken. I did three hours on one train, then another bunch of work on the next one - that had working sockets which was nice. Pro travel tip: take an adaptor with a light on it so that you can discover which sockets are working before you sit down.

I love working with the Surface Go. It recognises me and give me a cheery hello when I start it up. It’ doesn’t make a fuss when I ask it to do something. It just gets on with it. Actions like opening Visual Studio provoke no reaction at all from the hardware, rather than the furious whirring of fans I used to get with my Surface devices. Yes, it is slower than them, but it does get there, it was half their price, and it gives me time to admire the scenery going past the windows. I even don’t mind the smaller screen, bearing in mind I’m having to carry it around. It’s a great device.

More Heltec Fun

Welcome to the blog all about the Heltec Lora 32 V2 device that occasionally mentions Rob Miles.

Last night I was feeling quite pleased with myself because I reckoned that between us we’d solved all the problems relating to our Air Quality sensor. We’d picked hardware that seems to work, a case that seems the right size and even got a power supply that looks like it will cut the mustard. We’ve even figured out how to attach the box to a lamp post.

I should know not to think things like that. In my experience it is just at this point in a project when something that has been totally reliable suddenly breaks for no reason. So it was with our Air Quality sensor. The LoRa transmission code broke. The driver locked up after only having sent one packet. Since this has never gone wrong before it was a bit of a scary head scratcher. Just before I’m due to head off to Dundee for some external examining too. Oh well.

Last night I did the very best thing that I could. I stopped thinking about the problem and walked away from it for a while. And today, that approach paid off. Coming back to it fresh I decided to look for some known good code on the Heltec site. At which point I found the following little gem:

#if defined(V1)
const lmic_pinmap lmic_pins = {
    .nss = 18,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 14,
    .dio = {26, 33, 32},
};
#elif defined(V2)
const lmic_pinmap lmic_pins = {
    .nss = 18,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 14,
    .dio = {26, 35, 34},
};
#endif

This is the code that maps the pins on the LoRa device to the driver software. And it is different for Version 2 of the Heltec device. Just in the “.dio” element. These are the numbers that map the indicator pins on the LoRa chip to the software expecting to be told things like “the last packet has been sent” or “a new packet has just arrived”. With the wrong pins assigned my driver was getting stuck waiting for messages that would never arrive. I fixed the numbers and all is now well.

These issues haven’t dimmed my enthusiasm for the device, I still think it is rather neat. However, I’m going to compile a little document that sets out all the differences I’ve discovered between the two versions of the Heltec device. For myself, if nobody else.

Laser Cutting at Hull Makerspace

I spent a very pleasant afternoon at Hull Makerspace laser cutting last week while the car was being MOT’d. I wanted to cut some chassis parts for the air quality sensor. I turned up with some files and my lovely Surface Go and set to it. By the end of the day I’d got exactly what I want and even been able to use the cutter myself.

Laser cutting panels is much, much faster than 3D printing them, and I think that the new design (you can see it on the right, looks really classy in smoked perspex. It will end up hidden in a box on a lamppost somewhere, but at least I’ll know the insides look nice.

They were busy giving help on programming and making stuff and there was a lovely buzz about the place. If you are interested in making stuff you should get down there and take a look around.

Godzilla: King of the Monsters

We went to see “Godzilla: King of the Monsters last night. Not really my idea, but I didn’t need to be dragged there. After all, there was popcorn too.

The story was a bit rubbish, the special effects were OK but the whole movie was made great by something that happened right at the end when the final big battle was over. If you go along (and you should if you like daft movies like these) make sure that you look out for it.

Get Coding! A great book to start programming

I found this book in a library. But, given that it represents really good value for such a well written text with full colour pages, you should buy your own copy.

The title is a tiny bit misleading though. There is coding in the book, but there is also a lot of HTML and CSS type stuff which is not really programming, but you need as a framework to hold the JavaScript that readers end up writing. The context of the code exercises is beautifully set out, with lovely illustrations and and engaging characters being used to build a fun narrative. It also has a few things that a kid learning to program could use to “impress mum”, always a good thing.

If you’ve got kids this who fancy a go at coding this would be a great starting point. There is also a follow on text (called Get Coding 2!) which has more coding and a focus on game development.

Heltec Lora V2 I2C Pins Fun

I seem to be filling the blog with items about the difference between versions 1 and 2 of an embedded controller. But then again, someone might find this useful.

Anyhoo, my shiny new Heltec devices have broken another part of my Air Quality sensor, but this time in a good way. When I was using the previous version of the device I had to use to additional pins to implement the I2C connection to the BME280 environment sensor. In the new version we can use the same I2C connections as the OLED display, i.e. pin 15 for SCL and pin 4 for SDA. This works fine as long as you initialise the OLED panel before you initialize any other I2C devices.

Using the existing I2C controller frees up a pair of precious pins. You also get the benefit of a new Heltec version 2 feature. The device has two 3.3V outputs that can be controlled via pin 21. This means that your program can switch off the power to connected devices before entering deep sleep mode. You could also use this to perform a hardware reset of any connected device by turning its power off and on again. The power pins can’t deliver a huge amount of current, but it is nice to be able to control them in this way.

How to reset the EEPROM in an ESP32 device

Today’s stupid action (I try and do at least one a day) was to deploy a program to an ESP32 device with the wrong libraries. I’ve just got some Heltec LoRa 32 V2 devices. It turns out that the V2 is important. Among other things it means that you shouldn’t deploy version one binaries to the device, otherwise the WiFi will crash every time you try to use it.

Should you be as stupid as me, you can reset the EEPROM in a device that you’ve broken like this by using a command line tool that you can find in your ESP32 installation:

C:\Users\Rob\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.1>esptool --chip esp32 --port com11 erase_flash

I’ve added the full path to the command on my machine, yours will be different unless you are also called rob. This command also only works if your device is attached to com port 11, change the value to target a device connected somewhere else.

Racket Fury for Oculus Quest plays a mean game of Table Tennis

I’ve no idea why a table tennis game should be called “Racket Fury”. But the game is great. I had a go at the Sports Scramble game on the Quest (a demo version is supplied with the device) and found that to be a bit “meh”. They seem to think that changing your tennis racket into a golf club in mid rally is a good thing.

I beg to differ.

But the Racket Fury: table tennis game is another thing entirely. I’ve played enough “proper” table tennis to be able to tell when a shot I’ve made is going to go out. I get this “sinking feeling” as the ball leaves the bat. The Eleven: Table Tennis game I play on the HTC Vive is good enough to give me that “sinking feeling” and so is Racket Fury. The frame rate seems a bit lower, but the fun of playing the game is still there.

It’s also rather satisfying to be able to play this game better than number one son, thanks to many years spent bouncing off real tables.

The tracking of the bat is very good, two pro tips:

  • investigate the menu that lets you rotate the bat in your hand, this means that you can have a more natural bat holding experience

  • changes from arcade to “physics” mode. This makes the game harder, but more satisfying.

If you have an Oculus Quest you should get this game.

The Oculus Quest is the future of VR

I’ve played with Virtual Reality enough to know that it is the future. I was never sure about 3D TV, but I think that the experience you get from a good VR system is something that everyone will want. The problem has been that until now a good system has involved external lighthouses for tracking, trailing wires and a hefty PC.

The Oculus Quest changes that. It gives a good experience that you can get just by putting on the headset and picking up the controllers. There’s a simple room calibration that you need to perform and then it will transport you into a whole bunch of engaging virtual experiences.

Number one son turned up with his device yesterday and after around 10 minutes playing with it I decided to get one too. It really is that good. The graphics are not as detailed as those from my HTC Vive system, but it is just so much easier to put the headset on and get started. And the lower resolution images still manage to conjure up a very real environment.

The controller and headset tracking is first rate and the device manages the boundaries of your virtual environment very well. We only seemed to have problems with bright sunlight from one side of the room upsetting tracking every now and then, but not enough to get in the way of a good time.

If you’ve not played with VR before this is a great way to get started.

Reviving a Dragino LoRa Gateway

I’m a sucker for “upgrades”. Maybe it’s because I like watching progress bars. I find them rather relaxing, and a great way to avoid doing work.

But upgrades are not always your friend. Take my little LoRa gateway for example. It’s not a “proper” gateway, in that it only has a single channel, but it is fine for testing devices (as long as you are happy for only one in eight packets to get through).

Anyhoo, a while back it broke. So today I tried to fix it. It turns out that I’d actually broken it by upgrading it. The first time it failed I’d done what I thought was a sensible thing and upgraded the firmware, thinking that this might fix it.

Actually, it broke it even more.

Turns out that if you upgrade the gateway to version 1.4 this breaks all the stored settings. There’s a useful description of the problem and how to solve it here.

Now I’m back on the map, which is rather nice.

Lamp post sensor mountings

I’m not sure how many of my readers really want to know a good place to get plate to mount air quality sensors on a lamp post, but if you do I can recommend these. They seem pretty strong and two of the fixing holes line up neatly with this box.

If you’re prepared to shop around and wait for delivery from China you can get both these items much more cheaply than the Amazon prices.