More sutainable Android Software with Project Treble and 6-y LTS Kernels on Android O?

Recently, we could read and hear about Google putting some effort in facilitating easier updates for android devices:

So, even though three years are not the promised four years, we can still see a trend of increasing years of guaranteed software support on Android phones.

That is a positive trend! I hope that Google takes the gloves off soon and guarantees four upgrades to a new android version, forcing other vendors to at least start guaranteeing something for their phones. As I said before, this would really be a unique selling point. Also this would really mean a big leap forward regarding sustainability of Android phones! Let’s see if any of the Oreo Phones being release now will support Android S 😉

Advertisements

Android 7 (Nougat) on a 5-year-old phone

A 5-year-old phone is not going to the kindergarden, it is more likely to be found on the phone graveryard. One important reason for this is that its manufacturer stopped caring for it at least three years ago. Fortunately, there are other caretakers – people that maintain the latest android version also for five-year-old phone grannies – in form of custom ROMs.
So, is it possible to run the latest Android version on a device that’s 5 years old? Hell, yes! This article shows how.

My old HTC One S (aka ville, the older S4 processor not the “C2” with S3 processor), launched April 2012 runs terribly laggy on its latest stock anroid 4 firmware, last update 2013 – four years ago! That’s why it was retired a long time ago. At the beginning of 2017, when the first unofficial builds of lineage OS turned up, I was surprised to see that HTC One S was among them. I was wondering, how can such an old device run the latest android version? I had to see for myself.

TLDR; Android Nougat works surprisingly well, way better than the latest Stock version but HTC makes it a hell of a way to get there. Lets see what has to be done.

Note that all files on your device will be deleted during the process!

Unlock Bootloader

To be able to flash software to our HTC devices, HTC forces us create an account on htcdev.com and register our device there. Then we receive an unlock code as zip file which we can flash on our device.


adb reboot bootloader

fastboot flash unlocktoken Unlock_code.bin

For all Windows 8 (and also Windows 10, apparently) users who have problems getting the fastboot driver to work, whereas ADB works, this little registry edit did the trick for me.

In the bootloader make sure to remember your HBoot version, it will be required during the process.

HBoot 2.16 - we're good!

HBoot 2.16 – we’re good!

Flash TWRP

Download from here to your PC and flash as follows


fastboot flash recovery twrp.img

fastboot reboot

Check HBoot version

I had to find out the hard way by flashing lineage 14.1 that there are requirements regarding the HBoot (HTC Bootloader) version:  HBoot 2.16 is required.

So better check in advance. If you’re on HBoot 2.16 flash lineage and enjoy. If not, let the games beginn.

S-OFF & root

Upgrading HBoot needs S-OFF (Security off, enables writing to /system directory). On top of unlocking our bootloader at htcdev.com we need to risk bricking our phone to enalbe writing in the /system directory of our device.
Those two things are the reasons why I most likely won’t ever buy an HTC device again.
Anyway, with the One S, we’re lucky! S-OFF takes a bit of time but not much effort and comes at almost no risk, thanks to rumrunner (a good overview of other S-OFF Mechanisms is described here). Rumrunner makes it easy to get S-OFF, but it needs root access.

What? Why are we doing this again? We want to Upgrade HBoot, that’s why we need S-OFF, in order to get S-OFF, we need root. That’s the last unpleasant surpise, promise!
Lucky again, root access can be gained easily on HTC One S. I used Superboot: Just Download, execute Script on PC while Phone phone is in bootloader mode. Root done. More detailed description here.

Then just download rumrunner follow the instructions, wait for about 10 minutes (don’t worry, your phone is restarting about one million times) and you’re S-OFF!

Upgrade HBoot

We’re getting closer. Now, with S-OFF we can flash HBoot 2.16. I followed these instructions, and found the firmware here.

Caution: After flashing HBoot 2.16, the internal memory is really small, only 50 MB left. Obviously Android 4 and Hboot 2.16 are not good friends. Don’t worry, this is solved once Android 7 is flashed.

Flash Android 7.1.2

