Monthly Archives: May 2015

Using Skype

For those used to seeing me rant about micro-controllers this may seem a little odd, but I thought I’d drop this in here as a diversion to give others the benefit of my experience as IT Chairman of a fairly large national organisation.

About 14 years ago the organisation decided it wanted to go down the video-conferencing route and bought a couple of obscenely expensive dedicated conferencing systems. At about this time I was just about to become in charge of IT and before very long the shortcomings of such a dedicated system became obvious – what if you wanted to bring someone in from a remote office or home? Another several grand for another unit?

So when Skype came along this seemed like a godsend and ever since then we’ve been saving massive sums of money in travel and overnight stay codes thanks to Skype. But it is not without issues, some of which are technical, most of which are “human error” related.

I use Skype every day both for one-to-one video calls and for conference calls and I’ve learned a LOT about it – perhaps you might find this useful. I refer to Skype as it exists today on Windows PCs and mobile units from Apple and Android.

So first things first, there are no major issues with one-to-one video in any combination of the above other than the obvious – it is not your download speed that matters to Skype, it is your upload speed (and reliability)  and for those with minimum ADSL broadband, Skype video is going to use up most of your upload bandwidth even though you might have 8Mbps download capability – that’s irrelevant. Ensure then that there is nothing else going on (and this applies to BOTH parties in the conversation) like Dropbox or other background uploads or backups. If you are watching a movie online, your movie player can handle all sorts of dropouts with the broadband as the movie is “streamed” i.e. buffered in memory. You can’t do that with Skype as everything is LIVE… if the broadband dips momentarily, so will you call quality!

For multi-user conferencing the situation is worse. Many folk when coming into one of these for the first time will say “but Skype always works for me”. Not for multi-user conferences it doesn’t – not on an iPhone or Android phone. These do NOT handle multi-user conferences with Skype so beware. See the Skype FAQ on their site! Now, the cynical might say “I’ll bet it works with Microsoft phones” – I’ll bet it does but hardly anyone is using them! Also check their FAQ for broadband requirements for multi-video calls – you’ll find the speed requirement goes up frighteningly the more people you have in the call.

So, assuming all parties have a good connection you might think that’s really all there is to it. No.

Many laptops have built-in cameras and microphones and usually they are rubbish. Here’s why. The internal microphones tend to pick up all sorts of stray noise from internal fans, hard drives, people typing on keyboards etc and the automatic level control (AGC) does not help. So, where possible use an external microphone NOT mounted on your desk – or if you must, mount it on some foam or something to reduce vibration from the desk.

By default, Skype uses AGC… so imagine you’re having a chat and the background noise seems fine… and the other guy is now talking. Because you are not saying anything, the AGC is slowly ramping up the sensitivity of your microphone… which means the background noise is getting louder, and louder… at some point Skype may think you are trying to say something with that background noise and may attempt to cut the other guy off (it does this to help prevent HOWL). So – if you know what you are doing – go into TOOLS- OPTIONS – audio and turn that automatic level control OFF.

If it is just you – any decent microphone will do – if there are a few of you sitting around a table – don’t be cheapskates – there’s a reason good conference microphones cost several hundred £££

As far as VIDEO is concerned, the usual result of using poor internal cameras is blurry images due to the camera simply being unable to handle inadequate lighting. Use the best lighting you can manage – and no that’s not the sunlight coming in the window behind you!!

That is one aspect of a Skype call – the technical side – but then there are people involved and that is where things usually start to go wrong. If you are using Skype for business, here’s a tip, always make sure around 15 minutes before your meeting starts that you check in with all the people coming in on the call to make sure their kit is working properly… I guarantee otherwise there will be one guy who’s bust his computer and he’s borrowed his son’s computer and when the whole conference call falls apart and your credibility is shot you’ll wish you’d checked as recommended. What can possibly go wrong? Someone needed a USB lead the day before and left everything un-plugged – and the one person who might know how to reconnect it is off sick. TEST FIRST to save disappointment later. If there are non-technical people in the call – it will always be Skype’s fault and if you set it up – yours.

