Nesting in the wires

I just upgraded my Macbook Air to OS X Yosemite.  But never mind about that; I realise that I’ve started building a bird’s nest of wires.

redwall

Recently I’ve become enamoured of a couple of things.  The first is saving money and especially that money which ‘leaks’ from my family budget through slow, grumbling month-on-month charges like electricity.  I measured my large 4U server with dual-core, dual-Opteron motherboard and it was chomping 183W every hour of every day.  As it was a £10 purchase off eBay the motherboard was a good buy but at my local electricity supplier’s rates that was costing me approximately £17 per month.  Too much!

So I started a drive to move services such as my web server and gaming software off it onto something lower powered.

I fell in love with small form factor PCs such as the Raspberry Pi and Beaglebone Black.  They are truly astonishing and I have a wonderful collection of them on my wall, festooned with power cables and wires which keep them fed.  Take for example the Raspberry Pi – it draws just 250 milliamps when under light workload.  The Beaglebone Black (of which I am highly impressed) draws just over 300.  In terms of power usage that is much better than the large server hardware underneath them.  Of course they are less capable machines and do less – however for what they do that does not matter.  If you think of computers in terms of four main measures of CPU, memory, storage and network then not all computers need everything big.  Something like my little Raspberry Pi for example, let’s call him “hugo”, only need to monitor signals from the variety of devices I’ve scattered around my house and environment to measure things such as light levels.  Hugo then passes things off to another small computer – let’s call her “jess” – who then determines if house lights should be switched off or on.

Much more satisfying than having a great clunking computer doing all this is a little farm of smaller devices which share out the work.  Each can be specialised to do their job well, an added advantage is that they can be turned off independently and worked on without affecting what the others are doing.

I love my micro-PCs!

The flipside of too much security

I just typed my password into a google search.

That was accidental; I run a multitude of different operating systems across a number of different hardware and virtual platforms.  Some of the places I’m required to enter passwords save them securely for me (for example, my corporate VPN client), others I use a password manager in the browser.  But sometimes I still have to enter them manually.

I like my bank – it uses _parts_ of my password so I never inadvertently type it anywhere.  However this entering of my password in Google happened because of a couple of things: being eternally vigilante throughout the day does not equate to having to enter a password multiple times, and screen blanking versus screen locking.  In the case in question one of my laptops went blank screen to powersave, I then started typing my unlock password (which is mandated changed every 90 days) and pressed enter, only to find that the screen had blanked but not locked.  Of course I can alter this so that when it blanks it also locks, but my point is that constantly entering passwords is counterproductive and some sort of presence (RFID? geo-fencing?) is more applicable than the simple you-have-not-touched-the-keyboard time out, and is probably better for security control.

And don’t get me on to the mis-handled SSO tokens, constant re-entry of passwords throughout the day as I use corporate internal websites!

Petri nets, state machines, decision tables and light switches

I’ve been running a set for my home lighting for some time now using a combination of smart lighting (Lifx bulbs), Node RED from the IBM labs, and a set of sensors and time schedules.  This has enabled me to do some surprising things like

  1. Turning on my son’s lights early in the morning using a ‘rising sun’ sequence – earlier on college days, later on weekends.
  2. Enforcing a lights out! at a reasonable time during college term times, while leaving the lights on Friday/Saturday nights.
  3. Drifting colours of the bulbs through a bright white the first part of the day, into a more yellow or orange glow into the evening and later part of the night.
  4. Gradually dimming the halls lights into before the lights out! command during the working week.

Other than the annoyance it provokes in my offspring it has all be rather unreliable – mainly because the API by which I call the smart bulbs is written in a language which needs special support, and not easily integrated into my standard computer setup of diverse embedded or micro-computer hardware.  I’ve also a larger, more capable server which runs Linux and could do a whole lot of this but I wish to turn it into a power-down mode when it is not being used by my son’s gaming clan, thus saving some of the considerable electricity it consumes throughout the month.

My Node RED flows look like these:

Screen Shot 2014-09-08 at 13.00.10

 

So, a little complicated!

The real issue is that I need several different events to all A long way back I did some work around artificial intelligence and rules engines, so when my wiring diagram above started to get difficult I looked further afield into rules – most of which use something called a ‘rete engine’ for forward or backwards chaining rule invocations.  Whilst that is fine and dandy it takes lots of programming and understanding either the domain-specific rule language of the particular engine, else the programming language and constructs in which the engine is written.   None of that is trivial, unlike the wiring diagram above.  The issue becomes when you try to visualise complex conditions – wiring no longer gives that and we need to look wider afield.

The net comes to the rescue of course.  I’d seen decision tables as being close to where I needed to be.  Those look somewhat like this (from Wikipedia):

