Playing with Linux for Free using Azure

Last week I built Linux PC and started it going on Azure. I kind of did it by mistake, in that I had half an hour between meetings and I thought I’d just do something to pass the time. There was intent there though, in that we are moving the Connected Humber air quality data visualisation platform (that sounds posh) over to Azure.

Getting started is very easy and free. Just follow the instructions in the site here. These are the things I learned when I had a go:

  • you’ll need two PuTTY programs. PuTTYgen to generate an SSH key and PuTTY to connect to the server (if you’re connecting from Windows like I was). When you download the program files there are lots of slimy links to things that aren’t what you want, be careful about this.

  • make sure that you open up port 22 on the virtual machine, otherwise you won’t be able to connect to it using SSH at all (although there is a Linux prompt available on the Azure Portal too)

  • you can reset passwords on your Linux installation via the Azure Portal. This is great if you, ahem, forget to write them down when building the machine

  • a virtual machine starts off in “developer” mode, which means that it shuts down at 7:00 pm each evening. You can turn this off - look for Auto-Shutdown in the settings

  • if you want a static ip address (which you really will want if you want to point a DNS address to it) then you need to set this explicitly. Click the ip address in the virtual machine properties to drill through to the properties for the address and select static

The “machine” is now running and folks who know Linux much better than me are now busily installing the software on it.

Zed book review

Zed by Joanna Kavenna s not a happy tale in the same way that 1984 is not a happy tale. However, it is a very relevant one in the same way that 1984 is very relevant.

Zed is set in the near enough to be scary future and tells of the travails of Beetle, an all encompassing tech company that is in no way similar in reach and vision to companies like Facebook and Google. Not at all.

Beetle is everywhere, and is using its everywhereness to provide everyone with a handy “lifechain” which is able to predict what you might do before you do it. The story explores what happens when pesky humans start behaving in ways which the lifechain doesn’t predict and how Beetle is forced to come up with the idea of “Zed”, an imaginary quantity that defines this unfortunate characteristic. Mitigating Zed becomes a company priority with bad results for just about everyone.

It’s a lovely description of how people, companies and governments can justify, rationalise and institutionalise evil without anyone being consciously malicious. You’re never quite sure where the evil is coming from. Bad things seem to happen to good people as an emergent behaviour of the system, rather than having been mandated by any particular person.

If you have any interest in the future you should read this book. It won’t leave you with a warm feeling that things are all going to be OK with our benevolent corporate overlords, but it will give you a lot to think about.

Men at Work Board Game

Men at Work is a balancing board game. Players take it in turns to place girders, supports and workers on the building site. Place the highest piece on the site and you earn an award from Rita the site boss. Get three awards and you win the game. Make things fall down and you lose one of your three safety certificates. Lose all three and you leave the game. The pieces are beautifully made and presented, and the whole thing is nerve-wracking fun.

With most games you’re waiting for your turn so that you can do something. In Men at Work you get at least as much excitement watching other people take their turns trying to place items on precarious beams without everything falling down. Very enjoyable.

Air Quality Hardware Meetup

We had a splendid hardware meetup today. A whole bunch of new people turned up, including Dave White, Hull City Council Air Quality Officer. We wanted to discuss sensor design, data visualisation and a bunch of other things. So we did. It was great. Lots of plans made which I really look forward to seeing lead somewhere.

At the time I promised to put up a bunch of links to things that folks might find interesting. I think these are the ones, please feel free to let me know if there is anything missing.

  • You can find out about Connected Humber here.

  • You can join in the conversation about Connected Humber, Air Quality or anything else you fancy chatting about here.

  • You can read my amazing blog here. Oh, you are doing. Thanks for that.

Enter the Humber Healthcare Challenge

Click the logo to enter

The Humber Tech Challenge is in October. You should enter. You should enter because:

  • you learn stuff

  • you meet people

  • you make stories to tell

  • you do good

  • you have fun

Everybody who took part last year got something out of the event. Even the judges had a good time. This year the challenge kicks off with a Visioning day on the 5th September. If you can’t make that we’ll have a Visioning Video out straight afterwards that sets up the challenge. Then, on the 1st and 2nd of October we’ll open up the Spa Hall Bridlington and turn you loose. There’s free food (and biscuits).

