Wednesday, January 23, 2019


Marcus and Agata have been having unusual conversations with each other lately.  Saying things like:  Now if only the race was only 100Km, then it would be so easy ...

Because time is now drawing preciously short towards another significant running race, one that this time we would sincerely like to finish

A Trouble Wubble

The problem was highlighted when last Sunday our local not so hilly trivial trail run took far too long.  And afterwards we were not exactly fresh.

Emergency Action

So, since that time we have made all possible efforts to

- Do a Marathon Distance Trail Run
- Do a Marathon distance run at night in < 5 degrees C
- Start the Untapering.   Today Marcus is at Untaper 5.


There has been more than one occasion when spectators have shouted out encouragement on even a marathon distance run

"You are doing so Well"
-> The implication is, that you don't look like a runner

"Have you done this before?"
-> When you finish a Marathon and people seem surprised.

Neither Marcus or Agata have a natural running physique.  So we have to fall back on something else: grit and sheer determination.

The complication for our forthcoming race is that it has tough timed checkpoints.  And so, going too slowly is not an option.  Hence our efforts this week and next to pick up our longer distance, day in day out, running pace.

To Be Continued

Tuesday, January 22, 2019

The Sonoff Smart LightSwitch Project

Sonoff Lightswitch and Smarthome overview

Smarthomes have until recently been the province of the wealthy and installed (usually at great cost) by a series of Professional companies.

Typically they have a closed set of products that work excellently with each other, and provide high levels of control, reliability, but also ... installation cost.

Now in 2019, for the technically savvy there is a DIY, low cost and high function alternative.  And no doubt in years to come this will be standard fit in all new builds.

The LightSwitch Project
Marcus and Agata have been working on our Smartswitch replacement project for over 12 months now.  So our solution is the result of substantial research, analysis, and more recently implementation and tweaking

In this post we present the Sonoff Smartswitch


- Your own home!   You are going to be making alterations to your building, so this would not be permitted on a rental without the owners permission

- Some Common Sense and Kit
You need to be respectful of the 240V Mains voltage, that can easily kill you if you touch it.

I'd recommend a Voltmeter to check actual voltages on wires before you touch them, so you need one and need to know how to use it

- A Friend
A friend is useful to stop you getting electrocuted,  plus discussing and rationalising the wiring nightmares you are likely to uncover when you take off your switch faceplates.  Choose a friend with good logic skills.

The Neutral

All Smartswitches we have researched need a Neutral.  So the first thing you need to do is check

- Goto your Fusebox / BreakerBox
- Disconnect power to your lights
- Test by leaving a particular light on and then when you switch at fuse the light should go out
- Goto associated light switch
- Unscrew it
- choose a circuit were there is one switch for one light only
- Inside there should be a switching mechanism i.e wire coming in, the switch, wire going out.  Typically Brown was Red
- There should also be a Blue Neutral (was black)

If there is no Neutral wire you are basically screwed

Why?   Because your switch needs power so it needs a Neutral and Live in.

 If no Netural wire in your lightswitch box then you will be limited to installing smart lightbulbs.  And not touch your lightswitches at all.

In this case each lightbulb talks wirelessly to your Router then to a Private Manufacturer cloud.  You would use your smartphone with an App to talk upto that cloud, then back into an open connection thru you home router and back to the light to control it.

Our LightSwitch Project and Sonoff

+ We do have Neutral electrical wiring.  Pretty good since our house is Grade 2 listed  (means old for non UK readers!)

+ We chose Sonoff since they are economically priced and high function.   Each lightswitch should be under 30 GBP

+ Their product is quite attractive  (obviously subjective)

+  Available via Amazon Prime, hence fast delivery and no quibble returns

+ The killer feature is that we can remove the native programming and install a custom firmware / Operating System

+ There are different UK, EU and US versions so order the right product

+ Website Link

+ Though you can order directly from them you don't save much and it takes 2 weeks plus to arrive.

Sonoff Before
 Lets assume that you just install the Sonoff Switches as is.   They can control your existing lights via the touch switches,  or via a Smartphone app.

But wait!  So to use any Sonoff switch you must tell it your Wifi password, the same in the App.   In other words the Itead Sonoff cloud knows your password, and lets suppose they are hacked.  Then your home Wifi Password is compromised!

This is just one reason why we move onto our actual architecture

Oh, and also note, our home has a dedicated Internet of Things (IoT) untrusted LAN which is distinct from the home Secure and other LANS, and each one must pass thru a dedicated firewall to get out to the Internet, or a different firewall to talk between LANS.

