Project Blogging for Fun

flowersburnby.png

It’s been a bit quiet on the blog for the last few weeks. I always said that I blog because I want to force myself to do interesting things so I can write about them. Recently there have been so many interesting things going on that I’ve not had time to write the blog, which is an interesting problem. Or perhaps I’ve persuaded myself that I’m too busy to blog…

That is going to change a bit now though. I’ve decided to experiment with “project blogging”. I’m going to take the thing I’ve just done, which is create some JavaScript code that runs in a web page and can load code into ESP devices, and write it up. I’m doing this retrospectively from diaries that I kept during the development process. If you’re a programmer it might be an interesting read. The posts will appear around the time I did each task. I’ve tidied things up a bit to reduce the number of dead ends and whatnot.

They start around here. If you then click the left hand link at the bottom of the text on each post you can move through them in order. There will be other topics here and there too, and some pictures. You can just see the project posts by using this link.

I’d love to know what you think of it and how I can improve the presentation content. Feel free to comment (he said dangerously).

Connected Little Boxes servo pulse

I’ve added a new feature to the Connected Little Boxes software. You can now ask a servo to move to a certain position, stay their for a specified length of time and then move back to its previous position. This makes it much easier to create devices where you want to open a lock or wave a flag.

{"process":"servo","command":"pulseservopos","value":1,"pulselen":2.5}

The command above will move the servo to the end of its travel (the value 1) and hold it there for 2.5 seconds before returning it to its original position.

Apple TV in less needy shock

Yesterday I got a nice new remote for the Apple TV. Today I noticed another improvement to the Apple TV user experience. The new remote has a prominent power button. You can use this to turn your Apple TV (and anything else connected to it) on and off.

You might think that this should not be news. It is after all what a power button should do. You are correct, but the thing is that in the past the Apple TV has always been a very “needy” device when I’ve used it. Previously, if the Apple TV was turned on and had HDMI control enabled it would to grab the foreground at every opportunity. Even if you didn’t want the Apple experience at that precise moment you seemed to have it thrust upon you.

The new device is much more relaxed. The Apple TV is happy to sit in the background until you wake it up.

Apple TV Remote

apple TV remote#.jpg

I’ve had an Apple TV for a while. I like the Apple TV. I hate the remote that came with it. The very first Apple TV devices had a lovely little silver remote that had just enough buttons to be properly useful. It was very well made and worked a treat. The next Apple TV that I got had this horrible black thing. It looked like it had actually been designed so that you couldn’t tell which way up you are holding it, so that using it involved a lot more messing around than it should. It also had a touch pad that was as useless as it was unnecessary. In short, not good.

Then, a while back, Apple announced a new Apple TV remote. As I use Apple TV a lot, i thought I’d get one. It is annoying to have to spend lumps of cash to get to a situation where you should have been at the start, but the new remote does a good job of making amends. The buttons are nice and clicky, the design makes sense and it works very well. I’m now a less unhappy customer than I was.

The Price of Greed

This post doesn’t reflect well on me. I present it as a salutary tale about greed.

When I started working on the “Connected Little Boxes” I invested in the domain name “cleverlittleboxes.com” as I thought that might work for the name of the product. Then I found out that there actually is a company called Clever Little Boxes which rather scuppered my plans. So I switched to the name “Connected Little Boxes” which is just as meaningful and ties in rather well with our “Connected Humber” project. I spent another six pounds or so on “connectedlittleboxes.com” and went on my merry way.

Last week, via a domain sharing thingy, I got word of an offer for the “cleverlittleboxes.com” domain. The mysterious purchaser was offering 199 dollars for the domain name. Visions of riches swam in front of my eyes. Or at least, enough riches to get a new iPad. So, having done some research on the domain selling site I sent back a counter proposal of around half the price of what I saw as comparable names. This is a long-winded way of saying that I got greedy.

Anyhoo, today I got a rather sniffy response from my mysterious buyer, complaining about my profiteering actions and dropping the offer to a very iPad unfriendly 50 dollars or so. Oh well. I’m going to hang on for the domain for now and see what happens.