You can sign up here. I already have.

Cheap project boxes

What you can get for seven pounds

Making boxes to put projects in is hard work. You can 3D print them but that takes ages. You can laser cut them (but you need a laser cutter). And making things waterproof is really hard too.

Turns out that terminal boxes make great project boxes. They arrive waterproof and the holes in their sides have nifty little rubber plugs in them which you can cut to fit whatever you really want connect to. It turns out that the buttons that I bought last week can be made to fit in the sides with just a modicum of surgery. We’ve also used these holes to provide inlets for air quality sensors.

If you’re lucky you might find that you can shine neopixels through the rubber plugs to get a nice lighting effect - like I do for the two button game. I don’t think this will work with the boxes above though, their plugs seem quite opaque.

Terminal boxes are available in lots of sizes and really good prices. I got the ones above from Screwfix.

Taiko no Tatsujin: Drum 'n' Fun is awesome

Favourite birthday present so far: Taiko no Tatsujin: Drum 'n' Fun

Absolutely. I’ve always liked rhythm games and I really love the exuberance of Japanese productions like these. The enthusiastic commentary (all in Japanese so I’ve no idea what they are saying), the bonkers animations and the crazy soundtrack are all really infectious.

But the thing i really like is the collection of crazy music. I think it is fair to say that, save a few game sound tracks (including Ridge Racer), there are no pop tracks that you will ever have heard of. Ed Sheeran is not on the playlist. In a good way.

But what is there is proper daft. There are pop tracks and anime sounds that are just fantastic, along with a version of the alphabet song that just has to be heard and drummed to. It is deeply silly and, of course, there is a lot of skill required if you want to crack the harder levels.

You can drum with controller buttons or on the touch screen but I’ve got the version that comes with a plastic drum and a pair of drumsticks. The drum worked very well for me after a bit of fiddling to sort out the timing. Word on the street is that waving the joycons around doesn’t make for a great drumming action, but I’ve not tried this yet. There are also some multi-player modes that I’m looking forward to having a go at.

The biggest limitation for me is that the drum controller is wired to a USB plug, so you can only use the drum if your Switch is plugged into a docking station. It might be possible to do something cunning with a USB C hub , but since this connection is on the bottom of the Switch it would be hard (and potentially damaging) to stand the Switch up when using it. If the drum was wireless and battery powered it would be great for portable drumming action, but as it is I’m having a lot of fun and enjoying the crazy music.

Special delivery

Bit of a commotion outside our house today. It started with the sound of helicopters hovering overhead, then motorcycle outriders hurtled down the road, followed by a couple of police squad cars, and finally an armoured truck. And then, with full sniper cover, a helmeted guard brought a package to our front door and rang the doorbell.

Turns out that it was just a printer cartridge delivery, but with the price of these things I’m not surprised by the precautions.

Getting Started with Azure Sphere

Pictures shows security aware graffiti

My free Azure Sphere development kit arrived last Friday, the day after I ordered it. Awesome. If you want one of your own you can get them here for free. It has serial ports, environmental sensors and buttons, plus a connection for an OLED display. You write programs for it using C via a Visual Studio extension. You can deploy and debug the code in the device from your PC and its very secure.

