Revitalising a Google Nexus 5 – solving battery drain problems

nexus-5-gekkoI’ve owned a Google Nexus 5 phone for just shy of 2 years now (wow, I didn’t realise it had been that long!) and I can honestly say it’s the best phone I’ve ever had – the screen is a good size (5″) but not too big, it’s got plenty of storage (32GB) and is very responsive. I had the Nexus 4 16GB prior to this, and that was a very good phone too, but the Nexus 5 is better in all departments.

However, over the last 3 or 4 months I noticed that the battery was draining more quickly as the day goes on, to the point that I was having to charge it in the afternoon if it was to last me all the way home from work. Not good.

Checking the battery usage stats didn’t reveal any obvious rogue apps draining the battery so I put the situation down to the fact that the battery must have been deteriorating, so I bought a replacement battery and fitted it (using an iFixit guide) in the hope that it would restore the previous battery life. Unfortunately replacing the battery didn’t seem to make much difference at all.

I’d more or less resigned myself to the fact that I’d need to upgrade to a later phone (possibly the Nexus 5X) when I wondered if it would be worth trying one last thing – a factory reset. It was a bit of a long shot but I figured that there might be something nasty left over from the several successive Android updates that had been applied and by performing a full factory reset it might clear out some rubbish.

After backing up apps and data, including using the excellent SMS Backup & Restore app to backup text messages to both Dropbox and Google Drive I carried out a factory reset. This took a fair bit longer than expected (around 45 minutes) but once completed I rebooted the phone and proceeded through the initial setup again. I then restored the main apps I actually use – taking the opportunity to get rid of all those I hardly ever open – along with my text messages.

Nexus 5 Rejuvinated!

After charging the phone overnight I was eager to see what, if any, difference it had made… and to my delight I found that battery drain throughout the following day was nowhere near what it was prior to the factory reset. Whereas I would previously have been looking at only 30% battery capacity in late afternoon, I was surprised to see a significantly improved 80% left. Repeating the same test the following day saw very similar results, so it is looking very promising so far.

So, if you too are experiencing very poor battery life on your Nexus 5 running the latest versions of Android, I would seriously recommend considering performing a factory reset.

Update – 23/12/15

It’s been a few days since performing the factory reset and I’m very happy to report that battery performance continues to be amazing! A couple of friends of mine who were also experiencing very similar battery drain problems have also carried out the same factory reset and they too report results consistent with mine. So get doing a factory reset on your Nexus 5 if you are experiencing battery drain problems!

Energy efficiency and saving money with LED lighting

As readers of my previous blog posts may know, I’m all for being energy efficient – primarily because of the savings that come with using less energy more than anything else! We’ve got a ground source heat pump as our sole source of heating and hot water, accompanied by a 4kW solar PV array; the newer barn conversion part of our house uses modern insulating materials and has underfloor heating throughout; and the loft space in the original slate roof barn conversion part of the house has been beefed up to 300mm of Knauf Earthwool insulation.

Although we’ve improved energy efficiency and made considerable savings by doing all of the above (we now use around 30% less electricity compared with previous years) one area that was still a large drain on electricity was lighting. Most of the lighting in our house still uses either classic incandescent bulbs or the newer slightly more efficient eco halogen bulbs. We do have some LED lighting, for example in the architectural spot lights illuminating the timber frame roof in the thatched barn conversion, garden patio lighting and kitchen under-shelf lighting. I also recently replaced the two 100W globe bulbs in the large Original BTC Titan metal pendant lights in the kitchen with Megaman 18W globe bulbs which will add to the overall savings. However, the bulk of the lighting is still old technology.

Most of the remaining lights in the house are exposed metal dimmable wall lights with visible shadeless 60W candle bulbs. The fact that they are dimmable 60W candle bulbs has meant that I have struggled to find suitable LED replacements… until now.

Enter Megaman…

megaman-7w-ledHaving been impressed with the Megaman LED bulbs bought so far and also by their good reputation, I decided to try a couple of their 7W dimmable warm white 400 lumen candle bulbs (model number LC0607dv2-B22-2800K). Even though these are marketed as equivalent to 35W non LED bulbs I was pleasantly surprised to find that they were nearer to the existing 60W bulbs than I had expected at full brightness.

Older style leading-edge dimmer switches don’t work well with LED bulbs so after a bit of research I decided to upgrade our existing switches with Varlight V-Pro replacements. These are recognised as being quality dimmers and are even recommended by Megaman themselves. The switches are also configurable so you can switch between 2 or 3 different trailing-edge / leading-edge modes and can also set the minimum and maximum brightness levels – clever stuff!