The four quadrants
Conditions Condition alternatives
Actions Action entries

 

… or a good example (also from Wikipedia).  The following is a balanced decision table (created by Systems Made Simple).

Printer troubleshooter
Rules
Conditions Printer does not print Y Y Y Y N N N N
A red light is flashing Y Y N N Y Y N N
Printer is unrecognized Y N Y N Y N Y N
Actions Check the power cable X
Check the printer-computer cable X X
Ensure printer software is installed X X X X
Check/replace ink X X X X
Check for paper jam X X

There was some discussion on the Google groups which are used by NodeRED to discuss product features or issues.  Here’s the link https://groups.google.com/forum/#!forum/node-red    Amongst other topics one was  for a couple of enhancements and mentioned Petri nets.  I’m not familiar with those and needed to look up what they did, and it seems that their use is similar to what I need for my smart lights.  Here’s the discussion https://groups.google.com/forum/#!topic/node-red/K7yQFxG07u0

Underlying it all is the concept of state machines, of which I am somewhat familiar having seen these in the world of Business Process Management or BMP.  These are good for taking many inputs and either coming to s definite, simple conclusion (either deterministic or non-deterministic finite state machines) but the issue then becomes displaying them visually.  Normally the connecting line between states is used to determine the transition but NodeRED uses it to depict data and control flow.

What I’d like is a simple way of combining multiple inputs into a single decision; at this point I’m uncertain if Rete engines, state machines, Petri nets or decision tables are the simplest to depict visually.

 

Rethinking the love affair between lights and switches

Bonnie … and Clyde.  

Hanzel … and Gretel.  

Lights … and switches.

Why do we have switches?  Think about it – what is a switch without a light? Nothing.  What is a light without a switch?  Something.  A light by itself is still useful (like a clock which is broken, it tells the correct time once per day), the only downside is that you cannot turn it off, or on.  But at least it is a light and still serves its main purpose.  What happens if we break that link between switch and light?  What happens if we rethink the gift that Edison bestowed upon us?  What if the light could be the switch and somehow know when and what to do?

I purchased some Lifx bulbs recently, and have had a really good experience in setting them up and using them from the smartphone app.  I previously used LiightwaveRF sockets and switches, but somehow they didn’t seem to satisfy what I was looking for.  I think one of the reasons is that the Lightwave system makes the switch intelligent rather than the other way around, so in the marriage of switch+light both parts of the pairing have to remain, whereas the Lifx system makes the light intelligent and makes the switch redundant.  So the divorce can be complete, and lights can stand alone without the limitations of switches.

Am I making too much of this?

We all assumed that houses should have telephone numbers, and dutifully called a house and sub-addressed the occupants of that house.  Nowdays of course we call people, and discard the need for sub-addressing the responder to the call with the assumption that if we’d wanted someone else, then we would have called their phone number instead.  So it goes.

Do we assume the same thing with lights+switches?  Do we assume that one needs the other simply because, well, they always have?  What happens when the light becomes intelligent and does what we want (switches off, changes colour, turns on at certain times, dims) without the use of a switch?  I think this liberates lights to become really, really useful.  For example, I am wiring up NodeRED, the Node.js module ‘suncalc’, Lifx bulbs all in my WiFi router and Raspberry Pi so that my lights switch on the in mornings, change to bright cool light (colour team 6500K), then change to warmer lighting in the evenings (3000K) and dim before bedtime.  A lot of this is due to colour and circadian biorythyms which mean that we expect morning light to be cooler, and evening light to be warmer (essentially bluer in mornings and yellow in evenings).  It actually works really well and the house feels a lot more ‘natural’, whatever that means!

I love this setup so much that I’ve purchased 6 Lifx bulbs, and mean to purchase another 10 GU10s to fit in my main living space.  Now I’m looking for a trigger system such as a multi-button keyfob to replace all the light switches in rooms where I’ve placed Lifx so to trigger ‘events’ such as going to sleep, leaving the room and the like.  I wonder if systems of independent motion detectors as well could provide similar intelligence to really make my system act as a whole?

Blocking unknown callers on mobile phone

Want to block ambulance-chasing lawyers?  Friends you don’t like anymore?  Random strangers?

Normally blocking incoming callers on the Android platform is easy: register their number as a contact, then select ‘block this caller’ from their contact entry.  However calls where caller-id is withheld or not known don’t have the equivalent under Android unless you use an app, and those apps would normally ask to have access to all your contacts and their details – surely a privacy warning!

I was randomly set upon by some law firms who wished me to claim personal injury for a no-fault accident in my car.  The fact that I was stationary at the time and received no injury didn’t deter them, so I looked for another way of doing this.  Google is your friend, of course and somewhere on the internet this little gem appeared.  Almost all the calls have dropped to zero now, along with blocking them on my home telephone line using a powerful wifi router from AVM, and by migrating my phone line physically to a VOIP system which allows greater control (- and that was done before the calls started, for cost reasons).

