What’s this about?
This is the UK website for Peter and Maureen Scargill. We live in the Northeast of England and also Andalucia in Spain.

Read through the blog entries, menu-accessible pages and archives if you're interested! Welcome to Peter and Maureen's website.

Get in touch via Facebook My Facebook Page
You should follow me on Twitter Follow me on Twitter
Join my LinkedIn network Join my network

Pete's Online CV
Archives

Dreaded Lurgy

Well, that was different. Tuesday night I was all set to go off to 2 days of meetings in Blackpool, I had my case all packed, the car running to warm it up as the weather was taking a turn for the worse.

My wife Maureen had been suffering with flu and had lost days sleeping because of it and I thought I was getting away with it – a slight tickly cough but nothing more. I was in the hallway getting my coat and Maureen spotted that I was leaning against the wall dozing off. Given that it’s a 2+ hour drive to Blackpool, nearer 3 hours in poor weather, she didn’t want me to go. I objected at first but I could actually feel myself going downhill by the second – that’s never happened to me.

I took my coat off and went to bed – around teatime. 20 hours or so later I was awake, but unable to do anything due to a stinking bad head and ribs that felt as if they’d been crushed.

It’s now Thursday. I’m up and typing but it’s not going to last – I’ve almost zero motivation (which anyone who knows me will tell you is “unusual”).  The backlog of email is nerve-racking to say the least but it’ll have to wait.

So if anyone thinks I’m ignoring them – I’m not – and for those who’ve already been in touch, concerned, thanks awfully. We’ll both be just fine.

Sound and Light at Grand Place

That’s my international travelling done for the year, another couple of local meetings and that’s me done until the new year, giving me time to get down to some solid research as well as checking out the first lot of PCBs from China.

I just spent the last couple of days in Brussels as Vice-Chairman of the ICT development group for the EU ESCO project. We’ve been working on skill definitions and putting together some standards to help ourselves and other groups.

Meanwhile of course our evenings are free and so I spent both nights at Grand Place where, at this time of year they have the most stunning visual and audio treats. A picture is worth a thousand works so here are some pictures… Also check out the video.. and go easy, I’m still getting used to the new EOS-M.

tmpAA12

Grand Place

tmpAEF3

ESP8266 LUA editing tool

This one is definitely only for a very narrow selection of techies – and is also featured in my tech blog – the only reason it is in here as I’ve had lots of help from a Chinese manufacturer and they were interested in the blog – but the great firewall of China seems to have blocked it – so I thought it only reasonable to put it somewhere they could access the entry.

This blog refers to the ESP8266, which is a small, inexpensive board for embedded processing. It offers cheap WIFI to add to an embedded microprocessor project. Indeed with a little work it’s useful on it’s own.  Early days and entering information into the thing is not ideal, especially for Windows programmers – so I wrote a little serial terminal to do the job.

Need a serial terminal to help program the ESP8266 in LUA?

Well, I certainly did as even the rather nice Coolterm was driving me nuts. As of the latest version, we have the basics of an excellent programming tool in the Lua Interpreter for the ESP8266 boards. All you have to do is use a file like FLASH DOWNLOAD TOOL to blow the LUA interpreter onto the board then it’s a matter of sending information via serial to the board and watching the responses.

Except for some peculiarities – the board is chronically short of RAM and sending functions directly eats up more of it… one way to get around this and also to ensure that your functions are set in the board “permanently” – ie stored in FLASH, is to write them as files. But that can get a little messy. It is sometimes better to store functions in “files” – these are then activated by the “dofile” command. For more on that see the LUA documentation.

One particular file you will NEED is the “init.lua” file – because whatever is in there will be run when the board powers up! If you want a little remote light controller you are going to need the board to power up, connect to your router and start some code ALL ON IT’S OWN.

In my case the code is simple..

