Satnav Upgrade Fun

Whenever we drive to our favourite cinema in Beverley the journey used to take us over a number of ploughed fields. At least that is what the car navigation system thought, what with the road having been added comparatively recently.

So today I thought I’d fix that and spent a little while downloading 22 Gigabytes from the BMW servers, unpacking it onto a micro SD card and then upgrading the internal maps in the car.

I’m pleased to be able to report that all that data seems to have done the trick, and map wise things are a bit more up to date.

Christmas Code Crack Answer

I’m feeling a bit guilty about this (in so far as I ever feel guilty about anything). A while back I asked both of my readers the meaning of this cryptic message:

Yes, that is Z9 by the way. And Y5. I find the sequence fascinating. And I use it every year when I build our Christmas tree. It’s the installation order of the individually marked “branches” that clip onto the central core. If I get the order wrong the tree gets bigger as it gets higher, which is not a look that I like. I’ve no idea why the numbers are the way they are, or the mysterious need to go off into different letters and numbers in the middle of the sequence. But now it is on the blog at least I’ll not lose it for a while.

Sofa So Bad

The sofa in our living room has a few problems. Mostly these are caused by the fact that I always seem to sit in the same place when watching the telly. What can I say, it’s the perfect seat for pictures and sound.

However, my “tv sweet spot” is now 2 inches lower than the cushion next to it. We had some folks over at Christmas and when they were sat next to me they seemed to tower over me. I’m not used to people towering over me. It feels wrong somehow.

So today I’ve started the process of fixing the problem. The solution I’ve going for is what I’m going to call “cushion pinhole surgery”. I’m going to open up a seam in the low cushion, add a bunch more stuffing and then either sew the hole back up again (posh solution) or stick some duct tape over it (lazy solution).

So, today I’ve ordered a big bag of foam pieces. Soon I should be sitting pretty again.

Debugging with Rob

OK. Today I’m going to find out why my program is crashing. I’m going to do this in an “experimental” way. I’m going to put up a hypothesis (a theory about why something happens) and then try to test it. Before I do that though, perhaps I’d better describe the problem. I apologise if some of this explanation is a bit technical:

The program runs for a while and then stops.

The length of time the program runs varies, and I can’t tell what happens at the point of failure because it is inside a device. And I can’t take a look inside the program because those tools aren’t available to me.

So, let’s try my first hypothesis:

Hypothesis 1: “The program flashes the neopixel leds at the same time as it receives data from the air quality sensor. Perhaps the code that controls the lights is affecting the code that gets the data.

Test:

  • Increased speed of pixel update.

  • Loaded up the serial interface with data.

  • Increased rate of MQTT update to once per second

Results

Display update slowed right down (as we might expect) but no crash

On this basis I’ll conclude that this hypothesis is not valid. So let’s try another:

Hypothesis 2: Serial data reception is interfering with the WiFi transmission. When the device has got a complete reading from the air quality sensor it sends a message over WiFi to the server.

Test:

  • Turned off the Pixel updates

  • Loaded up the serial interface with data

  • Added code to confirm successful network message sent

Result:

When the serial data is being transmitted the data transfer is slower because the serial interface steals cycles from the processor. Eventually the transfer collapses and the Publish method starts to return false. Shortly after that the whole system falls over.

Further Test:

restored the pixels and loaded up the serial port

Result:

When the serial port is loaded the performance collapses before.

So, it is not a good idea to use the network connection while you are receiving data from the serial port.

This is because I’m using a software simulation of the hardware that normally receives serial data. This simulation has specific timing constraints that means that it needs to “lock out” other processes when it runs. And it seems that this is causing the problem. Under normal circumstances the node only sends a network message every six minutes or so, and the chances of interference are small. But when I’m doing “proper” testing - sending lots of messages and receiving loads of data - I notice the problem.

The solution is to re-work the code so that the two things don’t occur at the same time. Which means I get to write more code. Which I quite like.

You might like to know (if you’ve read this far) that the notes above actually came from my diary. I always write these things up each day. The idea is that if I get a similar problem in the future I’ll have something to go back to. If you don’t write a diary/log when you do this kind of thing you’re really missing out on a trick.

Peter Principle Programming

I seem to have the ability to write programs that are just that bit more complicated than I can get to work. I think this is an extension of “The Peter Principle”, which states that in an organisation any given person will be promoted to their “level of incompetence”. In other words, you stop being promoted when you get to the level where you can’t do the job.

I’m working on the code for the Air Quality sensor and I’m running up against the worst ever kind of fault. The one that occurs so rarely that you can’t easily cause it to happen. And if you add code to find out what is going on the problem vanishes. There are usually two possible reasons for this:

  • it is a timing bug, which occurs when a given set of events occur in a particular sequence

  • it is a memory corruption bug, where a process damages the contents of a value in memory which is picked up subsequently and causes the program to fail

I’ve done all the sensible things to try and isolate the problem. I’ve moved things around in memory to see if the fault changes. I’ve changed the order of code elements to see if that causes different things to happen. As of now, I can’t find out what is going on. Oh well, there’s always tomorrow.

Comedy Eye Test

I had to go for an eye test. I really wanted to do this as a comedy routine, but my nerve failed:

Doctor: ‘Have your eyes ever been checked?’
Me: ‘No. They’ve always been blue.’
Doctor: ‘I don’t find that very funny.’
Me: ‘Well, I do know lots of cornea jokes….’

Anyhoo, all was well. They are not going to have to shoot any lasers at my exploding eyeballs, which has got to be a good thing.