That’s all I really know at the moment, so lets get started. You can find the documents here. They tell you to go here and install the Visual Studio plugin. This also installs hardware drivers for the device. The bit that they don’t document very well is how to set up the device with Azure Sphere. You need to go here to do that. I worked through the sequence with no problems and now I’m waiting for my device to perform an OTA update to the latest firmware. Things that I noticed:

  • When you start using the azuresphere command in the Azure Sphere Developer Command prompt you’ll be asked to log in. This needs to be with an Active Directory enabled account. If you’ve not got one (because you are using an Office 365 subscription username for example) then that won’t work. However, if you’ve an Azure account (and having an Azure Sphere device without an Azure Account would be very stupid) you can use the free tier of the Active Directory provision (just click Azure Active Directory in the portal) to create Active Directory enabled accounts.

  • Once you’ve logged in with your shiny new Active Directory username you must create an Azure Sphere Tenant which acts as a container for your devices. Physical devices are then “claimed” by the tenant so that they are managed by that tenant. This is a one time action. Once a device has been claimed by one tenant it can’t be claimed by any other and a device can only be claimed by one tenant. I’ve made a Tenant called “Connected Humber CIC” for all our devices.

  • By default (i.e. unless you specify otherwise) any user in the Active Directory that authenticated your azuresphere command can control your devices, including pushing new firmware, claiming new devices and so on. If you want to restrict this you’ll have to set this up yourself. It’s not hard to do, but you have to do it. This is not a problem if, like me, you’re only got a few users on your Active Directory, but it would be an issue if you were adding the tenant to a large Active Directory setup (perhaps a corporate lan) with lots of users with different levels of access.

  • You have to use the azuresphere prep-debug command to allow you to deploy code into the device and debug it from Visual Studio. Once you’ve put the device into debug mode it stops receiving OTA updates. The azuresphere prep-field prepares the device for the field. These commands might install usb drivers for the debugging, so they need to run in Administrator mode - (start the Azure Sphere Developer Command prompt as Admin)

  • The Visual Studio Add-In for Azure Sphere works fine in Visual Studio 2019

Well, the firmware update has completed, I’ve done the command to prep the device for debug and now I’m running the GPIO version of “Hello world”; a flashing LED. I’ve even managed to put a breakpoint in the code and stop it. Next thing to do is connect a sensor and get my Air Quality code ported across so that I can get readings into the device, then I’m going to have to figure out how to get the readings over the network to store them and finally how to deploy the code for real.

Exciting stuff.

Long Cow

If it seems like I’ve been playing a few games lately I have. So there. Long Cow was an early birthday present, purchased because I liked the phrase “udderly ridiculous”, it looked like fun, and it had a “moo” voice box as one of the play pieces.

Players compete to create the longest cow and the biggest herd. Your cows can be of particular breeds, or you can use “frankencow” cards that allow you to mix them together and even add robot components. And there’s rustling and other cow related tom-foolery to be had too.

It’s actually rather fun. Nothing too taxing (although I think you can take it very seriously if you want) and some lovely artwork on the cards.

Lego Lunar Lander

I’d really like to be rich. If I was rich I could afford the new Lego Lunar Lander kit and a big house containing a “Lego wing” into which I could put it once I’d made it.

Actually, to be honest I’m not that bothered really. As someone who was around at the time of the landing (#oldagebrag) I remember getting and building the official Airfix Lunar Lander kit (complete with a piece of the moon). Mine even had gold tin foil from Caramac bar wrappers around the legs, just like the real thing.

Lamppost Sensors Live

Well, this is rather exciting. The air quality sensors that we handed over to Hull City council to be attached to lamp posts and measure air quality are now attached to lamp posts and are measuring air quality.

We didn’t expect them to show up on the network just yet, but thanks to one plucky LoRa gateway in the middle of Hull, three of the four sensors are getting readings into the servers.

The next step is to get the data onto our interactive map so that everyone can see what it looks like.

Free Azure Sphere Development Kit

One of my big concerns about the Internet of Things is that people might not do it properly. By that I meant that they will rush to market with the ability to put connected control into all kinds of situations without worrying about security, deployability and maintainability. That’s one reason why I very much like a new competition where you get to play with an Azure Sphere embedded device which has those abilities at its heart.

Another reason why I like the competition is that you can get a free device to play with if you enter. You can find out more here.

Werewords rocks

This is a really good game. I’ve been a fan of werewolf for a while. That’s the game that pits werewolves against villagers. Werewords has a similar basis, but rather than trying to just spot the werewolves the villagers are in a race against time to deduce the “magic word” that only the seer, the werewolf and the mayor know. If the werewolf identifies the seer the wolf wins. If the villagers spot the werewolf, they win. Everyone can ask the mayor yes/know questions to try to work out what he word is.

The seer can try to steer the questions towards the answer, but not too much in case the werewolf spots them. The werewolf is doing the same thing, in the opposite direction. And sometimes the mayor is a werewolf.

Confused? You won’t be. Not after a few rounds. The whole game is run by an app that sets the scene and times each round. A complete game lasts around 6 minutes, and so over an hour or so of play everyone gets a go at the different roles. Well worth a look.