print “Pete’s LUA module 0.4”
tmr.alarm(4000,0,function() dofile(“thelot.lua”) dofile(“mylistener.lua”) end

WHAT?? What on EARTH was that all about???

Well, on powerup I want the interpreter to say “Pete’s LUA module 0.4” – I then want it to wait for 4 seconds… and call a stored function (one I stored) called “thelot.lua”. That function will check to see if the board connected is actually talking to my router – and if not – will run code to make that happen. It will then call another stored function I wrote called “myslistener.lua” which will go off and listen for commands coming in front the Internet.

AND THAT’S FINE, I’ll not detail those functions here, that’s for another place… BUT you have to get this information and the other functions (which are a lot bigger than this one)  INTO the Lua interpreter via the serial port.  Using Coolterm you could do this by pasting in the code from, say, NOTEPAD.. but there’s a problem – that stuff will run there and then – it won’t wait till powerup!!

SO to delay the inevitable, you make it a FILE by wrapping your code inside file commands.. You firstly ensure the file does not exist by erasing it.

file.remove(“init.lua”)

If it does not already exist, no problem. Then you create the file.

file.open(“init.lua”,”w”)

Easy enough, when you’re done you close it.

file.close()

Also easy.. but the bit in the middle – my code above needs wrapping in “file.writeline([[“ and “]])” and that gets messy. See the final code you need to enter into the LUA interpreter.

file.remove("init.lua")
file.open("init.lua","w")
file.writeline([[print("Pete’s LUA module 0.3")]])
file.writeline([[tmr.alarm(4000, 0, function() dofile("thelot.lua") dofile("mylistener.lua") end )]])  
file.close()

In this example it’s not too bad… but it makes the code harder to read. What would be nice would be if Coolterm could spot that you’re in a file and add that info for you. Also what about comments

–this is a comment

or blank lines.. here’s what you might have

— My startup file – this needs loading into LUA

    file.remove("init.lua")
    file.open("init.lua","w")
    file.writeline([[print("Pete’s LUA module 0.3")]])
    file.writeline([[tmr.alarm(4000, 0, function() dofile("thelot.lua") dofile("mylistener.lua") end )]])  
    file.close()

— All done.

So here we are, after struggling for weeks, we now have a nice interpreter for our little boards and we can start to get ambitious – but the tools for sending this to the board arent’ really up to the job and if you’re a Windows person you don’t want to go messing with command line stuff.

SO I wrote this little serial terminal specially for the job – to make life easier for myself. It started off simple enough but like all things I got ambitious. The terminal will now take your code, strip out leading and trailing spaces, strip out comments, it will add delays between each line to make sure the LUA interpreter doesn’t get overloaded, it will spot that you planned to send stuff as files and will add the relevant code.

So this is what you send.

— My startup file – this needs loading into LUA

    file.remove("init.lua")
    file.open("init.lua","w")
    print("Pete’s LUA module 0.3")
    tmr.alarm(4000, 0, function() dofile("thelot.lua") dofile("mylistener.lua") end
    file.close()

— All done.

That’s a bit neater.. and this is what will actually appear in the window showing feedback from the board.

file.remove("init.lua")
> file.open("init.lua","w")
> file.writeline([[print "Pete’s LUA module 0.4"]])
> file.writeline([[tmr.alarm(4000, 0, function() dofile("thelot.lua") dofile("mylistener.lua") end )]])
> file.close()
>

And that, is that. The installation files are below, no source code, no support and no I’m not spying on you… I wrote this for me and will develop it as the need to do so arises. Works on Windows 7 and 8 is all I can tell you.

Here’s a screenshot

Esp8266 Lua Terminal

And here is a link to the zip file – unzip somewhere – run install . Enjoy. Note this will NOT work on XP as apparently said operating system does not support .NET 4.5 – sorry.

Incidentally you RUN files – i.e. make the Interpreter load up the code with the “dofile” function. For example dofile(“init.lua”) – in the case of this particular file you don’t have to worry as it will automatically be loaded on power up). All of this is detailed with the LUA interpreter.

Of course, you don’t need to be using LUA to enjoy this – you could be using the AT demo… or something else – but I wrote it to help with LUA programming.  Did I miss some really neat, simple feature?

Update – I’ve added tooltips, turned the format on by default, replaced the original simple automcomplete with a new version with most of the AT commands and some Lua commands all in there and put a check in for opening a dead port. Also added Arduino mode (to reset Arduinos as does their internal IDE serial monitor) and more.

Photo Editing

Pete - alteredMorning all. For those of you who like to play with photo manipulation, you may well have come across Gimp. If you haven’t, that might be because you can afford Photoshop and it’s updates and that’s fine – but if not I suggest you take a look. I suggest you go straight to the site rather than searching for gimp which could return some surprising results.

I’ve used Gimp for years and it is very powerful but updates seem to be few and far between so I was delighted this morning while perusing Google+ to come across this link for G’MIC which is trivial to install and adds a whole boatload of filters to Gimp. I did note that the 3D options killed Gimp but the rest seem fine and there are SO MANY options, enough to keep the budding artist busy for hours if not days.

Why the NHS needs Reform

We’re constantly told about being more efficient – and minimising un-necessary use of fossil fuels, yes?

Well, with that in mind, many weeks ago – I think in September I made an appointment to have a small bump removed from my finger – apparently something caused by bone wear and tear – not painful but REALLY awkward, embarrassing and prone to catching on things. I went to see my doctor who gave me a date a few days later – I agreed and she booked me into the local hospital. I went there a few days later and was checked out, given an MRSA test, photographed and X-rayed – and a few days after that, the bump was removed. How efficient is that?

No, just kidding. My doctor told me I’d have to wait until November (which was a while off at the time) for the local hospital but kindly offered to speed the job up by sending me to Washington (the UK version) hospital.  I agreed for the sake of getting it out of the way.

A 72 mile round trip, I headed off a week or so later to the hospital and saw the doctor – who arranged for an instant X-ray and told me he could not operate until November – completely defeating the object of travelling all the way to Washington. I cooperated as it was now too late to mess them about.

On the way out they said I’d have to come back in to have a photo of my finger taken… but not now!

Another 73 miles round trip a guy took a photo of my finger in ordinary light with an ordinary camera – the kind of thing I could have done at home with my mobile phone and emailed – or indeed the doctor or better yet the X-ray technician could have done that on my first trip while in the X-ray room!!

As the operation was nearing,  I got a call to say I could NOT come in for the operation before I’d had a test for MRSA. More time passed and another 72 miles round trip and that was over – and MAYBE they would have the results in time for my mid-day surgery that week, if not I would have to wait around for a while (not that anyone asked if this affected my job).

You just don’t GET any less efficient than this – nearly 300 miles of fossil fuels and the most convoluted business practice you can imagine! This is how the NHS operates today. Nothing wrong with the skills of the people I’ve met OR the politeness OR the hospital – but their organisation skills STINK. You don’t SEE the cost to the UK because the NHS will only record THEIR costs. By the time I was finished, I’d used 9 gallons or so of petrol and lost what, 2 days of productive hours? – all this for a tiny operation.

Now I will end this on a positive note, the service other than the efficiency was excellent, the people friendly, the operation done well. I arrived for my 1.10pm appointment a few minutes early and was seen almost immediately. An hour later I was out of the door with a bandage on my finger after something like 40 minutes of hacking or whatever the doctor did (I didn’t watch). Good people, good kit, good service but someone needs to sit down and consider the overall costs, not just theirs – that could have been handled in 2 visits.

Days later the finger is still bandaged to let the stitching heal, feels good, no surprises, I reckon the weekend will see the bandage off. Lovely.

Sunny Cornwall

Cornwall

tmpAFFAI created the above imagery at the start of our trip to Cornwall, hoping that really, the umbrella would not be needed. Sadly it was.

Not so much rain but it was foggy throughout the ENTIRE trip. Click on any of the images in here for a larger version.

British MuseumWe started our journey from home, travelling down the A1M etc all the way down to London where we parked up at Heathrow where we were meeting Maureen’s brother. We spent a couple of days walking around the usual tourist traps as you do.

Maureen always likes to go see the mummies and so we started our tour at the British Museum – always pleasant.

We took Andy on the underground from place to place on Friday and Saturday and then he went off to the states and we started our car drive down to Cornwall – and that was the last we saw of the sun.

tmp623BI have to say, there were some great things down there, the Eden Project is worth spending several hours examining – it is MASSIVE and very impressive – but overall I can’t say as I was too impressed by Cornwall, most likely due to the weather.

Once in Cornwall, staying at a pleasant little cottage, we met our friends and neighbours from Spain and drove around – Monday night we were horrified to find that nearly everything was closed and ended up in a particularly greasy-spoon Chinese cafe as it was the only thing other than a pub that we could find open – very disappointing.

Route 38Not untypical of our experience we popped into the “Route 38” restaurant for breakfast. Looking as it does (see photo) we expected an American style breakfast.

Well, we didn’t get it – the place looked the part inside and the menu looked very American – but no corned beef, the bacon was that Aldi-style stuff that refuses to cook properly, the Maple syrup wasn’t or at least didn’t taste like the real thing – and on and on. Of course the “Route 38” actually referred to the A38 but there was no mistaking they were trying to give the impression of an American diner. We won’t be back there again.

Eden ProjectWe took our friends to the Eden Project, a very worthwhile experience and quite a walk – and after that we parted as they had to get back to work.

We had 2 days left and decided that as the weather was so atrocious we’d spend a day around Cornwall and then head up north, not far off Manchester for our last night. Overall a pleasant break but one I think might have been better placed in maybe July or August.

 

Portsmouth

Down at the South Coast

Eden Project

The Benefits of a Mobile Access Point

It could be argued that with modern Android phones offering to act as WIFI access points, there is no longer a need for the likes of the THREE WIFI pocket Access points, the successor to “WIFI dongles”.

three access pointMine has been sitting in my case doing nothing for the better part of a year and it is only by chance that I’ve never handed it back. I use my phone as an access point and that generally works well for my laptop and tablet.

But this week, all of that changed. We’re having a week off for the school holidays and my wife Maureen and I are in Cornwall, staying in a little cottage.  When we got here, the promised WIFI never padded out.

The building was split in two with the owners in one half and us in the other. The access point was in their half and the walls were just too much for the connection – in addition they have a limited connection and asked that we take it easy – that is just NOT what either of us do as we have so many gadgets that need WIFI for updates, browsing, email, watching video etc.

In addition we had friends with us both of whom spend much of their spare time on the web – such is the modern world. 

To make things worse, I’d just installed some cloud software on the phone which wanted to back up all 8,000 photos from the phone to the cloud – not to mention the usual numerous updates of Apps and laptop programs and operating system.

A part-time next-door WIFI was just not going to do it.

My first line of attack was to use my phone as an access point – after all it has 4G and I have an unlimited use contract with 3. Well, that option vanished as I realised I had almost no signal.

It was at this point I realised I still had the dongle-type unit in my bag, a black THREE-based unit able to share a 3G connection with several devices/ people at once. I switched it on and… nothing – months of lying around and the battery was utterly flat – but within 10 minutes of charging it had enough power to run and I was delighted to find FULL SIGNAL.

Unlike phones these gadgets are designed for no other purpose than to take in a 3G signal and re-broadcast as WIFI… and they do it very well, In addition I could stick it in a window for best signal. The unit gave access throughput the tiny cottage without any problems for the week, left charging 24-7 and requiring a reboot only once in the process (most likely due to too many gadgets trying to access it).

If I don’t use this again for a while, the unit has well and truly earned it’s keep. The weather down here has been and continues to be ATTROCIOUS and so we’ve spent slightly more time indoors than we expected. The continuous, high speed, reliable connection has been more than welcome.

The camera never Lies, or does it?

I should stress at the beginning that I am neither a doctor nor an optician so if I use the wrong terms, consider the source.

I have however been fascinated by photography since getting my first SLR in my very early teens. That was followed by a few years of getting my hands covered in chemicals as I learned how it all worked. The move to digital was a no-brainer but offers so many possibilities.

They say “the camera never lies”.

There is a world of difference between the camera and your eye and I will use that to challenge the above statement (ignoring of course the wider truth that some “CGI” is now indistinguishable from reality – and if you still believe that CGI is not “real” take a look at this stunning piece of video – the first few seconds defy believe).

When a camera takes a picture, let’s say outside in the brilliant sunlight (clearly not in the Northeast of England) with some trees and dark shadows, it records faithfully what it can… and therein lies the rub – “what it can”.

The camera stores images in digital memory. It stores 3 colours – red, green and blue and it stores them with a limited dynamic range – that is, the range from the lowest brilliance to the highest brilliance and that is FAR from complete. Technically there are only so many digital “bits” and so only so many “levels” of any of the colours – the range is just not wide enough for reality – and it would not make any difference if it was – because your screens you view the images on are ALSO not capable of reproducing the brilliance of sunlight.

So I will firstly argue that the camera DOES lie in that it does not show you the complete range from the darkest shadow to the brilliant sunlight.

That is the first issue with “normal” photos and though there are ways to improve this (RAW images contain more bits-per-pixel than JPG – and HDR photos take multiple exposures to try to “cluge” a wide dynamic range picture) the result is often beautiful and WELL worth pursuing but far from perfect and the mechanism (as described above) for displaying the image is also far from perfect as it, too is unable to display the brilliance of sunlight down to the darkness of the deepest shadows (we’re ignoring the fact that the image is flat rather than 3D – that’s a WHOLE other discussion).

But this is only the beginning.  When you use your EYES to look at a similar scene of high contrast, your eyes and brain cheat in many ways, NONE of which are replicated by the camera.

a) You see a combination of the truth and what you expect to see. That is why people sometimes see “ghosts” – if we are not sure what it is we’re looking at – the brain desperately tries to create sense out of disorder.  There is a video out there that demonstrates this.

