Category Archives: Uncategorized

Coffee Boss day 1: Set up

So, this should be easy, right? I've used my [coffee_boss scales]( device to save a load of weight measurements into a couple of text files as csv. I want to show these values as a graph, and do some other things with them. I'm working on my home machine, which is Windows 10. I opened up Pycharm and checked a new project out of source control (

I create a new directory "viz" to do some visualisation stuff in. Inside, I create, and look at which I think is a good place to start. I've never done anything visual with python before, never used pandas, barely used numpy.

# Diversion 1:

Set up the environment. Oh right, lets switch to python3 - start on the right foot eh. Ok, that's in project settings, I remember that. (I haven't used Pycharm for anything for years.) Oh right, there's already loads of packages loaded in site-packages.

I want a fairly fresh Python environment so it's easier to debug problems if they happen. I'll create a virtualenv through pycharm's interface. Should I create the virtualenv somewhere near the coffee_boss project? I don't think that's a good idea because I don't want it to be checked into git. But I don't really want a random disconnected bundle of venvs either. I'm sure I already have a few of those floating around, with names that only made sense at the time.

So I'll do it anyway, create sandy_000/venv/coffee_boss. At least there's something concrete to connect it to this project.

# Back to work

Good, fresh environment. First line.

from pandas import read_csv

Ok, got the squiggles, that's good. Let's see if muscle memory serves me… what do my fingers do? Turns out alt+enter is still the combo for "solve the squiggles". Nice, I feel clever, all those years haven't abandoned me entirely. Alt+enter, then "install package pandas".

# Diversion 2: Update Pycharm

I've got an error: "AttributeError: module 'pip' has no attribute 'main'". Hm. Check that pip is the right version...

Google. This was a problem in 2018, when upgrading to v10.x of pip, maybe that's it. Ok, I'm on version 19.x, that's not it. 20 minutes of searching. Google. gives me the hint, and I notice that this is version Pycharm v2017.

I start up the Jetbrains toolbox and hit the button to upgrade Pycharm. I decide to uninstall an ancient version of Webstorm while I'm there. I didn't even know I had that installed.

# Diversion 3: Make this into a blogpost.

I decide to write this down. I had this idea about stepping through my process of getting something from idea to openshift and it's this kind of back-and-forth that reveals the dull complexity of trying to get anything done with programming. What a good idea. Just type it into an email in the first case.

I open the empty draft and instantly remember I hate swapping between tabs in firefox. And I hate having multiple instances of firefox open, I always end up finding the wrong window and duplicating tabs in both.

I just opened notepad++ instead. That's good too, I got up to here typed, and I'll just use markdown for code.

# So, back to work

So I've started and got this far. But hm. I'm writing this article in notepad++, and I want to paste in a picture of the squiggles. I use snipping tool to take it, but of course I can't paste it here. Man.

Diversion 4: Updating WordPress

Obviously, why don’t I just switch to writing this on my dev blog. Yes, good plan. Go to, it’s a wordpress site. Figure out my password and log in and start a new post. Good, now we’re getting somewhere.