Smartswitch Architecture

This is our actually implemented architecture.  With all the reasons why ...

+ We made some early investigation and investment into Samsung SmartThings.  So we wanted to keep that

+ All Lightswitches that we bought, for us the  T1 UK model, will be reflashed with Tasmota 

+ The UK lightswitch has both Wifi BGN radios and also RF 433 Mhz  (like your garage door).   Thus far we only use the WiFi but later could use the RF too

+ Many People use Home Assistant as the higher level product that all lightswitches talk to.  However we already had setup Domoticz to talk to our Automated Blinds, and integrated everything with SmartThings.   So we prefer to keep it so and not use Home Assistant

+ Each lightswitch will use MQTT messaging.  This is based on IBM MQ series that Marcus battled with remembers fondly from his AIX days.  I knew it would come in handly one day!

+ The Domoticz server also runs a MQTT server.  The lightswitch send a message to tMQTT server and that is passed to Domoticz

+ Domoticz talks to Samsung SmartThings

+ SmartThings has an Alexa skill.   So Amazon Alexa voice commands are passed to SmartThings, and then to Domoticz and via MQTT back to the lightswitch.

+ So at all times the physical switch is in sync with Domoticz, SmartThings and Amazon Cloud.

N-Way Switching
2 way switching is where you have 2 switches for one light and switching either of them will change the light state.  Example switch A and B.  Goto switch A and turn on light.  Walk to Switch B turn off same light.

Good news is that is possible using our setup!

- One SonoffT1 switch connected its live out to the light switch

- The second, or more   (our solution can have n ways) just has input Live and Neutral connected.  It can't physically switch anything

- When we define a Virtual Switch in Domoticz it gives us a Switch ID number

- Enter the same number in all Sonoff Switches in the Domoticz configuration ID

- Now when any switch is pressed,  the Server is informed and all switched with that ID also change state.  So your light will switch from anywhere.

It works!

Frikkin Amazing

I am still both proud and a little freaked out that every lightswitch in our home now has a Webserver in it.  Changing times eh!  All the following screenshots are from surfing into the lightswitch  (it is user and password protected of course!)

For Super techies be aware that there is also a command line.  For example there you could disable the blue light on the button so that in a bedroom environment it is a little more discrete.

Reminder: Tier 0 Activity
I still regard Smarthome installations as optional.   You can't possibly cost justify them, and they usually automate things that you can easily do yourself.  Example, turning on a light switch.

So don't prioritise this installation over the fundamentals of eating well and tastefully furnishing your home.  

With That Said
In our next related post we will show the flashing of a single and then a double gang switch with Tasmota

Our Lightswitch project is now fully implemented.  All that nightmare rewiring is complete, all our lights are now Alexa voice controllable, or touch controllable, or via Web Interface.  All activity is now centrally monitored and logged.
Lights can now feed into other systems like Power saving,  Security Systems.  Time to relax, just a little.



ITEAD Smarthome Devices
Itead Sonoff T1 UK
Control 4 UK

Monday, January 21, 2019

Going Publically Off The Rails

Queen: Going Slightly Mad

Subtitle: The Intentional Public Liar?

My heart first goes out to all and any Tesla owners. That once deemed visionary Icon Elon Musk has recently come out with the following pronouncement:

In this twitter exchange the well know technical Blogger Marques Brownlee, who has met Musk personally and published videos of said event, asks and is replied to.

Talking Shit in Public
Actually the above is a precis.  

I will say this: One should distinguish between a proclivity to lie in public as distinct from from making the occasional mistake, that of course when recognised should be retracted.

Besides thinking about the validity of the Twitter proclamations of Mr Musk there is an obvious and much greater danger to Truth.   No prizes for guessing who in North America I allude to.

Does it Matter?
Fundamentally yes.   If I personally come across any individual that I interact with who consistently lies, for whatever reason:

Be it marketing, bullying, self aggrandisement, or just being a total and utter wanker,   why should I try and understand  and then tolerate their behaviour?

I very soon disregard all their utterings.   I try not to meet or interact with them.  I try not to support them or anything business enterprise they are associated with.

The Mad Get Out Clause
Mental illness is of course not a joking matter, but more than anything it cannot and must not be used a justifiable excuse for lying.