b) The individual sensors in your eyes can selectively desensitise to give you a non-linear image of wider dynamic range than a camera would manage. i.e. areas of strong light are suppressed over time – dark areas are magnified – one would guess the history of this is – if you spotted the animal in the shadows that was coming to get you – you survived.

When you look at an image on a screen, your eyes do not work the same way that they do when looking at real life – because the screen image does not have the dynamic range from dark to light to trigger the same responses in the cells.

Don’t believe me? Do you squint when you see a photo of bright sunlight? No. If you look at a photo of darkness will more detail emerge from that photo the longer you look at it? No.

Beautiful piece by Matthew Sullivan in HDRSo when someone comes along with a beautiful HDR photo and the photographic “experts” complain about HDR not being “pure” it reminds me of the people who say that valves are best (generalisation – the old ways are best) – I find myself smiling.

I take photos with the best equipment I care to carry around (more often that not a modern Android phone) and I often use photo tools to render those images to as near as what I THOUGHT I saw or I WANTED to remember and that, at the end of the day is what matters – unless of course you’re selling the images and even then – the image on the right is nothing like reality – but it would still look lovely on a wall. A “pure” photo can never reproduce reality exactly – so treat the camera as an artistic tool and enjoy.

A note for Android lovers… “Camera FV-5” app promises RAW format images. If you have something like a modern Samsung or similar phone with high grade camera – you’re in for a treat! RAW will allow a greater range of post-editing as there is more information to start with.

