Hungry DFPlayer

The DFPlayer Mini is an amazing device. Particularly as you can pick one up for around a pound on AliExpress. It will pull mp3 files off a MicroSD card (which is the most expensive part of the system) and play them for you. It outputs good quality stereo and even includes an amplifier that will drive a pair of speakers up to useful levels.

I’m using it in a device that I’m building. I’ve got a Raspberry Pi PICO triggering the audio playback over a serial connection. I loaded an MP3 file onto the SD card for testing. I used the track Fireflies from Owl City for no particular reason. The music started playing, which pleased me. Then, around 20 seconds in the drums and the bass kicked in and the whole thing crashed. Which did not please me.

It’s a power supply thing of course. I was powering it from a USB port on my PC which is a bit weak. I switched to a different port and it worked fine. There’s an important lesson here that I’ve mentioned before. If you’re making something and it starts to misbehave try a different power source.

Super strength Rob

There’s a scene in most superhero movies where the would-be hero does something while unaware of the incredible strength they now have. The results are things like baseballs going into orbit, cars flying in the air and really unpleasant handshakes.

I’ve just had that experience myself. I was taking my morning row when there was an almighty bang and the rowing machine fell into two pieces. Obviously my super-strength was the problem. I tracked it down to the above bolt which I have managed to snap after only 9 years of regular use. It seems that every rowing stroke bent the bolt slightly and eventually it failed. I wasn’t too worried about this. I’ve repaired the machine several times. I looked up the availability of bolts and found a suitable replacement. Then I took a look at the fitting it goes into on the machine. The head of the bolt had been welded into place. I’ve no idea why. It makes it impossible to for me to replace and increases the chances of the bolt failing in the first place.

So, it was onto the internet and a search for a replacement machine (I don’t want to stop rowing). I took the old one down to the tip and bid it a fond farewell. The new machine arrived this afternoon (thanks Argos). I hope it lasts as long as its predecessor.

DDD Registration open - and I'm doing a session

The bad news is that the DDD event is online so we don’t get a trip out this time. The good news is that the DDD event is online so you don’t need to make trip out. You can register here.

I’m doing a session about Pure Data and making musical instruments using the Raspberry Pi PICO. I’ll also be performing the world premier of my “Concerto in A Room” (It’s slightly smaller than a “Concerto in A Flat”) using the PICO MIDI Cheesebox and Crackers controller. Surely that’s something you mustn’t fail to miss.

Masked Fun at Comicon

They had a unicorn there.

We went to Comicon today. It was great fun. Although the Covid protection measures were laughable. Our carefully printed COVID passes were checked by someone who could apparently read QR codes by just glancing at them. Social distancing was non-existent, the place was more packed than I've ever seen it and we were pretty much the only people wearing facemasks that weren't part of a costume. It seems that "mask friendly" means that they won't throw you out if you are wearing one. Oh well. To be honest, I wasn’t expecting much more. And we still went and had a good time.

The halls at the NEC are pretty big with high ceilings. And we didn't stay in one place for very long. With a bit of luck we’ll be OK. Although I'm not convinced that hope really counts as a pandemic management solution.

Google is still broken for me

Google search is still broken for me. And a few other people too. Apparently the search team is looking into it. I just hope they can get access to their pages.

This really brings home to me the benefit of paying for services. If I was paying for a search service I’d have proper leverage with the supplier. It would be directly in their interest not to upset their customers. And I would know exactly how my service was being paid for. As it is, they seem to have made the call that giving the problem a proper level of priority isn’t worth it.

Begin to Code with JavaScript on Taskmaster

Taskmaster is a super TV program. The Taskmaster gives, er, tasks to competitors. The tasks are always interesting and the real joy of the program is watching how the competitors respond to each one.

In the show last night (season 12 episode 8) at the very end they played a game that they called “Pop Up”. Everyone sits down and then the last person to stand up before a particular event occurs (they had a pop-up toaster, jack in the box and bursting balloon) wins. It was great fun to watch.

If you want to have a go at this at home you can use a web page that I created as an example program for my book Begin to Code with JavaScript. I called it “Nerves of steel” and it works in a very similar way. The page starts a random timer. The last player to sit down before the timer expires wins. You can play it here.

If you enjoyed that you can then you can graduate to High and Low, where players try to guess whether the next random number will be higher or lower than the previous one. Guess wrong and you are out, last person in wins. You can play that here

.. and you can buy the book here:

Making lots of WiFi

I’m trying to track down the cause of my network problems at the Bonus Arena on Monday. One possibility is that a large number of available WiFi connections might cause the joining software to run out of memory.

So today I tried to make a large number of access points using a box full of ESP8266 devices. I got up to 14 access points and my software still worked fine. I think I’m going to have to go into town with a system and have a proper play to find out what is going on.

Google is ghosting me