(Don’t want to spoil the tension, but you can tell this bit worked eventually.

Copy the snipped image, … paste it. Paste it. PASTE IT. It’s not pasting. Doesn’t wordpress allow pasting into posts? I’m sure it used to. Oh, the installation is three years old. Maybe it just needs an update – I think I remember doing that on my other site recently.

So abandon that post and click “Get v5.2.3”. It says it can do it automatically. I know it says take a backup first… Well nothing has changed recently on this machine, so I’m sure the last backup is ok.

Downloading. Now unpacking the update… That’s taking a long time. Open a new tab. It’s not in maintenance mode. I wonder if I can see the logs somewhere? What version even is this one? It tells me this could be updated, but is it a minor or major bump? What should I expect?

Ok, this is v4.something. Try to start the update again. Hm update already in progress… Gosh I’m going to have to look at the logs. Lets go to, that’s my hosting company. Oh.

This wordpress installation was installed through “softaculous”. That’s got a way to do upgrades outside of the wordpress UI. Try that. Great, the install to 5.1.2 seemed to go ok… It says. How did I check the version again? This is awful. Oh right, under the big W. It still says it’s at 4.9.11.

Why isn’t it upgrading. Ok, in the file manager I can see that the upgrade bundle has been downloaded, and unpacked. What happens next? Can I do it manually?

Google. Found which describes my issue. It points me to some plugins – “fix another update in progress” in particular. That wasn’t the error I had… But try it. Ok, manual install it is. Make a backup and remove the files, and copy across the new ones. Ok, test it, that’s trying to setup a fresh installation… I’ll copy wp-config.php and the wp-content directory over too. It works. showed how to update. It was pretty easy.

Now, were was I. That’s taken an hour and a half. Dave has just sent a message on steamchat asking if I’m ready for some rocket league while we’re waiting for Andy to come online. I haven’t even had my dinner yet! The dishes from lunch are still waiting in the kitchen! I had hotdogs for lunch. I’m not really hungry.

Oh right, just before I do that, let’s just see if I can paste inline images into a new post.

Oh yeah, it was all worth it.

Back to work

Copy and paste the doc from notepad into wordpress. Oh I’ll do a clever thing where I show how the text started in notepad and do some stuff to indicate diversions.

This is getting long. Got to make dinner. I started this just before four, it’s half eight now and I’ve got one line of code written. And that doesn’t even work. I think this is a two-parter.

Getting to grips with ESP32

I’m tinkering with the ESP32 board. There isn’t a loader that works with the Arduino IDE’s board manager yet, and I had a basic problem installing the board files following the instructions at It says to put the files into [sketch folder]/hardware/espressif/esp32, but because my sketch folder is in my Documents/arduino, weird permissions blocked me from doing it.

I moved the files into C:\dev\arduino-1.8.4\hardware\espressif instead and it worked fine there. confirmed that there was no special magic involved in where it goes.

There’s a load of warning during compilation, but they seem to be in places that make no difference, because it worked, good stuff.


Used SD_Test.ino from the ESP32 examples.

And it worked. This isn’t the connection I expected: I thought the MISO on the SD card would be connected to the MOSI on the ESP32. This isn’t how SPI works, and I’m conflating MISO and MOSI with DIN and DOUT.

DIN and DOUT are implicitly directional. The OUT of a device is naturally the IN of another device. So while it might make sense on a board to have an OUT marked, it’s not possible to have a conductor which is called OUT at one end, but looks like IN at the other.

Master In, Slave Out is a buss that might be common to multiple SPI devices. There is only one master with one input, so that doesn’t change, no matter how many devices there are added.

SPI uses the chip select pin to put other devices into a high-impedence state that means that effectively the SPI bus is only connected to one device at a time. There is another form (referenced in the forum post above) where SPI devices are daisy-chained. That’s not for me.

Bose Soundlink Mini II vs Mass Fidelity Core


I asked for a Bose Soundlink Mini II for Christmas, because I wanted a way of getting music audible while I work, screen printing on vacuum tables. The vacuum is noisy. I figured a small speaker I could put right next to me would be better than blasting the proper stereo from the other end of the room.

It’s great for that, it’s close to me, I can hear even with the vacuum on, and it doesn’t have to be so loud that it’s offensive to other users of the print room. Problem solved.

For my studio (sounds fancy, it’s just a little room full of boxes), I wasn’t loving it though. Because I have coveted the Mass Fidelity Core since it got kickstarted, and I received a bit of a windfall, I pulled the trigger on that, and it arrived a week or two ago.

My existing machine is a Creative D80 bluetooth speaker, so we aren’t talking audiophile gear here. Nevertheless, I was surprised by how a machine four times as expensive compared, and a machine ten times as expensive.

There are plenty of reviews of the Soundlink and the Core, so I’ll not describe what they’re like in terms of specs, but I will give my reactions and feelings on build and finish.

Bose Soundlink Mini II is a tiny, solid piece of engineering, beautifully finished. It weighs about 700 grams, but seems heavier. The metal case of it is smooth where it should be smooth, and has sharp edges where it should be sharp. The metal grille makes it very grabbable, and inspires confidence. I was happy just to grab it and shove it in a bag, without fear of clicking fabric, or poking a driver.


It comes with a charging dock. The Soundlink Mini II has a big rubber foot, that means it doesn’t easily slide into place on the dock. You’ve got to wiggle it a bit until it seats properly. That’s literally the only problem I can find with the build on this machine, it’s really a nice piece of kit.

Unpacking is a pleasant experience. The USB charger has got a couple of international prongs to slide into it. Neat.

The Mass Fidelity Core is not as tiny as the Soundlink, and twice as heavy – though it doesn’t seem so. Holding both out in front of me, I struggled to sense a great difference in weight, despite the huge difference. It seems solid enough, and the polished metal is a beautiful element. I wish there was a bit more special up top though – it’s a bit of a bland top. Shiny black plastic – I’ve seen it before.


Unpacking looked good to begin with: The box has a colour sleeve, over a rather beautiful stepped, sturdy board box. Inside are two sections, with high density black foam precisely cut out to cradle the Core, and another little cupboard at the side for the accessories. It seemed a little over-dressed to me, and my Core had clearly been unpacked and re-packed up before – cardboard tabs were bent and delaminated. A bit of the protective film had already been peeled back through handling.

The precision of the packaging made the untidy contents seem more problematic.

The Core comes with a little infrared remote, the power supply, and a handful of international figure 8 leads for it, and a stereo RCA-to-3.5mm jack cable.


The size of this means it isn’t going to be slung into a shoulder bag, even with the odd little tote that accompanies it – it’s a weird sort of shape, and just too large for me to pick up with one hand. I do have small hands though.

The power button is on the back rather than the top.


Physically it’s a little underwhelming, and there was some marring on the moulding at the back. I can’t tell if it’s damage or just a slightly duff mould, either way it’s cosmetic only, but just reflects a little less attention. If the rest of the unit wasn’t so sharp and sleek, then I wouldn’t even have noticed.


Frustratingly, neither of these devices are anywhere near as reliable as my Creative D80, that just connected instantly as soon as I wake my laptop, and stays on, rock solid. It’s never dropped. The D80 is mains powered (and old), I wonder if it’s something to do with power saving.

Both the Soundlink and the Core lost their connections once or twice over the course of a day’s use. With the Core, any silence of longer than about six seconds makes sound fade back in, when it next occurs. This is most obvious when changing the volume in Windows, using the slider – the sounds that plays misses it’s attack. In the scheme of things, not that strange, but just a bit curious. I guess this is a power saving thing, and it doesn’t happen with a wired connection.


This is tricky, these are very different beasts.

The Soundlink is focussed, bassy, powerful. It has a flattened, compressed punch that is unsubtle but effective. It is very directional, and falls off very quickly as you move away from the unit.

The Core is polite, detailed, expansive. The soundstage is quite amazingly expressed, and I’ve never had the layout and composition of the musicians suggested to me so openly before.


I listened to a couple of different tracks to compare them.

First off, Nigo‘s Ape Sounds. The Soundlink expresses this with a wonderful focus and punch, round bass, a full, convincing sound. The Core showed it diffused, a bit neutered. Compared to the Soundlink, the Core sounds oddly phased, a bit like turning on “surround sound” on some hifi systems. Not the best.

Inception OST, We built our own world and Radical Notion contain passages that I was surprised to be able to “see” quite deeply into on the Core, it was obvious that there were different physical instruments playing different sections. The layering was clear. On the Soundlink, it all just blurred into “strings”, and the difference between the violins and the cellos was lost.

The Soundlink really has punch, and expresses bass that the Core only eludes to, but it does sound a bit muddy down there.

The track Mombasa has a repetitive bass drum signature, that sounds insistent and solid, processed on the Soundlink, enjoyable. On the Core, it sounds like a real drum, in a room, quite surprising.

There’s a brilliant brass break at around 1:25 on that track, and I was expecting it to really show the best of the power that the Soundlink could deliver, but it actually sounded compacted and processed, a bit of a dirge. The Core lacked the oomph, but expressed the part open, rasping, tearing. A much more interesting piece to hear.

Avril 14th by Aphex Twin is a fairly low-fi simple piano ditty, and was actually pretty hard to differentiate on these speakers. The Core edged out as being more realistic, sounding more like an upright piano. The Soundlink more like a toy piano.

The Way by DJ Taktix was a sub-bass test. Weirdly, I could hear the very low tones on the Core, but just not loudly. On the Soundlink, the bass rolled and boomed carelessly, certainly a lot more perceivable than on the Core, and powerful bass is part of the joy of this kind of record. It flapped a bit, loosely expressed.

I was surprised to find with the Core, separation was obvious, clear even on something as unsubtle as bloodclot jungle techno that I always assumed was just a thrilling hot mess of splats and breaks. The Soundlink presented is as such, a solid scribble of energy. The Core again neutered the track, showing it almost too unforgivingly, maybe highlighting the track’s lack of sophistication a little too clearly.

Max Richter‘s Sleep was a surprise. I found I much preferred the simpler presentation that the Soundlink gave this album. There’s a conviction and a seductiveness in it, sipping a more concentrated soup. The unsubtlety of it worked well with the droning, solumnabulatory sound, allowing it to sound warmer, more complete, less interesting.

With the Core, I found it open and layered rather than sonorous and suggestive, but not any more engaging.

Listening summary

The killer feature of the Core is the ability to present a wide, expansive sound stage with one pretty dinky speaker. It does it, quite amazingly well. When it plays, the source of the music is very indistinct, but the actual sound itself is crystal, chiming, rareified. It invites deep inspection of layered orchestral sounds, and is realistic. Instruments sounds like pieces of wood and cork and strings, and brass, blown, plucked, bowed and hammered, in a room. Rather than recordings, or something from the radio.


On the down side, that realism is a problem for acoustically simple music – particularly bass music (which is a lot of what I like) where the Core’s expansive presentation sucks quite a lot of power out of it, makes it sound neutered, or hollow. Unmoving I listened to quite a few jungle tracks I love, and just felt “so what?”. An empty performance.

The Soundlink is tiny, and has bass. It presents a much more simple picture, not muffled exactly, but just flattened. The highs are just as high, and the lows are just as low, but there doesn’t seem to be much range in between. This gives a powerful, directed sound that is fun and bouncy, and plays bass music (and probably rock and pop) pretty well. It doesn’t travel far.


Delete a bunch of mongo databases at once

I know this is knucklehead stuff, but I never trust myself to do it without 10 minutes of practice beforehand:

var dbs = db.getMongo().getDBNames()
var prefix_to_drop = 'testdb_';

for (var i in dbs) {
  db = db.getMongo().getDB(dbs[i]);
  if (db._name.lastIndexOf(prefix_to_drop,0) === 0) {
  print("Dropping " + db._name);

I use this when I’ve been breaking tests, and the database cleanup is getting skipped. And I end up with 150 test databases lying around.

Calibrating e-steps

Every time I have to do this, I forget what to do, and have a frustrating time. Because it’s simple.

G91 – Sets the printer into relative mode. This is so that issuing:

G1 E10 – actually moves 10mm. I do this twice in row for each measurement. The first one compensates for the inaccuracy of the previous measurement.

I could issue a G92 to zero everything instead of doing the G1 twice, but I don’t.

Then M92 E800 to set esteps per mm to 800. Mark on the filament 10mm on the ruler, then send G1 E10, and see how far the mark is from the 0mm mark on the ruler. Once it’s as accurate as can be at 10mm, do a couple at 50mm or 100mm to check the accuracy better.

I just got a new extruder.


  • Mini extruder with NEMA14, E3D hotend: e-steps per mm: 700
  • Bulldog Lite with bowden, E3D hotend: e-steps per mm: 114