Monthly Archives: July 2015

UPS in Spain

UPS are SO never getting my business again


Update 14/10/2015

Absolutely predictably, after promising delivery today – UPS have once again marked the tracking system as “incorrect address” and given up. I keep sending them simple Google map links and they keep writing back to say they cannot read them – how can you not read a link to Google MAPS!!!???!?!?

Update 12/10/2015

Here we go again… despite telling every supplier NOT to use UPS, I’ve just received an email from UPS to say there is a parcel arriving tomorrow from China – or is it Wednesday?

So the email clearly states

Scheduled Delivery Date:

Tuesday, 13/10/2015

Estimated Delivery Time:

End Of Day

There you go – you don’t get any clearer than that – except that it ALSO gives a tracking number. Hopping over to the website – the tracking page says…

Scheduled Delivery:

Wednesday, 14/10/2015, By End of Day

Of course – none of that is important because based on past history – tomorrow afternoon the tracking page will say that the address is wrong (I’ve sent them a map) and that they will try the next day…. and the next… 

Well, one could be optimistic and say “third time lucky?”  – I’m not getting too excited. More info later.


Update 20/09/2015

As some of you know, in July 2015 I was invited by Espressif to MIT in Boston, USA  to be involved with their  microprocessor product and how to use it. This small microprocessor has lots of uses and I’ve been independently blogging about the subject for some time – with some success judging by the numbers in here.

I was trying to think of something visually appealing to show people and it occurred to me that as I had written some software for serial LEDS to simulate a CLOCK, it would be nice to actually take a very bright CIRCLE of these LEDs with me – and the software and a little board so that people could visualise a nice use for the chip.

This presented me with a problem – I was moving to Spain for the summer and needed a quick fix. A Chinese company sold a LED ring for £11 which was reasonable – but it would take 2-4 weeks to deliver the little product to me. So I asked them to ship it via courier. They chose UPS. Bear in mind, while reading this the cost of the product – £11 or maybe 16 Euros.

So all in Euros – the product cost around 15.57 Euros. The postage cost 22.62 Euros – that’s a total of 38.21 Euros inc delivery. YES that’s a LOT for delivery – but I was in a hurry. Normally that kind of stuff chips from China for free.

It would seem that when charging VAT, UPS charge VAT on not only the product but the delivery – which seems UTTERLY ridiculous to me – but that’s life – so at 21% that would be what, around 8 EUROS?

The first time I realised something was up – was when UPS contacted the Chinese supplier for 17.20 Euros extra, bad enough after accepting a delivery job, but then it got worse – MUCH worse. Now, remember they have already contacted the SUPPLIER for more money. It turns out they also recommended he up the value of the package… reading the previous paragraph makes me wonder…

Where we live in Spain, Google maps had at the time, not caught up and the address did not show up on the maps. So I made sure that UPS had the address of a business in the village of Galera where we live (a mere 6 minutes by car from the significant main road into town and the map showed a clear path) – The people at that address speak English and Spanish – so I figured they could give directions to our place. How naive can you get.

So I missed a call from Spanish Inland Properties – UPS had called and wanted – wait for it – 38 Euros extra – half VAT, half “brokerage fee”. As Spanish Inland could not contact me they quite rightly refused  the package. It was never intended that the delivery would be to that address but the driver clearly thought it was appropriate – it would seem talking to  others in the village that this is “normal” and they put up with this poor service. Several villagers have now said “we pick stuff up from Spanish Inland Properties as the delivery companies can’t be bothered to deliver to our places”.

This seems to be acceptable for some and if it works for them that’s fine – but we’re not getting discount for laziness here so I decided to tackle this. The postman in the village has NO problems delivering to our place – a mere 6 minutes from the main road into the village. He delivers stuff from all over the world to me no problem.

I provided UPS with photos, coordinates and even a direct Google link as by this time Google had added our place to the maps. Every now and then I would see revised instructions on the tracking note – but none of my information was passed on to them – it always came out as it I had changed the delivery address or that it was wrong – neither being correct.

I had a promise of delivery a week later – nothing – then another written promise of delivery days later  – nothing.

Meanwhile because UPS systems don’t like my address – when I filled in a form on the web to provide more info – it would never complete.  I then receive a letter from “UPS MY CHOICE” – typical American-style bull letter to make me feel welcome – instructions – access code – the lot – I filled it all in on the website – lovely. But the very first time I tried to make ANY change, provide ANY information – this was refused as first I have to go to the user area which is not where the web form suggests (but I found it anyway) to update my info – which it will not accept. Back to square one.