It’s finally gonna happen. We’ll flash Lineage 14.1, Android 7.1.2 (maintained by moozon, thanks so much!). But how, the internal memory is only 50MB, but the image is almost 300MB? I copied the image to an USB thumb drive, connected it to the phone via an USB OTG adapter and flashed via TWRP Recovery. TWRP also offers ADB sideloading, which might be an alternative, it you don’t have an USB OTG Adapter at hand.

Once flashed, you finally can enjoy the latest android version on your “antique” phone. 🥂

Optional finishing and more info

Root is built-in but disabled by default. If you want root access, you can enable it in developer options.

If you need google services, get ARM | 7.1 | pico (my recommendation) from opengapps.org and flash via TWRP.

If you need more info, you might get started here: [LINEAGE OS] HTC One S Lineage OS 14.1, Android Nougat 7.1 ROM

Final thoughts

The One S with Android 7.1.2 almost works better than my HTC One M8 with Android 6! Why must HTC make it so hard to get there? And why are manufacturers not able to support their devices longer than 2 years, while the community or even single indivudals are able to do so for more than 5 years??

[EDIT 2017/06/13: Google just published the guaranteed updates for its devices: two years of upgrades and another year of security updates. While this is at least some formal guarantee (other manufacturer just don’t guarantee anything) it still is far from the five years provided by the community for my HTC One S… ]

I’m still waiting for a manufacturer that guarantees support for its devices for many years. That would really be a unique selling point! I can’t believe no manufacturer uses this USP on the highly competitive market for mobile devices. In addition, this would be so much more sustainable, and contribute to a green(er) IT. While the whole world complaints about planned obsolescence, why is there no manufacturer that uses this fact for positive marketing?

[EDIT 2017/07/01: HMD Global (owner of the Nokia brand) just announced that they intend to provide plain vanilla android phones with support “even after two years“. I looking forward to their next anouncements. My calls might just have been heard 👂]

[EDIT 2017/10/05: Google talks about four android version upgrades being possible from Android O and releases Pixel 2 with three years of support. See More sutainable Android Software with Project Treble and 6-y LTS Kernels with Android O?]

What is Google doing, by the way? They introduce Safety Net, providing the oportunity for developers to hide their apps on Google Play from specific devices, such as the ones running custom ROMs. So now, no more Netflix, etc. for custom ROMs. Effectively, this is another punch for the custom ROM scene after the death of CyanogenMod.

Lets just hope custom ROM developers will not be discouraged by these facts and continue their imporant work, making success stories such as the one of my HTC One granny possible.

Thank you android community, XDA forums, custom ROM developers, etc. for sharing your work and never giving up! 👍

NAS: DS213+ & WD20NPVT – 2. Power Consumption

As announced in the first post about the Synology DS213+ and the Western Digital WD20NPVT, here’s the measured power consumption of the NAS and the two hard disks in differnt operational modes.

Measured values

The following table compares the values measured to the values as specified in DS213+’s specification.

Operational Mode Mean power consumption (measured) Power consumption (specification)
Off ~1W
System hibernation 2.9W 2.64W
on – HDD hibernation 9.6W 10.08W
on – idle 12.56W
on – download 13.94W 22.20W (“access”)
on – upload 15.47W 22.20W (“access”)

The spec mentions higher values for “access” and, HDD hibernation probably because they used 3.5″ HDDs. However, the value for hibernation is lower. Maybe that’s due to the measurement accuracy.

Note: The power consumed by the power supply when the device is off, is below the effective power range of the measurement device. Therefore the measured value is only an approximate value.

Measurement

For measurement, an Energy Logger 4000 device was used. It is not the most accurate one (5 – 3500 W (± 1% + 1 count), 2 -5 W (± 5% + 1 count), < 2 W (±15% + 1 count)), especially in the lowest measurement range. Still, the values measured should povide an impression of the power consumption in the different operational modes of the NAS.

For off, system hibernation, HDD hibernation and idle the power consumption is an arithmetic mean over several hours.

The download and upload, values have been measured while reading/writing a 50GB file. The values bellow are mean values over the process of reading or writing, respectively. The data rates measured during this process will be published in the next post.