Finally always ensure that EVERYONE in the call has the latest version of Skype – I can’t tell you how many calls have failed mysteriously because it turns out one of the people in the call has never, ever updated Skype. It is free, after all.

Pre-preparation, reliable broadband and the right kit are essential to ensure that you really do make the savings that Skype promises.


Using GroveStreams

GrovestreamsNo sooner did I finish the blog on my new GroveStreams Node than I was faced with the question “how do I use GroveStreams?”

Well, that’s generally up to you – but I will start you off on how I use GroveStreams – and the ridiculously simple setup (once you know how).

So what I will describe here takes you from never having heard of GroveStreams to sending information to your own stream. This should take no more than minutes if you already have managed to get my NODE set up on your Node-Red installation as per my previous blog. If you are NOT using Node-Red, then read this anyway as the API call is trivial and you could organise this from just about any package.

First things first – head off to GroveStreams and get a new account. That is, register, receive a confirmation email, click the link and receive a welcome email. You are done.

garageYou will be asked to create an organisation. This confused the hell out of me until I realised they don’t necessarily mean a business organisation. For the purpose of demonstration I created one called “Garage”.

So now you have that. There are many ways to use GroveStreams, for me I wanted a simple means of looking at graphical logs of simple devices over time.. so for example my temperature sensor. GroveStreams does SO much more than simply log data, you can average over time, zoom into areas, you can even use graphical instruments for real-time monitoring – but let’s keep it simple for now.

api keyscomponentsIn my case having created “Garage” – click on it in your browser window. You are now in the “Observation studio”. You will see “components” on your left. Don’t do anything with it…

Top right is ADMIN in the menu – go there and go to API keys. Click on the one marked “Feed Put API Key (with auto-registration rights) – make sure you’ve picked the right one. Select “View Secret Key” above that and you will get your API key. Copy to the clipboard.