On the UPS website I entered the tracking number – there is an option to add a description – so I pasted in the Google URL I made to show the directions… nothing – the ADD button did nothing – clearly intended for short, sharp responses and nothing else – but badly designed as no error message. The only option was to cancel. I could not find a way on the site even to tell UPS to put this off for another day so I could HAVE A LIFE. If you try to contact UPS – you are forced down a narrow range of operations – the nearest I could get was “receiving a package” – ” InfoNotice Number” – and …. nothing – I could not  get any further in contacting them. For someone having a problem – the UPS website isn’t worth a light.

Anyway, several days after I was actually expecting the parcel and far too late for my trip which had come and gone, I had just about given up when… the van arrived – as it happens we’d left the house but we stopped the car just outside – sure enough  38 Euros had to be paid. So AT LEAST I proved one thing – if you stand up for what’s right – it appeared at the time that they COULD deliver to the door – not without a fight and with charges that bore no relationship to the cost of the product.

So now you, dear reader, now know what to expect from UPS in rural Spain – others have already warned me – terms generally seem to focus on the word “rubbish”. Another reader has warned that he too has been subject to “brokerage fees” totalling twice the value of the product… and he won’t touch UPS.

I then wrote and asked for an explanation as to WHY they charged me 30 Euros more than the VAT and why they also charged or tried to charge the SUPPLIER more.

A letter came back  – the VAT was the supplier’s fault – for reasons WELL beyond me – on advice from UPS , he had declared a value more than twice the actual value of the goods, on the package. Why would ANYONE want to do that. But that only accounts for HALF of the ridiculous price – the rest came from “Brokerage charges” – Now I have to say, in my 60+ years I’ve not come across this in the UK – maybe I’ve just been lucky – but check this bunch of nonsense out – on the link, scroll down to “brokerage charges” –

It seemed there were a couple of lessons here… (a) make sure your supplier UNDERSTATES the value of goods, (b) Avoid UPS – but mainly, when buying from China – avoid couriers altogether and stick with simple airmail. It may be slower but in my experience it is reliable and there are NO charges – indeed on small packages there isn’t even any VAT (and up to now that applies to both Spain and the UK).

And that was that – at least the parcel arrrived, they now knew my address. FAST FORWARD to September 2015. I’d bought a watch – a smart watch, from America and it did well for a while but got some water damage. They said no problem – we’ll ship you another straight away – you’ll have it in days.

And they chose… UPS. Too late to stop them.

On time the supplier sent me a tracking number – and the parcel would arrive Wednesday. I made sure they had the map link, that they sent the map link to UPS and I sent a copy to the guy I’d previously spoken to at UPS in Spain. What could go wrong.  Eventually the tracking info updated and sure enough – LATE WEDNESDAY ARRIVAL. We were off to the coast for a couple of days (Thurs Fri) so I let everyone know. Early Wednesday afternoon – “Incorrect address” – I could not believe my eyes.

I immediately wrote to everyone involved and ensured they knew that 1. My address was correct and 2. I was NOT going to be around on Thursday or Friday.

Sure enough nothing happened on Wednesday – I sent a stream of correspondence off and we went off on our trip to the coast, with a confirmation from UPS that they’d try again Monday.

Friday, an email came in on my phone – UPS have DELIVERED YOUR PACKAGE.  The address was nonsense – 2 letters – and the delivery was to “SOAN L” – not only was the address rubbish – but who on EARTH was “SOAN L” – didn’t really even sound Spanish and it certainly wasn’t English.

So after screwing up the Wednesday delivery, they sent the package on the WRONG day to the WRONG place to the WRONG person.

As it turns out – they’d just resorted to form – and delivered the package to …. Spanish Inland Properties – “SEAN L” – the very helpful chap there and on Saturday I picked up the replacement watch from him.  They simply could not give a SHIT about customer requirements.

All’s well that ends well, but now I feel it is my duty to warn everyone, everywhere – DO NOT USE UPS IN SPAIN AS THEY ARE COMPLETE RUBBISH.



Just a quick note – as a few of you have said you’ve had issues flashing ESP boards and some have worked then not worked etc… ensure you use the relevant pull ups and pull downs and the right voltages.  As you know I do a LOT of work with ESP-01, ESP-12, ESP-12E and I can say I have NEVER broken one!  So look for other problems than broken FLASH I suggest??


