12
Aug 14

Arduino and code efficiency

The thing I love about programming for Arduino is that, unlike programming in most other environments nowadays, you are forced to think about memory footprint, memory allocation, and how your code relates to the hardware.

That’s great for people like me who don’t really consider themselves coders at all, because “perfect code” is less about something that’s mathematically beautiful and conceptually elegant, and more about getting the job done. In fact the code is often more efficient if you spell it out line-by-line in a bunch of nested if statements, rather than abstracting it into a pre-written processing function that may do the job in fewer lines of code but end up costing more in storage space because the function itself is general purpose.

Take for example this code. Horrendous to mathematicians I’m sure, but lovely for electronics engineer types;


void callback(char* topic, byte* payload, unsigned int length) {

Serial.println("Volume Callback");

if (length == 1) { output = payload[0] - 48; Serial.println(output); }
else if (length == 2) { output = ((payload[0] - 48) * 10 + (payload[1] - 48)); Serial.println(output); }
else if (length ==3) { output = 100; Serial.println(output); }

}

In the above you can see I have a byte array, each location in the array is an ASCII representation of a digit that forms a number. I know that number coming in from the payload will only ever be between 0 and 100, AND have considered in what situations that might not be the case and what would happen. So it will have a maximum of 3 digits. Indeed if it does have 3 digits the number must definitely be exactly 100. And so rather than using expensive string to integer manipulation functions which add 2k (yes, 2k!) to my sketch it is cheaper to write it out in if statements that calculate it in a “units – tens – hundreds” way working on the basis that the characters 0 to 9 are represented in the ASCII table consecutively.

So oftentimes it’s more computationally efficient to write more lines of code than fewer, which is great for idiots like me who tend towards wanting to put everything in terms of flow charts and IF statements!

There are so many examples of the above I’ve discovered so far, e.g. using a switch statement, whilst looking a little clearer on the page, is worse than using IF statements unless you have over at least 4 cases. The exact detail depends on your sketch and how variables are stored of course.

Arduino helps us by showing us how many bytes your sketch is at compile time. Great for keeping an eye on things as you progress your project.


09
Aug 14

Arduino, MQTT, OpenHAB and the Ultimate Room Control Panel

Little demo video of the project so far below!

My idea for a room control panel came about after seeing the vastly expensive options on the market, and because we are building a new home!

Lovely! But I can do *far* better, right?

Lovely! But I can do *far* better, right?

 

I love the brushed stainless steel precision-cut panels they offer – so I plan to make my own.

Not only are the options available a little* over budget, more importantly they don’t come close to addressing my ideals:

* a lot

  • Combine lighting and audio control into one panel. Soft dimming of multiple lighting channels with advanced / user-friendly audio control.
  • Field nodes small enough to be placed in wall back-boxes and controls flush-mounted in the wall.
  • Accessible but autonomous. Should not require changing batteries or worrying about someone hacking the RF wireless protocol. CAT6 and mains powered. RF options with secured MQTT an option, but we have a blank slate with cabling so prefer to go wired.
  • All control to communicate with an automation server (Windows laptop / RPi / whatever) which provides rules that integrate audio, lighting, security, and give me access from out of the home. Must be resilient to server outage; lighting must still work using physical switches.

The audio control aspect is particularly close to my heart:

  • I have always used Squeezebox. Whilst Sonos is more “user friendly” it doesn’t cut the mustard for me!
  • Hardware controls for audio in every room. Physical dials and buttons with tailor-made visual feedback and ergonomic design.
  • Audio to be controlled from anywhere and any device, therefore control panel must show updated volume and status. Volume display using LED ring around a knob (muted colours, no “chav-blue”!)
  • Backlit display showing current artist / track.
  • Discreet display which lights up when you walk past, or move within e.g. 1m of the panel (distance sensors).
  • Presence sensing for added convenience.

You’ll see I have shunned wireless communications and touchscreen control devices. Whilst they might seem sexier, to me nothing beats the reliability of cables and the hard, fast, robustness of a physical knob. Especially when we are controlling digital devices, it’s so hard to get that lovely “feel” when turning things up and down, but we must try!

(Also I have a huge surplus of CAT6 cable :)

My budget includes laser cutting some screwless faceplates, and even with this custom work, it’s looking very likely it will still be around 5-10 times cheaper than anything else I’ve seen… and SO much better.

Check out my progress so far!

