Filed Under (LG Android Phones, LG Optimus Series, LG Phone Problem and Solution) by lg-phones on 26-04-2011

Investigation led us to the following conclusions:  LG Android Phones

  1. The LG Optimus V has a Wifi bug that drains the battery rapidly
  2. Wifi consumes less power than 3G when downloading, but more power when idle.
  3. 3G consumes the same power as airplane mode when idle.

Yet most of you don’t believe conclusion number 3. You’ve set Tasker to turn off your 3G when the screen is off and have seen great battery savings. I know why…

Your installed programs are using your 3G even when the screen is off. It makes sense that you want to turn off your 3G to stop them and get better battery life, but you are punishing the wrong culprit. You may want some of your apps to occasionally update when the screen is off. You may want to use Sipdroid and get incoming calls. You may want your emails to be occasionally updated, but you don’t want Google maps to constantly update the CIA to your precise location every minute. If you want to control exactly which programs have access to 3G/Wifi. LG Phone Problem and Solution

Here is what you should do:
You will need root access to do this. This will setup two script files, one to run when the screen turns off and one to run when the screen turns on. These will "enable" and "disable" the firewall. The firewall is never actually disabled. You are merely changing the rules that apply, either to give access to a limited number of apps or to allow all apps through. Because of the requirement that the scripts be executed with root access, there are actually five script files required. Two are created using Droidwall and are unique to your LG Optimus V. Three scripts are attached in the zip below and are universal.  LG-Optimus info

  1. Install Root Explorer or a similar app. You can also use adb.exe, but it is up to you to figure out the correct commands.
  2. Install Droidwall .
  3. Figure out which apps you want grant internet access to when your screen is off. If none, then select none.
  4. Set the rules in Droidwall and enable the firewall.
  5. Using Root Explorer to navigate to this folder: /data/data/com.googlecode.droidwall/cache/
  6. Copy the file droidwall.sh and place it on your microSD card.
  7. Rename it to droidwall-on.sh
  8. Open Droidwall again, uncheck all the apps you had selected, and instead check the boxes for "(any application)". This will be the profile that is applied when you actually want to use your LG Optimus V and the screen is on.
    You can choose to limit access here as well, but it is safer to choose "(any application)" to for now. You can come back later and recreate a more restrictive profile once you have everything working.
  9. Apply the rules and then turn the firewall off and then back on again.
  10. It is important that the firewall is still enabled.
  11. Navigate back to the folder: /data/data/com.googlecode.droidwall/cache/
  12. Copy the new droidwall.sh and place it on your microSD card.
  13. Rename it to droidwall-off.sh
  14. These two script files will "enable" and "disable" the firewall.
  15. Use Gscript to test the scripts to make sure they work. Run droidwall-on.sh, and test an app you didn’t give 3G or Wifi access to. It should be blocked from accessing the internet. Now run droidwall-off.sh. That same app should now have internet access. If this test does not work, go back and repeat the steps above. This is also the point where you check that all your critical apps function correctly with either script activated. You must make sure the scripts work as intended before proceeding. If you don’t know how to add/run scripts using Gscript, learn.
    While you can run these scripts as root in Gscript, running them as root when the screen turns off/on is a bit harder. The following steps have to all be done in order for the scripts to be executed correctly.
  16. Install Tasker
  17. Install SL4A. (more info)
  18. Run SL4A once so that it creates the following folders on your microSD card or create them yourself: /sdcard/sl4a/scripts/
  19. Copy droidwall-off.sh and droidwall-on.sh into the "scripts" folder.
  20. Copy screen-off.sh and screen-on.sh from the zip file attached to this post to the "scripts" folder.
  21. Using Root Explorer, copy "sush" from the attached zip file to the folder "/system/xbin/". Make sure to "Mount R/W" before pasting the file, and then "Mount R/O" when finished. Read here about why we need this file to run the scripts as root.
  22. Open Tasker -> New -> Ok -> Event -> Display -> Display On -> Done -> New Task -> Ok -> + -> Misc -> Run Script
  23. Where it says "Name" select the search button. You should see the four scripts we placed in the "/sdcard/sl4a/scripts/" folder. If not, retrace your steps to see what you did wrong. Select "screen-on.sh". Don’t select the Droidwall scripts because they can’t run as root as they are written.
  24. Done -> Done
  25. Repeat the steps to add a profile for when the screen turns off and "screen-off.sh". When you have both profiles, select Apply at the bottom.
  26. Now when your screen is off only the programs you selected will be allowed to use your 3G or Wifi.
  27. You no longer need to run Droidwall, but you can use it to update your droidwall-on.sh script. Don’t uninstall Droidwall. If anything goes wrong and you lose all of your internet access, try deleting the scripts in the "/sdcard/sl4a/scripts/" folder, and then allowing all apps to have internet access using Droidwall.
  28. You can actually setup any number of profiles to control your firewall using location, time of day, …etc. To do so, create the correct ".sh" file using Droidwall. Place it inside the "/sdcard/sl4a/scripts/" folder. Then add a secondary script to run your ".sh" as root. Use "screen-on.sh" as a template to create your secondary script. Then create the proper profile inside Tasker to run the secondary script. If what I just said confuses you, don’t attempt to do this. You can really mess up your LG Optimus V if this is done incorrectly!


LG Cell Phone – Related Posts


Hobbes on 14 June, 2011 at 11:51 am #

maybe I’m just overlooking something, but where is the link to the zip file containing the shell scripts?

Binod on 22 May, 2012 at 2:32 am #

I own a LG Optimus 2X and it provides a decent battery life. I have noticed that keeping Wi-Fi, 3G/4G, Bluetooth turned off when not in use further extends the battery life. However, turning on and off these services manually can be painful.. i have been using cosmos for smartphone from past few months have noticed some improvement in the battery life. The app is free and also cleans junk data stored on the phone. Highly recommended! https://play.google.com/store/apps/details?id=com.support.cosmos

Post a Comment