ESP8266 Reliability and ID

Questions for you C programming ESP8266 guys re: the ESP SDK (1.2.0) and some possibly important info on WIFI and MQTT reliability.

In the SDK:



HOST ID….  If you do an IP scan on a windows network – ESP units will coming up as IP addresses – and Manufacturer ESPRESSIF…   there is a WIFI HOSTNAME GET function in the SDK –  but not only can I NOT get it to do anything, the corresponding GET function returns something like ESP_945645  – and not what I put in and NEITHER are showing up in the Windows IP scan – so the question is… where are you supposed to use the SET function in the SDK to replace the info that comes out of the GET function – and why isn’t any of this showing up on a Windows scan.


I discovered that if our software was running happily on the ESP12, happily talking to MQTT, if I then disconnected the WIFI and router for a few secs and reconnected…… DEAD. The board would respond to serial but it had LOST the WIFI number.

No amount of waiting would fix this – I wonder how many people have NOT twigged to this – well, if not – this could be your lucky day. The reconnect policy set to 1 will ensure that within a few minutes, the IP will reconnect.. and of course you can CHECK this!!!

So the next step was to see if the IP had been reconnected and call the MQTT reconnect routine – after all, you’ve lost all your MQTT subscribes at that point.

Then it occurred to me – there might be other circumstances – the NODE-RED might have gone off for a while – could I be sure I’d still have a connection – so finally we set Node-Red off sending a “heartbeat” message to all of the units (by missing off the unit name and just having a topic of “toesp” on our boards, you send to all) every minute – and that resets a timer – so then in the above routines – if the WIFI is active and the timer has timed out – once again reconnect to MQTT.  I checked the stack and this does not suffer – so fingers crossed that will be just fine for the odd occasion that this is needed.

Hence reconnect without rebooting and all the horrible relay flicking results of that!!!  I’m quite happy – a beer, I think. The repository is updated and I have boards testing now.

If you are using MQTT and C on your ESP8266 boards, you might just want to ponder the above and if you have an answer for my query at the top, please do let me know.


Hackitt and Bodgitt discover Healthy Lighting

Hackitt and BodgittThere has been a lot of talk in the press recently about the colour of lighting and it’s relevance to health.

As far back as 2012, the BBC reported that NASA were to test “space-sleep colour-changing lights” on the international space station and since then there have been a number of articles in the press suggesting that the colour of light at certain times of the day can affect everything from sleep to prostate cancer.

Of course newspapers have also claimed at one time or another that aliens landed on the moon but there is a certain amount of obvious logic in selecting the right colour for the right time of day. Everyone knows that due to atmospheric filtering, the sun appears shifted toward red at night – and it is quite feasible that our bodies respond to those colour changes. No, I don’t follow my star signs!!

KelvinRecently the papers were full of the news (as it there’s nothing more important going on in the world) that our lighting and our various devices such as tablets can affect our sleep and that you should avoid blue light in the evening and that light shifted toward blue in the morning can aid waking up etc. I subsequently found, thanks to readers, a boatload of APPs that do this colour shifting on phones – not a lot of use when you’re trying to take a photo and you’re mobile has gone all red, but probably a good idea when you’re trying to read yourself to sleep.

And with that in mind I set off trawling the web for more information and finally ended up with a set of RGB values which match “colour temperature” in degrees Kelvin. Now I would not be one to claim 100% accuracy here because for that to work with modern LEDs you’d have to be assured that the RGB values you poked into the LEDs would render accurate colours and I doubt very much that this is the case.  However, I’m going to suggest that what I’ve done here is “near enough”.

In our “Hackitt and Bodgitt” board described in the blog article “Home Control 2015” I’ve added a new command to provide white light from RGB LEDs which can be “shifted” by providing a value in degrees Kelvin from 1,000K (very orange-ish) to 40,000K (very blue-ish).  At 6400K you have a perfect representation of the more garish compact Fluorescent lighting and at 1,100K you have a pretty good match for dim candle-light – with all the subtle variations in between.