In this video I’m perhaps unfairly harsh about OpenHAB and provide no detailed information about MQTT, but I’ve spent a great deal of time assessing OpenHAB vs. alternatives like Domoticz, and I’m sold. I believe it will become the glue that will hold the increasingly disparate world of automation together. It provides persistence, data access layers, and a binding for pretty much any automation device or system you care to think of.

It’s true that OpenHAB is daunting for the non-coder, but v2 is set to address these problems. Most importantly for me, OpenHAB has an advanced rule engine and a lovely array of software control interfaces.

MQTT as a transport protocol is a winner; HTTP is clearly not appropriate for sensor networks and REST is for sleeping. I may post about MQTT in more detail later but I’m really satisfied by how sophisticated and simple it is, and I find it highly intuitive. I like the mindset behind MQTT which you can read about here.

 


03
Aug 14

A world of home automation opening up

So I became pretty obsessed with home automation. You know, the type where your home detects you walked through the door, turns the lights on, and says through the speakers, “Hello Mat, did you have a nice day?”

Actually the above, whilst it sounds a bit sci-fi, is something I already tested out in my home to great success. My home automation system can now speak to me and tell me things. It’s a fine line tweaking it to only communicate useful things, such as “I see you are getting ready to go out, don’t forget your kitchen window is open”, but it’s important that the automation system doesn’t become a gimmick. For example, and this is something I tested, using a combination of cheap wireless sensors in different rooms allows me to write rules: bedroom door shut, lights off, bathroom detects movement, front door opens, BANG – he is leaving the house. Automatically check windows and if any are left open then speak a message through the home network audio system using Google’s voice servers. Then send a notification to my iPhone.

Sounds far too neat to be true, but it works a treat, and reliably too. It really is “set and forget” once you get the rules right.

Whilst I ditched the “hello Mat” bit spoken through the speakers (it got annoying after a while), you must agree the hallway lights coming on when you enter the home is a rather warm and lovely thing you might want to keep.

Using a combination of cheap and free bits of tech, it’s rather easy to do this*.

* I say easy. It’s easy for the geek or the technically-minded, but sadly out of reach for the technically-challenged at the moment. No doubt this may change in the coming years.

First of all you need to replace your lightswitches with the lovely RF controlled dimmer types available from manufacturers such as Z-Wave / Fibaro, or closer to home, an English company called LightwaveRF who make very cheap multi-way multi-gang dimmer switches that pair with controllers also manufactured by LightwaveRF. These were until recently found in B&Q, I think stock may come back shortly. After playing with those for a while you can stop using the LightwaveRF handheld radio remotes (they are radio, not infrared. That means they work anywhere in the house), lovely as they are, and for £80 buy an RFXtrx which is a little USB device you plug into your laptop or server or Raspberry Pi and it transmits and receives signals and talks to your lights.

Now hook the RFX with a computer running one of the excellent open source automation products, all free of course, and hey presto – you can now control your lights from the nearby park from your iPhone! One-touch access to moods, scenarios, dimmer sliders, you name it.

A lightswitch is an “actuator”. LightwaveRF – and many others – also sell “sensors”, such as PIRs to detect movement in a room, or door sensors, which feed into the system too.

Many home automation products – the one I have settled on is called OpenHab – allow you to integrate with a number of systems you might already own. Network home audio? You bet! OpenHab has a binding for Sonos and Squeezebox. They integrate with Google Voice. No extra cost and only a bit of extra playing to get it working. The world of opportunities now opens up – you can now control your music AND your lights from your light switches…

Actually it turns out that of course the LightwaveRF switches only receive signals, they don’t send them out. They ship with remote controls that can be re-purposed for controlling your volume and play / stop etc., but the lightswitches themselves will clearly need upgrading to the more expensive Z-Wave RF types which have 2-way communications in order to do such a thing. Well I don’t plan to do that because I’m a cheapskate, and more importantly I love the challenge of building my own room audio controller. This gives me a chance to integrate a pretty flush-mount digital display into my walls showing the current playlist.

Next post: the new home.


03
Aug 14

Arduino – the beginnings of a journey

Warning: geek post to follow.

Anyone who has been unlucky enough to know me over the last 3 weeks will realise my obsession with all things Arduino has got out of hand. From the initial buzz of realising “I can do ANYTHING with one of these things” to the late-night shopping sprees with Amazon sellers who distribute from warehouses in Hong Kong (I placed my 18th Ardunio order in 3 weeks yesterday night at 4am … gladly most of these purchases come in around a quid per unit so it’s not even that expensive a hobby so far), it has been a fun journey so far.