My Take & Summary
To my reasoning Elon Musk has totally disgraced himself.  If I possibly can I will boycott all of his products and tell others to do so.  [Until behaviour changes and remorse shown and ammends made].  As a public figure I am not happy that he has not only

Used his position of Power to victimise Others

Unbecoming behaviour

And so far, not done any apologising, with a comma, will do better in the future, postscript.


Sunday, January 20, 2019

The UK National Running Show 2019

Subtitle: Several orders of Magnitude better than 2018

I practically groaned when Agata told me that I should apply for some free advance tickets to the NEC National Running show 2019.

The 2018 show was documented here

Today Sunday Jan 20 2019
If you are a runner and in the Midlands who reads this on Jan 20th then I suggest that you go to the show.  It will be 10 GBP entry and you have to park somewhere.  But there is a lot to see. 09.00 to 17.00

In No Particular Order

Some commentary from the show

As a non beer drinker, I was sociably charmed into a glass of this Erdinger.  It was not awful!

 Macebar?  What an awful title

 We noticed from here  that you can sign up to some competition and based on the number of miles you ran get some free prize from runaroundeurope.  Like bargain hunters we went thru a shit load of admin to sign up, send in strava run proofs etc.   And turned up at show ... to receive a rubber bracelet with their logo on it.  Come on!

 Let's just say my hearbeat was not exactly racing as I walked around.  As time progressed walking speed deceased as the floor became really packed with people

 I do like a nice Ballpark pouch :-)

 Runners world had a great offer of a 6 month subscription with a free camelbak or wired headphones.  The Camelbak was single chest strap and 2.5L bladder.  That's bloody huge.  And who uses wired headphones?

It's funny how when the offered freebies are not to your taste it actually counts against the offer!   So we chose not to subscribe.

I'm sure these Japanese socks are of the highest quality, but I don't spend 20 GBP on any pair of running socks  (Sealskinz waterproofs excluded).  I mean 20 GBP, you are kidding me!

We are so economical.  None of that overpriced cafeteria for us.   Got out our sandwiches and bottles out thank you.

 Holidays in wine country.  Nice.

I was disappointed to find out this was the Ealing Half Marathon and not the Eating Half Marathon as I first read it

 The stage and talk area was absolutely packed out.

Because of course AI  (Artificial Intelligence) is everywhere these days.  In my day it was called an algorithm.

Well honestly, if you believe in this, I might have some Magic Beans that you could be interested in.  See me later.

We already buy and use several specialist detergents and sprays.  Shows like this are a good chance to try something new.  We bought.

 Very decent Ronhill, 2XU, Hoka stands

 It was a real pleasure to see so many sporty people all looking interested in running.

The Saucony Kinvara is at the 10th anniversary stand and the Saucony stand had a little celebration.  No show discount so Agata, a multiple time Kinvara user will buy hers online more cheaply.

 I had a second beer, and I really hate beer,  but this free beer in a good atmosphere was drinkable.

Agata had a medal for going (way) past here 1000Km logged running in 2018.   The posted medal was damaged, so we exchanged it for a pristine one at the show.  Nice.

Summary Points

+ It's an order of magnitude better this second year of running.

+ Lots of exhibitors of kit for entry level to mid level runners

- No real train running kit or race exhibitors.  No Garmin

- Far too many bloody people

- This year the show should have been in a bigger hall!

++ If you read this on Sunday, live in the Birmingham area and are a runner, you should go.

Running show guide 2019

Saturday, January 19, 2019

When it DOES NOT Work ... Eventually

To Steal a Million

Subtitle: cf  When it works eventually

Marcus has just spent what seems like days, but was actually hours failing to mute SNMP   (Simple Network Monitoring Protocol) alerts.

Now, to help with the explanation of this technical topic I must first ask you to first watch the above Audrey Hepburn film

To Steal a Million

For me the crux and brilliance part of this film is where Peter O'Toole uses Human Nature when faced with what seems like a continued failure of an Alarm System.

This is the sort of thing that has happened with my SNMP configuration ...

What is Systems Management
It's good practice if you have multiple Computer Systems to invest in a Systems Management Server.   I'd say this system has at least 2 fundamental tasks

a) Act as a central information point where I can look at the parameters and health of my systems.  Example: for each system, is there enough disk space left?

b) Collect, and helpfully display all the error and informational messages from your computers

How does it all work?

We modelled our home setup, which now has tens of computers due to the fact that even our lightswitches are computers, with environments I'm familiar with Marcus' background of Enterprise Computing.

- We have a single Systems Management Computer which is actually a Mikrotik networking device running software called The Dude