Pete.

Life

Peter Scargill in SpainSince coming back from Galera in Spain in the summer, life has been hectic – Maureen went back to school for a while, was recently off again but is now back in action. Hollyberry Cottage has been packed but we managed one day to get some essential maintenance in. I’ve been to Brussels for meetings and managed to fit in a trip to the Mini-Europe, I’ve been back and forth to Blackpool for FSB meetings, visited Jodrell Bank, been on a cruise just off Guernsey and next week we’re taking a short trip to Cornwall to go see the Eden Project, something we’ve been meaning to do for years but somehow never gotten around to it. We will of course post pics in here and on Facebook – I’m just hoping we get something remotely like decent weather.

The rest of the time has been filled with day to day emails and phone calls. I’m sitting here surrounded by new technology, trying to get a little WIFI board working and my friend Jonathan has brought me a wonderful tiny blue display which we’re considering right now to be a wonderful idea like the laser was – magical product but what can you do with it – well we certainly found plenty of uses for the laser!

Of course no blog entry is complete without a decent size photo – so here’s a picture of breakfast at a wonderful little cafe in Bellingham – good healthy stuff.

Breakfast at a cafe in Bellingham, Northumberland

ESP8266 WIFI Miracle Board

tmp64FI’m currently working with a miraculous little board called the #ESPN8266 from #ESPRESSIF which could revolutionise low cost side of the “Internet of Things”… essentially a tiny circuit board that allows low cost control systems to interact with the Internet via WIFI in the way your phone does – but it’s WAY too technical for this blog I fear so anyone interested might head on over to my tech blog.

The idea of WIFI controlled gadgets is nothing new of course but for the first time this can now be done extremely cheaply. If you’re interested, head on over to the blog.