Surprisingly, there is no (measurable) difference in hibernation whether Wake On LAN (WOL) is on or off. That’s why there is only one system hibernation mode.

Conclusion

15.5W at max, is not so bad for a device running two hard drives. It’s idle consumption of about 12.6W still is about twice the power consumption of other devices running 24/7 (like routers).

That’s where the the system hibernation mode comes in handy. 3W in hibernation – that’s about as much as the power supply of an old desktop light consumes when the lights are off. If you use your NAS as a private storage, or even a web server that’s a very good compromise. Of course, it would be even more economical to switch the NAS completely off, when not in use. But probably not what these devices are intended for.

Thanks to the WOL functionality, you can use a hibernating NAS almost as comfortable as if it ran all day: For usage at home, the NAS can be switched on by sending a WOL package to the NAS MAC/IP address from any PC (e.g. WOL for Windows) or mobile device (e.g. Wake On Lan for android). Actually, I don’t have to do this very often as it seems that my Windows Explorer switches on the NAS as soon as it is started, for I have mounted some NAS folders as network drives.

If you want to use the NAS as a web server you can configure your router to send a WOL package to the NAS when a request is received on a certain port, for example via HTTP or HTTPs. This will switch on the device, which takes about 30 seconds, that is, the website is delivered some seconds later, once the NAS is awake. I think in private usage scenarios this should not be too much of a drawback but it safes 75% of energy.

Doing so, allows for having a NAS or even a self-hosted web server/”personal cloud” that consumes almost no energy when it is not in use. A good enough solution for my “green conscience”, at last.

By the way, a device consuming 3W consumes about 26kWh in a year, which is about 7€ (as of 2012 in Germany, the average price for electricity was 0,26€ per kWh). In comparison: A device consuming 12.6W, consumes about 110kWh a year, which is about 29€.

NAS: DS213+ & WD20NPVT – 1. Conclusion

Motivation

I have been looking for a Network Attached Storage which sufficient performance but rather low power consumption.

As a NAS needs to be running 24/7, the power consumption is of particular importance. On the other hand, whenever the NAS is in active usage it can’t provide data too fast.

The crucial component for both the power consumption and the data rate is the processor.

The best compromise it could find in October 2012 was the DS213+ NAS. It features a Freescale Dual Core CPU with 2x 1.067GHz, which should provide more performance as the single core CPUs used in most other NAS in medium price range, but consumes less power than the Intel Atom Dual Cores used in NAS in higher price ranges.