My first stop was to give myself a brief refresher in electronics and coding in C, so I followed some excellent examples from the Arduino “getting started” book. Right, after 13 minutes of making a little circuit that pulses an LED at the speed set by a knob and a few other beginner projects, I thought I should dive right in and do something serious.

I mean *REALLY* serious. A piezo tune generator. #sarcasm

The key array basically sets out the diatonic notes of a scale for 8 notes. The ones following those 8 notes are a random selection of semitones that I snuck in just so that I could program “You are my sunshine”. Musos will understand why.

Next instalment: how to control your hi-fi volume using an Arduino, RF signals, and a rotary encoder!

Here’s the sketch:

// Whack a piezo between 8 and GND
// Comment or uncomment the tune array definitions

int key[] = {261,294,330,349,392,440,494,523,587,622,659,698,784,880,987,1046};

// "You're Just Too Good To Be True"
// int tune[] = {5,5,5,6,5,3,5,0,5,5,5,6,5,3,5,0,5,5,5,6,5,3,5,0,5,5,4,5,4,5,4,0,4,4,3,5,4,3,4,0,4,4,4,4,3,2,3,0,3,3,3,3,2,1,2,0,2,2,2,2,1,1,1,0};

// "You are my sunshine"
int tune[] = {5,8,9,11,0,11,0,0,11,10,11,8,0,8,0,0,8,9,11,12,0,14,0,0,14,13,12,11,0,0,0,0,8,9,11,12,0,14,0,0,14,13,12,11,0,8,0,0,5,8,9,11,0,0,12,9,9,0,11,8,0,0,0,0};

int tunelength = sizeof(tune) / sizeof(int);
void setup() {
}

void loop() {
int currentnoteindex = 0;
while (currentnoteindex < (tunelength)) {
if (tune[currentnoteindex] == 0) {
delay(180);
currentnoteindex++;
}
else {
tone(8,key[tune[currentnoteindex++]-1],90);
delay(180);
}
}
currentnoteindex = 0;
}


30
May 14

I have discovered a new use for chocolate

As an “extreme owl” I often stay awake working in the night time.

Mornings are therefore not enjoyable for me. Even when I have a lie-in I can feel grumpy until the coffee flows.

I’m not sure if this is because my senses are heightened or if they are asleep. Either way, I reckon I am more sensitive than most to changes in light, sound, smell, and definitely taste.

Aside from the obvious side effects of morning hatred such as inability to open eyes and short-lived rage at the world (which incidentally can be extended into a general ratty mood for the rest of the day if some negative external thing happens during this window of opportunity) – aside from this I have another strange symptom.

I can’t put anything in my mouth. No water, no food, not even coffee. I have to be awake for at least 45 minutes before attempting to do this. Is this normal?

Today I discovered an exception: 3g of Dark Chocolate.

Not the sweet caramel substances you find in the newsagent. I mean the kind that you put in your mouth which, if stored in a larder, tastes like a cold, hard lump of nothing for the first few seconds.

This is perfect. The initial shock to the tastebuds (texture, sour, salty, watery) I experience with most other foods makes we want to run for cover.

But chocolate is neutral at first. It is already the right temperature for the mouth before it goes in. Then as it warms the flavour gently develops into something that is neither too sweet nor too bitter. It turns into a warm goo, much like being handed a soft blanket.

It gently wakes up the tastebuds.

Then as it disintegrates it slowly releases more and more interesting natural flavours. In doing so it activates the bitter and the sweet receptors just the right amount if it’s the correct balance of cocoa, cocoa butter, and sugars. It activates the sour receptors shortly after this, and gives them something to think about if the chocolate has a red fruit (cherry, raspberry, or strawberry) note.

The chocolates I like are more naturally fruit-like than nut-like, but even my favourite chocolates have a small amount of nut-like flavour, which also stimulates the salt glands – and we know what that does for saliva.

And all it takes is half a square of good chocolate.

Chocolate, I love you.


22
Feb 14

I refuse to buy backup software

So, I’m writing a powershell script that:

  • Uses volume shadow service to take a backup of a directory
  • Compresses the above backup using 7zip / whatever
  • Time/Datestamps the compressed backup and copies it off-server to a given location
  • Looks at the above location and deletes backup zips older than a given number of days (i.e. retention period), e.g. keep 30 days of backups
  • But wait, it won’t delete anything unless it knows that a given number of backups exist from the last x days (retention period). After all, if your backups had been failing for 30 days, it would be pretty dumb to delete everything over 30 days old. So the script allows you to set what you deem as a good total number of backups to exist within your retention period in order to delete everything outside of the retention period. Some contingency built in.
  • It connects to your authenticated SMTP server (e.g. Google Mail) to send you an HTML formatted report of exactly what it found in that backup location (filenames alongside their age), whether it detected that recent backups were indeed found, and therefore whether backups older than the retention period were tidied.
  • Obvs, it supports reading / writing to network shares.
  • It supports multiple backup sets per report, using a set of commands like this:

Backup-Tidy 8 6 28 “c:\dir-to-backup” “d:\dir-to-store-zips”
Backup-Tidy 4 2 7 “c:\another-dir-to-backup” “d:\another-dir-to-store-zips”
EmailReport(“hazymat@gmail.com”)

The arguments for Backup-Tidy:

Backup-Tidy 8 6 28 “c:\dir-to-backup” “d:\dir-to-store-zips” “ForReal”

read as follows: “If you find 8 files from the last 6 days, then remove all files over 28 days old”

  • The “ForReal” is a safety belt. Without this argument, the detailed report email is generated but the backups and deletions don’t get done.

And the pretty HTML report looks like this:

Mat’s Backup Tidy Report – 22/02/2014 04:00:36

\\internal.hazymat.co.uk\root\Backup\Mat’s Files [retention period = 28 days]


Recent backups were NOT found. We needed at least 8 zip files 6 days old or less; there are only 3.
We didn’t touch any files; it wasn’t safe to delete anything.

Name Size Age
backup-log-2014.02.19-193402.txt 8k 2d
images-2014.02.19-193402.zip 930m 2d
images-2014.02.18-193409.zip 870m 3d
images-2014.02.17-193355.zip 840m 4d
Total size: 2.6g

 

\\internal.hazymat.co.uk\root\Backup\Big Files [retention period = 7 days]


Recent backups found. We needed at least 5 zip files 7 days old or less; there are 7.
Old files were removed: jolly good.

Name Size Age
backup-log-2014.02.19-193402.txt 8k 0d
images-2014.02.21-193402.zip 930m 0d
images-2014.02.20-193409.zip 870m 1d
images-2014.02.19-193355.zip 840m 2d
images-2014.02.18-193402.zip 930m 3d
images-2014.02.17-193409.zip 870m 4d
images-2014.02.16-193355.zip 840m 5d
images-2014.02.15-193355.zip 840m 6d
Total size: 6.12g

21
Feb 14

One year today

I wanted to write an eloquent status update reflecting my thoughts, beliefs, and status one year on.

But I am so besieged with grief, and so incapacitated by regret that I cannot.

Last night I walked his last journey from Lilac Ward Tolworth Hospital to the tree. It broke me that I could walk back, get in my car and drive home again to a warm home with loved ones.

* Please see my previous post “one week today”


09
Jan 14

An open letter to my Facebook friends

Facebook, it seems, has become a front-end for cheap, baiting, advert-laden websites like Buzzfeed and apparently my Facebook friends are falling for it by the droves by posting links to “Top ten tatoo fails”, “8 reasons you are single”, “10 things you can do to be nice to a single person”, etc.

I thought Facebook and its evil advertising ways was the devil – not my friends themselves!

Get out there and create your own engaging content, write your own blogs, talk about your own life experience, create your own world – an authentic one, one that does’t pander to the brain-numbed masses, one that requires some kind of attention span to read – instead of posting links to pointless articles that only draw your friends into the frivolous world you inhabit online!

It doesn’t matter if you aren’t a great writer, photographer, baker, political mind, whatever. Your friends will read it and like it because it’s you, because they are your friends, and because you expressed a piece of yourself.

I have no problem with posting links to newspapers, news stories, or even the odd mild distraction to your friends.

But spare us the copious amounts of crap that line the pockets of sites like Buzzfeed who only exist to bait link clickers, and to profit from the lemming-like nature of unthinking humans.

Such websites have utterly no intention of making a positive contribution to humanity, to an online community, no intention to inform or educate. They are not built around a particular subject or theme. They are the internet’s cess pit and you are pulling your own friends into it when you post such links. Stop it!


27
Jul 13

How To Touch Type (for beginners)

Today I came across my old website which is hosted on the University of Manchester Compsoc server. I had an account on this server since I studied Computer Science at Manchester which was in 1999 (before I gave it all up to read music instead). I can’t even log on to my account, but I’m glad to see my account and therefore my webspace / website is still online. For posterity, I am salvaging some of the stuff I wrote back then when the word “blog” didn’t even exist, and blogging it here…