The easy answer is to create a entry in your Google userid contacts, the same one which you sign in on your telephone, with a list of phone numbers in text such as ‘Unknown’, ‘(Unknown)’, or ‘Private number’.  The reason for doing it off the phone is that the phone person app, which edits your contacts, does not allow text numbers, only numeric numbers.  This may vary of course by hardware – but the offline editing works for them all.  Now when your Google id is synced to your phone it will have a new entry with those numbers, and you can then edit them and select to block the caller.  Simples!

 

What’s wrong about Livescribe

I’ve been a long-term user of digital pens, all of which have been the ‘mouse-hidden-in-the-pen’ type which use the Anoto patterned paper.  These have been a couple of Logitech pens, a Papershow, and now a Livescribe one.  The reason I haven’t tried more is most likely because they are rather expensive and I’ve lost or broken three of them, which puts a damper on things.

I first started with a Logitech IO2 pen which had to be docked.  This was a rather fat, very dark blue pen with a cap that activated the pen when removed and which had to be docked in a clunky USB-attached wedge of an accessory, which rather spoiled the cut of the Gucci suit, so to speak.  These were the days of Windows XP and laptops that ran for 2 hours, max. While the pen opened more doors than the products I purportedly sold, the effect was rather bizarre and text recognition (ie. OCR) wasn’t that great.  It was almost there, but just a little rough.

I then had some interaction with a business partner of my company (I work for IBM, the business partner was Destiny Wireless in Guildford, UK).  That was great and their sales lady at the time showed me how they could complete a form, take a picture and then upload the result to a computer for a process such as assessing insurance claims.  I subsequently purchased a bluetooth version of the same pen, the Logitech IO2 and tried to use their note-taking web site with some of their special pads.  It worked to some degree, but mere images of the notes I’d taken weren’t much use without some computer index of what I’d written.  Conversion using the MyScript product was laborious (read; I didn’t take the effort) and so it ended up just being lots of note books with computer images of their contents, non-searchable.

It was during this time that I became infatuated with a digital pen called Papershow.  It is the same dot pattern from Anoto but in a large screen format with an accompanying landscape pad.  The idea is that you write on the pad, and your strokes appear on the screen.  Again, not cheap (over £100 when I purchased) and needed some small technical setup – including a fat USB dongle which was the bluetooth connection.  This mean that instead of the built-in bluetooth of most laptops, you had to always carry the pen, paper, and bluetooth dongle.  Which was fine the first (and last) time I used it, but a mess of paper, laptop, caps, dongles and pen including a case to hold it all meant I left it behind!  So if you find a Papershow case with pen and dongle somewhere on the south bank of the Thames in London, you may know who to call.  I still have the paper and spare nibs…

The story thus far is not a good one, but persistence pays off, right?  I purchased a Livescribe pen for my recent birthday hoping that it’s fabled Mac compatibility would fit with my Macbook Air, which I love.  I’d seen people struggle with iPad mini’s to take notes, as well as traditional iPad users with folding keyboards and the like.  None impressed me and no-one seemed to use them long term, so my digital pads seem almost a good idea.  But what I’ve found is that the pen has several missing or mis-construed aspects which do not fit the ‘enterprise’ space easily.  For one, you need to switch it on each time, otherwise it doesn’t record a single stroke!  This is frustrating as the IO2 from Logitech was activated by removing the pen’s cap, so being a natural part of the pen’s use cycle.    Next, the cap on the pen is thumb-nail sized, so easily lost – and uncomfortable to store in a shirt pocket as it it quite sharp – YMMV with this one as it is just a niggle.  Finally, recording someone’s actual words is forbidden in most enterprise situations (“no recording devices”) so I have to be careful not to activate that aspect of the pen, but I’ve previously been challenged when using one of these type of devices.

But it does work on Mac!  It does work with MyScript to OCR the text!  It does create image files!  It does do a lot of things, but leaves me feeling that somehow, somewhere there is a magical confluence of capability and engineering which makes simple the whole note-taking in meetings for later retrieval, searching and indexing.  I’ve yet to find it.

Making dirt

My brother in law created dirt.

The environment where they live is composed of a type of gravel that looks like large ball bearings, orange brown in colour.  Something in the soil –  iron? –  makes ferrous oxide and you end up with clay overlay with round hard stones that can be broken if you have a big hammer.  Nothing much grows as the topsoil layer is quite poor, but gum trees have colonised the biom and rule supreme.    Humus consists of eucalyptus leaves which have the property of killing things due to their essential oils.  Whilst they give a shade of sorts and cover the hills with an attractive foliage any undergrowth in the form of bushes and mixed trees are discouraged.