- One of the Dude's functions is to scan the network and discover all computers

- Next it continually asks these computers common things like: how much disk space have you,  is your networking Okay?, What is your CPU loading?

- The Dude does this via SNMP polling.  This means it continually makes a request to every machine, and, to each machine this generates, in the default setting, more than 10 queries per minute.

- Each machine then needs to have a SNMP daemon setup.  And this is where the trouble begins.  The default SNMP configuration logs all requests into its local system log (syslog)

- And we setup all log messages to be forwarded to the central Dude computer for analysis

- The result is that our Central Systems Management server is flooded with hundreds, no in fact thousands of totally shit messages, from these client SNMP daemons

Must be easy to fix right?

Lots of people have had this problem, but not a single concise way to troubleshoot and fix the problem have I found, bloody anywhere

Some Things to Know
# Commands shown for Debian / Raspberry Pi and differ for other UNIX

#Install snmp and snmpd
apt-get -y install snmp snmpd libsnmp-dev

# Stop daemon
service snmpd stop

#Start daemon
service snmpd start

#Reload Daemon
systemctl daemon-reload

#Check was is parameters are actually running
ps -ef | grep snmp

Why is there a  Problem?

The locations of the config file for SNMP are in different places on different UNIX and Linux distributions.  Typical!


Many people think some of the implementations are in fact bug ridden and not working correctly

Giving Up
Rather like the police in the film  "To Steal A Million" I have given up.   I'm turning off all the messages, Warnings, Errors and Informational from SNMP.  What a load of bloody rubbish!

For Raspbian the control file is /lib/systemd/system/snmpd.service
ExecStart=/usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteT

ExecStart=/usr/sbin/snmpd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteT

In Summary So unlike my post of January 4th when I celebrated the eventual milestone success of a project,  here is an admission of a small failure.   It happens.

Friday, January 18, 2019

Amazon Echo Dot: Really Out of Stock

Starting from first principles, Amazon Alexa is a voice activated smart assistant that can answer simple queries.  It can also interact with the real world using software called Skills that Amazon encourages Smart Home gadget manufacturers like Sonoff et al to write.

Amazon also provides a world leading online shopping service, and for UK Prime members tries to ship items to you within 24 hours.

But as you will see above,  when I ordered my Amazon Echo Dot on Monday November 26th 2018 I was in for a surprise.

In stock January 25 2019

The Amazon Echo Dot was the runaway sales success of  the Black Friday shopping season for Amazon.  And that continued so that by Mid December Echo units were unavailable from Amazon online, from anybody else online or from any Physical seller.

It's a wonderful triumph for Amazon.

Amazon Alexa vs Google Home
In the Smart Assistant space there are now 5 assistants I could name

To get rid of the useless Virtual Assistants:  Bixby, who uses that?   The best thing about Siri is that it is not Bixby.   Cortana was a good start that has gone nowhere.

Today Amazon Alexa is the people's choice of Virtual Assistant.  It's runaway popularity over Christmas was countered by shelves of unsold Google Home devices.

Marcus and Agata have been using both Alexa and Google Home for over 2 years now.   Today we only use Google Home for traffic information and directions.  It's brilliant at that. For every thing else we use Alexa ....

+ Weather Forecasts

+ Control of our TV

+ Control of our Blinds and Windows

+ Control of our Lights, selected powered devices

+ Control of our Heating

+ General Knowledge

+ Listen to the BBC in particular Radio 4

+ Listen to Music via Spotify

Without exaggeration we use Alexa over 100 times per day, and that usage is fast accelerating as more home devices are painstakingly  integrated.   I say painstakingly because you can integrate devices to Alexa, but getting devices to interact with each other, example when you leave the house, take heating, lighting actions, can be hard work.

I am glad to say that one more Echo has now arrived and so control of things in our Bathroom is now finally possible!  But we still have an outstanding delivery.   Still sold out :-(

Which Device

I still recommend the Amazon Dot version 3.  I think the Spot and the Show are overpriced.   If you have an Amazon Tablet you can repurpose it well

At CES 2019 a lot of devices had Alexa integrated.  Some usefully so.  Here is a list

In the future, Virtual Assistants will be a given for every Household.   One will simply not be able to think of not having one.  In the same way that today somebody who has the money, and the possibility,  but actively refuses an Internet connection, they seem a little odd.

For Engineers and Technical people the time to become proficient with this technology is now.

What are you waiting for?