Introduction
It seems to have become the norm that in order to learn to type fast you should pay for a software package or take evening classes.

Well, I strongly disagree with this need for ongoing typing lessons. Perhaps they are necessary for some people – but if you are able to practise on your own and motivate yourself, then the only thing stopping you from typing at 80 words per minute is a lack of knowledge of the basic principles.

Health and safety
Goodness knows why the user manual for the Microsoft Mouse has in it the following advice:

“Eat a balanced diet and get adequate rest.”

Sounds like my mother. Oh well – even though it seems a little random, I’m sure Microsoft pay their medical consultants lots of money to come out with such gems. More importantly when considering the health and safety aspect of computing, however, you must ensure that your sitting position at your computer is natural.

  • Straight back
  • Don’t rest your wrists on hard surfaces (in fact not at all unless you have a wrist-rest: “rest not your wrists without right and ready wrist-rests”). Best of all, get a chair with adjustable rubber armrests
  • Both feet flat on floor
  • Forearms almost horizontal
  • Eyes at same horizontal level as the top of the viewable area of your monitor. (Tilt monitor up slightly.)

Know the default typing position
The basic tenet of good typing practise is found in the following directions:

  • Place your index fingers over the F and J keys. Thumbs over spacebar. There should be little bumps on F and J: these are useful if you are blind, but they also exist should you want to find the default position without looking (hint: you should want to do this).
  • Place all other fingers over the keys that are directly next-door to F and J. Your fingers should now be on all of the following keys:

A S D F J K L ; SPACE

Establish a personal regime
The following step is possibly the hardest because it involves re-learning to type, and also it involves making some critical decisions about your preference and the way your hands work.

  • Consider each key on the alpha side of the keyboard (i.e. excluding the numeric pad on the right hand side). When your fingers are in the default position, which finger is closest to each key? This step will take some time to figure out, but must be done in full. This step is vital to the process.
  • A S D F J K L ; …. all these keys have one and only one finger option. H and G will be pressed using only the respective index fingers. Shift buttons will be pressed by each little finger. T and V are pressed by left-hand index finger. U and N and possibly Y (preference) are pressed by the right-hand index finger.
  • Try to use both left and right shift keys equally, instead of just using the left one. This kind of variation is necessary to equally disperse the number of key presses per hand per volume of text.
  • Once you have established a regime for your typing presses, practise typing a sentence v-e-r-y (painfully) slowly. Be absolutely sure that each key you press is the one you initially thought should be pressing it. Be strict in this respect. Again tedious – but vital to the process.
  • Start slowly, and speed-up your typing by practise and repetition.

If you are a key-prodder (1+ words per minute!), the above should be relatively straightforward if tedious.

If you are fairly new to typing, but can already do it fairly well – be reminded that this is probably easier for you than for those who can type 35+ words per minute!

If you type over 35 words per minute, or you use computers a lot – but do not ‘officially’ touch type – this process will be exceedingly annoying. Indeed, you may be able to say the following: “I don’t officially touch-type, but I can do 60 words per minute”. That is a good result: now re-learn and attempt 90+ words per minute. You will probably be quite taken by the whole thing. You will probably see how much faster you could type if you try the above. You will probably want to give up after 5 minutes. If you want to type faster, you need to start-off properly, so don’t give up.

If you are already an OK typist, then you may simply not be able to re-learn properly (supposing you have work to do and can’t afford to type at 5 words per minute to start off with). In this case, you should try to set aside ‘typing time’ – preferably every time you use a computer, preferably for at least 5 minutes depending on your time constraints. When you get acceptably good at proper-typing (i.e. typing under your strict regime), then try to mix this in with your ‘old-style’ that you have been using till now for the sake of practicality. Personally, I see nothing wrong with this crossover approach. Learn properly alongside carrying on the way you were working before – and then gradually mix the dodgy old technique with the new with a long-term view to fully substituting new for old. It’s worth it. Because I’m worth it.

  • Whatever level you are at: start slowly, and speed-up your typing by practice and repetition. Do not let your speed overtake your accuracy at any point, unless you are ‘mixing’ techniques as described above.
  • I believe that the more time you can give to abandoning your current typing technique and adopting a systematic technique, the more time you will save in the long run. Be motivated.

