Monthly Archives: December 2015

Happy New Year

tmp4A6A

Just wasted part of the day trying to get Python 3 working properly on an upgraded Raspberry Pi 2 updated from Wheezy to Jessie without luck – very depressing – so I think an early night (yes, on NYE – having seen the fireworks in Moscow and the “special” fireworks in Dubai I’ve had enough for one night Smile

(Update: I did get it working - I have TWO Node-Reds in there now but the latter one works).

So – to everyone  – lots happening soon, more reviews, new interesting kit, more new ideas and hopefully more exciting feedback in the new year!

Thanks to everyone looking in and I'd like to point out that I regularly go  back to older posts and update if I think something is hopelessly out of date so do look around when you're in here, I don't think the system sends out emails for such updates.

Pete.

Facebooktwittergoogle_pluspinterestlinkedin

A successful Techy Day

So much going on today I thought I’d put the lot into one blog entry.

So, I’ve spent the day with my pal playing with one of several IOT solutions – familiar to regular readers – node-red-contrib-ui. This just keeps getting better.

tmp6D4ASo we spent our afternoon getting to grips with the new “template” node which Andrei the designer has been improving recently. We wanted an RGB controller which the UI does not (did not) currently feature. Getting to grips with Angular and how it interfaces with the UI is proving a challenge but the long and short of it is (I know a couple of you are about to get excited) – we have a working RGB controller.

Here it is. Just ignore my FREDDY experiments and the pretty coloured line of buttons…

Well, no, don’t ignore the buttons – I’m finding increasingly frustrating to have to use the big but still limited range of ANGULAR icons – so I’m about to write off to Andrei to see if we can maybe trap HTTP in the icon description to allow us to use any arbitrary online PNG file – preferably transparent ones – imagine you have a row of buttons for +, minus and auto.  The Angular icons do + and -  but how on earth do you represent “AUTO” – I could think of a 1000 examples where you just can’t do it with a limited set of icons… so that needs work…

Update 31/12/2015 – It is now my understanding that soon we will have the ability to use our own images as well as an expanded library – that is just excellent!!!

However I digress – see the bottom line – RED GREEN AND BLUE controllers (ignore the yellow, I’m experimenting). On the right is a BLACK BLOCK which changes colour as you move the sliders. So this TEMPLATE node in Node-Red UI- and this is all down to Andrei, has an input and an output – the output puts out  JSON string with R G B values…. the input expects msg.payload.r, msg.payload.g etc… well I didn’t have a CLUE how to do that so again Andrei helped. So here I will show you an example of use –, the template node and the input to manually set the controls. I CAN CONFIRM that all of this mirrors perfectly if for example you have this running on 2 phones at once – they remain in sync perfectly!!!!  This is just so good!

tmp7074

So above you see an inject (ignore the timestamp) – the function will set up 3 values to put into the template to affect the sliders – so for example you can set up initial conditions.

msg.payload = {
  r: 10,
  g: 50,
  b: 100
};

msg.payload.b=190;
return msg;

So there’s an incoming payload which we’re going to ignore – the bit I was not sure about was adding new stuff – ie msg.payload.r  and again Andrei came to the rescue – you’ll see I’ve initialised RGB values and then proven to myself that you can quickly alter them before sending MSG off to the template node. The output of the template node goes off in this case to a DEBUG node and there’s a JSON string with RGB values going out (that might be used to populate a global variable and off via MQTT to some RGB lighting).

Here is the content of the template.

<div layout="row" layout-align="space-between center">
    <md-slider ng-model="msg.payload.r" ng-change="send(msg)" flex="30" min="0" max="255" class="slider-red">
    </md-slider>
    <md-slider ng-model="msg.payload.g" ng-change="send(msg)" flex="30" min="0" max="255" class="slider-green">
    </md-slider>
    <md-slider ng-model="msg.payload.b" ng-change="send(msg)" flex="30" min="0" max="255" class="slider-blue">
    </md-slider>
    <div style="width: 32px; height: 32px;" ng-style="{'background-color': ('rgb(%d, %d, %d)'|sprintf:msg.payload.r:msg.payload.g:msg.payload.b)}">
    </div>
</div>

<script>
(function(scope) {
    scope.$watch('msg.payload', function (v) {
        if (!v) scope.msg ={ payload: {r:0, g:0, b:0} };
    });
})(scope);
</script>

<style>
    .slider-green .md-track-fill {
        background-color: green !important;
    }
    .slider-green .md-thumb:after {
        background-color: green !important;
        border-color: green !important;
    }
    .slider-blue .md-track-fill {
        background-color: blue !important;
    }
    .slider-blue .md-thumb:after {
        background-color: blue !important;
        border-color: blue !important;
    }
</style>

What you have there is not only the RGB controls – but all you need to know in order to make any custom system you like which has INPUTS and OUTPUTS. This is so very useful.

So there you go – a great new UI gadget.

Strangely enough – I needed that bit of knowledge about adding stuff to MSG as today another pal of mine pointed me to an ANDROID/IOS App called OWNTRACKS. It has a lot of uses but one of it’s features allows you to set up your phone to send regular LONGITUDE/LATITUDE messages to your own MQTT server.

Now, I went off on a crawl and found a NODE-RED node to do GEOFENCING – here it is.

tmp6FBE

So the ORANGE node is a node called GEOFENCE (node-red-contrib-geofence).  This is marvellous – so you feed it longitude and latitude and it compares against a set area and either passes the message through – or not.

On the left you see my MQTT node picking up a topic which I set on the phone. Next you see me convert the data to the right vars – exactly the same issue I had above so I killed 2 birds with one stone – here’s the function.

var fred=JSON.parse(msg.payload);

msg.location = {
  lon: 0,
  lat: 50
};

msg.location.lon=fred.lon;
msg.location.lat=fred.lat;
return msg;

So from my incoming MQTT in a format decided by the App, not me I’ve created 2 items which the geofence node understands – regular updates as to where I am.

Here’s the winner – the Geofence admin page when you click on the orange Geofence node.

tmp2B7F

This is so good I’m betting I don’t have to explain how it works – you simply put a square, circle or shape around a location, town, house or whatever – and if the incoming coordinates are in that area the whole message just gets passed through – if not, nothing gets passed through. There are other options!!

The obvious next move is a function with a check to ensure you were OUT of the area and coming IN and the string “I’m nearly home, get the kettle on” – passed to the speech system I showed you in my last blog. In my case I’d likely get beaten up for doing that but I’m sure you understand the MASSIVE potential for this.

Put welcome lights on when coming home, alarm the house when leaving etc etc etc… actually with an ESP8266 you could put the kettle on yourself!!! HEY that’s a good idea.

All of this takes only minutes to get going when you have info like this (I had to kind of fumble through much of it). You could use multiple nodes from the same MQTT input to do all sorts of analysis on movement. What’s needed next it really tmpFED7cheap GPS transmitters for the cats!! Just so many possibilities.

So – that was that – then when I got home tonight – the post was waiting for me.  This little number arrived in the post.. This bare board was less than £2 on Ebay… http://www.ebay.co.uk/itm/172017546015?_trksid=p2057872.m2749.l2649&var=470889509954&ssPageName=STRK%3AMEBIDX%3AIT

Ok, it needs 2 MOSFETS, a couple of resistors (SMT) and a regulator and an ESP-12 and you have yourself a handy 0.1” centres development board – only for true soldering iron enthusiasts but I thought it would be worth having.

tmpD4F5As well as that, SEED STUDIOS sent me their LinkIT SMART 7699 board and a nice adaptor to go with it… I’ll have to write this up later when I get enough time to do it justice but on the left you see one of the little boards – it has 2 micro-USB sockets – 3 buttons (reset, program, user) and a WIFI module with lots of IO – the accompanying breakout board lets you do the whole thing with wires and connectors without going anywhere near a soldering iron.

Unlike ESPs (which are of course cheaper) these little devils run Linux!! Anyway, it’s late but here’s a link for interested parties.. http://labs.mediatek.com/site/global/developer_tools/mediatek_linkit_smart_7688/whatis_7688/index.gsp

 

And that is about it for one day. I’ve just found a cheap TIMER unit for my upstairs radiators so I can turn them off when we’re sleeping downstairs and by the time that turns up I’ll have a very pretty mobile application for my good lady to control the heating with.

Good night, all.

Facebooktwittergoogle_pluspinterestlinkedin

ESP 32 Unofficial Development Kit

Michael Grigorev has released a Beta version of Unofficial Development Kit for Espressif ESP32 (Windows)

From Michael:

The kit includes the following components and tools:
* Unofficial GCC compiler for SoC Xtensa L108.
* Official Espressif ESP32 RTOS SDK v1.1.0
* Documentation for SoC ESP32.
* Examples in the firmware source code in C language.
* Additional tools for working with boards based on the ESP32.

Instructions for installing and configuring the Unofficial Development Kit for Espressif ESP32:
1. Download (114Mb) and install my Unofficial Development Kit for Espressif ESP32.
2. Download and install the Java Runtime x86 (jre-7uXX-windows-i586.exe)
3. Download and install Eclipse Mars x86 to develop in C ++ (eclipse-cpp-mars-R-win32.zip). Unpack the archive to the root of drive C.
4. Download and install MinGW. Run mingw-get-setup.exe, the installation process to select without GUI, ie uncheck "... also install support for the graphical user interface".
5. Download the (84Mb) my scripts to automate the installation of additional modules for MinGW.
6. Run from my file install-mingw-package.bat. He will establish the basic modules for MinGW, installation should proceed without error.
7. Start the Eclipse Luna from the directory c:\eclipse\eclipse.exe
8. In Eclipse, select File -> Import -> General -> Existing Project into Workspace, in the line Select root directory, select the directory C:\Espressif\examples\ESP32 and import work projects.
9. Edit the Makefile, correct COM port number in the parameter ESPPORT and SPI_SIZE_MAP.
Further, the right to select the Make Target project, such as esp32_hello_world and run the target 'all' the compile project, while in the console window should display the progress of the build. Run the target 'flash' for burn firmware.

Official website of the ESP 32 unofficial development project

Facebooktwittergoogle_pluspinterestlinkedin

Node Red Speech – The Sequel

Some time ago, I wrote about speech output (text to speech) on the Raspberry Pi using Node Red. Well, that’s been running just fine but like most things – it works until it doesn’t.

In this case the nice people at Google have decided it is time to make money out of the people they offered free language translation APIs to and the API behind the excellent NORMIT program no longer works – I feel sorry for the fellow who spent ages putting it together. Here’s the original article.. https://tech.scargill.net/talking-raspberry/

So, I’ve checked and the best I can come up with for text-to-speech that doesn’t once again rely on someone else's servers, is “eSpeak”. This is simply installed on your computer as “apt-get install espeak”. I can only vouch for it running on the Raspberry Pi. I tried it on the Radxa Rock yesterday and it failed miserably.

So – I’ve come up with another route.

A program I used which works well, to sound alarms is called mpg123.  (npm install mpg123).  You simply hand it the name of an MP3 file on the command line – and it plays it! http://www.mpg123.de/ for more info.

So yesterday I discovered another service called voicerss (http://www.voicerss.org/) – and you can fire some text at them – and get a streaming MP3 file back!

For example…

http://api.voicerss.org/?key=xxxxxx&src=hello

where xxxxx is the API key they’ll freely give you on application.

So – I wanted this to work in Node-Red from a simple input.  I decided to use msg.payload to carry the text – and reserve msg.topic for the word “alert” if I wanted to prefix the sound with an alarm.

In this version I’ve not implemented complicated queues – I just play the message. See my previous article on queues. These might be needed if you wanted to fire messages out in rapid succession because I’m using Node-Red’s EXEC function and as far as I know – as it fires off things asynchronously – there’s no way to know when jobs are done. I guess you could have it run a batch file which sets and clears some kind of flag – I’ll leave that to others.

Here’s the basic setup.

tmpEAD1

What you see above – is a simple inject node – with the word “alert” in the topic (optional) and some text in the payload – for example “hello how are you”.

The function in the middle does all the work – the EXEC node at the end simply has “mpg123” as the command – other boxes are defaults.

Here are the internals of “THING” in the middle.

if (msg.payload.indexOf(".mp3")!=-1) return (msg); // if payload is an mp3 just play it, nothing else
    if (msg.topic.indexOf("alert")!=-1)
    {
    var msg2 = {
                payload : "",
                topic : ""
                };
        msg2.topic=msg.topic;
        msg2.payload='/usr/audio/alert02.mp3';
        node.send(msg2); // possibly play an alert
    }
    var moment=context.global.moment;
    var timeadd="";
    var dateadd="";
    if (msg.topic.indexOf("time")!=-1)
      timeadd= moment().format("h:mm a ")+ ', ';
    if (msg.topic.indexOf("date")!=-1)
      dateadd= moment().format("dddd, MMMM Do YYYY")+ ', ';
     
    msg.payload = msg.payload.replace(/''/gi, "'");
    msg.payload = msg.payload.replace(/'/gi, "''");   
    msg.payload= " -q 'http://api.voicerss.org/?key=XXXXXXXX&src=" + dateadd + timeadd + msg.payload + "'";
    node.send(msg); // synth   

Where you see XXXXXX above – put your API key from api.voicerss.org

You’ll note I have a file called /usr/audio/alert02.mp3 in there as well -  you can change the name and location but you should grab a suitable short alert mp3 sound from somewhere. I got it off a trekkie site.

As detailed in the original blog you’ll need to install and include MOMENT  if you want to be able to put “time” or “date” into the topic and have that spoken – if not just miss that stuff offf.

Below is a version with no time and date stuff.

 

if (msg.payload.indexOf(".mp3")!=-1) return (msg); // if payload is an mp3 just play it, nothing else
    if (msg.topic.indexOf("alert")!=-1)
    {
    var msg2 = {
                payload : "",
                topic : ""
                };
        msg2.topic=msg.topic;
        msg2.payload='/usr/audio/alert02.mp3';
        node.send(msg2); // possibly play an alert
    }
     
    msg.payload = msg.payload.replace(/''/gi, "'");
    msg.payload = msg.payload.replace(/'/gi, "''");   
    msg.payload= " -q 'http://api.voicerss.org/?key=XXXXXXXX&src="  + msg.payload + "'";
    node.send(msg); // synth   

Have fun.

Facebooktwittergoogle_pluspinterestlinkedin

Node Red UI Mysteries

Yes I did think when writing the title that it reminded me of “Ruth Rendell Mysteries”.

There are times when I consider taking up a new career in bricklaying and this is one of them.

So I’m working with Node-Red and the UI (node-red-contrib-ui) which has a FUNCTION node which lets you use a weird combination of JavaScript and something called “Angular”.  I am failing to get to grips with this one..

So right now the UI has a button – and it has a text box – but not on the same line – and this to me seems like an obvious marriage.

tmp2F35

So Imagine the scenario.. you press the button which merely returns “1” to Node-Red so you know it has been pressed.  Either as a result of that action or for other reasons you want the text on the right (or icons representing the text) to say – for the sake of example “Active”, “Sleep”,”Standby” – in other words an arbitrary message which is affected by the button press.

So here was my first attempt – using the “template” node in the UI.

<div layout="row" layout-align="space-between">
<md-button class="md-raised" ng-click="send({payload: '1'})">
    Press
</md-button >
    <p>
        {{msg.payload}}
    </p>
</div>

tmp878AIt all seemed obvious to me – you press the button and it sends “1” – you send an input to the node and it prints the incoming message.

At this point you will get a clear picture of just how far off the mark I am here – could be too much Christmas cheer or course.

Pressing the button returned “1” to Node-Red alright  - however it also set the text on the right. Worse, sending a message “Active” to the node input put up the message as I needed – but ALSO sent that to the output. It just is NOT making sense to me. I want the button press to go back out – but incoming messages to go to that text area ONLY.

Here is my kluge to get around all of this.

tmp75E

The inject node on the left sends “Active” when pressed. The function (2nd left) copies this from msg.payload to msg2.payload. The modified template uses msg.payload2 for it’s text section.

<div layout="row" layout-align="space-between">
<md-button class="md-raised" ng-click="send({payload: '1'})">
    Press
</md-button >
    <p>
        {{msg.payload2}}
    </p>
</div>

And the last function only passes the message if it sees “1” in msg.payload.

Update: Even THAT doesn’t work… press the button – fine – press the inject – fine – press the button – it wipes the panel on the right!!

The template node in node-red-contrib-ui is clearly very powerful for creating user interface elements but I suspect it is going to take a variety of examples to give some of us the mental tools we need to make best use of it.

Any more takers on the above – there has to be a way to get this to work properly!

Facebooktwittergoogle_pluspinterestlinkedin

Pm2, Node-Red and the Rock

Well, this isn’t really about the Rock – but does this scenario mean anything to you? You’ve installed Node-Red on a new setup of Debian… and while it has always worked in the past, it just isn’t having it – you can run manually but attempts to run at powerup fail miserably?

The usual sequence of commands assuming you use PM2 to start up Node-Red is this…. and it is what I use in my scripts. I’m assuming ROOT user here.

cd /root
pm2 start /usr/local/bin/node-red -- -v
pm2 save
pm2 startup

It has worked a treat on countless installations so I’ve never thought twice about it.

So the first shock when installing Node-Red on not a Raspberry Pi but a ROCK – using Debian Jessie was that Node-Red wasn’t there.

which node-red

Well, that solved that – it is stored at /usr/bin/node-red

And that was fine – pm2 start /usr/bin/node-red would start up Node-Red (followed by “pm2 save”) but it STILL would not come up at power-on.

I scoured the web and just as when my Samsung S4 started to fail, I found all sorts of witchcraft out there until finally I came across an item specifically referring to JESSIE.

So here’s the solution that worked for me.

I went into /etc/init.d and DELETED the original pm2 file in there…

and did this..

pm2 startup systemd –u root

If not using root you might want to change that last bit.

And then started Node-Red as before…

pm2 start /usr/bin/node-red

pm2 save

I rebooted the Rock – and…. voila – one working Jessie Node-Red installation.

Why did I bother with all of this? Well, my Raspberry Pi installations are generally way over the top with databases and all sorts… and… it occurred to me that as I save variables in a JSON file, for the likes of my thermometer and control system – I really don’t need all that and I don’t want the worry of database systems wearing out my SD – so an absolute minimal system – Node-Red (without verbose logging), Node-Red-Contrib-UI and not a lot else – I want my Thermostat to work year in, year out, not just a few months!

Did I say UI there?  Until someone else comes up with a fix for the Blynk node being less than 100% reliable, it is going on the back boiler.

For Christmas I received a nice home weather centre, touted a “full colour”. Well, of course it isn’t – it’s just a clear LCD with black lettering and a nice set of coloured imagery in the background and that started me thinking – I wonder if it would be possible to put full-width backdrops into the DIVs in the UI. I’m about to drop Andrei an email Smile

Facebooktwittergoogle_pluspinterestlinkedin

ESP 32 Update

An update for you. As you may know the ESP-32 is Espressif’s latest venture, a new, hopefully more powerful alternative to the ESP8266 – with Bluetooth 4 and all sorts of other goodies.  I received my ESP-32 module this week along with 0.1” header adaptor board. All very nice you say but what to do with it. I’m still waiting for Espressif to provide a simple diagram for programming – i.e. what pins on the adaptor need pulling up/down and when…  no point in experimenting when you don’t have a backup. (Update: See below).

tmp2D54AND they are all out of beta tester copies – but the GOOD news is for all you budding Windows programmers (like me) – there is a PRELIMINARY copy of the unofficial development kit sitting on my desk waiting for that pin-out info. I got in touch with Michael Grigorev, developer of the fabulous “kit” for Windows which gives us the Eclipse editing and compiling environment without having to dabble in Linux commands… and he is indeed developing an ESP-32 version… sadly because he missed the boat on the beta program it looks like I might have to send mine over to Russia! Well, chicken and egg – can’t program the chips without an environment – got to be hard to make the environment without the chips! Currently the test environment compiles a “hello world” program – ok, not a lot of use but it’s a start.

Finally – our thanks to reader NELSON for bringing this to our attention – just exactly what is needed to start the ball rolling!!!

http://www.instructables.com/id/Beginners-ESP32-Guide-to-Assembly-Testing/?ALLSTEPS

The pin-out of the adaptor board provided to beta testers is pin mapped to the ESP-31 (which is a kind of engineering sample of the ESP-32 and there are unlikely to be significant differences between this and the final product). The only exception being that pin 19 on the baseboard is grounded – to pin 15 which is out of sync, all other pins follow the ESP31 as you’d expect.

 

If you know more, do let us know in here.

Facebooktwittergoogle_pluspinterestlinkedin

Christmas 2015

tmp9029

Just a quick note to wish our many subscribers a very Merry Christmas and a Happy New Year.

Our plans for Christmas are simple – we’ll be spending time with family and friends. Sadly in the modern world many people who have come to be friends are scattered all over the world but thanks to our technology at least we can keep in touch.  No doubt lots of new gadgets will appear over the Christmas and as usual I won’t be able to resist the temptation to write about them – but for now, to everyone looking in – have a great Christmas break!

Pete.

Facebooktwittergoogle_pluspinterestlinkedin

Radxa Rock Pro

Radxa Rock ProUp to now, my delving into tiny computers has been limited to the Raspberry Pi, the Pi2, Zero and the Orange Pi. The latter still isn’t doing it for me as the latest attempt to get it working (DietPi) turned out to be not so good (no hardware acceleration, no PIO etc).

While the Pi2s are serving me VERY well I thought it might be nice to try something a little up-market – and so to the Radxa Rock Pro which in the USA costs around $99 or, somewhat inexplicably, around £113 in the UK – rather interesting as $99 translates to around £66. Even Amazon want £126 in the UK even though the same company sell it for $119 in the USA (don’t you get sick and tired of being ripped off in the UK?).

So – about twice the size of a Pi2, this board uses a quad-core ARM Cortex A9 running at 1.6Ggi , comes with 2GB of DDR3 memory, 8GB Nand Flash and supports up to 128GB of microSD.  It has a GPU, analog and HDMI video out, Ethernet AND WiFi, Bluetooth 4.0 and analog audio out. It has 2 standard USB 2 connectors and a microUSB OTG connector. IR input, 2 pushbuttons, 3 programmable LEDS (red, green, blue), a real-time-clock (battery not supplied) and IO including GPIO, I2C, PWM, ADC and more.

In other words, the kitchen sink.

Radxa Rock Pro in enclosureAt first sight, a work of art. The box is nice, the packaging is nice and you get a power adaptor lead (which is more than can be said for the very much cheaper Orange Pi where I had to solder wires to get power to it). You need to be able to supply the board with up to 2 amps at 5v. I just happened to have a handy 5amp 5 way USB supply.

Software-wise the board supports Android (4.4.2), Debian and Ubuntu. I intend to use it with Debian (called Rabian – which sounds a little like a disease - and apparently officially maintained). But for the purpose of a quick review I downloaded the Android image.

Almost every different type of board I’ve tested recently has had issues… I turned this on – a few seconds later I had Android running – requiring only my login details – I downloaded Kodi (the artist formerly known as XMBC) – pointed it to my NAS-based movies, threw a 4GB movie at it – no problem. I ran this using the Ethernet cable but the high speed WIFI works just as well out of the box.

And that’s about it  - how do you review something that just works. At 1920*1080 resolution it looked somewhat interpolated to me but I guess that’s down to Android – and to be fair, video playback looked great.

I did notice something a little odd - despite using a 64K microUSB, Android reported that I had 4GB. It turns out that by default, Android is installed on INTERNAL memory so in fact the system is currently ignoring my 64GB drive! The Debian installation – Rabian – is ONLY available for internal memory – it turns out that the default Android is ALSO using internal memory – and hence knows nothing about the external SD.

Of course – playing videos on the device is very different to attaching stuff to the GPIO and powering it from, say, Node-Red – but that’s for another day.

Update 21/12/2015: I’ve now installed Debian on the Rock – at first sight it looked as if you could ONLY install their Debian in the internal 8GB of memory – that concerned me a little as this stuff does not have infinite life – what happens if it wears out? Regardless, I installed Node-Red, Apache and Mosquito without any real issues and mounted my 64GB microSD as a folder under root. All of that was working well but I really wanted everything on an SD card – for backup purposes if nothing else as Linux backups tend to be a nightmare. Anyway, I wrote to Radxa and they quickly pointed me to the nightly build of an SD-based version of Rabian. I installed that and this time the desktop Debian 8 graphical environment came up with user “root”.  I checked that out and noted that while the WIFI was operating (both wired and wireless) – the Bluetooth manager could find no reference to Bluetooth and the volume control in the control console could not find any reference to volume control devices. I’ve written to Radxa for feedback.

In the process of setting up speech, I discovered that my favourite program NORMIT is now dead thanks to the miserable people at Google closing API access. The only alternative I’m aware of that is any good is eSpeak (synth speech) and that simply will not run in the Rock Pro – and that started me thinking – all of this IO is all very good – but how do you access it? On the Raspberry Pi there are (for example) not only NODES to  do this but lots of examples – I can find no such thing for the Pro. I did find an example of a simple read-write process to the GPIO pins and I’ve successfully tested that – I’m fairly confident I can toggle at least 29 pins on and off… but that’s all I’ve achieved. There are at least 2 serial ports on the board and both of them work without issue in Node-Red.

When I’m all done I think this could end up transforming one of my large and very nice but NOT smart TVs into a bang up to date media centre, OR – depending on just how fast this thing is it might get the job of central MQTT server! It certainly FEELS a lot faster than the Pi2.

The basic board looks great but I suspect at this point, that support is more important than the raw power of a device such as the Radxa Rock Pro. Time will tell.

More later.

Facebooktwittergoogle_pluspinterestlinkedin

Thermostat Christmas Wishes

Still ploughing away with the thermostat side of my home control. Having had working code for some time now using ESP8266 modules (and hopefully soon the odd ESP32 device) to control things with Node-Red on the Raspberry Pi acting as the central controller and in charge of mobile and serial UIs, I’ve been making changes with the advent of the relatively new BLINK app and even newer (to me) node-red-contrib-ui. (All of this is running live).

I also had complaints from my wife that the heating was too high up overnight. At an early stage I’d made the decision to have 2 on-off times in the day, so 2 periods of peak heat and the rest of the time off-peak. This has been working for some time – but it occurred to this week what a stupid way to control the heating that is.. and so yesterday I completed an upgrade to 5 PROGRAMS a day (with 5 separate ones for the weekend). So now armed with up to 5 program times and 5 temperature settings I have WAY more control over the heating.

Blynk backgroundI use Nextion displays for the wall (serial) talking directly to the Pi. Their editor is currently very primitive and the graphics not that good, especially in the smaller displays like mine (400*240). I should say at this point that I think the hardware is very good value for money – but like SO many projects they start with good intentions then other stuff gets in the way – so right now editor progress is slow. So – I make my own backgrounds in PowerPoint (NEVER under-estimate PowerPoint).

As you can see – on one small page I’ve managed to get all the weekday controls and some extras – on another page I have the weekend controls. Simple enough – this is just a .PNG graphic which acts as a background then I use the Nextion controls to make hotspots and dump in simple text values. It’s a compromise but it looks good.

On mobile phones however things are not so easy  - you want a few simple controls – fine but many of the UIs out there do not lend themselves to displays with this much information – which is why I’ve abandoned so many in the past. I’m still hoping the Blynk guys come up with more – but it seems to me that again, right now I’ve not seen new toys for that system for AGES (I should also point out that there is a reconnect issue with Blink and the otherwise excellent node-red-contrib-blynk nodes – I should also point out that the very helpful author of the latter thinks he has a fix and is just waiting for the Blynk guys to incorporate his fixes – if you’re working on this – do write to Blynk and ask them to merge in his changes ASAP.

node-red-contrib-uiMeanwhile there is the increasingly flexible node-red-contrib-ui – and I think this might be the one – the author Andrei is working very hard on this right now but visually it leaves something to be desired and I think the community could help there as his code (if you know where to look) lends itself to CSS modding as essentially this is not an APP but a web sockets page running under Node-Red.

On the left you see my current control page. It works (as of last night) but there is just SO much wastenode-red-contrib-uid space. A good start would be to go full-screen but on Android Chrome – I just cannot get this to happen – I suspect you must need something in the page header.

So my wish-list would be firstly to eliminate the cluttering menu (Chrome’s menu). From there I suspect it is down to some CSS.  On simple LED controls it is possible to get two items on a line – but right now with individual nodes it is one per line.  A simply tick box option might be the way around this but it is down to convincing Andrei of the need (and after all like many of us he’s doing this for fun so it’s not like we can insist.

As you can see, in my Christmas wish list version of the control, space is used FAR more efficiently. And it is needed because I plan to do SO much more with the stat.

Right now – I read the temperature in the living room – and act accordingly – but this is silly – at night who cares what the temperature in the living room is – I want the BEDROOM temperature monitored etc.. so ultimately each of the 5 programs will be able to select from one of 3 sensors. Great but creates more nightmares for the UI  - so flexibility of sizing here is the key and right now we don’t have that.

Today we have node-red-contrib-ui with basic examples of use  - what would be really nice would be a complete guide to CSS possibilities for dummies along with example controls using the “template” control to supplement existing controls – I think we might have to chip in and help Andrei with that. Right now I know how to change that green “controls” menu background colour – and that’s about it.

I’ll finish by thanking the authors of node-red-contrib-blynk and node-red-contrib-ui for their work so far and encourage them to keep going – so many possibilities.  Thoughts welcome.

Facebooktwittergoogle_pluspinterestlinkedin