One timed I visited and they showed me where they’d planned a section of garden and encouraged the growth by watering and covering with compost.  All types of compost had been used including kitchen scraps, worm manure, chicken manure and other biodegradable materials.  The local wildlife loved it as it held a rich tapestry of bacteria and mixed materials, so over the years a fine black soil had developed with lots of worms and plant growth including lush vegetables.

Now I previously lived on this same soil and had tried all ways to get things to grow, including commercial fertilizers and creation of garden beds using mechanical diggers.  Nothing much flourished and it was all heartbreaking hard work even getting flowers to grow.   They’d succeed by similarly hard work but also the knowledge that good stuff breeds good stuff, and that given enough time and patience that anything can be brought forth.

The lesson I learned was that even on the hardest soil, lots of loving care produces something.

Shopping as entertainment

The core purpose of physical shopping has turned into entertainment.

With the growth of the online store, I can now click and press to receive my goods delivered to my front door.  Gone is the need to walk in the world to gather essentials for myself and family, gone is the worry of finding the thing I want amongst a poor selection on shelves, gone is the hunting in different shops to find something suitable, gone is the lugging home large parcels of stuff.

Now women take this differently to men – and boy don’t we know it!  Whilst I cannot fully participate in the experience they receive from gazing at clothes I do appreciate that my young daughter likes to spend a lot of time in her browser doing just that – is there a generational shift happening here?  However the call is strong even for her and mother and daughter still walk the clothes boutiques getting pleasure from the “gathering fruits and berries” exercise.

Where is the pleasure?  Maslow would have us believe that if we answer the lower calls of essentials, then the higher calls of self-actualisation come into play – so shopping become entertainment rather than food-gathering, drinking coffee becomes socialisation, and online shops become what?  Our grain silos?  Certainly the shopping centres that I see growing are combinations of eating, entertainment, climate control and relaxing – not hard pavements and boring flat shop fronts trudged past by shoppers ‘looking’ for items.

We are the people, and we want entertainment.

How to level a line, or mass loss of group memory

I’m looking to install a suspended ceiling into my 90-year old house.  I could get a contractor in to do it but in a long tradition of learning other skills want to try it myself.  More recently I’ve been doing less ‘heavy’ DIY recognising that laying concrete or building brick wall may be best left for those with younger muscles, or more talent than me.  But suspended ceilings seem relatively easy and more importantly relatively quick to erect.  Plus there is a puzzle to solve.

With the advent of the internet group memory is starting to change, along with spacial memory through things such as static maps and the like.  I’m sure that there is any number of studies of the Google effect or how most kids homework seems to exist of searching the internet and printing pictures.  But what about things we learned as skills and became as specialised in our jobs as individual craftsmen?  What is happening to things such as problem solving, or doing things which no-one has yet done?

Take my ceiling-line-leveling challenge.  I have to draw a line around a room which is absolutely horizontal and attach the edge trim for the suspended ceiling.  I realise that the ‘professional’ way to solve this is to obtain a “self-leveling construction laser” which is a device that shoots out light from a rotating head based on a floating platform which seeks dead level.  Now I just have one room and the cost of these is approaching one month’s salary, or to hire even for one day it is £100 – almost as much as all my other materials.  Should I abandon my attempts to do-it-myself and just call a contractor who can amortize the cost of purchasing one of these over many jobs, or should I search the internet for cheaper ways to do it?  Having searched the Internet I actually can’t find any way other than measuring from the floor or using lasers.

Which brings me back to group memory and learned skills.  I actually do have a way which is almost zero cost, but the Egyptian pyramid builders thought of it first.  They had the task of getting the base of their structures dead flat so that the enormous weight of stone above would look good from a distance – no cheating the Pharaoh.  It is believed that they used the idea of filling small channels with water – which over a large distance self-levels – then marking the height and building from there.  I want to use the same idea.

I’m not going to fill my kitchen with water like a bathtub but use a thin transparent tube.  One end will be held at the right height up the wall, and water on the other end will self-level to the same height.  Exactly the same height.  Cost?  One thin tube and the kitchen tap.  The Internet didn’t (and maybe still doesn’t) carry this simple idea in a retrievable form because the group memory links aren’t there.  The internet and present search engines don’t have the advantage of our electrical/chemical wetwear brains where memories are reconstructed as they are recalled, nor does context or ‘usefulness’ play a very large part.  Most successful searches require the user to construct what they need in the same language as expressed by the writer, rather than the rather more messily architecture on which our memories are stored.  Does this mean we need new skills, just like Vernor Vinge’s Rainbow’s End, of people who’s role is to construct searches rather than providing answers?  Good questioners, so to speak.