As storage device, I decided to purchase two Western Digital Scorpio Green (WD20NPVT), a 2.5″ drive which seems to be designed exactly for this use case: It has low power consumption, but still provides enough space (2 TB). From a economical point of view, it would probably have made more sense to purchase a 3.5″ drive (such as the Western Digital Red (WD20EFRX), which has a higher power consumption (4.4w compared to 1.4w), but is cheaper (about 65 Euros in Germany, as of January 2013).

Still, I thought it’s a kind of statement that we (the consumers) are interested in energy efficient devices, and not only as much GB per quid as possible.

Or maybe I’m just an idealist 🙂

Structure

So, after having used the NAS for over two months now it’s time for a little resume. Just for a change, I’m going to start with the conclusion. My first post (the one you’re reading at the moment) contains the benefits and drawbacks of the device – What I like about my DS213+ and what problems I encountered.

In addition, I measured power consumption of DS213+ and the two WD20NPVT, which I will publish in a second post.

I also measured data rates and encryption performance of DS213+, which will be published in further upcoming posts.

Benefits

Synology’s Operating System, Diskstation Manager (DSM), which is shipped with DS213+ provides a real lot of features. In this post I’m only going to mention the most important ones to me. For more details see Synology.

The device can be set up via an ajax-driven web interface. In fact, it’s one of the best web interfaces I have seen recently. Synology provides a demo here. As an alternative you can configure it via SSH. Synology also included a plugin system which allows you to extend DSM with different packages to be used in your LAN (such as a web interface to the stored files, photographs, music, movies, etc.), but also tools intended to be used on the Internet (like Drupal, wordpress, etc.). In addition Synology provides several free mobile Apps for Android, iOS and Windows Phone that provide those features using interfaces that are optimized for mobile devices.

Another feature which is important to me is encryption. You can set up different folders on the hard drive which are encrypted with different keys and can be accessed by different users. As per DS213’s spec, the encryption is done in a dedicated hardware module, so the NAS performs well, even when encrypting. At least better than ordinary TrueCrypt on my PC 😉

In addition, you can encrypt all communication via HTTPS.

Another neat feature is that images stored on the device are not only indexed so they are quickly accessible via DLNA, but the device also creates thumbnails. This allows for viewing images for example on mobile devices via WiFi very smoothly. Almost feels like viewing local pictures on my mobile. However, it takes what feels like ages to create the thumbs. More precisely, it took about three days to create the 30k images on my NAS. That’s just a one-time expense, though.

As low power consumption was one of my main objectives, I very much appreciate the hibernation mode, offered by DS213+. The disks are spun down after a configurable time period. In addition, you can set up the NAS to hibernate the whole system 60 seconds after the disks are down. For this hibernation mode, you can set up if the system can be switched on again via network – Wake On LAN (WOL). This results in slighly higher power consumption but is a lot more comfortable. Of course, it would be even more comfortable to have the NAS running 24/7, but at the cost of a higher power consumption. As mentioned, I’m going to publish the actual power consumption I measured in the next post.

Drawbacks

Enough words of praise. I have some issues with DS213+.

Most of them seem to be in conjunction with the encryption functionality. The DS offers versioning functionality which is one of the features I am particularly interested in, to use as part of my backup strategy. This feature can be used via a comfortable web interface. Only, that the feature cannot be used with encrypted folders whilst all my important folders are encrypted. That is, I can’t use this feature at all. The same applies to the pictures web interface: Even though you can view pictures stored in encrypted folders via DNLA, they cannot be found via the web interface or picture app. However, encrypted music can be played via the web interface. Not real consistent behaviour, is it?

In addition, I wasted almost a whole precious day off trying to figure out why I could not access encrypted sub folders via SMB. After trying about every possible configuration of DS’s SAMBA server, I found out that it was a bug in DSM relating to case-sensitive file names. Fortunately, it had been fixed just a couple of days before (Version 4.1-2647). So I upgraded to the next DSM version an the problem was gone. The good news is Synology keeps improving the DSM Software and provides the new versions to customers for free. Still, it seems as if DSM has a bit of “banana software” (it “ripes” at the customer) – at least where encryption is concerned.
 
<UPDATE >
22 January, 2013: After updating to DSM 4.1-2668 the bug re-appeared! I filed a bug at Synology and received the following answer one day later:


The developer confirmed that this is a known issue that our developer is currently working on. The issue will be improved in our future official update in the future.

Let’s hope so! If you didn’t update yet, better wait for the next version.
</UPDATE>
 
Another issue that seems to occurr every now an then with Synology devices, is hibernation. See for example here and there. I’m experiencing unexpected behavior myself. Every now and then I’m surprised that the device is not in hibernation, even though there should be no reason for it to be not. For example, I was wondering why it was switched on every now and then when I went to work, early in the morning. On the other hand it seems to ignore some of my WOL packages sent from my PC or my phone. I started debugging, but haven’t quite figured out why it behaves like this.

There’s one more thing (though less important): The DS sparkles like a christmas tree. There are five LEDs in different sizes and colours that are twinkling in different frequencies. Unfortunately, they cannot be deactivated via the web interface. Some of them can be switched off via the command line, but the device keeps switching them on. Still looking for a solution to permanently switch them off.

Conclusion

Despite these issues pointed out above, I don’t regret buying DS213+. It meets most of my expectations, but still, some things could be more elaborate, especially when it comes to encryption. There also are a lot of features that I’m not using yet but might be of good use in the future (like rsync).

So wrapping things up, DS213+ is real good NAS device with lots of features and rather small energy consumption. If you’re interested in using the encryption features, you might have a look at different devices. I can’t say, however, if there are a better ones.