Imagine Cup Judging

I’ve got very fond memories of the Microsoft Imagine Cup. At one point I was the captain of one of their competitions, which meant that I got to travel around the place and see awesome work from students. That was a while back. Today I spent a happy afternoon as a judge going through submissions for the junior competition. They were lovely. Some great work and some splendid explanations. The best bit for me though was knowing how much value taking part in these competitions adds to the contestants. I’m really pleased to see that the competition is still out there doing good. If you want to sign up for next year you can do it here.

Connected Little Boxes web flashing now live

flash.png

Well, that was fun. One thing I’ve always said about tricky projects is sometimes you have to “go and live there” to solve the problem. Well, that’s where I’ve been for the last month or so. I’ve been grappling with the JavaScript serial interface and the espytool with the aim of creating a website that can directly flash my Connected Little Boxes software onto a brand new ESP8266 or ESP32 device.

And I’ve finally gone and done it. If you want to put my software onto one of your devices (I’ve tested it with Wemos D1 Mini and Wemos 1 ESP32) you can go here, plug your device into your PC or laptop and then flash my software into it. For this to work you have to be using a Google Chrome or Microsoft Edge browser.

I’ve also created a simple terminal (called Simpleterm) that you can use to configure a Connected Little Box from your browser. You can find Simpleterm here. You can use Simpleterm to talk to any device that uses a serial port.

The Connected Little Boxes website will be further developed over the next few weeks to add more projects. I’d love to know what you think. And it’s nice to be back in the blog…

Thrustmaster TCA Officer Pack Airbus Edition

airbusjoystick.jpg

I first ordered the Thrustmaster TCA Officer Pack Airbus Edition last year, when the idea of flying away from everything was even more attractive than it is right now. I’d taken the precaution of ordering in good time, which I thought was a great idea, particularly when I saw the price of joysticks go through the roof. Unfortunately, the people selling me my joystick were also watching these prices. Their claims about my order status became more and more outlandish, at one point the order was marked as despatched, but then they cancelled it completely.

So that was that for a while. But, ever persistent, a few weeks ago I noticed that Scan computers were claiming to have them in stock. I thought I’d test these claims, and today the joystick arrived. Just in time for our Monday evening flying session.

It is very nice. Not the real thing of course, but good enough for me. It works beautifully with Microsoft Flight Simulator. The joystick response is very smooth and there is plenty of movement in the throttle. It even has nifty reverse thrust settings which you can use to stop your Airbus from plummeting off the end of runways that turn out to be a lot shorter than you expected.

I never had many plans for my long term future, but one of the one that I was pretty sure would come to pass is that I would always be playing with silly plastic toys. And so it has turned out.

Installing Roli Connect software on a Mac

I’m liking my Roli Lumi keyboard. It came with some rather nice programs. The Roli Studio Player program links the keyboard to lots of interesting sounds and provides some really nice control options. The Roli Studio Drums application lets you play drums (the clues is in the name).

The programs work on both PC and Mac, or at least they are supposed to. However, they failed to install properly on my MacBook Air. The installation sort of worked, but firing up the applications produced a message that a part of the system was not running. This was annoying because I could actually see the missing component in the filestore. It got even more annoying when number one son turned up with his Mac, installed the software and it worked first time. Wah.

I still feel a bit at sea when I’m trying to understand MacOS. It works OK, but I don’t know it as well as Windows. And, forgive me for saying this, MacOS seems a lot more primitive than Windows 10. Particularly when installing software. There is no well defined way of putting programs onto your system and, equally importantly, getting them off it again. Windows apps have a nice set of installation processes that also contain an uninstall component. Mac apps are installed by dragging them somewhere and then hoping that they will sort themselves out when they run. And if you want to properly remove a Mac app it seems that you have to trawl through lots of folders deleting files that might or might not be part of the installation.

