HullPixelbots at AzureCraft

HullPixelbots on parade

Well, that was fun. It was the first proper outing for my robot army. We were all at AzureCraft in London. It was an absolutely great event, kids getting together to make things in MInecraft. And learn to program along the way.

I'd set up my Robot Arena in one of the board rooms at the fantastic venue. Over the day groups of kids and parents came to take up the challenge of controlling their robots and getting them to line up in the arena with no collisions. Harder than it looked, but everyone who came along was up for the task. Quite a few folks came back for another go, which was nice. 

Great fun. Thanks to the folks at the UK Azure User Group for setting up the event and inviting me along. 

A tense moment as the pixels line up...

Buy more than you need

I'm kind of cross with myself. I've broken one of my own rules. I needed bits for 8 robots. So I bought 8 sets of bits. Stupid stupid stupid. You should always buy a few spares in case of failures. It's not that they are expensive. And you can always use the spares on other projects.

Of course a few were duff, which meant that I couldn't make all my robots. Of course (cunning bear move) the faulty parts were the ones I used last. Fortunately have have friends with similar interests (thanks Ian and Robin) so I was able to grab some spares, which is how come I'm sitting on the train with 7 working robots (I couldn't fit 8 in the case...)

The Robots are coming to c4di

Sam drives some robots..

I took my working pixelbots down to c4di and gave a talk tonight about how they worked. Before the talk I set out a small part of my robot arena and we all had a bit of fun steering them around using my chatbot client. 

Thanks to everyone who came along. Some very useful conversations. I left with some good ideas for improving the system. I'll be putting the presentation and the code up soon. Keep watching the blog for details. 

Bear Wrestling and Hardware Development

I think that building devices is a bit like wrestling a bear (not that I've ever actually done any bear wresting). It's an ongoing struggle and then, just when you think you might be winning (always a dangerous thing to do) the bear pulls out a killer move and knocks you flat on the floor. 

I've just suffered from this. Nasty bear.

I've been building HullPixelbot devices for c4di and AzureCraft and connecting them to my home wifi for testing. It's been going well (a dangerous sign). I'm controlling them quite successfully and thinking that I might actually end up with a working system. And then today everything slowed right down. Commands that previously took no time at all to deploy suddenly took ages, which is a problem because all the robots need to move at the same time. 

Of course I thought my software was broken and spent a couple of frantic hours trying to speed it up. But the performance was still rubbish. 

Then, at 3:00 am this morning the answer came to me. At the same time as deploying the final version of the code I'd switched to my portable WiFi router, rather than the home network. All the problems started then. Turns out that not all WiFi was created equal. Some is much slower than others.

At 3:30 am I was resigned to going off and buying a new router in the hope it might be faster. At 4:00 am I realised that I actually had a router I'd bought a while back for another project. Only problem is that it was running the Chinese version of the router firmware. 

So at 8:00 am this morning I was trying decipher Chinese menu screens and load a new version of the firmware into the router. I've finally managed to get it working and performance is back to reasonable again. One up on the bear. 

However, the most important thing about the "bear wrestling model of hardware development" is that you mustn't start to think that the bear hates you. He doesn't. He's just there to wrestle, because that is what bears like to do. You need to work on the basis that at some point the bear will step back, bow gracefully and say "I'm going to let you win this one". 

Starting a Diary

If there's one thing I hate, it's making the same mistake twice. Doing something stupid once is bad enough, but repeating it is really silly. One of the reasons why I blog is so that I can find answers to questions that I have that I've already made once. I've had the experience of searching for information about a problem and finding my own blob post about the subject a couple of times now. Very strange. 

Doesn't stop me making more mistakes though....

Anyhoo, as I'm building my HullPixelbot robots I've found it very useful to keep a diary of the process. It turns out that doing the same thing 7 times is a great way to learn how to do it.  And I keep forgetting the best way to build the device and then discovering it again.

So I'm writing a diary of the project. I'm finding this kind of useful, and I'd advise anyone building something to do the same. Proper engineers have log books where they write down what they've done and, more importantly, why they did it. My diary isn't quite as ambitious, but it is good enough to be useful, which is nice.

Strictly Ballroom the Musical

It's a well known fact (at least to me) that I don't "do" musicals. I blame my parents. As a child I was dragged to film after film where everybody started dancing and singing just as the plot was getting interesting, which I found really annoying.

I thought all movies were like that, and that perhaps there were parts of the world where spontaneously bursting into song and dance was normal behaviour. I can vividly remember the relief of finding that there were films with no singing. 

This has left its mark on me. I don't like musicals (except for "Beauty and the Beast" of course, but that's different......)

Anyhoo, today found me, rather unexpectedly, in the audience for Strictly Ballroom - The Musical. This follows the current trend of making every mildly successful film into a musical. Although I wish them the best of luck with "The Artist".

And I rather enjoyed it. I don't remember any of the songs well enough to hum them, but I did remember all the of good bits of the film that they had reverently inserted into the production. If you like live theatre performed with style and gusto, go along. If you enjoyed the move, go twice.

 

Appalling UI Design

Ugh

I still like my Apple Watch. I still like my Apple phone. But mainly for what they can do, not the way that they do it. Going back to my Windows Phone always puts a smile on my face, as I get to use a user interface that is properly usable and scaleable. Then the smile disappears when I find I can't read books or do anything much with it. 

For a company that prides itself on design Apple should be ashamed of the above screen. Take a look at it and decide whether or not the watch will make sounds. After a while you might deduce that if silent mode is off, the watch might make sounds. Although you might also be confused because the icon shows a bell with a line through it which might imply silence. The icon is not lit up - although it can be - something that you need to know to make sense of what is happening here. 

Ugh, ugh, and ugh. Anyone who thinks that user interface design is easy should take a long hard look at this and consider how they would do it. They are almost certain to come up with something better than this mess. Me, I'd take away the icon and use the words "Noisy" and "Silent", it would be a lot clearer for your's truly. 

Update: Turns out I can't spell appalling. That's ..... not good. 

Fantastic Beasts and where to Find Them

We went to see Fantastic Beasts and Where to find Them today. It's set in the Harry Potter universe, but based in New York in the 1920s. It's very good. If you like Harry Potter, you'll love it - which I guess was the idea. he movie has the air of the start of a franchise, so there will be more films, toys, wallpaper, cuddly toys and maybe even books.

Adventures with the ESP8266

I love the esp8266, as far as I'm concerned it's the embedded processor with the mostest. 

But It does have one or two foibles. I ran into them today as I was trying to improve HullPixelbot reliability. My little robots work fine to start with, but then have an annoying habit of crashing or getting stuck after a while. 

Today I found out why. The HullPixelbot is a two-brained robot. The wheels are controlled by an Arduino Pro-mini device, and the esp8266 does the networking and stuff. The two devices are linked by a serial connection, so that commands received via WiFi can be passed into the motor controller which then makes things happen. 

I'm using the SoftwareSerial library to create a serial port on the esp8266 which then sends commands to the Arduino device. This is a software implementation of a hardware device, fast running code does the same task that is normally performed by a piece of dedicated hardware. 

And therein lies my problem. The SoftwareSerial driver was causing my network code to fail. It works fine sending data, but incoming messages cause interrupts in the esp8266 that seem to upset the  connection. I've changed to using the hardware serial port and everything seems to work a lot better. 

Oh, and one other thing I've discovered about the esp8266. Pin 18 (identified as D3 on the Wemos Pro-Mini board) controls whether or not the device can be flashed with a new program. If this line is held high it can stop your programs from downloading. I've been using D3 as a serial connection and having all kinds of problems. And now I know why. 

HullPixelbots at Azure Craft

I'm taking some HullPixelbots out on the road in December. I'm going to try out some group exercises involving 8 robots being controlled at the same time. 

Which means I need 8 robots. 

I'm feverishly building them at the moment, then I'll have to write some code and get it all working in time for the event on the 10th December. Such fun.

This is all at the AzureCraft event in London, where they are also having lots of fun activities for kids (bring a parent) involving Minecraft and whatnot.

Places are limited, but if there are any available you can sign up here

Begin to Code - Get a Free Copy

I need your help. And I'm prepared to give things away to get it. I've had the above error reported to me when trying to use the Begin To Code with C# demo programs. I can't reproduce it, and I can't find out the circumstances in which it happens. 

This bothers me. 

I would love it if someone could get in touch and tell me how they managed to make the error occur. All you have to do is go to to the book site here and get the Snaps examples from the Downloads page. Unzip them and try to build and run them using Visual Studio 2015. There's a help document to tell you how to do this, or you can watch my screencast here

If you get the error error above, send me an email to ibrokebegintocode@robmiles.com so I can work with you to fix the problem. First person to do this gets a free copy of the book. If you get a different problem please get in touch too.

And if your version works send an email to begintocodeworksforme@robmiles.com and I'll draw a name at random in a couple of weeks and send them a free copy of the book too. 

Everyone who gets in touch will receive a "Certificate of Undying Appreciation" as well. 

I'm prepared to post around the world (which means it will cost me money) but I'm determined to find the source of this problem. 

Automotive Shenanigans

I would think that the primary purpose of a motor show is to make you want to buy a car. In this respect the Seattle Auto Show has must be counted as a success as far as I'm concerned. 

In amongst all the monster pickups and unfamiliar brands of the show I spotted this little gem. It's a BMW i3. It's an electric car, but you can get a version with what they call a "range extender", essentially a small generator that can top up the battery when it runs down a bit. Which means that your range is not limited by how much electricity you have left and you are never in the situation where the battery runs completely flat. 

I'd read about the i3 but never actually seen one in the flesh. Until last week in Seattle. I really liked the look of the car and made a mental note to check it out when I got back to the UK. I definitely make the most rational purchasing decisions when I've got jetlag....

Anyhoo, I went and sat in one earlier in the week and discovered that it fits me just fine. And apparently one of the rites of passage for retirement (although of course I'm not really retired) is the purchase of a shiny car. So said the jetlag. So I began the search for one that was in my budget. Which proved tricky. Until I found what seemed the perfect vehicle. Only snag is that it was 250 miles away from Hull. In Canterbury. 

So...... Today I got up at 6:15 and took the train to Canterbury with a return ticket I hoped I wouldn't have to use, and an overnight bag if I had to stop and take on wood (or whatever) on the journey back. A test drive convinced me that it was the car that I wanted, and after a modicum of paperwork, they let me drive the car away there and then. So there was just the matter of a 250 mile night drive which included the Dartford Tunnel and the M25. In a car with a 75 mile electric range. 

Erin said I'd be fine. And I was. In fact I got home with the battery still half charged. I had to stop a couple of times to add petrol to the tiny tank that the Range Extender runs from but apart from that it was a comfortable journey. 

The aim of the Range Extender is not really to let you drive 250 miles in one go, but to allow you to go a little further on a charge (hence the name). But it is nice to know that you can do long journeys if necessary. 

Thanks to the folks at Broadoak Canterbury for looking after me so well, particularly Erin who deals with their electric vehicles. I never ever expected to be a BMW driver, but here I am. 

And the Cube will be staying around too, but now in the hands of number one wife. 

"Soul of a New Machine" now on Kindle

One reason why I liked Ada's so much is that they had a computer book club and their next meeting was going to discuss "The Soul of a New Machine" by Tracy Kidder. 

It is one of my all time favourite books. 

It's supposed to be about building a computer, but really its about people. It's about management, ego and human interaction. Along with a good dollop of how computers work. 

It was written a while back, but still holds lessons for anyone who wants to get thing done. I lent my printed copy to someone (no idea who) a while back and I didn't fancy buying another paper copy. What I wanted was a Kindle version I can carry around on my phone. 

And now I've got one. Amazon have just released the electronic version. If you are in any way serious about computers or management you should read this book. Oh, and it also holds some lessons about how to write a compelling story. A fantastic read.

How to Begin to Code

It turns out to be very hard to record videos when you've got jetlag. I found this out yesterday, when a ten minute recording session turned into a "fur lined copper bottomed ocean going disaster". Andrew had asked for a bit of help and I thought I'd oblige.

Anyhoo, it's done now. It's tells you how to install Visual Studio 2015, get hold of the example programs for my Begin To Code book and then run them. Let me know what you think. 

Subtle plug eh?