Background Beavering

You could be forgiven for thinking I’ve gone off the boil as I’ve not written much in here this week… far from it in fact. This week I’ve been working on my ImperiHome setup and the new Raspberry Pi software.

ImperiHomeImperiHome: In case you don’t know, ImperiHome is an app for Android and IOS that enables remote IOT control. It does this by trying to appeal to just about every system out there, none of which I use.  I’ve taken the approach of having IBM’s Node-Red control everything – and thankfully ImperiHome has a generic API to allow control if you don’t have ANY of the devices it supports.

I’ve written more than one item on this subject and I have to say despite a rather lacklustre approach to answering people’s questions by their team and something of a lack of generic controls (such as a momentary push-button), the product actually works and works quite well. I have RGB lights, relays, sensors and a host of gadgets attached to Node-Red. Those which are required to just come on and off at varying times of the day are controlled by my BigTimer (which, recently updated, works a treat – or rather, it does if you remember to set the time zone when setting up the Pi as I found out last night when all the lights were still on at 2am, defying all explanation until my wife said “did you ever set the clock on that thing?”).

Those gadgets which require interaction are controlled by ImperiHome on my HTC Smartphone.

On the subject of Node-Red, we are promised non-volatile global variables in future by the Node-Red team and I for one can’t wait – but for now I’ve just completed a function to save a global object (buffered in time) when any change is made. That global object forms the variables used in my ImperiHome project – so now at last, the phone is always aware of the state of my lights – a handy thing. Essentially the object contains a counter which is set whenever any other variable in the object is altered. This is monitored by a timer which also kicks in on power-up.  If the counter is true, it is decremented – if it hits zero I update the file on SD which contains that object.  I also check to see if the file exists – and if not, I create it. If the file DOES exist and the object doesn’t – I populate the object.  So now, my lighting and other settings can survive power-cycling.

Raspberry PiRaspberry Pi: On 10/05/2016 the Raspberry Pi foundation put out a new release of Jessie (Debian) and with it, items you might expect like better support for Bluetooth etc., but then something I wasn’t expecting – a decent backup program. After (what seems like) years of struggling with arcane Linux commands some of which I never really got to grips with and hence never achieved a satisfying backup solution, at last, a simple push-a-button backup program that not only allows for live backups, but also allows for the use of varying size SDs both larger and smaller.

WHY did this take so long…  I can’t tell you how this has changed things for me – backup time is reduced, no need to shut the house controller down when I’m doing backups, the use of smaller SDs, running multiple copies of the same software on different boards – the list goes on.

But for days I’ve been struggling with upgrades – the backups just did not want to accept upgrades (apt-get-upgrade) and when they did, invariably Node-Red would fall over with missing nodes etc. I didn’t know if it was the backup program or what…  (I knew it was not the SDs as I use only good ones). Well, it turns out that my script was in need of bringing up to date. I still scrap node, npn and node-red and re-install to get the very latest but I’ve done it a different way, more by trial and error, but I got there in the end and now my backups and restores are working perfectly. I’ll publish the updated script soon, replacing the older one and I’ve added some tricks I’ve picked up along the way from readers like you.

Tiny part of my controls

I started this blog entry before our BBQ yesterday and here I am up early on a Monday morning finishing off the job. The lights worked a treat last night now the clock is set correctly – thanks to NTP it will now stay that way.

Coming up this week hopefully – a couple of new boards from Friendly Arm, the new Nextion display and more. But first things first, some supply shopping,  I’ve lost a filling and Maureen’s done her foot in – this should be good – dentist and hospital – in Spain (and not in the tourist areas where they speak English).

5 thoughts on “Background Beavering

  1. Hi Pete, i was just wondering if you have any experience using DomotiGa ( https://www.domotiga.nl/projects/domotiga/wiki ), i found it googling around this morning? It looks like it can be linked to Node Red and SmartVISU which can be used as a web UI interface. I do like Imperihome, but i’m always looking for something better 🙂

    1. Good morning Charlie

      And I too while happy with Imperihome (and to some extent Blynk) – but like others always looking to make sure what I’m using is the best. Since I discovered I could get Imperihome to SPEAK I’m even happier – however…

      So I looked at Domotica – something I always find handy is SCREENSHOTS – not a good start going to that site – selecting OVERVIEW and finding…well, no overview.

      THIS…
      https://www.domotiga.nl/projects/domotiga/wiki/DomotiGa_Screenshots
      might be helpful to others – so a nice screen interface on Linux – for the SERVER

      I looked up SMARTVISU but the demo was in German – not too helpful for me… It LOOKED to be all about visualising info – not CONTROLLING – but I might have missed something.

      So if anyone has better screenshots/demos of the above – sure – never say never.

      1. Yeah the SmartVISU demo does look like it’s in German, but fortunately the documentation is in English, http://docu.smartvisu.de/2.7/index.php. There are a few examples there too. I’ll grab a spare micro sd card and give it a go. I just wanted to make sure you weren’t going to tell me you’ve tried it an it’s terrible.

        Or maybe SmartVISU can be used directly with Node-RED?

        1. Please do come back and relay your experiences… no never used it – but always happy to look at something new.

Comments are closed.