I don’t use Google search that much. The search built into Edge does most of what I want. And for really hard stuff I use duckduckgo. But recently I don’t use Google at all. When I go to google.com I get the above error. I’ve tried it on different machines and I get the same error. I think it might be something to do with my Google account, although mail works fine, as to other Google services.

When I was at Tech Week on Tuesday I made the mistake of trying to read my Gmail on a machine I hadn’t used for a while and when I tried to sign in it offered me the chance to complete the process on a device that I didn’t have with me. Which was tricky. The process failed, I got an email telling me that someone was trying to access my account (yes! it was me!) and ever since I’ve had this problem accessing the site. I think it is having a form of digital sulk.

Fun at Tech Week Humber

Well, that was fun. Brian and I have just spent a day at the Tech Week Humber Expo. We got into place nice and early, made sure that everything worked and we knew where to get the coffee from and then settled down for the day. It was great. Lots of people asking what were doing and seeming to like it when we told them. And plenty of solid contacts to follow up after the event.

This is our Connected Little Boxes demo, showing how you can configure them to keep in touch with loved ones. We don’t want to sell these as a healthcare solution, but we think it might be fun if you got together with your kids to build one for grandad…..

Thanks to the folks at the Bonus Arena for looking after us so well (especially the packed lunches), Lucy Clark for keeping everything bowling along and finally to Hull City Council (particularly Richard) for organising things for us, getting all our mains adapters (there were a few) PAT tested so we could power up our toys and then getting our amazing stand made.

I love to see all the local expertise being showcased. It’s great to meet up with people that used to come along to my programming lectures back in the day and now find themselves running thriving companies.

Surface Go to the rescue

Our little company, Connected Humber, has got a stand at the upcoming Humber Tech Expo. I’d spent a few days prepping the devices for the demos, took them along to the Bonus Arena and plugged them in and …. they all failed.

Oh good.

The only computer I had to hand was my tiny Surface Go device. I’d brought it along because it weighs almost nothing and you never know when you might need a full fat Windows installation. I fired up Visual Studio Code, pulled down the latest release from GitHub and started investigating.

The fault was interesting. The WiFi code in the ESP8266 seems to be upset by very large numbers of available access points. It shows its displeasure by running out of memory and crashing. There wasn’t time for an elegant solution so I removed the WiFi scan, hard wired the connection details and got it working before they had even managed to get the mains connection to our stand.

I’m going to have to dig into the code later in the week and find out just what is going on. But at least I’ll have something to show off tomorrow. If I’d not thought to bring the Go along, it might have been a different story.

DDD Goes Online

Developer, developer, developer (DDD) events are one of my favourite places to meet up and talk tech. There’s one due at the end of November and the original plan was for a physical meetup. However, with Covid cases on the rise the decision has been made to make the event online. The good news is that this means that anyone can come along (the event usually fills up really quickly) and the event is not constrained by space, so there can be lots more tracks and sessions. You can sign up and take part here.

Another one bites the dust...

My loft is now officially called “The Place Where Rob’s Gadgets Go to Die”. My lovely Hitachi digital 8 camcorder is broken. It tries very hard to work. You can hear the motors struggling and then it finally gives up with an unhappy pop. I managed to make it record something but what came back were just flickering lines. I’ve got tons of old tape I was planning to import into a computer and now all I can do is look at the boxes.

I might take it to bits to try and fix it. With a bit of luck it might be something mechanical that I can mend, but I’m not that hopeful. Oh well, I suppose it is over twenty years old….

What your bugs are telling you

Last night I was doing some work on the PICO MIDI cheesebox when I found a bug in the way that note values are assembled when the box is generating random tunes. I came up with a quick fix and opened up the relevant part of the code. And then I stopped. I was wondering if, in the absence of a commercial imperative (after all, nobody’s business is hanging on this code) I should be wading in just right now. Perhaps it would be better to sleep on it and then fix it in the morning.

I put the question to Twitter, and got a variety of replies. I didn’t make it clear that the bug was not affecting anyone else at this point and so quite a few folks pointed out that in a production situation you would triage the bug (decide how important it is) and then either drop everything and fix it or roll it into the next release. Or, of course, live with it. All good stuff. But if the bug appears while you are creating a solution you have a bit of wiggle room when deciding how best to fix it. And I think you should sleep on it. As long as it won’t keep you awake…

Having left the bug and slept on it, I decided that the way the bug manifested itself reflected my poor understanding of how the program should work. To properly fix the bug I’d have to re-structure part of the code. So I did that, and the solution is much better as a result.

I’ve had this kind of experience many times. It seems that to find out how to really write a piece of code you have to write it. No amount of up-front design work shields you from this. And when you write it you must expect to have to change the structure and content of the components. I view this as a kind of battle between warring factions. As I write the code and build my understanding of what I’m trying to do I find that the objects in my solution grow and shrink. A class you think will be pivotal can shrink in importance while a “young pretender” can emerge and take over. So I don’t regard discovering bugs like this as a problem, they are part of the process. So give yourself time to deal with them properly.