After trialling these bulbs and dimmer switches in one location I was happy enough with the results to bite the bullet and upgrade two rooms – a total of 10 bulbs and 2 dimmers, at a cost of around £170.

The results

So, let’s look at some electricity usage and cost savings as a result of this upgrade.

Taking one of the upgraded rooms which has 6 bulbs, and assuming that the lights are on for an average of 5 hours a day, 365 days a year and our electricity charge is 12p/kWh:

Using 60W incandescent bulbs we would use 365 x 5 x 6 x 0.06 kWh of electricity = 657 kWh = £78.84 per year

Using 7W LED bulbs we would use 365 x 5 x 6 x 0.007 kWh of electricity = 77 kWh = £9.24 per year

So, in just one room we can making a saving of over £69 a year!

It might not sound a lot, but when you apply the same upgrade to further rooms the savings start adding up. And it’s also worth bearing in mind that the life of quality LED bulbs should far exceed that of incandescent or eco halogen bulbs.


Thunderbird 38.1.0 unresponsive on MacBook Pro OS X Yosemite

I’ve used Mozilla Thunderbird as my desktop mail client of choice for years, switching from Microsoft Outlook because of its initially poor support for IMAP after I first switched from a POP3 to IMAP model for all my locally hosted mail accounts.

I’ve never really had many problems with automatic Thunderbird updates in the past, but the recent Thunderbird version 38.1.0 update caused me some major problems.

One of these was that it broke SSL connectivity to my Courier IMAP SSL service across all platforms – OS X and Windows. After a lot of digging I eventually found the cause of the problem was a tightening of security around key lengths and I had to tweak the dhparams.pem file in my Courier installation. This blog post discusses how to do this. After fixing this Thunderbird 38.1.0 was able to connect again over SSL.

The second problem was limited to OS X and this resulted in Thunderbird becoming unresponsive most of the time. Again after a lot of Googling I found that the cause was the Google Birthdays calendar configured in Lightning.After removing this calendar, Thunderbird became responsive again.

Hopefully this info might save someone else some pain if they experience the same problems.

IntelliJ IDEA 14: How to stop stripping of trailing spaces

I’ve recently been using Markdown in conjunction with Metalsmith to create some new static content web sites (more on this in a future post). IntelliJ IDEA, IMHO the world’s best IDE for Java/web/Python/PHP (and many more languages/technologies) supports all the popular web technologies and is a joy to use most of the time.

However, I came across an annoying little problem recently when I noticed that line breaks were missing from my Markdown generated content. Markdown uses 2 trailing spaces on a line to signify that a line break is required, and it transpired that IDEA was stripping these trailing spaces from lines when the Markdown file was saved!

After a bit of a search through the IDEA Editor settings I finally found the offending option buried deep in the Editor / General section:


The default setting is set to strip trailing spaces so simply select “None” here and your Markdown line breaks will remain intact!

Renewable Heating Incentive (RHI) is here

I’ve written previously about my Ground Source Heat Pump (GSHP) and how it would be eligible for the Renewable Heating Incentive (RHI) once launched. Well, after several delays, the RHI was finally launched in early 2014 so I proceeded with making an application.

In case you are not aware of the RHI, it’s a UK Government backed subsidy scheme designed to encourage the up-take of renewable energy sourced systems for heating. This includes technologies such as ground and air source heat pumps, biomass boilers and solar thermal panels. The RHI scheme is similar to the Feed in Tariff (FiT) scheme already in place for solar PV installations in that you receive a tax free, index linked payment every quarter for a period of 7 years (compared with the 25 year period for solar PV FiT) based on the amount of renewable heat you are generating for yourself. When combined with the solar PV FiT payment, this more than covers the cost of installation of the new technology and also will pay for our only fuel source – electricity – for the next few years. For more information about RHI visit the Ofgem site.

Applying for RHI

While the actual RHI application process was relatively straightforward, getting to a point where I could make the application proved to be a bit more complicated…

One pre-requisite for applying for RHI is that you have had a Green Deal assessment carried out to determine the EPC rating for your property i.e. how energy efficient it is and what measures should be considered to improve it’s rating. I had already increased the loft insulation to a depth of 300mm in our relatively small loft space, and with the recent barn conversion utilising modern building techniques and materials our energy efficiency was better than it had been over previous years. As a result, our EPC rating came out as C (70) with an estimated total heating and hot water demand of 25,000kWh per year which wasn’t too bad considering it’s an early 19th century barn conversion.

Heat pump SPF assessment