Anyhoo, I digress. The Roli software didn’t work for me, but it seems to work fine for most everyone else. The Roli support people were excellent, but they were a bit hamstrung by the fact that their software worked for them too. In the end number one son fixed it, which was nice. He managed to run the program from the command line, so that he could watch what happened. And he saw this:

[08:47:58.864] [error] { code: 'EACCES',
errno: -13,
message: 'EACCES: permission denied, open \'/Users/robertmiles/Library/LaunchAgents/.com.roli.roliblocksserver.plist.a1040590be279758\'',
name: 'Error',


More importantly, he also knew what it meant. The install process is trying to drop some code into the LaunchAgents folder. This is where MacOS applications put things that they want to have launched at some point in the future. The problem was that on my machine the folder didn’t exist. What the Roli installer should have done is create the LaunchAgents folder and continue, but it didn’t. It fell over leaving things in a mess. This is a horrible bug to spot, in that if you happen to have installed other software on your machine that has created this folder the Roli software will install and run just fine. But if you are me, it breaks.

All we had to do was make a LaunchAgents folder and run the install again. If you are having problems with your Roli installation on your Mac you might want to make the folder. You can work out from the path above where on your system it needs to be put.

Alita-Battle Angel is watchable rubbish

alicia.jpg

Sometimes on a Saturday night all you want to do is watch a big dumb movie and eat popcorn. Tonight that is what we did. We watched Alita: Battle Angel which, as the poster says, is from the same producer as Titanic and Avatar. As if that is some kind of recommendation.

Anyhoo, it was fun. Lots of impressive computer graphics, fight scenes and whatnot. The ending is a bit of a let down though. It’s an obvious setup for a sequel that, given the performance of this movie, probably won’t be made. Worth a look as long as you have popcorn handy.

McCoys in Hull is great

We went shopping up town in Hull today for the first time in a very long while. It was sad to see that some places haven’t made it through the pandemic, but it was great to see that McCoys is doing well. They are something of a Hull legend and benefit from a chunk of outdoor space on the side of Victoria Dock which is a great place to sit and watch the world go by as you chow down on their huge portions.

Great stuff.

Editing with lovely pictures

kitchen.jpg

I’ve just received a set of chapters for the final editing pass for my Begin to Code with JavaScript book. This is the point that I get to see what the artists have come up with for the illustrations at the start of each chapter. As usual, I’m completely knocked out by the quality.

I reckon that the book is a good buy just for the pictures. You can pre-order it here :)

Web Page Temperature Viewer

temp.png

Yesterday I created a command which will let a Connected Little Box send temperature values out of its serial port. Today I made a web page that will receive this data and display the values in large friendly letters.

This works by using the same browser serial libraries as I’m using for the the ESP firmware uploader. It works well. It means that it is now very easy to display serial data on a device by simply visiting a web page. You can find the temperature viewer page here.

Connected Little Boxes can now produce JSON data

I’ve added a new feature to Connected Little Boxes. You can now ask a box to send out sensor values as a JSON encoded string. This means that you can hang a box off a serial port and get data from it in a format that is very easy to use. It’s done using the console process and the command is called reportjson:

{"process":"console","command":"reportjson","text":"starting","sensor":"bme280","trigger":"tempsec","attr":"temp"}

The above command tells the Connected Little Box to send out the temperature value from the BME280 sensor every se4cond. The box will then produce a sequence of messages that look like this:

{"temp":"24.0"}

Andertons Music are good in failure mode...

andertons.jpg

I bought my Lumi keys from Anderton Music. The only device they had available was an “opened box” unit which was a bit cheaper. However, when the keyboard arrived it turned out that someone had done a bit more than just open the box and look at it. They’d also used all the download voucher codes that came with the device. It is at this point my heart began to sink a bit, what with having to go back to Andertons and ask them to sort it out. However, the good news is that they owned the problem and kept me informed as they fixed it. I think the true measure of a company is how well they work in “failure mode” when things go wrong. In this test Andertons passed with flying colours.