Showing posts with label wifi. Show all posts
Showing posts with label wifi. Show all posts

Tuesday, 8 March 2011

Howto Get Long Battery Life on a Nexus One

In case this is copied, go to the original site which should be http://philatwarrimoo.blogspot.com/2011/03/howto-get-long-battery-life-on-nexus.html

I would use my phone a lot (music, hotspot, not phone calls) and only get 15 - 18 hours from a fully charged battery.

I had read that some people got between 1 day and 1.5 days.

So, what is the upper limit? If you leave you phone in one spot and hardly touch it, how long will it run for?

The specs say 250/290 hours for 3G/2G.

To get this I assume you would need great signal levels, and virtually nothing running on the phone - in fact the phone would be the factory default.

But what could I get? I don't get great coverage at my place, especially inside where the signal is shielded by metal fly-screens, foil insulation, steel roof and two layers of brick - it is almost a Faraday cage.

I defaulted the phone. I didn't clear my SD card because I didn't want to.

I did make a few changes: I kept some applications that I do use often, and I disabled Picasa sync because I am in the middle of uploading lots of photos and that would distort the tests.


The big power consumers are believed by some to be the display, radio, GPS, WiFi, Bluetooth, and sync.


I have found that the main ones are the display and the radio (2G/3G).


In Australia the carriers all have GSM as well as either UMTS or HSDPA. My carrier only seems to have GSM and UMTS.


I decided to test what radio setting uses less energy. My options are GSM Auto (PRL), WCDMA Preferred, WCDMA Only and WiFi (for when I am at home). I don't want GSM only so I am not going to test that. I won't test Automatic either because I have no idea what it actually does.


  • GSM Auto (PRL) I believe prefers GSM rather than WCDMA, but it will switch to WCDMA if the signal is strong enough.
  • WCDMA Preferred is the opposite.
  • WCDMA Only is what it is.


When WiFi is on, I believe the 2G/3G radio switches off, so only the WiFi radio is on.


GPS will be left on (as per the default), as will sync, the default live wallpaper, widgets etc.

As I said earlier, Picasa sync will be off.


The Applications installed are:

4trak (since uninstalled)
adobe flash (since uninstalled)
anycutastrogoogle earth (since uninstalled)
espeakfunction express (since uninstalled)
gmailgoggleshotspot widgetlistenmapsmarketplugin launcher (i added this last night - since uninstalled)
realcalcringdroid (since uninstalled)
spareparts (since uninstalled)
terminal emulator (since uninstalled)wifi analyser (since uninstalled)

And this is what generally runs:

settingsgoogle servicesmapsgmail (regularly on and off)android keyboardandroid live wallpaper

The following Widgets are part of the default setup:

google searchpower controlyoutubeweather and newsmarket

I checked once and found the 107 MB used and 244 MB free.

I generally did not reboot between tests - perhaps I should have.

I ran the tests for different periods and only long enough to get a feeling for how long it would run for. 


The phone was always in the same place and was only moved to check how it was going. Usually I checked a few times for just a few seconds.

Test Results

WiFi On: 4.25 hours, 82% remaining. I'd expect it to go for 24 hours.

From the graph you can see that something changed for about 30 minutes that consumed a lot of energy (about 10%). This has resulted in the poor expected battery life.

The graph also shows the screen being turned on a few time and once for about 15 minutes - I don't recall doing this!


When the screen turns off or the phone sleeps, WiFi still runs for up to 15 minutes.


WiFi wakes up when the radio signal drops or changes.

I should re-do this test.


GSM Only (PRL): 9.2 hours, 90% remaining. I'd expect it to go for 92 hours.

Battery drain was fairly constant and seemed to increase when coverage was poorer (at the beginning and end of the test period).


The screen was also on for 20 minutes at the start of the test - I am sure that this did not happen.




WCDMA Only: 3.2 hours, 91% remaining. I'd expect it to go for 36 hours.

Again something happened for about 40 minutes causing a drain of about 5% of the battery.