However, the biggest delay to being able to make the RHI application was down to the desire to have a heat pump performance assessment carried out in an attempt to secure the highest possible RHI benefit rate. The RHI tariff is based on the amount of renewable heat generated, so this has to take into account the efficiency of the heat pump i.e. the more efficient the heat pump is, the greater the ratio of heat generated to electricity used to generate it (to drive the pumps). This efficiency is called the Seasonal Performance Factor (SPF) and the RHI scheme assumes an SPF of 2.5 for all applications for legacy heat pump installations. Now I was pretty sure my heat pump was more efficient than that so I commissioned Ice Energy, the supplier of the heat pump, to carry out a full assessment.

The assessment involved a site visit and survey with lots of measurements of rooms and construction materials taken followed by an office based analysis running the numbers through a spreadsheet. This process took longer than I had hoped and when I finally got the results back, I found that it had been assessed with an SPF of 2.5 – the same as the default! The reason for this was that two radiators in two large open plan connected rooms in the older part of the house were deemed as undersized. So, if I wanted to achieve an SPF of 2.8 I would either have to install additional radiators or replace the existing double panel double convector radiators with larger ones. As space was tight I decided to upgrade these radiators to triple panel triple convector equivalents, a job which I did myself.

Once the new radiators had been installed, Ice Energy issued an updated SPF rating of 2.8 which would increase the annual RHI benefit by around £300 – more than paying for the cost of the heat pump assessment and new radiator installation. With the final agreed SPF rating and Green Deal assessment / EPC I could then make the actual RHI application.

The application took a few days to go through an approval process, but once completed I was informed that my first quarterly payment of £733 would be made in November 2014, with subsequent index-linked payments being made quarterly for the full 7 years. I love my Ground Source Heat Pump!

A month of using my MacBook Pro

It’s been over a month since I got my new MacBook Pro so I thought I’d post a few thoughts on my experience with it so far.

First, I’ve got to say I love it!

It exudes quality in nearly every area.

On the hardware side, the things I love most are:

  • the aluminium unibody construction is rock solid, yet still light
  • the quad core Intel Core i7 processor, 16GB RAM and 512GB flash storage make it fly!
  • the Retina 15″ screen is very high quality and provides plenty of screen real estate to work with. I was concerned about dropping down from a 17″ screen to 15″ but that’s not proved to be a problem at all
  • the trackpad is the best I’ve ever used… very accurate and responsive and when combined with multi-touch gestures takes it to another level
  • battery life has been very good so far (I get home from my 4 hour commute to London and back with around 80% battery left which is fantastic compared with the 20% remaining I used to get from my old HP laptop!)
  • the sleep and instant-on behaviour when closing and opening the lid is great
  • the Magsafe 2 power connector is so quick and easy to connect with its magnetic connection and useful indicator LED showing charging state

On the OS / software side I’ve found working with OS X on a daily, development-oriented basis quite refreshing. The multiple Spaces (desktops) works very well and intuitively with multi-finger trackpad swipes to switch between them. I’m also using the Mission Control (formerly Exposé) feature a lot to see a birds eye view of all applications I have open, and the App Exposé feature to see all windows opened by the current application.

The recent Mac OS X 10.10 Yosemite upgrade looks really nice and makes it even more pleasant to use.

When I’m travelling, I rely on the mobile network connection from my Nexus 5 phone for internet access. With my old Windows laptop I used to use a wifi hotspot on the phone to connect, but on the MacBook I’m using the Bluetooth connection which seems easier and very stable.