Power Packed for Tech Week Humber

I’ve just dropped off all the power supplies we’re going to be using on our exhibit at Tech Week Humber. They need to be PAT tested to make sure that there are no bare wires or sparks on our stand. The exhibition itself is next Tuesday (9th of November) in the Bonus Arena in the middle of Hull. Anyone can come along and say hello. Brian and I are going to have a bunch of sensors and stuff on show. If you fancy seeing what we get up at Connected Humber it would be lovely to see you.

If you write stuff, you should know about Scrivener

I bought Scrivener a few years back as part of a MacHeist bundle. I’ve always liked the way that it lets you organise your writing. It seems to have been created by writers for writers. I played with it for a while at the time but then I ended up back using Microsoft Word to write all my stuff because I was working with a bunch of folks who also used Word. This is not a problem, as Word is a great place to work. However, recently I was wondering if Scrivener could help me when creating magazine articles. These have well defined structure and content and are associated with lots of assets, web links and images. They require a lot of tinkering during the writing process, because getting the sequence of the elements doesn’t come easily (at least for me) and you are always battling against a particular word count.

Earlier this week I took another look at Scrivener with a view to using it on a few solo projects. One particular attraction is the way that you take a single version of the core text and then “compile” it for different destinations. One of the destinations could be an e-Pub book. This is very interesting to me, as I’ve not found a way of working with text that lets me do this cleanly. I end up using Calbre (another wonderful program) on an a copy of my text that I’ve exported from Word. This is not optimal I have to do a lot of fiddling to make it all fit together and it makes version control really hard. So today I fired up Scrivener and spent most of the day playing with it. This is what I’ve learned so far:

  • A document is made up of a bunch of text items.

  • A text item can be a folder and they can be nested. In this case the text in the text item is included in the output before the nested items. You can use this to make a structured outline of a document.

  • You can browse the entire document at a high level and will automatically move between the text items that it comprises.

  • A text item can have a synopsis text, as well as a bunch of other properties including type.

  • A document is compiled into a single output element (pdf, word, epub, html etc) by the compile process.

  • The compile process is controlled by a template that specifies the mapping of layouts onto sections types. Each text item is assigned a section type. There are also sections that you can apply to text sequences inside a text item.

  • You use different templates to format the output for different platforms. Templates can contain conditional elements, so that you can have things like a “Mac” and a “PC” version of a core text.

  • A given layout contains specified properties of a text item to be included in the output. This means you can generate a "synopsis" document by creating a template using layouts that only include only the synopsis element. You can make your own layouts. A layout can also contain prefix and postfix items to be put around the text using that layout when it is compiled, as well as having lots of font and formatting options. You can include placeholders in layouts to create automatically numbered sections.

  • Text items can be tagged and there are very comprehensive search and grouping commands.

  • A project can contain a research element that holds text, images or even web sites. The web sites are copied into the project (although this doesn't always work). You can also add research documents, for example a list of web sites.

  • It contains visualisation tools like maps and corkboards to allow you to play with your ideas for the document structure. It also lets you checkpoint your writing so that you can always get back to a “known good” state.

  • The slant of most most of the templates is towards fiction and drama, which is an interesting direction I’ve never really tried before. But you never know….

Scrivener is extremely powerful stuff. Its documentation runs to 750 pages and the learning curve is quite steep, although a lot of the functionality is built on things that you’d really want to do if you were writing a book, a play or an article. I think I’m going to find it very useful for magazine articles. It’s not horribly expensive, being a bit cheaper than a video game. But if you write any kind of text for a living (or even for fun) I think it is well worth a look. It might even change your life….

My Video Walkman doesn't work any more

At least the screen backlight works….

True story: A long time ago I had to go to the dentist to have some wisdom teeth removed (although some folks thought I should have some put in). This raised for me the prospect of pain and suffering. Not keen. To divert from this prospect I promised myself a gadget at the end. I managed to get up town, buy a video Walkman and get home before the anaesthetic in my mouth wore off. I suffered a fair bit of pain, but at least I could distract myself with a recording of Back to the Future. At the time being able to carry around TV programs and films was very cool, which is why I bought the Walkman. These days the idea of ninety minutes of poor quality video on a tiny screen followed by a flat battery is much less impressive. Such is progress.

Anyhoo, I’m doing some clearing up in the loft and came across the player, along with the box. Hoping to relive some cool from the old days I plugged it in. It doesn’t work. Apparently the screen on these devices self destructs over time. You can put a cassette in and the hardware goes through the motions, with the tape feeding as it should. You can even fast forward and rewind. But you don’t get any sound or picture.

I’ve boxed it up and I’ll probably put it up on eBay for someone who has a device with a working screen but broken transport. I’m not going to use the weaselly “untested” label used by some people. I take this to mean “I’ve tested it and it doesn’t work but I don’t want to admit this”. It’s definitely broken and that is what I’ll say. It will be a rather sad end to what was an amazing device.