Big thanks to all the folks at the Eye Clinic in Hull who were professional, efficient and totally awesome.

Air Quality on the radio

The coloured fountains in Hull city centre look lovely.

Every now and then I get to do the newspaper review for the Radio Humberside breakfast show. It means getting up at stupid o’clock in the morning but it is rather fun. We talked about a bunch of things, including Air Quality, which was actually in the news today. Apparently the air in London Underground tunnels contains dangerously high levels of particulates (just the things we are measuring with the sensors that we are building at Connected Humber). According to the standards that we’ve been using, things get unhealthy when an indicator value we are measuring goes above 60 or so. The values they are seeing in the deepest stations are around 450….

The bit that took my breath away (really) was that someone actually said something like “Although the levels are high, it doesn’t matter because people don’t spend a lot of time on the tube”. Unless, of course you happen to drive a train or work in the station…..

Achievement Unlocked: Joined Hull Makerspace

Today I went for my induction at the Hull Makerspace and paid up for my first month of membership. I’m rather pleased that my recent financial shenanigans mean that I’ve actually saved the monthly membership fee before I spend it, which must be a first for me.

The induction session set out how they see the Makerspace working and I’m really keen to get in there and play with stuff.

My ambition is to have used every single machine in the Makerspace by the end of the year. This means that I’m going to have to have a go at making pottery and using the scary lathe and CNC machines as well as laser cutting.

Looking forward to it.

BME280 Power Fun

Sometimes the old solutions are the best. In this case the solution is “Turn it off and then on again”. I’m using a BME280 temperature, pressure and humidity sensor in the air quality monitor that I’m building. It works well, except sometimes, when it refuses to say hello when it starts up.

This has caused a certain amount of head-scratching. However, after a while I worked out that it only misbehaved after I had downloaded some code into the device. It’s as if it doesn’t like being woken up twice once it has been powered up.

Now if it gets stuck I just unplug the device and plug it back in. It’s something to be born in mind when you can’t get something to work.

I have a special category in my work (particularly with hardware) called “Things you do to make it work but you don’t know why”. This is another one.

Hull Makerspace open for business

I’ve been saying for ages that Hull needs a Makerspace. And now we’ve got one. And it’s bigger and better than my wildest dreams. It’s in the library in the middle of town and it is packed with equipment and expertise in equal measure. Membership costs 20 pounds a month (which it turns out I’ve already raised thanks to my last two financial deals) and gives you access to valuable machinery and tuition.

I’m looking forward to making robots, air quality sensors and daft lights among other things. You can sign up here for an induction session that will get you stared making.

New Kcom Tariffs can save you money

I’ve just changed to a new contract for my home networking. The speed goes up, the amount of data stays the same and the price drops by eleven pounds a month.

What’s not to love?

If you’re in Hull you really should take a look here and see if there is something cheaper that you can change to. Hull is already one of the best connected cities in the world, it’s nice to see it getting cheaper as well.

Stealth Selling

Old joke: “They say that money talks. The only thing it says to me is ‘Goodbye’”.

However, these days it doesn’t even do that. When Netflix (or a host of other subscription services) take their fees from my account they do so invisibly. The only way that I know that it has happened is by carefully checking my statements to find out why the balance value is dropping.

Today I found that a service I thought I’d cancelled ages ago has been racking up these “stealth charges”. Of course it’s my fault for misunderstanding what I was paying for, but if I’d had regular emails each time that the fee was paid I’d have spotted the rogue transactions much earlier.

It’s as if they don’t want to tell you when they take money in case you notice and cancel something…..

I reckon that a service provider should be forced to send you an email or a text each time they take your cash off you. These companies seem happy enough to send me emails advertising new things I can buy from them, it would be rather nice if they also told me when I had bought something.

Happy New Year from Hornsea

We’ve got a tradition of going out to the seaside on New Year’s day. We didn’t do it last year, but this year the weather was so nice that we couldn’t resist it. So we headed down to Hornsea to see the sea. We managed to make the morning perfect by finding the Hornsea Floral Hall, where they were serving bacon butties.

The thing about a bacon sandwich is that once you’ve heard someone mention one, you really want one for yourself. The chap in the queue in front of us ordered a buttie and so we of course had to follow suit. It was really really nice.

What a great way to start 2019.

New Year Resolution Time

As the year ends it is time to think about new year resolutions. One of mine is that I’m not going to make the very old joke about getting a different computer monitor.

The other is to try to be a bit more assertive in the new year, or at least to stop apologising when cashiers in shops ask me “Do you have a loyalty card?” when I try to buy something. Up until now I’ve always said “Sorry, I’m afraid not”. From now on I’m just going to say "no”. That’ll make a difference to my life, no doubt.

I’d like to wish all (or is that both) my readers the very best of times in 2019 and beyond.

May your code always compile and your solder always stick.

Invisible hearing aids and other frauds

I was very upset to discover today that a shop in Cottingham (where I live - the village not the shop) has taken away their “Invisible hearing aids - 475 pounds a pair” sign. I really wanted to get a photograph of that sign.

The way I see it, advertising things like this is fraught with fraud potential.

“I say, there’s only one hearing aid in this box”
"That’s because the other one is switched on”
.. and so on.

They’ve now have a sign that that says “Free Eye Tests”. I can see fraud potential here too:

“We’ve done your test, that will be fifty pounds please”
”Hang on, the sign says that you do eye tests for free”
”Ah yes we do, but the charge is for testing the other eye. That costs fifty pounds….”

Sometimes I consider myself a great loss to the world of commerce.