The only minor problem I’ve had is that the Moshi iGlaze transparent hard case I fitted for some extra protection started to crack in the corners of the lid cover. This happened just over a month after getting it but Amazon replaced it free of charge when I reported the problem to them. It is a nice case and definitely adds  some valuable protection without detracting from it’s appearance – in fact most people don’t even realise there’s a case on it! – but I think the cracking is a basic design flaw so I’m expecting it to happen again :-(



I can has MacBook Pro?

I’ve finally done it.

After years of owning cheaper, lower quality laptops I’ve decided to go for quality with my next laptop by getting a MacBook Pro.

I’m now the proud owner of a MacBook Pro with 15″ Retina screen, 2.5GHz quad-core Intel i7 CPU, 16GB 1600MHz RAM, 512GB PCIe based flash storage and NVIDIA GeForce GT 750M with 2GB DDR5 memory. And I’m loving it so far. The two things that I’m most impressed about so far are the instant on/off capability, and also the vastly superior battery life.

My old HP Pavillion dv7-3112sa 17.3″ monster running Windows 7 Home Premium has served me well over the last 5 years but no more will I have to heave it out of my bag while doing the long distance commute by train and sink back into my seat in embarrassment as the spotty kid opposite me pulls out a shiny MacBook. Ha!

It’s going to take me a while to get my new OS X based software development environment and workflow set up but I’m sure it will be worth it.

HP N54L Microserver as a desktop PC

If you’ve read any of my previous posts you’ll know I’m a long time fan of the HP Microserver. It’s an extremely versatile little machine that can be used for many different purposes (one of mine is a FreeNAS based NAS, another is a VMware ESXi virtualisation test machine) and with the various cashback schemes that HP has offered throughout its life, it’s worked out to be a very cost effective option.

HP ProLiant N54L Microserver

Although it’s designed as a home/small office server I know many people have used them as desktop PCs. I recently built my parents a basic Windows 7 desktop PC in a day, at very short notice when the main low-power PC they used to run their newsagents died.

I had a spare N54L G7 Microserver from the last HP £100 cashback promotion so I thought I would see how effective it would be as a desktop PC for myself, with a view to it possibly acting as a cheap replacement for my 8 year old Windows XP Pro based PC which I was sure was on its last legs.

This ancient PC had an Athlon 64 X2 dual core 4400+ CPU, 3GB RAM and a single NVIDIA GeForce 7800GT video card and has served me well for all these years. It’s graphics capability has changed somewhat over its life – I used to do a fair amount of flight simming on it using Microsoft Flight Simulator 2004 and FSX… it started out with a single 7800GT card, then a second identical 7800GT was added to form an SLI pair, then both of these were replaced with a single 8800GTS card which eventually blew up and so finally I reverted back to a single 7800GT. When I looked at the benchmarks for the Athlon X2 4400+ CPU and compared these with the dual core Atom in the N54L microserver, the microserver came out more powerful! And modern GPUs are much more poweful than the 7800 so it wouldn’t be difficult to improve the overall specs on a budget.

A basic desktop PC

After installing Windows 7 64-bit to the bundled 250GB hard drive I ended up with a usable desktop PC, albeit with only the stock 2GB RAM and using the on-board VGA-out only graphics and no sound. I then installed a few of my frequently used apps and trialed it for a few weeks.

EVGA GT620 2GB DDR3 graphics card

The machine performed admirably during this initial trial so I then decided to get a dedicated PCI-E graphics card to up the graphical power and also to add sound capability…
For the graphics I decided to go with the reasonably priced EVGA NVIDIA GT620 2GB DDR3 PCE-E graphics card for £42 from Amazon. I’d read reports that the 1GB version of this board had been tested successfully in the microserver so figured that the 2GB version should be almost identical. It’s a low profile card with a large heatsink and small fan so hoped it would fit in the limited space available. When it arrived I was relieved to find that it fit with no problems and worked just fine, increasing the Windows Experience Index for the graphical elements by several notches. You can just hear the fan on-board this card so it does add to the overall noise a little, but I wouldn’t describe it as loud and it’s way quieter than the big old cards in the old PC!

For the sound I opted for a bargain basement Dynavision USB sound adapter for the princely sum of £4.99 from PC World!

I also took the opportunity to swap out the 2GB RAM for 8GB of Kingston non ECC RAM from another of my spare microservers, a move which gave Windows more room to breath.

After these relatively minor upgrades the resulting PC felt very responsive, much more so than my ailing Windows XP Pro machine.

My first SSD

Newertech Adatadrive bracket

I’ve never owned an SSD before and have wanted to give one a try for a long time, so now seemed like the perfect opportunity in an attempt to make this little PC even more responsive. I did plenty of research and decided that the Samsung 840 Pro would be the best fit for this PC. I could probably have got away with a lesser performing drive given that the microserver’s SATA ports are only SATA II 3Gb/s and not SATA III 6Gb/s but I’d read no end of good reviews of these drives so decided that was the one to go for. I deliberated over what size to get but in the end thought that 128GB would not give me much headroom and so went for the 256GB model.

In order that I could mount the SSD in one of the four available drive bays I purchased a NewerTech Adaptadrive SSD to 3.5″ mounting adapter from Ebuyer. This clever little adapter bracket screws to the SSD so that the SATA data / power connectors and drive mounting holes are in the same position as a 3.5″ drive such that it can be mounted directly in the microserver drive bay caddy. This would mean I didn’t have to use up the optical drive bay with the SSD or have to route the eSATA connector back into the case.

Migrating the existing Windows installation

Given that I’d already got a fully tested Windows 7 installation on the 250GB HDD, I used the excellent bundled Samsung Data Migration tool to do a clone of the existing installation onto the SSD. This was very straightforward and took around 20 minutes for the 85GB Windows installation. Once the cloning had completed, I shut down the microserver, removed the 250GB HDD and rebooted, setting the SSD to be the boot drive in the BIOS. On reboot, Windows started as expected and from that point onwards felt even more responsive than before.

In summary

So all things considered, this little experiment has resulted in a very usable and responsive little desktop PC and a more than suitable replacement for my old Windows XP dinosaur.

Summarising good and bad points:


  • Reasonably powerful
  • Good quality construction
  • Small form factor
  • Very quiet
  • Decent spec level (RAM, graphics, SSD)
  • Storage easily expandable (3 remaining HDD bays and eSATA port on rear)


  • External USB sound
  • USB2, not USB3
  • Only 2 x USB on the rear, other 4 x USB are on the front panel
  • Limited expansion possibility (CPU, graphics, RAM up to 16GB)


Tracking down a lost iPod

My daughter lost her 5th gen iPod Touch earlier today :-(

She had been at home all day apart from a short visit to the local doctor’s surgery with my wife. She remembered using the iPod before going to the doctors, but couldn’t remember if she took it with her. So – it was most likely to be somewhere in the house, in the car or left at the doctor’s surgery. However, by the time she realised it was missing, it was past the doctor’s surgery closing time so we couldn’t call them to ask if anyone had found it.

We’d never got round to enabling Find My Phone in the Cloud services on this iPod so that was no use :-(

After a couple of hours of searching the house, garden, car etc. by the whole family, we still couldn’t find it :-(

But then I used a bit of (simple) technological detective work and we managed to locate it safe and well :-)

In the chance that it might help someone else in a similar situation I thought I would share exactly what I did to track it down…

Logical steps…

The first thing we did was to try calling the iPod from another iOS device using FaceTime. We tried this several times and listened for the ring tone each time but this proved fruitless.

Then we tried messaging using iMessage. When we did this, we noticed that each message was given a status of “Delivered”, but not “Read”. This suggested that the iPod was on a network somewhere. Now our doctor’s surgery doesn’t have public WiFi so this meant the iPod had to be close enough to our home wireless network for it to be connected! We’re getting somewhere…

Armed with this knowledge, I logged into the admin pages of each of the dd-WRT based wireless access points in the house and grounds (there are 5 in total!) and checked the wireless client lists of each. This listed the MAC addresses for each connected client.

I then checked the messages.log on my Debian Linux server which provides DHCP for the whole of my network and found the DHCP entries relating to the missing iPod. The most recent DHCP request/offer/assignment sequence was only a few minutes earlier so this was further evidence that the iPod was still recently alive and on the network. This also gave me the MAC address of the iPod which I could use to determine which access point it was connected to.

Checking the access point connected client lists again I found the relevant MAC address and this showed it had a signal strength of 50%, so it was pretty close to the access point in the utility room at the far end of the house. We were getting warmer!

And finally, after having a good search in that area we found the iPod down the side of the cushion in a comfy chair in the corner of the kitchen!

Our solar PV installation – a year on…

Following on from the previous short post about our experiences of a new Ground Source Heat Pump system a year after its installation, here’s an even shorter post about how our solar PV array has performed a year on from when it was installed.

(For earlier posts about our solar PV installation, read these…)

Our installation comprises of 20 x Linuo 195Wp monocrystalline PV panels mounted on Schüco Lite rails connecting to an SMA SunnyBoy SB4000TL-20 inverter. The installation was specified, supplied and fitted by the excellent Greenday Renewables based at Fort Dunlop, Birmingham.

The original estimate for the total annual output of our installation, based on historical local climate and meteorological data, was 3,560 kWh. Our actual output for the first year has been 3,585 kWh which I’m pleased with given how much poor weather we’ve had this year.

As we managed to secure the higher Feed in Tariff (FiT) rate of 43.4p/kWh at installation time (which increases every year as it is index linked) we have generated an income of around £1,700 for this first year, plus any additional savings from not having to import as much electricity by using our own generated electricity as much as possible. Based on these figures the system should have paid for itself within 5 years.

Being a true geek, one of the first things I did after the system was installed was to set up some automated logging and reporting of data acquired from the inverter by connecting to its bluetooth interface. This data logging solution has evolved over time but is now implemented using the open source sma-bluetooth project running on a Raspberry Pi single board computer with a USB bluetooth adapter, storing captured data in a MySQL database and producing real-time web accessible charts using PHP and the excellent Highcharts library.

I look forward to reporting on how the system has performed after it’s second anniversary!