Use shortcuts
This isn’t part of touch-typing, but if you class yourself as an efficient computer user you should at least be using the following Windows shortcuts (it should be second nature):

  • Ctrl-S (hold down control key and press S) to save your work
  • Ctrl-C to copy a bit of selected text (or Ctrl-X to cut)
  • Ctrl-V to paste
  • Alt-tab to cycle through the different programs you have open
  • Alt-F4 to close the program
  • Alt-S to send email (or save and exit items)
  • Ctrl-B; Ctrl-I to bold or italicise text.

01
Mar 13

One week today

The last seven days have been a blur. I have eaten and slept, but only because of the efforts of my nearest and dearest.

One week ago today, a kind man – a man I may never meet – was walking with his dog through an open green space in South London.

At first this man must have wondered why his dog, which had disappeared into the middle of a copse a few hundred yards ahead, was barking incessantly.

After a few minutes of calling and whistling, the man must have realised he could not bring his dog to heel and so went to see what the fuss was about.

Nothing could have prepared the man mentally or emotionally for what he was about to see.

For there, through a small opening into the copse in which the dog was barking, he saw a human body, hanging from a tree.

I never had the chance to tell my dear brother Steve how much I loved him.

I did not visit him daily in hospital.

I did not lock myself in a padded cell with him until his terrors were over.

I did not rugby tackle him to the ground.

I did not think up a master plan for his survival even more intricate and watertight than the far-fetched conspiracies he had built-up in his poor tortured mind over the years.

Why not? I was capable of doing these things. Because he didn’t let me close enough to see the signs? Was I simply not good enough to figure them out myself?

I have seen signs before in others. Like the dog with its killer sense of smell, you could not put me off that scent. I have called parents in the middle of the night to tell them to come to the hospital soon because their daughter may not make it – and please take a taxi.

I knew he was very ill; at Christmas time I tried to rally the troops around him to show a unified front of love and support. I failed.

I did not know he was that ill; since last week I have learned his family, my family, knew of his intentions. Since then I have heard his friends were party to the intimate details of his plans. Since then I have read diaries, letters, emails, text messages. Since then I have hacked his computer to find his final goodbye note.

Since then I have felt his darkness, hugged his children, reasoned with their mummy, cried uncontrollably.

Since then I have tried to reconcile this new Steve I did not know with the old Steve I grew up with.

My tears have turned to frustration at my parents’ inability to discern his truths from his lies. I have listened to every part in the play justify, defend, blame themselves, blame others, disagree, blame doctors, sob.

Since then I have identified the five stages of bereavement, related them to my own loss, tried to break free from them, in order to support my family, and failed. Like a rat stuck on a treadmill.

I considered myself enlightened and strong. I am neither enlightened nor strong.

Since then I have learned of his mantra over the last few months: better an end with terror than terror without end.

I have of course taken my mind to that dark place. Researched his hanging technique. Found out just how much planning was necessary. Walked through the procedure in my mind. Read medical accounts, reviewed statistics, and cried at the sheer terror of the fact that hanging was, for Steve, less painful than the mental torture he was suffering.

I understand mental illness this much: it is an entire mystery. I have not felt such terrifying depths of depression myself, but I have spent sleepless nights before Steve’s death trying to feel it. Trying to understand what it must mean to be unable to pull myself together.

I have heard hints in the past from Steve’s friends about how dark his thoughts had become. Nothing shocked me. I am not shocked by things which 99% of the rest of humanity would be shocked by. Why didn’t he talk to me? I am unshockable.

I imagine that Steve lost his battle with mental illness approximately twelve hours before the point he was found. Unbeknownst to me, this had a been a long battle lasting more than several years. How had I not known this?

Dear readers and friends, if you take just one thing from this, please contact a loved one, or even a distant friend, whom you know – or even suspect – struggles with depression or mental illness.

Go gently, but go. Ask questions until you are weary. Ask the difficult questions. Ask how bad it has been for them at its worst. Ask how they thought they might end it all. Go into the detail even if it does not seem appropriate. Just ask questions.

You may think they have people closer to them who are better placed to support them.

Forget that. Forget other people. Ask the questions yourself. Meet them in their darkest place, if you have the strength to do this. Of course, this can cause more harm than good if you are not prepared. But at least consider it. Consider opening up a dialogue.

Or if you have yourself battled, I would like to hear from you. Have the courage to share your mental state with someone you know can be trusted.

We live in a culture which has, in the most part, banished shame from mental illness, and so there are no excuses.

To my personal friends: I’m not taking calls right now. I need you to be there for me when I do, though.

Please donate to the charity below:

http://memoryspace.mind.org.uk/MemorySpace/memspacemindorguksteve-smith