Hence with a simple command to alter the hue of white lighting, in our case initiated no doubt in a node-red command, we gain the ability to alter the lighting to the time of day.  Now, WHY would you use more expensive RGB lighting as against simple WHITE LED strip in your home of the future? I have a theory about white LEDs and it’s a theory increasingly backed up by anecdotal evidence that white LEDs don’t last as long as some manufacturers might have you believe. RGB LEDs on the other hand don’t seem to have that problem and have the benefit (we’re talking about modern integrated LED, not separate red, green and blue LEDs) of allowing just about any shade of any colour and in this case, any shade of “white”.

I doubt very much that due to this new lighting interest you’ll read “Peter Scargill becomes the first person to live to 150” but you never know, it might just be an aid to better sleeping and that has to be a good thing.


Espressif SDK 1.2.0

smileyJust today a new release of the SDK from Espressif along with a patch.   I note they have brought back the watchdog controls. Tried it on our code and up to now it’s absolutely fine. Still no sign of the PWM_STOP() function I’m waiting for however.

There is a one-liner remark about memory optimisation. I can’t swear to it but I’m fairly sure I noted a marked drop in the amount of RAM used… the limiting factor for me for a while has been .text space and that was as high as 0x7c00 at one point – a bit of a worry as it only goes up to 0x8000. However between finally getting different types of array into FLASH and the updates I’m now down to 0x744e which is a lot more healthy! See the Espressif forum (downloads) for a complete list of changes.


Fab-Fest Boston August

At the start of August I will be a guest of Espressif at the 11th Fab Lab Conference and Symposium in Boston.  Espressif have asked me to do a 30 minute session talking about what we’ve been doing with the ESP8266 (which, as regular readers will know is quite a lot!) and our experiences.

Many of you have written to me about your products and ideas and so it occurred to me that this is a good time to catch up with the very latest. If you have something new you want to let me know about – drop me a direct email at pete at scargill dot org (sorry about that  – just trying to avoid robots here) and bring me up to speed. Clock is ticking…


The Plan

So here’s the plan… in my home control article I pretty much tell you what we’ve done with our ESP-12 boards – we’re expecting one with no mistakes arriving this week – artwork is in the blog – I’ll confirm once we’ve tested it that there are no sillies. The code is on the web and linked to from the home control article though we do need to do some more explanation and that will happen soon.  These boards are at their best talking to MQTT and Node-Red and the next step is to start a series of articles on how to get this up and running. We’re planning to release a script that should make setup on Debian quite simple and then to continue the series tackling the various aspects of control and monitoring. I’m in the process of preparing for a summer in Spain which is why not a lot new here (though some GREAT comments coming through) but this weekend coming we should be starting to put something together.



Accessing ESP8266 Arrays in FLASH

A new challenge – the answer to which I will post in here.

Accessing an ESP8266 C array in FLASH – i.e. never touching RAM until you actually access something.  One suggestion was to ensure you use 4-byte variables.. so I tried this – it compiled – the array is in FLASH – but the access IMMEDIATELY reboots the ESP8266. iprintf is just a macro for printf – no issues there..

static const uint32_t petes[] ICACHE_RODATA_ATTR = {

iprintf is just a macro for a normal printf function…

iprintf(“Data= %ld”,petes[37]);

Result: Immediate reboot….

Thoughts anyone? Why do we need this? Because FLASH is in plentiful supply on these boards, RAM is not.  Ok, you could use tricks from the web page lookup and make functions – but that involves knowing exact addresses etc.. If possible I’d rather let the compiler worry about that.

I’ve posted this on the Espressif forum – I’ll post a working solution in here – but I’m out of ideas….


Pebble Time

imageJust a slight diversion to tell you about my new Pebble Time watch.  Pebble as you may be aware brought out a Kickstarter project some time ago which did well, a watch based on the same technology used in the Kindles – a black and white display that uses no power when standing by and works in direct sunlight. Well, they’ve done it again and this time it is in full colour.

The technology means that not only can you read the watch in bright sunlight – but the battery should last a week. Mine arrived this morning with 50% battery charge and by midnight was down to 40% so that sounds not far off.

There are many Apps for it (quite a few of which are naff but it is early days), particularly if you have an Android phone and the watch interacts by low-power Bluetooth with your phone to get notifications, setup and more.  Of particular interest to me, one app lets you set up and use screen controls which send off URLS – which of course can then be used to control things. Sadly there isn’t an MQTT app yet but give it time! There are apps for several home control systems however so it is worth a look. I just could not stomach the idea of charging a watch every day but once a week – sure. The watch comes complete with magnetic charge USB lead.

I bought the white one.