WCDMA Preferred: 2.25 hours, 92% remaining. I'd expect it to go for 28 hours.


The phone seems to wake up when there is poor or changing signal.



The observation to make is that there is a big difference in the expected battery life depending on which radio setting you choose. For me, GSM Only (PRL) would provide the longest battery life at home, and probably where the 3G signal is poor.

WiFi was the poorest, but at home it will generally be on the dock and charging.

For those that have good 3G coverage, the WCDMA Only option will probably serve you well.


Custom Test

I then decided to turn off the widgets, use a black live wallpaper that I made a while ago, select GSM Auto (PRL) and turn WiFi on.

WiFi On, GSM Auto (PRL), most widgets off, black live wallpaper: 4.3 hours, 92% remaining. I'd expect it to go for 54 hours.

Only the Power Control widget was running.

Wifi seems to stay on for about 15 minutes then sleeps. It wakes up when you turn the screen on.

The WiFi Sleep Policy is Never when plugged in so this means that it will sleep if it is not plugged in.



WiFi Power Hungry Bug

Some have reported that WiFi on anything but the default sleep policy setting causes Android OS to run at high levels. Normally it sits at 2%-ish, but when the fault occurs it runs at 40%, 50% and even higher - usually higher than the display.

Some get relief using the WiFi sleep policy: 'Never', and others find this to be the cause. By this I suspect they mean that if the setting is changed from the default (to 'Never', for example) something bad happens when you switch back to the default setting. This is my experience.

In one of my tests I used the WiFi sleep policy: 'When screen turns off' and Android OS sky-rocketed. I recommend you keep the default (Never when plugged in) until this is fixed.


Summary

1. When WiFi turns on, it stays on for 15 minutes.
2. For me, GSM Auto (PRL) is better than WCDMA Preferred or WCDMA Only.
3, The graph seems to show the screen on when it isn't.
4. The phone seems to wake up on signal strength change, or this could be base station changes.
5. If WiFi is asleep and the radio looses signal, WiFi will wake up.
6. The default Nexus One setup with all the widgets and live wallpaper seems gentle on the battery.

Update


I have used my phone with minimal apps installed, my special black wallpaper and very few gadgets. I have been getting at least 12 hours of use before the battery reaches 50%, so this is about 1 day.


I'll try to keep some records from now on to quantify this.


Sunday, 20 June 2010

Google Captured Data and Passwords in Australia - an Estimate

Most would have heard by now that Google's StreetView cars have been taking pictures of our streets and at the same time collecting WiFi SSIDs. But they have also been collecting other data that has got them into trouble with Governments and privacy groups.

http://googleblog.blogspot.com/search/label/privacy

Google sponsored report

http://www.google.com/googleblogs/pdfs/friedberg_sourcecode_analysis_060910.pdf

In Australia it is no different. Senator Conroy has been very vocal about this.

http://www.abc.net.au/news/stories/2010/05/25/2908415.htm

I was chatting to a friend and a quick calculation seemed to indicate that the amount of data and passwords captured must be small.

So, with lots of assumptions I have looked at two cases: the 'best' case and the 'worse' case.

To do any estimation I needed numbers. Fortunately our Bureau of Statistics (ABS) provided what I needed.

Here are my assumptions:

1. From the ABS December 2009, 5.2M ADSL and Cable subscribers. http://abs.gov.au/ausstats/abs@.nsf/mf/8153.0/

2. 114,400 TB downloaded data per year (ABS)

3. Uploaded data is 5 - 20% of downloaded data.

4. Between 50 and 80% of all subscribers use encrypted WiFi.

5. WiFi range from an indoor household Access Point is +-100m to +-250m.

6. The StreetView car samples 5 channels per second (See report).

7. Data in overlapping channels can be received in channels 1, 6, 11.

8. StreetView car travels at 30 - 50 km/h between 8:00 and 16:00. The car need bright light to take photos and for safety (fatigue) reasons they would only do 8 hour shifts - probably with breaks every 2 hours or so.

