Godzilla: King of the Monsters

Godzilla king.PNG

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

get coding.PNG

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

heltec v2.PNG

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

racket fury.PNG

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

oculus quest.PNG

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

dragino.PNG

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.

backonthemap.PNG

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

Lamp post sensor mountings

lamp post.PNG

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.

Collapsing Regions in Visual Studio

regions.PNG

I like using regions in Visual Studio. They make it much easier to move around code. I’m writing C++ at the moment and functions and code blocks are automatically tuned into regions, which is nice.

If you want to collapse and open them quickly there are a couple of control sequences that you might find useful.

CTRL+M CTRL+O

This collapses all the regions. You can hold down the control key and press M followed by O.

CTRL+M CTRL+L

This collapses all the regions recursively. So if you have regions inside regions you might end up with just one line in the editor if you use this..

These sequences are toggles, so pressing them again will open all the regions. I find them especially useful when copying or moving code, in that you can select the collapsed region and it will select all the code in the region.

Snaps and Visual Studio 2019

vs2019.PNG

It turned out that the hardest part of installing Visual Studio 2019 was freeing up the 18 GB or so of space that was required. If you are installing it for use with Snaps from my wonderful Begin To Code with C# book you can do a very ordinary installation, but you do need to select to two options that I’ve marked in red above.

If you do this you should find that the Snaps you can download from GitHub here should just work.

If it doesn’t work please let me know. It might work just for me because I have some libraries already on my machine. I’m going to try with an “empty” machine, but I need to set it up.

Update: If you are finding the image hard to read, make sure that you select Universal Windows Platform Development and Windows 10 SDK 10.0.18632

Mowing blind

Every now and again I do a good turn for someone. At least once a year.

Earlier this week I was out cutting grass for a neighbour, navigating a mower and strimmer around his lovely garden. When I’d finished I looked across the road at our house and I noticed that it seemed a bit blurred around the edges. Turns out that I’d done the entire job wearing my “close up” glasses (the ones that I only ever use with the computer). These turn everything more than two feet away into a mildly pleasing blur.

I’d been replying to an urgent email (yes I still get the occasional urgent email) before I left the house and forgotten to change back to my proper spectacles.

I think I'll leave it a while before I go back and look at the damage….

Pokémon Detective Pikachu is not a bad film

detective.PNG

I’m not a huge fan of Pokémon. But I am a fan of nights out and popcorn. So last night we went to see Pokémon Detective Pikachu. It’s fair to say that films of video games don’t have a great history. My favourite ever video game film has got to be the original “Tomb Raider” movie. Mainly because it contains this line.

“The letter’s from my father. He must have written it before he died.”

Anyhoo, expectations appropriately managed we set out to the cinema last night. And we were both pleasantly surprised. The story is a bit wonky, as are some of the special effects and the dialog. Bill Nighy was along for the ride and probably to pay off a sizeable chunk of his mortgage. Ryan Reynolds does a fantastic job of voicing the title character and things burble along in an amiable manner to a satisfying (if not terribly well explained) end.

Worth a trip. Particularly if there is popcorn.

Day tripper

trip.PNG

If you want to get a good response when you are on the phone to an electrician, mention the smell of burning. It wasn’t very pronounced, but it was definitely there….

It all started when the charge for the car failed half way through. The earth drip on the charge box had triggered. I reset it and tried again. And that’s when it tripped again and I smelled the fateful smell.

I think this is a known fault with the charge box that I bought. Anyhoo, they are coming in a week or so to replace the faulty unit. And I’ve turned everything off.

Always put a hole in the bottom

Note that this is not our air quality sensor. This is a nuclear warhead. Almost as complicated….

Note that this is not our air quality sensor. This is a nuclear warhead. Almost as complicated….

Had a great meeting with John today about the Air Quality sensors that we are going to fit on lampposts around the city. He had a couple of pieces of very sensible advice.

  • don’t make holes in the top where the water can get in

  • make a hole in the bottom where water that gets in can drain out