Now dump the API key in my NODE along with a sensible name, a component name (in my case for fun “GarageRoof” don’t use spaces.. and a stream called “temperature” – again – an arbitrary name in this case.

Click OK, send some numbers to the node from a device or the “inject” node to test.

If you are NOT using Node-Red then you are looking at a PUT – this should give you a clue as to the format.

var options = {
                  host: ‘’,
                  port: 80,
                  path: ‘/api/feed?api_key=’ + node.api + ‘&compId=’ + node.component + ‘&compName=’ + node.component + ‘&’ + inmsg.payload,
                  method: ‘POST’

And that is that!!!

The component should appear magically along with the stream.


Now, what you DO with that is another matter. In my case right clicking GarageRoof opens a dialog and you can then select temperature, tell it what kind of data you are looking at, what averaging period if any you want to use etc. If you have several test values and want to see a quick average, in the image above, right window you will see below the tab “none” – you can drop that down and instantly see some averaging options – there is just SO much to this but my plan here was merely to get you started. I originally set up GroveStreams to take in data from an Arduino (with Ethernet card) and it did that a treat too – still today logs the temperature in my place in Spain every 15 mins and it’s been doing that for over a year – you can zoom in, overlay one reading over another etc.… time to go look at the documentation – have fun.


A GroveStreams Node Red Node

One of the more obvious things to do with a home control system is to capture information like temperature and humidity – and to graph it.  For example I spent part of my time in the UK and part of it in Spain. When I’m not in Spain it is usually raining in the Northeast of England and so I take great delight in checking the weather back at base in Galera in Andalucía.

There are of course many online systems for logging your data and I have demonstrated elsewhere in this blog doing the job locally on a Raspberry Pi. One of my favourite online services is GroveStreams. They have both paid and free offerings and I have chosen the latter as I’m only logging the information out of interest.

I am using a setup in Spain which is about to be replaced… a series of Arduino type modules with either DS128b20 chips or the combined temperature/humidity devices, the DHT22. These talk by short range radio to a large Arduino (1284-based) which is connected to the Internet. These will soon be replaced by ESP8266 devices connected directly to WIFI and using MQTT as the protocol.

Accordingly I want to interrogate those devices and send off the information somewhere.

There are a number of ways of sending information to GroveStreams via their API – and as far as Node-Red is concerned there is an http response node – you could tie that to a function block but I thought it would be nice to have a dedicated GroveStreams node – and so here it is.

GroveStreams node by Peter Scargill

What you see above is an MQTT listener awaiting a regularly-sent value from a module – and firing it off to GroveStreams. What I like about their service is simplicity. I can tell it the name of a stream and if it does not exist, it will be created automatically.


GroveStreams setup

I made a nice simple dialog box. You can get an API key from your GroveStreams control panel and this is an example (a dummy example). As you can see I’ve given the node a meaningful name, the API key, the name of a “component” and the name of a “stream” under that component – a lot simpler than it looks. All the node needs is an incoming value and that’s it.


In the example below, neither RaspberryPi nor temperature existed initially – I put these in the dialog box, ran Node-Red and magically they appeared in the web interface for GroveStreams.  The API key is what you call a “Feed put API key with auto registration rights”. I won’t go into GroveStreams setup or we’ll be here all night.

And that is all there is to it.

sudo npm install node-red-contrib-grove

or depending how you set up your node-red

sudo npm install -g node-red-contrib-grove

(a quick restart of node-red and you should find the nice purple icon appear)

I hope this helps, if you do manage to get this working on any particular system do let us know what steps you took. Might save someone else some work.

Here’s that temperature graph from the sensor in Spain. GroveStreams does an excellent job of overlaying internal and external temperatures with humidity.



To GIT – or Not to GIT

DropboxFor years I’ve been using DropBox on my various Windows PCs to make shared file access easy… and at work, my PA and I have shared DropBox folders for just as long. And that’s fine for lots of things, it certainly makes access when on location easy, but it is not ideal in all circumstances.

For example two of us have been working on our Arduino and ESP code and we recently decided we needed something better than DropBox, a means of not only sharing files but of knowing when changes have been made and by whom. There’s nothing worse than realising you have completely screwed up a project and you can’t quite remember when or how.

Of course there are ways around this – you can save various versions of a file or project in folders, meticulously named and dated, but, like backups that takes discipline and not many of us are that good at backups!

Node-RedI was busy working on a new NODE for NODE-RED when one of the developers suggested I could make the program available to Node-Red users via GITHUB. I had of course heard of this but knew nothing about GIT. I’d even USED GitHub, downloading ZIP files of other people’s work but never given it a second thought.

This weekend I decided to change all that and learn more. I have to say it was a bit of a challenge and I don’t pretend to understand it all. This then is my description of how to make life easy. I’m not going to bore you with a load of unique Linux language as I’m not interested in that myself. This is about how to use GIT to your advantage as a Windows user – others may hopefully find something useful too. I’ll assuming you are a lone developer or someone in a very small team and that terms like “versioning” goes in one ear… and out of the other.

What is GIT and why bother?

GITGIT is a means of storing information, locally and, or on-line (in a “repository”) and keeping track of changes (“versioning”).  Let’s say two of you are working on an Arduino project and you think differently. You both make changes to the software and occasionally agree to put the two versions together. This is the stuff of nightmares without GIT. Oh, so everything I’m talking about here is free and I’m talking about work which might be private or which you might want the public to access.

What is a Repository?

So at least for me, I want to work on the files locally and when I’m done, “synchronise” them with something in the cloud like DropBox – BUT unlike DropBox, only when I decide – and I want to keep track of changes without any effort on my behalf.

Which Repository is best?

There are several and finding out which is best for me was daunting – so to save a lot of trouble, take a quick glance at this comparison.  So it would seem, if you want to be compatible with stuff that’s out there, like plug-ins for your blog etc., the on-line repositories to go for would seem to be GITHUB, GITLAB and/or BITBUCKET.  I spent ages going through the options. If you want everything for free, forget GitHub unless all your work can be public. That leaves GitLab and BitBucket. I spent ages on GitLab and although the instructions on-line seemed easy, every now and then they quickly devolved into instructions that would not work in Windows – or needed various plug-ins that turned Windows into a command-line environment… sorry I’m just NOT into that.

I don’t know where I first spotted BitBucket but I went off to their site – essentially free for up to 5 collaborating users so if there is just you that’s great or you and a small team is also great.  In the end the mental breakthrough for me came with BitBucket. This is not an exhaustive review – there should be just enough here to get you started. I didn’t use any secret keys, just created the account using user names and passwords.

Doing GIT with minimal effort!

When I started off the other day I was faced with public and private keys, a host of new Linux-type commands to learn and after several cups of coffee and lots of blind alleys, DropBox didn’t seem so bad after all, maybe I’d just give this all a miss. And then along came SourceTree.

To make a start,  I went to BitBucket and got a free account – then went off and grabbed SourceTree for your Windows PC. That took moments only.

This really does not get any easier once you get past the initial, brief learning curve. The following describes ONLY what I’ve done and which WORKS for me.

In essence… take a folder on your PC which contains a project – that is, one or more files you are working on. Add a simple text file called README.MD and put a brief description of the project (or not if you don’t wish to – but I decided this was one standard I could handle).

I have a simple library I wrote for Arduino (well, less a library and more a short header) to give me some simple timers for my work – I got sick of preloading and comparing variables with millis() and wanted something a bit more “posh”. I’ll use that as an example as it’s all very simple. So two files – the header file and the file.. that’s it.

Clearly in order for any system to keep track of file changes and synchronise online, there needs to be some information stored somewhere. You could store it in a program but with GIT the information is stored in the directory itself in a folder called .git  – yes that’s a period followed by the word git. But you don’t have to understand this because SourceTree does it for you.

The next step is to “initialise” that directory – fear not your files won’t be affected and if you want to start from scratch, just delete the .git folder if you change your mind – and I did… a lot.

So – in SourceTree, under “CLONE/NEW” just “Create a new repository” – give it the folder location and a name – my name was “Timing”.  I’d made a directory called GIT (not for any particular reason) and put my project in a file called “Timing”. 

RemoteDone. Now I needed a matching online Repository. I went to BitBucket website with my new account and created an empty project called “Timing” – that’s it, nothing more. It ended up with the URL – that doesn’t get any easier.

I made it public – I could just as easily have made it private.

Back to SourceTree I added in a new Remote Repository. By that I right clicked “Remotes” – “New Remote” and gave the dialog box the URL – it immediately knew what that was. I called it BitBucket. I realised later that you can add as many remotes as you like, commit locally and then just “push” to one or more remotes.  At some point it asked me for username and password then never again.

From that point on it got easier.  I tried making a local change to the “Timing.h” file and almost immediately the program noticed the change.  Two things need to be done at this point. One “stages” the changed files – then “commits” them. Thankfully this can all be done in one simple command – i.e. a couple of button presses. This is of course local – you then have to “push” the files – but then this is just two button presses.

So now to show this in action  I have deleted my Timing repository on BitBucket, removed my .git folder locally and will start from scratch to show you how easy this is to do.

Sourcetree in use

At this point I’m going to make a short video – here it is…. this should make everything clear. Hope you find it useful.

Armed with this new toy it is possible to see every change you have committed and hence – if necessary  – to go backwards or even branch off with a completely new version – all without losing a thing.

Update: From scratch on a second computer…

1. Download SourceTree, install and launch – tick all 3 boxes unless you wish to un-tick middle one about sending anonymous data.

2. At this point the program goes off to download and install version control systems. No interaction needed. Say yes to creating default exclude file.

3. Add account – I added my free BitBucket account – you could add GitHub or GitLab accounts – on the first setup I added all 3.

At this point it knows about any repositories you’ve already set up – I said Skip setup…. Did I want to add an SSH key – no – as far as I can tell, certainly with BitBucket – you don’t actually need one.

At this point I dragged my local repositories (same location on both machines as I use mapped drives to my DiskStation) – all done – apart from asking for my username and password for BitBucket the first time I tried an update (and the first time only) no more needed.


Lots of Users

I was just looking at the stats for the blog and in the short time this new version has been up and running I’ve something like 1300 subscribers – which is nice – but only a small percentage talk to us! So – obviously you’re here because you are into the kind of stuff I talk about… what are YOU making?