9. Uploaded data is sent evenly throughout the day from domestic homes and that between 8:00 and 16:00 the upload data rates are average.

10. Households send 1 - 10 non-secured passwords per day.

11. Household use the internet between 16 and 20 hours per day.

WiFi Reception Performance

One important variable that I did not model was the error rate of received frames that is related to distance: the further away from a WiFi access point, the lower the change of receiving a frame without error. The assumption that you can receive all frames within 100m (worse case) or within 250m (best case) is, frankly, silly and unrealistic. This will mean that any result is going to establish an upper limit for both cases.

WiFi Channels

So basically I assume the street car samples 3 channels at the rate of 5 per second. I conservatively assume that data on all the other WiFi channels can read using just these 3 channels. I doubt this is correct so again it will establish an upper limit for both cases.

Reception Period

I calculate the time the car is in range of a WiFi base is between 14 and 60 seconds and can sample between 5 and 20 seconds worth of data. The car probably travels at a speed between 30 and 50 km/h and can collect WiFi frames from any given access point for one third of the time.

Data Collected

By assuming that households transmit data continuously, and knowing the average amount of data sent each second I can estimate the amount of data collected on average per WiFi access point.

Australians downloaded 114,000 TB of data in 2009. Most web browsing is downloading, especially when we are talking about reading bank accounts and email.

Assuming uploaded data is between 5 and 20% of the amount we download, I arrived at an upload data amount of between 5700 - 23,000 TB per year or 400 - 1400 bps.

This means that they can record between 250 and 3400 Bytes of data per WiFi access point (SSID).

Password Capture

I have assumed that passwords are sent in the clear (unencrypted) between 1 to 10 times per day. Most sites (such as banks) use HTTPS and email hosting services generally support encrypted SMTP/POP/IMAP to send account and password information. But some sites may still allow access to mail and other discussion sites using unencrypted passwords. It is these passwords that Google could have captured on unencrypted WiFi access points.

The probability of capturing a password is between 0.002% and 0.14% so this means that between 17 and 3600 passwords would be captured Australia-wide as the StreetView car drove by.

Resulting Estimate

Data collected: 250 - 3400 Bytes per WiFi access point
Passwords collected: 17 - 3600 Australia-wide

The difference between my best and worse case is just over 1 order of magnitude for bytes collected and just over 2 orders of magnitude for passwords collected. This reflects the level of uncertainty on my estimates.

I think the real values will be much lower for these reasons:

1. During the day is not the peak time for downloads from households. On weekdays, on average, many family members will be at school or at work so it stands to reason that less internet activity will take place.

2. Encrypted WiFi access points seems to be closer to 80% rather than 50%. People are more aware about security and ISPs have done a lot to encourage the security of wireless networks.

3. Few services use unencrypted passwords - I can not think of any except for POP based email. All banks use some for of encryption - to do otherwise would be incompetent. Unfortunately it may be the small businesses that allow staff to access their email via unencrypted POP that are letting their employees down. GMail and Yahoo only seem to allow encrypted authentication so your account name and password are safe.

4. WiFi range is probably not even 100m and hardly 250m and the ability to pickup a transmission from a laptop/mobile at these distances is low. The further away from a WiFi access point, the higher the probability of receiving an errored frame that would contain no reliable data.

5. Uploaded data is probably less that 5% of Downloaded data. A packet containing an account name and password is small compared to the resulting page that gets downloaded.

6. Even when a WiFi access point is unencrypted, typically traffic to sites that require privacy are encrypted. So the actual unencrypted data is publicly available web pages, images, video and javascript code.

My Guess

The above best and worse case set an upper limit. But the worse case is too optimistic regarding the amount of uploaded traffic, WiFi range and the number of unencrypted access points. So I would suggest the number of passwords collected to be around 17 - say 10 to 100 - Australia-wide and the amount of unencrypted personal data to be much less - say 10 to 100 bytes per household.