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.

Lumi Keys

lumi.png

Lumi Keys are great fun. I’m trying to persuade myself to do more piano practice and a keyboard that lights up as you play it sounded like a great idea. Particularly if the keyboard supports aftertouch (you can press the the keys down harder to affect the sound of a playing note) and you can change the sound of the note by wobbling the key from left to right after you’ve played it. All this is sent out using MPE (Midi Polyphonic Expression) messages which work with a lot of modern sequencers. So of course I bought one. The package that I bought is called the Studio Edition and comes with drum and player applications that make really nice sounds.

The keys are not quite full sized, but they are big enough. The aftertouch and wobble effects do work, but they are not totally consistent across all the keys. Some keys need more wobble than others. However, they do allow for a lot more expressive playing. And the lighting effect is awesome. It really makes playing a keyboard a performance. There are a variety of different colour schemes and you can get the keys to highlight different scales and keys. You can also change the response curves of the various inputs.

There’s a learning app for IOS and Android devices that lights up the keys that you need to play to knock out a tune. This turns piano playing into a game a bit like Guitar Hero. I’ve had a quick go and it looks like fun, although I’m not sure how it would help you to read music, which is a key skill for a piano player.

At the moment I’m really enjoying playing with the keyboard. I’m even thinking of getting a second one. The keyboards have cunning connectors on the end so that you can double the number of keys available by just snapping another keyboard into place.

Paying off technical debt..

I had plans for today’s Hardware Meetup. I wanted to show off my ESP uploader. However, fate had other ideas. I’ve spent the day paying off technical debt.

You run up technical debt when you think “I’ll fix/document/investigate that later”. I keep a list of my “debts” and try to remember to go back and clear it every now and then. This morning I thought I’d spend ten minutes sorting out a few things. Five hours later I was still at it. Along the way I discovered:

  • the ESP32 random number generator uses WiFi noise as a random seed.

  • you need to download several files into an ESP32 device when you initialise it. These must include the partition table.

  • you can find out the precise commands that are used to deploy a program in PlatformIO by enabling verbose mode for the build process. I’ve done this twice and forgotten how to do it after each time. I really should write that down (which of course is another piece of compound technical debt)

Not withstanding my lack of demo, we did have a very good meetup though.

Browser Based Device Programming

Today I managed to take a brand new ESP 8266 device out of a bag, plug it into my PC and then go to a web site using the Edge browser. And from that web site I managed to download a program into the device. I didn’t have to install any software onto my machine. Very pleased with this, it is going to make getting started with Connected Little Boxes much easier.

Angry programming

One of the things that I’ve learned over the years is that if you are really, really angry about something the best thing to do is to try and channel that anger into something constructive. I started today very cross about the way that a silly virus is making such a mess of everything. And then I thought I’d channel that into sorting out problems with the code that I’m writing to deploy programs from the browser into ESP devices. It’s not been working properly for a while, and that has been annoying me too.

So today the problem got both barrels of rage. I simply was not going to let it beat me. And fortunately for everyone I managed to get it to work. At the end of today I’ve managed to transfer a stub program from the browser into a device. This is not the same as a “proper” program, it is a chunk of code that forms the bootloader element that will accept the uploader commands. However, It has proved the underlying process can be made to work, so I might have started the day angry, but I’m ending it happy.