Intro:
I wanted some way to limit the charge level on my Pixel XL. I tried the BatteryChargeLimit app, but it never worked properly. Soon realized I could so the same thing as the app using Tasker after looking around in /sys/class/power_supply/battery folder.
This guide should work on all Pixel and Nexus devices. Can be adopted to other devices (See BatteryChargeLimit thread)
Why:
Not charging to 100% should in theory extend battery life. This study is starting to get outdated.
http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
Prerequisites:
1. Root Access
2. Tasker
How to:
1. Open Tasker. Add a new profile. Name it whatever you want. Select State -> Power -> Power. Keep "Any" selected as Source.
2. Add Enter Task
Code:
No Charge (6)
Run Both Together
<Get Charging Source>
A1: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/charging_source
cat /sys/class/power_supply/battery/charging_source Timeout (Seconds):0 Use Root:eek:n Store Output In:%PluggedIn Store Errors In: Store Result In: Continue Task After Error:eek:n ]
A2: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/battery_charging_enabled
echo "0" > /sys/class/power_supply/battery/battery_charging_enabled Timeout (Seconds):0 Use Root:eek:n Store Output In: Store Errors In: Store Result In: Continue Task After Error:eek:n ] If [ %BATT > 79 ]
A3: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A4: Goto [ Type:Action Number Number:1 Label: ] If [ %PluggedIn neq 0 ]
3. Add Exit Task
Code:
Charge (14)
Run Both Together
A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A2: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/battery_charging_enabled
echo "1" > /sys/class/power_supply/battery/battery_charging_enabled Timeout (Seconds):0 Use Root:eek:n Store Output In: Store Errors In: Store Result In: Continue Task After Error:eek:n ]
4. Long click on Profile and select Properties. Uncheck: Enforce Task Order"
5. Save everything and test it out.
How it works:
1. Enter task checks /sys/class/power_supply/charging_source to see if phone is plugged in and stores the value in a variable (%PluggedIn).
2. Writes "1" or "0" to /sys/class/power_supply/battery_charging_enabled depending on the battery level.
3. Waits 1 minute.
4. Goes back to top and runs everything over again is variable (%PluggedIn) doesnt equal 0.
Known Issues:
1. Phone could go maybe 1% over defined limit in the 60 seconds before the task runs again. Try changing the wait time to 45 or 30 seconds if this bothers you.
Misc Information and rambling:
1. I used 80% charge limit in my example. Just change it to whatever you want.
2. Having the phone check this every 60 seconds is not a big deal. The phone never sleeps when plugged in anyways. The Profile exits and nothing runs when phone is not plugged in.
3. /sys/class/power_supply/battery/charging_source
0 = Not plugged in
1 = USB
2 = A/C
4. /sys/class/power_supply/battery/constant_charge_current_max
Default value: 1600000
This is 1.6 amps constant charge. You could increase/decrease this number. I tested 2.0 amps and 1.0 amps. Could have your phone only charge at 1.0 amp, even when plugged into the factory charger.
Contributions:
sriharshaarangi
I am no longer monitoring or updating this guide. If you poke around in sys/class/power_supply/ you can most likely modify this basic script for any phone.
FYI to help anyone else.
On my Galaxy Note 4 with Modest.Rom.v6
i don't have the file "charging_source" under /sys/class/power_supply/battery/
but I do have:
"batt_charging_source" which has a value of "4" when charging by USB and "1" when not charging/connected
and
no "battery_charging_enabled" but instead the file "status" which has a value of "Charging" while charging by USB and "Discharging" when not connected.
---------- Post added at 09:12 PM ---------- Previous post was at 09:00 PM ----------
isuelt1 said:
FYI to help anyone else.
no "battery_charging_enabled" but instead the file "status" which has a value of "Charging" while charging by USB and "Discharging" when not connected.
Click to expand...
Click to collapse
Maybe "wc_enable" would be the right file to change since I don't have "battery_charging_enabled" ??
Aaron1017 said:
Intro:
I wanted some way to limit the charge level on my Pixel XL. I tried the BatteryChargeLimit app, but it never worked properly. Soon realized I could so the same thing as the app using Tasker after looking around in /sys/class/power_supply/battery folder.
This guide should work on all Pixel and Nexus devices. Can be adopted to other devices (See BatteryChargeLimit thread)
Why:
Not charging to 100% should in theory extend battery life.
http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
Prerequisites:
1. Root Access
2. Tasker
How to:
1. Open Tasker. Add a new profile. Name it whatever you want. Select State -> Power -> Power. Keep "Any" selected as Source.
2. Add Enter Task
Code:
No Charge (6)
Run Both Together
<Get Charging Source>
A1: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/charging_source
cat /sys/class/power_supply/battery/charging_source Timeout (Seconds):0 Use Root:eek:n Store Output In:%PluggedIn Store Errors In: Store Result In: Continue Task After Error:eek:n ]
A2: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/battery_charging_enabled
echo "0" > /sys/class/power_supply/battery/battery_charging_enabled Timeout (Seconds):0 Use Root:eek:n Store Output In: Store Errors In: Store Result In: Continue Task After Error:eek:n ] If [ %BATT > 79 ]
A3: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A4: Goto [ Type:Action Number Number:1 Label: ] If [ %PluggedIn neq 0 ]
3. Add Exit Task
Code:
Charge (14)
Run Both Together
A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A2: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/battery_charging_enabled
echo "1" > /sys/class/power_supply/battery/battery_charging_enabled Timeout (Seconds):0 Use Root:eek:n Store Output In: Store Errors In: Store Result In: Continue Task After Error:eek:n ]
4. Long click on Profile and select Properties. Uncheck: Enforce Task Order"
5. Save everything and test it out.
How it works:
1. Enter task checks /sys/class/power_supply/charging_source to see if phone is plugged in and stores the value in a variable (%PluggedIn).
2. Writes "1" or "0" to /sys/class/power_supply/battery_charging_enabled depending on the battery level.
3. Waits 1 minute.
4. Goes back to top and runs everything over again is variable (%PluggedIn) doesnt equal 0.
Known Issues:
1. Phone could go maybe 1% over defined limit in the 60 seconds before the task runs again. Try changing the wait time to 45 or 30 seconds if this bothers you.
Misc Information and rambling:
1. I used 80% charge limit in my example. Just change it to whatever you want.
2. Having the phone check this every 60 seconds is not a big deal. The phone never sleeps when plugged in anyways. The Profile exits and nothing runs when phone is not plugged in.
3. /sys/class/power_supply/battery/charging_source
0 = Not plugged in
1 = USB
2 = A/C
4. /sys/class/power_supply/battery/constant_charge_current_max
Default value: 1600000
This is 1.6 amps constant charge. You could increase/decrease this number. I tested 2.0 amps and 1.0 amps. Could have your phone only charge at 1.0 amp, even when plugged into the factory charger.
Contributions:
sriharshaarangi
Click to expand...
Click to collapse
I've followed your directions and it works for the most part. It will automatically charge up to 80% when plugged in, however if the battery level is higher than 80% ( for example, if you charge it to 85% with device off or something and then turn it on while plugged in, , it will not charge any higher than 85% but it will not drop below 85% either... Even if the threshold is set at 80%). Not sure if my explanation makes sense.
Dollyllama said:
I've followed your directions and it works for the most part. It will automatically charge up to 80% when plugged in, however if the battery level is higher than 80% ( for example, if you charge it to 85% with device off or something and then turn it on while plugged in, , it will not charge any higher than 85% but it will not drop below 85% either... Even if the threshold is set at 80%). Not sure if my explanation makes sense.
Click to expand...
Click to collapse
Explanation makes sense and seems like expected behavior. No current is flowing to/from the battery. Phone maintaining power from source and not using the battery.
There might be a way to get the battery level to drop, but have not investigated.
Aaron1017 said:
Explanation makes sense and seems like expected behavior. No current is flowing to/from the battery. Phone maintaining power from source and not using the battery.
There might be a way to get the battery level to drop, but have not investigated.
Click to expand...
Click to collapse
I'm happy with it. Thank you for sharing it! It does what I need it to do. I first imported your xml (and it worked fine), but then I erased everything and manually programmed it into tasker to better understand the process. I set my threshold at 77% so I don't go above 78%. Works perfectly.
The only issue (and it's not even really an issue if you're aware of it is that if you reboot your phone while it is plugged in, it will charge all the way to 100% without applying the profiles. Need to manually drain the phone to below your threshold before plugging it back in...otherwise it just maintains the battery percent at whatever it is even though it is higher than what you defined.
Great guide, thank you!
One issue though, any idea why once I unplug my phone, the battery level drops to "0%", until I reboot it?
Edit: correction, stays at "0%" even after a soft reboot. Full reboot reflects accurate battery level.
Dollyllama said:
I'm happy with it. Thank you for sharing it! It does what I need it to do. I first imported your xml (and it worked fine), but then I erased everything and manually programmed it into tasker to better understand the process. I set my threshold at 77% so I don't go above 78%. Works perfectly.
The only issue (and it's not even really an issue if you're aware of it is that if you reboot your phone while it is plugged in, it will charge all the way to 100% without applying the profiles. Need to manually drain the phone to below your threshold before plugging it back in...otherwise it just maintains the battery percent at whatever it is even though it is higher than what you defined.
Click to expand...
Click to collapse
Droid_JD said:
Great guide, thank you!
One issue though, any idea why once I unplug my phone, the battery level drops to "0%", until I reboot it?
Edit: correction, stays at "0%" even after a soft reboot. Full reboot reflects accurate battery level.
Click to expand...
Click to collapse
Works fine here on my pixel XL stock with Magisk 14.0. Don't see the behavior you speak of. Maybe try importing the scripts again?
Sent from my Very Silver Pixel XL 128GB
mochamoo said:
Works fine here on my pixel XL stock with Magisk 14.0. Don't see the behavior you speak of. Maybe try importing the scripts again?
Sent from my Very Silver Pixel XL 128GB
Click to expand...
Click to collapse
I couldn't get it to import, so I just followed the directions to create the profiles.
Sent from my Pixel XL using Tapatalk
Hi dude!
I have one Huawei Nova and I'm rooted with Magisk.
I followed your steps, but changed the value to 89% and had to change the file which I have to cat, because I don't have the same as you.
I tried 2 files to cat the stat of charging/discharging:
charge_type
status
Both inside /sys/class/power_supply/battery/
charge_type give me 'N/A' when not charging and 'fast' when charging via usb/wall (I didn't test when phone is set to share files with PC, maybe it has a 'slow' value).
status give me 'discharging' or 'charging'.
I ended up using file status and setting PluggedIn neq Discharging
Everything is working fine[emoji16]
Thanks for sharing
Enviado de meu HUAWEI CAN usando Tapatalk
Great work Aaron1017!
Now one thing that's missing and wasn't working for me with BCL after upgrading to Oreo is resetting application battery usage statistics (Settings -> Battery).
Does anybody know how to add that?
I had both "battery_charging_enabled" and just "charging_enabled"
Had to change it to "charging_enabled" instead. I'm on 8.1 DP, so I imagine that could be why, and I'd imagine there's a good chance it will change to that in the final version. I just started using this, so maybe it already changed on 8.0. Just giving some info for people trying to get it to work, or who it May stop working for after an update.
Works great though... Thanks
Disregard
Ric G said:
Any updates for 8.1?
It's not working for me, as it went past 80%.
Also, I was unable to find the tweaks for amperage.
Thanks!
Click to expand...
Click to collapse
Still working as before on my pixelXL on 8.1. mine is set at 70%.
Thanks for posting this! The other method doesn't work on HTC phones. Question. I am thinking of trying this for my HTC 9 and HTC 10. I use the phone during the day as a tethering device. If this works would it still keep the tethering connection alive and well?
Works perfectly on my 10 but I don't use tethering, can't see that it would be affected though..
Just imported in the xml documents and gave it a try, doesn't work on HTC m9 running ViperRom.
I would like this task to only run Sunday through Wednesday nights. on Thursday, Friday, and saturday I'd like a full charge because I use my phone more on the weekends when I'm home. How do I do that when the profile is being triggered off a state? I need it to trigger off a state AND time.
I tried this task last night and it didn't work. Just to make sure I copied everything correctly here is my exported description:
Profile: Charge Limit (27)
State: Power [ Source:Any ]
Enter: No Charge (25)
Run Both Together
<Get Charging Source>
A1: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/charging_source
cat /sys/class/power_supply/battery/charging_source Timeout (Seconds):0 Use Rootn Store Output In:%PluggedIn Store Errors In: Store Result In: Continue Task After Errorn ]
A2: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/battery_charging_enabled
echo "0" > /sys/class/power_supply/battery/battery_charging_enabled Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: Continue Task After Errorn ] If [ %BATT > 85 ]
A3: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A4: Goto [ Type:Action Number Number:1 Label: ] If [ %PluggedIn neq 0 ]
Exit: Charge (23)
Run Both Together
A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A2: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/battery_charging_enabled
echo "1" > /sys/class/power_supply/battery/battery_charging_enabled Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: Continue Task After Errorn ]
Schroeder09 said:
I tried this task last night and it didn't work. Just to make sure I copied everything correctly here is my exported description:
Profile: Charge Limit (27)
State: Power [ Source:Any ]
Enter: No Charge (25)
Run Both Together
<Get Charging Source>
A1: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/charging_source
cat /sys/class/power_supply/battery/charging_source Timeout (Seconds):0 Use Rootn Store Output In:%PluggedIn Store Errors In: Store Result In: Continue Task After Errorn ]
A2: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/battery_charging_enabled
echo "0" > /sys/class/power_supply/battery/battery_charging_enabled Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: Continue Task After Errorn ] If [ %BATT > 85 ]
A3: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A4: Goto [ Type:Action Number Number:1 Label: ] If [ %PluggedIn neq 0 ]
Exit: Charge (23)
Run Both Together
A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A2: Run Shell [ Command:su
chmod 666 /sys/class/power_supply/battery/battery_charging_enabled
echo "1" > /sys/class/power_supply/battery/battery_charging_enabled Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: Continue Task After Errorn ]
Click to expand...
Click to collapse
What phone?
Sent from my Very Silver Pixel XL 128GB
Pixel 2 XL
Related
What can you expect from these tips?
*Increase battery life by 3 times compared to a situation without any tip implemented!
My target is to unplug my phone at 6am in the morning and have it around 10% at 11pm. The below tips enabled me to reach this target whereas, without them, I would run out of battery at noon (same usage, of course)!
Disclaimer: I consider that manually "swith off location" or "switch off wifi" as well as having Juice Defender on "extreme" are not acceptable. Why? Because we all need tips that enable battery savings without decreasing the user's experience! If you need to operate manually each time you want to connect and/or have 3G... this is not a solution. If Juice Defender just cut-off every communication and don't let e-mails flow, etc... this is not a solution!
However, for those who want those kind of tips, I created a special section in post 2!
Red % signification: Well, those % in red are gut feeling of "tip contribution" to the total battery saving.
My settings which enable best battery savings without reducing user's experience!
1. Use a NAND ROM
2% of battery improvement
Yes, compared to an SD ROM, a NAND ROM is less battery demanding. But as you can see, 2% is not a big part of the total improvement.
2. Use "SetCPU" with appropriate settings
5-10% of battery improvement
My Main is:
Max: 1190400 / Min: 245000 / Scaling: ondemand - yes! I want light speed HD2!
Click to expand...
Click to collapse
My profiles are (in order - this is important):
Screen Off
Max: 384000 / Min: 245000 / Scaling: ondemand
Battery <5%
Max: 614000 / Min: 245000 / Scaling: powersave
Battery <15%
Max: 614000 / Min: 245000 / Scaling: ondemand
Battery <30%
Max: 806000 / Min: 245000 / Scaling: ondemand
Click to expand...
Click to collapse
Click to expand...
Click to collapse
3. Lower VDD values as low as you can (till device becomes unstable)
5-10% of battery improvement
I am using Tyween settings from his ROM Typhoon.
Code:
#!/system/bin/sh
# set vdd_levels on boot by tyween (XDA Developers)
echo '245000 850' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '384000 875' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '422400 900' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '460800 925' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '499200 950' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '537600 975' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '576000 1000' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '614400 1025' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '652800 1050' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '691200 1075' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '729600 1100' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '768000 1100' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '806400 1125' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '844800 1150' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '883200 1150' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '921600 1175' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '960000 1175' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '998400 1200' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '1036800 1200' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '1075200 1225' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '1113600 1225' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '1152000 1250' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
echo '1190400 1275' > /sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
I tested even lower values, but my phone was not stable.
I read that each single piece of hardware is unique and could have its own minimum values, so your device could accept lower values (i.e. you're lucky compared to me) or on the contrary higher values (here I am luckier than you are )
Tip "easy way to test a new set of undervolting values": If you want to test undervolting values, themadproducer recommends to use the CONSERVATIVE CPU profile. Why? Because CONSERVATIVE seems to use the full range of scaling frequencies as it climbs up to MAX and falls back down to MIN. This way, if any particular frequency is set too low, it will complain and freeze the CPU. ONDEMAND and SMARTASS would skip over these middle frequencies or at best, never use them for more than an instant.
4. Use "Setting Profiles" for location-based WiFi
10-15% of battery improvement
This soft enables you to switch on/off wifi according to your location (based on cell towers - which does not use battery!).
Be careful: if your location is determined by GPS (instead of cell towers) than you will use more battery through GPS than you save by switching off wifi!!!
Example: you can define to have wifi ON when you are at home, and OFF when you leave home. Same with "work" or any other place where you know there's a wifi network to which you can connect.
Setting Profiles can also be used for automatic phone profiles switching (all kind of opitions from volumes, ringtones to screen brightness airplane mode, etc...)
However, I recommend you let Setting Profiles governing the wifi only. For phone profiles, I use Pocket weaver which is better I think - it can trigger profiles according to Touchdown calendar for example. Moreover, I need wifi on/off independently from hour or calendar status and these apps don't do well when it comes to integrate several conditions together.
5. Use "Phone weaver" for a night phone profile
% of battery improvement depending on situation
I am using a night profiles which goes "Air plane mode" from 11pm to 7am. But usually, I plug my phone overnight, so battery consumption is irrelevant overnight - my night profile is just to prevent radio waves to kill my brain too prematurely as the phone is nearby for morning alarm!
6. Properly setup your Internet apps
% of battery improvement depending on situation
Sounds obvious, but still! Do you really need your phone to check e-mails each 5 minutes? Or would 15 minutes be ok and in return get instantly a lot more of battery life?
Seriously, you need to setup your apps wisely.
e.g.: for those who use Touchdown (exchange sync), this app has awsome options: you can define "peak hours" during which you have a certain setting and the rest (off-peak hours) you will have another setting + the "push" option is very clever: it does not use much battery and on the top of the push option, you setup a period when it will go and check e-mails...
7. Use Auto brightness for your screen
10% of battery improvement
If your are running CM7, there is a function that let you set your own auto-diming values.
First you need to enable auto-dimming in Settings/Brightness and then check the box. After that, go in Settings/CyanogenMod settings/Display/Automatic backlight and set the following:
Light sensor filter=enabled
- Activated: checked
- Window length = 10 s
- Reset Threshold = 400 lux
- Sample interval = 0.5 s
Light levels
- Use custom = checked
- Screen dim level = 1
- Edit other levels…
Lower / Upper / Screen / Buttons
0 / 10 / 1 / 255
11 / 149 / 20 / 255
150 / 229 / 40 / 0
230 / 499 / 50 / 0
500 / 999 / 60 / 0
1000 / 2999 / 100 / 0
3000 / 9999 / 200 / 0
10000 / infinite / 255 / 0
Set number of levels = 8 (you need to set this before editing levels above)
(hit Save & Apply)
- Allow light decrease = checked
- Decrease hysteresis = 20%
Click to expand...
Click to collapse
Click to expand...
Click to collapse
If you are not running a CM7 ROM, then just enable auto-dimming in Settings/Brightness and then check the box.
8. Use "Juice Defender Ultimate" + "Juice Plotter"
50% of battery improvement
All of the above tips are very useful. However, this one is the one tip! I came to it almost depressed by my battery life (I had all of the above tips in place already).
I did not believe this soft could really help, and I thought "ok, yeah, this app will just cut-off all communication etc... but then I will have no more auto-sync and/or push e-mail"... I thought it would be a kind of "well just don't use your phone and you will get great battery life!"...
I was wrong. This app is a must! There are all kind of options in settings. Of course the first time you have to go through it and read-read-read learn-learn-learn. But in basically 20 minutes, you are setup and you have a huge battery life improvement! I can share my own settings if anybody is interested.
And the beauty of it, is that in the huge amount of options available, Juice Defender sort out everything by itselft and as a result - I don't feel the difference from a usage point of view (K9 e-mail flowing, Touchdown is pushing e-mail, everything works like a clock). From a battery point of view: wow! The app says it increases my battery life by a 2.5 factor! And this is pretty much what I observe!!!
Juice plotter is also a must: it tells you how long you will last on your battery and I find it to be the most accurate app of this kind!
9. Condition / Calibrate your battery
This one is also a must – and you should do it time to time, let’s say once a month and always first thing to do after you flashed a new ROM!
1. Plug the phone overnight.
2. In the morning: don’t unplug! Check you have 100%, check you have CurrentWidget showing 0 mA if yes/yes, restart the phone / if not, wait until you got a yes/yes answer.
3. After reboot, don’t unplug! Wait again 15 minutes charging. Check you have 100%, check you have CurrentWidget showing 0 mA if yes/yes, go to step 4 / if not, wait until you got a yes/yes answer.
4. Don’t unplug! Clear battery statistics: use a small app named “BatteryCalibration” for that!
5. Unplug your phone, use throughout the day - Don’t charge until you reached 0% battery (when the phone switches-off itself).
6. Charge again overnight up to 100% and CurrentWidget at 0 mA.
7. You’re good to go, on daily use, you can charge upon need even if not at 0%.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
By the way, if you use GPS navigation and/or Bluetooth system in your car, you must invest in a car charger – and plug the phone every time you are in your car (if not the day during which you are calibrating)… it’s another way of increasing battery life – ok, I admit, it’s more a “trick”!
10. Use small apps that help switch on/off the screen when needed
I also tested 2 small apps that actually could help battery saving on the one side, but also increase the user experience on the other side.
Screebl pro: this app is just fantastic! According to screen orientation, it senses if you are using your phone or if it is resting (lying) on the table.
Before screebl: in order to save battery I had the screen timeout set to minimum (15sec). But each time I was reading a long e-mail, I was "playing" with the screen (up-down-up-down) in order to prevent the screen to switch-off and then unlock, etc... This was really annoying. And disturbing: I could not read an e-mail or a webpage without think: "oh, I need to play with the screen somehow or it will switch-off very soon"...
After screebl: the screen timeout is now 5sec! (through screebl) so if the phone is resting, it switches-off more rapidly = you save more battery! And when I read an e-mail or a webpage, I just relax, concentrate on the content! Anyway, the "ON" time is the same because you had to read this e-mail anyway...
ProximityScreenOff:this is also an app to have. It switches-off the screen according to the proximity sensor status: if proximity is detected, the screen goes off. If you are left-handed as I am, you need to take care of not hiding the proximity sensor when you drag the notification bar down, but it is manageable. Not only it is easier to switch-off screen now. It is also saving battery if the phone accidentally switches-on in your pocket! We already had the lockscreen which prevent your phone doing silly things in your pocket. Now even better: in your pocked, the screen switches-off almost instantly!
There is also an option to switch screen ON when proximity is detected, but warning! this drains battery - so I don't use it!
And last but not least...
11. Track any bad app
% of battery improvement depending on situation
Yes, you should know about the Email.apk bug (thanks to themadproducer - I think you learn me that). And generally: you should monitor what is going-on.
I use Watchdog which will alert you as soon as an app uses CPU above a certain threshold that you set. So you know for example that a particular app eats a lot of CPu, which means battery! Watchdog also has a "white list" function for those app that you know are consuming quite a bit of CPU but that you absolutely want to keep!
Go time to time in Spare parts / Battery history / partial wake usage and see which apps are preventing your phone to sleep - they are eating your battery instead!!!
Use CurrentWidget (with log if you want) in order to track instant high current consumption but remember you have to double check with the other above tools as current might be quite high time to time, but it is a normal situation.
Edit: I had an issue with CurrentWidget. In my case, I was logging too much and in Settings / About Phone / Battery usage, CurrentWidget was showing 12%!!! Unistalling / reinstalling might correct the issue (to be confirmed).
Use Battery Monitor Widget Pro: this will draw a graph with the battery % history in a widget, so that you can see at a glance if your battery have been decreasing with a higher rate than usual (by checking visually the slope of the curve). This also to alert you that there is something to track!
I recommend you read this thread which completely describes in a very comprehensive way how to track a battery drain!
Additional thoughts
Of course, if you are on this forum, there is a chance that you like flashing ROMs, tweak it, change settings, etc… All these activities of course use more battery than what I would call the “normal” use…
Also, some activities literally pump out the battery: games, movies, camera, camcorder, GPS navigation, bluetooth headset/earset/car system… There’s no much to do about that – just just need to be aware that they use a huge amount of battery to run; after that you make your choice: game or battery / movies or battery / do I really need the GPS navigation from work to home / etc…
Additional improvements for your phone
I strongly recommend the use of Tyween's Typhoon NAND ROM it is the most stable and complete ROM ever. I tested all of them and as soon as I flashed Typhoon, I understood it was the best... I then continued testing others, but eventually, I went back to this one!!! It is fast, reliable and updated very often! Tyween's Typhoon is here.
My Juice Defender settings
Status Tab
JuiceDefender Ultimate: Enabled
Profile: Advanced
Control Tab
Mobile Data: Enabled
WiFi: Enabled
Options: wifi preferred
3G: not working on Typhoon
AutoSync: ping
Keep enabled: none
Timeout: disabled
Keyguard: none
Home WiFi network: your home network
Brightness/CPU/Speeds/Governor: none
Schedules Tab
Schedule: enabled
Frequency: 1h
Duration: 2m
Controls: default
Night: enabled
Start/End: 0:00 -> 7:00
Adaptive start/end: start +1h max, end -1h max
Option: none
Peak/Frequency/Duration/Controls: disabled
Weekend: disabled
Triggers Tab
Battery: enabled
Battery threshold: 15%
Charger: usb ac
Screen: enabled
Options: ignore on low battery
Controls: default
Traffic: enabled
Traffic threshold: Normal / 15s
Apps: enabled
Configure: interactive
Controls: default
Location: enabled
Properly setup "SettingProfiles"
1. Open SettingProfiles
2. Go on the "Locations" tab
3. "Menu/New Location"
4. In the pop-up menu select "Cell Towers identified" (do not select "Lat/Lon Identified": this would deplete your battery)
5. A window opens-up with the current cell tower id open "Menu/Save as Cell Location"
6. In the pop-up menu, give a name to this location: e.g. "Home" or "Work" depending on the place you are right now
7. Still in this menu, you can check the "auto-save for 60 minutes". If you do so, then during the next hour, all new cells that are seen will be saved automatically as a cell for the just created location. Be careful: if you check this function, you need to be sure you will stay in this very location (e.g. stay at home) during the next hour.
You're done the "Location" is created and and several Cell Towers are saved for this location. Now it appears in the list in the Location tab.
After that, you need to do the following:
1. In the "Profiles" tab, create a profile named "Wifi ON" which leaves everything as it is except Wifi that it will switch-on
2. Still in the "Profiles" tab, create a profile named "Wifi OFF" which leaves everything as it is except Wifi that it will switch-off
3. In the "Rules" tab, create a new rule. Add condition: "Location" and then select the appropriate location where you want Wifi on. Add action: "Activate profile" and then select "Wifi ON". Back key: your rule is appearing now in the "Rules" tab.
4. Still in the "Rules" tab, create a new rule. Add condition: "Location" and then select the appropriate location where you want Wifi off and check "inverse logic". Add action: "Activate profile" and then select "Wifi OFF". Back key: your rule is appearing now in the "Rules" tab.
You're all set!
The beauty of SettingProfiles is that in the rules created on point 3 and 4, you can add several locations in the same rule. e.g. it will activate "Wifi ON" when you are at Home or at Work...
Follow-up: if in future you realize that SettingProfiles has selected "Wifi OFF" when it should have selected "Wifi ON", it means that there is a new Cell Tower accessible from (let's say) Home. In this case, go on the "Locations" tab, click on "Home" and if this Cell Tower is not in the list, there will be automatically a "save" button on the top of the list. Hit "save" to say to the app that this Tower is also part of "Home".
If you realize that SettingProfiles has selected "Wifi ON" when it should have selected "Wifi OFF", well that's nothing to do about. A Cell Tower that is accessible from (let's say) Home can also be accessible 1km from Home... However, this is not a major drawback: you are experiencing this situation only during commuting transitional times.
Extreme Users section
For those users who are ready to decrease their user experience (refer to disclaimer in post 1) here are additional settings!
Warning: if you apply these tips, you may not be happy with:
* too much involvement from your side (go switch-on switch-off things)
* widgets and other functions not properly working (i.e. auto location)
* e-mail that are not flowing / not syncing with the period you defined
Tips:
A. Turn off network location, GPS and auto sync (dorimanx)
B. South to 2g (dorimanx)
C. Set Juice Defender on "extreme" (beston94)
D. ... suggest yours!
Changelog
July 12th
* Added tip #10: Use small apps that help switch on/off the screen when needed
* Moved old tip #10 to #11: Track any bad app
July 6th
* Added the "Properly setup SettingProfiles" in post 2
July 1st
* Added disclaimer and "red %" signification in beginning of post 1
* Updated SetCPU profiles (Tip 2)
* Tips to test Undervolting values (Tip 3)
* Potential issue alert with CurrentWidget (Tip 10)
* Added JD stettings in post 2
* Added "Extreme Users" section is post 2
* Added Changelog in post 3
Nice thread.
I hope people look at this before posting "my battery life sucks.."
Do you have your statistics for the percentage gain/loss of the battery?
settings
Well you said anybody who is interested in settings on juicedefender ultimate?
Well i am on cmylxgo rom i got 37 hours on and still had 30% left with moderate usage.
But maybe your settings are better ;P
parker09 said:
Do you have your statistics for the percentage gain/loss of the battery?
Click to expand...
Click to collapse
The % I wrote are from "gut feeling"...
However, I know for sure that: before applying any tip, my battery was lasting 6 hours. Now with those tips, it lasts 18 hours!!!
You should try for yourself and report results!
beston94 said:
Well you said anybody who is interested in settings on juicedefender ultimate?
Well i am on cmylxgo rom i got 37 hours on and still had 30% left with moderate usage.
But maybe your settings are better ;P
Click to expand...
Click to collapse
Uh... So you mean that you drain your battery in 50+ hours? More than 2 full days?
Mmmmmm...
So if it's not fake, you would share with us your "tip" from another world... And also elaborate a little bit on what you mean by "moderate" usage!
We are listening to you...
Hmmm... you get over 50 hours on your battery... do you use it?
Wow i see you got a nice Tread WELL DONE!!! One more Step to perfect Phone!
And Thanks for adding my tread on your main PAGE! it's an Honor!
I am now your follower
By the way my phone cant go under 925 Voltage if i set 900 on 245MHZ it's stuck in 2 seconds!
But as you know i have configured the minimal voltage script that work for me in my tweaks. bummer that my CPU like more battery!
Good Job
Thanks for your support!
This evening, I plan to:
Update first post with new settings/information
Load my JD settings (will be in post 2)
Check it out!
Thank you. Very interesting thread!
Now i feel inspired to do something for my battery...
I have a tip for battery save.
turn off network location and GPS and auto sync and switch to 2g if you can.
then when you need one of the futures just turn it on and when finish turn off.
this can save 15% battery or more.
Sent from my HTC HD2 using XDA Premium App
Looki75 said:
Uh... So you mean that you drain your battery in 50+ hours? More than 2 full days?
Mmmmmm...
So if it's not fake, you would share with us your "tip" from another world... And also elaborate a little bit on what you mean by "moderate" usage!
We are listening to you...
Click to expand...
Click to collapse
Here are my secrets juice defender ultimate on extreme and I turn on wifi whenever I want to. I also have auto killer on strict mode don't remember the exact numbers and as for my moderate usage I took 6 1minute calls and 10message received and 3 sent and a Couple of times on xda 5 minute each. Lets not forget setcpu was on on demand not over or under clocked and my profile was screen off 245 499 and my charge was 245 1190 and when battery goes under 40 its undervolted to 245 to 780. Btw I was using cmylgxo rom the lite one since I'm on European HTC hd2.l
Press thanks if I helped anyone.
Sent from my HTC HD2 using XDA Premium App
If it is everything ok with yours builds/kernell everybody should have more than 24hours on moderate use...
I mean normal batterry consumption in stand-by should be around 3-10ma depending of reception and what is turned on...
If that is not the case than you have litlle bit more than 8 hours... i mean that sucks
I thought also it's imposible but some experimenting with different build's and kernells get me to this that i can use my device for almoust day and a half without turning wifi off.
p.s. juicedefender is enabled at balanced...
Hi everybody!
I just added a lot of things in the first 3 posts!
Check-out changelog in post 3!!!
* New SetCpu profiles
* My JD settings
* and much more... !!!
Check it out!!!
very nice tips here, but am struggling with JD atm as it says the rom i use doesnt support mobile data, does your 3g work with JD activated ? if so how do i get it working for me,
thanks, great thread btw
Found room for this useful thread in my signature
To enable JD notifications or not? Because I think notifications eat battery.
LaneyEFC said:
very nice tips here, but am struggling with JD atm as it says the rom i use doesnt support mobile data, does your 3g work with JD activated ? if so how do i get it working for me,
thanks, great thread btw
Found room for this useful thread in my signature
Click to expand...
Click to collapse
Thanks for linking to my thread in your signature
If you mean Controls Tab / 3G then JD asks you to "Proceed".
When you hit the "Proceed" button, it proposes you to install "Juice Defender AOSP Helper". You should install this app and then hit "enable" in Controls Tab / 3G.
However, some ROMs do not support this function and in this case, "Juice Defender AOSP Helper" will not install. Typhoon for example does not support this soft.
Now here is something for you: you can install a soft named "Toggle2G-update.zip" (the update through CWM if you are running Gingerbread 2.3.4).
"Toggle2G-update.zip" is in this thread, with all explanations:
http://forum.xda-developers.com/showthread.php?t=739530
You can also choose another similar app (there are a lot of them).
This will perform the same than JD / Controls Tab / 3G but with a separated software.
Cheers!
radee85 said:
To enable JD notifications or not? Because I think notifications eat battery.
Click to expand...
Click to collapse
Hello,
I enabled JD notifications.
Why? Because in a glance you can know what is JD status (I use the graphical notifications).
I never noticed any particular drain related to JD notifications, and let's say to any notifications... I also heard about that but could not reproduce the drain.
If you have any precise information about a notification-caused drain, this is an interesting information that you can share in this thread.
Thanks to report your observations!
Cheers!
I'm using 3.09 ROM (but occurs with all ROMs):
Unexpected reboots occur only when screen off, specially if I've switched off the screen manually.
For testing I set the phone storage as default storage instead of the SD storage. From then, I've reduced to half reboots in a day... I've been getting around 10 reboots in a day, now 5.
Also I tried to write system logs in sdcard until reboot happens.
I installed a SSH apk in my UMI: https://play.google.com/store/apps/details?id=web.oss.sshsftpDaemon&hl=es
I connected via ssh from your computer and executed:
"cat /proc/kmsg > /storage/sdcard1/log.log &"
Then : exit from ssh session, close android ssh app.
It seems there must be a problem with kernel or governor when switching off/on cpu's when UMI comes back from sleep.
Last lines before reboot:
<5>[11919.129381] (0)[18972:kworker/u:5][SLP] [MENTION=522570 [MENTION=5839521 [MENTION=1065870 [user=1879310]@@@@[/user][/MENTION][/MENTION]@[/MENTION] [MENTION=522570 [MENTION=5839521 [MENTION=1065870 [user=1879310]@@@@[/user][/MENTION][/MENTION]@[/MENTION]@@@
<5>[11919.129393] (0)[18972:kworker/u:5][SLP] Chip_pm_end
<5>[11919.129403] (0)[18972:kworker/u:5][SLP] [MENTION=522570 [MENTION=5839521 [MENTION=1065870 [user=1879310]@@@@[/user][/MENTION][/MENTION]@[/MENTION] [MENTION=522570 [MENTION=5839521 [MENTION=1065870 [user=1879310]@@@@[/user][/MENTION][/MENTION]@[/MENTION]@@@
<4>[11919.129415] (0)[18972:kworker/u:5]Restarting tasks ... done.
<6>[11919.139172] (0)[18972:kworker/u:5][pm_notifier_call_chain]: there are 4 notify callbacks, event = 4
<6>[11919.139241] (0)[18972:kworker/u:5]msdc: 0,mmc_schedule_delayed_work ret= 1
<6>[11919.139280] (0)[18972:kworker/u:5]msdc: 1,mmc_schedule_delayed_work ret= 1
<6>[11919.139303] (0)[18972:kworker/u:5]PM: suspend exit 2015-04-04 14:36:14.414863846 UTC
<6>[11919.139345] (0)[18972:kworker/u:5]active wakeup source: event6-742
<6>[11919.139358] (0)[18972:kworker/u:5]active wakeup source: event1-742
<6>[11919.139368] (0)[18972:kworker/u:5]active wakeup source: event2-742
<6>[11919.139379] (0)[18972:kworker/u:5]active wakeup source: event5-742
<6>[11919.139389] (0)[18972:kworker/u:5]active wakeup source: event0-742
<6>[11919.139400] (0)[18972:kworker/u:5]active wakeup source: event4-742
<6>[11919.139419] (0)[18972:kworker/u:5]active wakeup source: alarm
<6>[11919.139431] (0)[18972:kworker/u:5]active wakeup source: pmicAuxadc irq wakelock
<6>[11919.139442] (0)[18972:kworker/u:5]active wakeup source: EINT wakelock
PMIC6323 Module code: https://android.googlesource.com/ke...vers/misc/mediatek/power/mt6582/pmic_mt6323.c
MT6323 is a power management system chip optimized for 2G/3G handsets and smart phones. Handles all 2G/3G/smart phone baseband power management .
PMIC 6323 datasheet: http://www.datasheet-pdf.com/datasheet-html/M/T/6/MT6323_MEDIATEK.pdf.html
I tried putting SIM in SIM2 slot (MicroSD slot) , disabling GPS, smart screen and air gesture, using Dalvik/ART, 3G data disabled... but still reboots.
In battery menu I can't disable power saving mode, I uncheck the box, but when I exit menu and enter to battery menu, the checkbox is marked again.
Now I'm looking for a 1,7GHz kernel (UMI ROM V3.09). Can anyone share it, please?
I'm using 3.09 and get about 1 reboot every few days.
It's always when the phone is in standby. I'll just hear it vibrate and when I look at it, it's rebooting.
Workaround to avoid reboots
No reboots in several days.
Workaround: Set as CPU governor "Powersave" or "performance" (UMI uses hotplug by default).
Okay, thanks, I'll try with powersave
drodero said:
No reboots in several days.
Workaround: Set as CPU governor "Powersave" or "performance" (UMI uses hotplug by default).
Click to expand...
Click to collapse
You can also use hotplug if you disable hotplugging of cores in the governor settings.
how can I change default governor in 3.09 rom??
Thanks!
EDIT: found 3c cpu manager !
Jimband said:
You can also use hotplug if you disable hotplugging of cores in the governor settings.
Click to expand...
Click to collapse
In powersave mode (no cores deactivation), battery decreases 1% each 12 minutes approx.
In hotplug mode, when setting "is_hot_plug_disable=1", or min core number to "2" , smartphone loses configuration after a reboot.
Is there any way to decrease work frequency to 1.7GHz or lower?
In powersave mode (no cores deactivation), battery decreases 1% each 12 minutes approx.
Click to expand...
Click to collapse
I can confirm this. powersave is not really "powersave". Lost 50% of my battery within 30min screen-on time duiring the day. Any other solutions for the reboot issue??
I'm using @arcatarc Emui 3.09 superleggera rom. We really need to fix that problem. Umi Zero is half a year on the market and there are still reboot issues... that sucks.
Undefined007 said:
I can confirm this. powersave is not really "powersave". Lost 50% of my battery within 30min screen-on time duiring the day. Any other solutions for the reboot issue??
Click to expand...
Click to collapse
I'm using the following script to fix reboots with hotplug governor:
echo "4" >/sys/devices/system/cpu/cpufreq/hotplug/cpu_num_base
echo "4" >/sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit
echo "0" >/sys/devices/system/cpu/cpufreq/hotplug/cpu_rush_boost_enable
sleep 3
echo "1" >/sys/devices/system/cpu/cpufreq/hotplug/is_cpu_hotplug_disable
So basically what it does is fix the core count to four and then disable core hotplugging. It works really well. Maximum performance will drop due to only four cores, but general smoothness is possibly even better because of four cores being online always when awake.
Jimband said:
I'm using the following script to fix reboots with hotplug governor:
echo "4" >/sys/devices/system/cpu/cpufreq/hotplug/cpu_num_base
echo "4" >/sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit
echo "0" >/sys/devices/system/cpu/cpufreq/hotplug/cpu_rush_boost_enable
sleep 3
echo "1" >/sys/devices/system/cpu/cpufreq/hotplug/is_cpu_hotplug_disable
So basically what it does is fix the core count to four and then disable core hotplugging. It works really well. Maximum performance will drop due to only four cores, but general smoothness is possibly even better because of four cores being online always when awake.
Click to expand...
Click to collapse
I tried several apps and manual config, in my case:
/sys/devices/system/cpu/cpufreq/hotplug/cpu_num_base --> Always is reset by system to "1", impossible to save a value different to 1.
/sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit --> Has no effect while is_cpu_hotplug_disable=1, always is using 8 cores
It seems that some parameters can't be modified with this kernel.
drodero said:
I tried several apps and manual config, in my case:
/sys/devices/system/cpu/cpufreq/hotplug/cpu_num_base --> Always is reset by system to "1", impossible to save a value different to 1.
/sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit --> Has no effect while is_cpu_hotplug_disable=1, always is using 8 cores
It seems that some parameters can't be modified with this kernel.
Click to expand...
Click to collapse
Both timing and order are important here: you have to disable the hotplugging last and let the online cores settle to 4 before disabling the hotplug. That's why I use the sleep in the script.
drodero said:
In powersave mode (no cores deactivation), battery decreases 1% every 12 minutes approx.
In hotplug mode,some parameters lose their configuration after a reboot.
Is there any way to decrease work frequency to 1.7GHz or lower?
Click to expand...
Click to collapse
I think hotplug governor with cpu hotplugging disabled is worst than powersave governor, battery decreases 1% every 8-9- 10 minutes. I'm testing different hotplug parameters...
Configuration #1:
powersave bias=250
up threshold=90
down diferential=5
cpu num limit=8
is cpu hotplug disable=1
Battery level decreases 1% every 15 min at least (sometimes 1% every up to 30 mins), same condition as previous tests (display off, wifi ON, BT ON, Location menu: GPS ON)
Antutu: 26500
With hotplugging disabled, I think cpu_rush_* and cpu_input_boost_* paramaters are irrelevant, but just in case I set:
cpu rush boost enable=0
cpu input boost enable=0
I suppose it makes them fully irrelevant.
Configuration #2:
powersave bias=250
up threshold=90
down diferential=5
cpu num base=4
cpu num limit=4
is cpu hotplug disable=1
also: cpu rush boost enable=0, cpu input boost enable=0
1% battery every 30-40mins
Configuration #3:
powersave bias=250
up threshold=95
down diferential=15
cpu num base=4
cpu num limit=4
is cpu hotplug disable=1
Testing config #4:
Script:
echo "0" > /sys/devices/system/cpu/cpufreq/hotplug/is_cpu_hotplug_disable
sleep 3
#echo "5" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_down_differential
echo "250" > /sys/devices/system/cpu/cpufreq/hotplug/powersave_bias
#echo "95" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_up_threshold
echo "4" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit
#echo "8" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_rush_boost_num
echo "0" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_rush_boost_enable
#echo "30000" > /sys/devices/system/cpu/cpufreq/hotplug/sampling_rate
#echo "2" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_input_boost_num
#echo "1" > /sys/devices/system/cpu/cpufreq/hotplug/io_is_busy
echo "95" > /sys/devices/system/cpu/cpufreq/hotplug/up_threshold
#echo "8" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_rush_avg_times
echo "5" > /sys/devices/system/cpu/cpufreq/hotplug/down_differential
echo "4" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_num_base
#echo "98" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_rush_threshold
#echo "5" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_rush_tlp_times
#echo "1" > /sys/devices/system/cpu/cpufreq/hotplug/sampling_down_factor
echo "0" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_input_boost_enable
#echo "10" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_down_avg_times
#echo "0" > /sys/devices/system/cpu/cpufreq/hotplug/ignore_nice_load
#echo "20" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_up_avg_times
sleep 3
echo "1" > /sys/devices/system/cpu/cpufreq/hotplug/is_cpu_hotplug_disable
Obviously, the major battery saving you can get is when you're using less cpu (hotplugging on), but you'll get reboots...
Finally, I'm using 2 CPU, with Max Freq limited to 1,7 for better battery life.
echo "2" > /sys/devices/system/cpu/cpufreq/hotplug/cpu_num_limit
- Long battery Life (with display off, BT ON, Wifi ON).
- Good performance, Antutu score: over 20.000
OK, let's give that a try. I'll try the second alternative.
50% within 5 hours. Screen on time 40min. Configuration 2 is much worser than stock.
Easy solution:
As reboots always occurs when the display is off , try to use "setcpu" or a similar app to configure:
-When screen off, select governor powersave
-When screen on, set governor hotplug.
So no more reboots when screen off... but battery will drain.
For better battery life , config #4 - 5.
Apply cpu script at boot:
0.-Remove cpu managers apps, or unmark "set config at boot"
1.-install universal init.d support.
2.-Access to /etc/init.d with rw permissions.
3.-Put the script into a file in this path, example: "/etc/init.d/99cpu"
4.-Reboot smartphone and check the applied config after the reboot.
Battery Monitor: https://play.google.com/store/apps/details?id=ccc71.bmw
When screen off, cpu is set to 1144MHz. With screen off, working freq should be the lower freq (728MHz)...
Hi, and there is no solution to this problem without deactivating 4 or 6 cpu cores??
We paid for an 8 core device...
I will never buy anything more from umi, **** them
vjeta said:
Hi, and there is no solution to this problem without deactivating 4 or 6 cpu cores??
We paid for an 8 core device...
I will never buy anything more from umi, **** them
Click to expand...
Click to collapse
Try to install EMUI 3.0 or EMUI 3.0 SUPERLEGGERA from arcatarc (with 1,7Ghz kernel). I'm using the first one and I've suffered only a few reboots. It's a very good ROM!
Thanks, but the problem is I don't like emui, I prefer stock android and my cpu running and its full 2.0Ghz speed...
That's what we paid for, umi...
very very disappointed with this phone
drodero said:
Try to install EMUI 3.0 or EMUI 3.0 SUPERLEGGERA from arcatarc (with 1,7Ghz kernel). I'm using the first one and I've suffered only a few reboots. It's a very good ROM!
Click to expand...
Click to collapse
Device : H60 L04 (4.4.2) -Rooted Stock Version B374
Nobody likes battery dying on them or having a battery die faster than it’s expected life time. On the other hand extending battery life is good incentive if you don’t plan to change your cell before the battery lives it’s lifespan
This thread shows you one way to do that
Leaving your cell phone plugged in while charging overnight, or for extended periods is something we end up doing fairly often.
While the battery doesn’t suffer electrical damage due to this, it surely gets deteriorated as the battery is maintained at a high temperature internally harming it, much like leaving it on your car dashboard on a hot summer day.
(Because chargers do a good job of limiting the charging current as the charge increases but the voltage reaches 4.2 V or beyond, while the optimum voltage level should be 4V at the higher end for longer battery life)
It is therefore much safer to have the battery stop charging much before it reaches 100% charge.
These threads will give you a better insight into:
a)Why it is better to charge more frequently instead of discharging fully and charging to 100%
b)Deterioration of battery at charging beyond 90% and keeping it for extended duration in that stage
http://forum.xda-developers.com/showthread.php?p=9777867#post9777867
http://batteryuniversity.com/learn/article/charging_lithium_ion_batteries
http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
There is NO app on Play Store which can do this and this involves some kernel level tinkering and AFAIK only Nexus 5 has a kernel mod to do this. This thread shows you a way to do it using a macro using the excellent app “MacroDroid “,developed by @UndeadCretin (http://forum.xda-developers.com/showthread.php?t=1694335).
The free version of MacroDroid suffices for this purpose but I strongly recommend it for those who like to personalize their phones and do things in a smart way. Honestly, it is extremely versatile and you can do a lot with it. And with minimal learning curve
This macro enables you to safely leave the charger plugged in for any duration and the charging gets automatically terminated or limited once the predetermined level is reached, even though it is connected and powered on !!!.NO manual intervention
Pre requisites
1.MacroDroid
2.Terminal Emulator (from Play Store)
3.Rooted phone running stock ROM
4.Root Explorer (prefer SD maid as it enables you copy the path of file which saves typing effort)
Procedure
1.Mount system R/W
Type su on the terminal emulator and enter this
mount -o remount,rw -t yaffs2 /dev/block/platform/ff1fe000.dwmmc0//system /system
OR
busybox mount -o remount,rw /system
2.Enable SElinux Permissive ( DO This if you have a problem in mounting per step 1. It is lost on booting, so you are back to enforcing after boot and this doesn't interfere with macro running)
Type su followed by setenforce 0. This will make SElinux permissive
Status can be verified by typing getenforce, which will return Permissive
3.Create a folder in your internal SD card by any name, say “for_testing”
Next, Navigate to the folder in this path .
/sys/devices/amba.0/fdf0a000.i2c/i2c-0/0-006b
You will see a file “enable_charger”. Set permissions 777 for this and copy this file to your internal SD folder (“for_testing).
Important: Don’t connect charger during this step
4.Create a macro in macrodroid
Trigger : Battery >=90% (or any level you choose)
Action:
1. Launch Shortcut Term Shortcut (this opens a window for the terminal emulator app where you can enter the following sh command
su –c “cp /storage/emulated/legacy/for_testing/enable_charger /sys/devices/amba.0/fdf0a000.i2c/i2c-0/0-006b”
Quotes are a MUST
2. Wait 10 seconds
3. Kill application – in the drop down menu choose Terminal Emulator
Constraints : None (leave it blank)
5.Remember to enable MacroDroid in Protected Apps and also enable it in accessibility settings
You are done !!!
How this works – when the charger is connected, the file enable_charger has the value 1 in it and when disconnected it has 0. Our aim is to disconnect charger on reaching desired charge (here 90%). The macro does exactly that by copying the file from your internal SD which has a value 0 and overwriting the same file in system having value 1. You can physically see that the charging LED switches off and charge doesn’t go beyond 90 %
Note:
1.You own what you do with your cell, not me, so please don’t expect me to help you from sticky situations or bricked phone
2.If something doesn’t work (it should , this is tested on my cell), please recheck terminal command syntax or ask someone who knows ( not me) or Google it
3.If you find that it works for other Honor 6 models please post here so that others can benefit
My MOTO X PLAY not charging when the charger is plug-in from the normal system, but I can recharge it from the recovery mode to 84%.
Attachments: -
1- screenshot from recovery mode (TWRP) shows wrong value in CPU temperature.
2- screenshots from CPU-Z shows normal CPU temperature but battery health is (cold).
3- screenshot from AMPERE shows battery temperature is (-30.2 c) & battery status is discharging during connect the charger.
How to resolve this issue?
hentorky said:
My MOTO X PLAY not charging when the charger is plug-in from the normal system, but I can recharge it from the recovery mode to 84%.
Attachments: -
1- screenshot from recovery mode (TWRP) shows wrong value in CPU temperature.
2- screenshots from CPU-Z shows normal CPU temperature but battery health is (cold).
3- screenshot from AMPERE shows battery temperature is (-30.2 c) & battery status is discharging during connect the charger.
How to resolve this issue?
Click to expand...
Click to collapse
Hi there,
I have a Moto X Play with the same issue. Have you found a solution?
Regards.
hentorky said:
My MOTO X PLAY not charging when the charger is plug-in from the normal system, but I can recharge it from the recovery mode to 84%.
Attachments: -
1- screenshot from recovery mode (TWRP) shows wrong value in CPU temperature.
2- screenshots from CPU-Z shows normal CPU temperature but battery health is (cold).
3- screenshot from AMPERE shows battery temperature is (-30.2 c) & battery status is discharging during connect the charger.
How to resolve this issue?
Click to expand...
Click to collapse
If it's a software problem, then it may go away with flashing of stock rom.
Sent from my Moto X Play using Tapatalk
K.khiladi said:
If it's a software problem, then it may go away with flashing of stock rom.
Sent from my Moto X Play using Tapatalk
Click to expand...
Click to collapse
Already flashed, the problem persists.
Wanted to know if OP was able to solve this.
After 18 months of reliable use, by X Play now has the same issue, with Ampere showing "cold" and -24.9C. By removing the rear cover and blowing a hair dryer until the sensor is now returning -18C, at which point it has started to charge. Does anyone have a clue of how to fix an error with the battery temperature sensor?
adrian r said:
After 18 months of reliable use, by X Play now has the same issue, with Ampere showing "cold" and -24.9C. By removing the rear cover and blowing a hair dryer until the sensor is now returning -18C, at which point it has started to charge. Does anyone have a clue of how to fix an error with the battery temperature sensor?
Click to expand...
Click to collapse
Did the temperature return to -24? Was the fix permanent? I am experiencing this issue too and will try the dryer as soon as I can.
Similar problem in Nexus 5
The problem seems similar to problem faced by Nexus 5 users,
I don't know how useful the solutions will be for Moto X Play,
The solution on that thread (especially for Out Of Warranty Products ) is to press the battery status connector to the motherboard
or
to first re-align the pins ( and then press the connector with some tape type thing ),
the thread on which the solution was posted : https://forum.xda-developers.com/google-nexus-5/help/battery-issue-charge-cold-t3100267
Lokken said:
Did the temperature return to -24? Was the fix permanent? I am experiencing this issue too and will try the dryer as soon as I can.
Click to expand...
Click to collapse
Sorry, didn't see your query as for some reason I had no notification of a reply. The hairdryer worked for a couple of weeks but it has developed to the point that I've been worried about damaging the phone as it is very difficult to achieve a rise in the measured temperature whilst the real temp must have been quite high! About to try the advice of the following post, by reseating the battery connector.
---------- Post added at 02:43 PM ---------- Previous post was at 02:27 PM ----------
nightBulb said:
The problem seems similar to problem faced by Nexus 5 users,
I don't know how useful the solutions will be for Moto X Play,
The solution on that thread (especially for Out Of Warranty Products ) is to press the battery status connector to the motherboard
or
to first re-align the pins ( and then press the connector with some tape type thing ),
the thread on which the solution was posted : https://forum.xda-developers.com/google-nexus-5/help/battery-issue-charge-cold-t3100267
Click to expand...
Click to collapse
Very good, nightbulb, thanks - will give that a go and report back here.
adrian r said:
Sorry, didn't see your query as for some reason I had no notification of a reply. The hairdryer worked for a couple of weeks but it has developed to the point that I've been worried about damaging the phone as it is very difficult to achieve a rise in the measured temperature whilst the real temp must have been quite high! About to try the advice of the following post, by reseating the battery connector.
Click to expand...
Click to collapse
The hairdryer was not useful to me. Although the temperature did rise and the status was set to "charging" the battery level either was not rising or was rising too slowly to be useful. What worked for me was boot in factory mode through bootloader for charging. Works 2/3rds of the time, no matter the temperature showing. Also it never charges completely. It halts at a limiting point. This point was about 75% at start, now it is about 68%. I am considering sending it for repair, since I have no tools to open it and try to repair it myself. Please, keep update on what happens. Good luck with the Nexus method, I hope it works.
Ps.: I would be grateful if you could tell me what kind of tools it is needed for this.
Did you find a solution?
Lokken said:
The hairdryer was not useful to me. Although the temperature did rise and the status was set to "charging" the battery level either was not rising or was rising too slowly to be useful. What worked for me was boot in factory mode through bootloader for charging. Works 2/3rds of the time, no matter the temperature showing. Also it never charges completely. It halts at a limiting point. This point was about 75% at start, now it is about 68%. I am considering sending it for repair, since I have no tools to open it and try to repair it myself. Please, keep update on what happens. Good luck with the Nexus method, I hope it works.
Ps.: I would be grateful if you could tell me what kind of tools it is needed for this.
Click to expand...
Click to collapse
You need a T3 screwdriver, I have opened up the back and tightened the battery connection but without result, still indication -30, did you find a solution?
Same problem here, suddenly Ampere reports -30.2C and Recovery something similar (although it's an unsigned int in TWRP so a very large number instead.) Thanks so much for mentioning that the phone still charges sometimes in Recovery, I hadn't noticed this and it's a lifesaver (the problem started on an overseas holiday)!
TLDR: I opened my phone up and was unable to make anything better, but I think a new battery will fix it. Seems like maybe a common battery fault.
The battery gas gauge sensor is MAX17050 and -30.2C is the minimum reading in the temp conversion table.
The phone battery connector on the mainboard has 4 terminals - VBAT, then two monitoring terminals, then Ground. The MAX17050 datasheet suggests the two monitoring terminals are an NTC thermistor. At approx 22C I measure 120Kohms across the battery's monitoring terminals when they are disconnected, which probably means a 100K thermistor not 10K. But it seems like one thermistor terminal has shorted inside the battery to VBAT, which on the MAX17050 reference schematic would correspond to a minimum temperature reading.
I looked at the on-battery protection board (under the black plastic above the flex connector) and no visible short or fault there, but it's potted in epoxy so hard to probe (and dangerous, don't fiddle with this unless unless you're sure you won't start a fire).
I think a new battery will fix it. It could still be a different fault though, I don't know for sure. I was planning to get a new phone anyhow so I'm not sure I'll bother trying to find a decent replacement battery to test this out (but if anyone knows an OEM-quality source, please post!).
I have the same issue with a Motorola X Pure Edition. Could anyone fix it? I replaced the battery but the problem remains.
Nothing worked.. I changed the battery and its charging now..
As a general cause for such an incident
Dal101 said:
I have the same issue with a Motorola X Pure Edition. Could anyone fix it? I replaced the battery but the problem remains.
Click to expand...
Click to collapse
Cm.nawin said:
Nothing worked.. I changed the battery and its charging now..
Click to expand...
Click to collapse
If the values of the sensor are at its lowest, it is most likely a faulty sensor. Can happen due to PCBA malfunctions and broken connectors. Sensor failures cannot be solved by software but in some cases if the ADC decoding is flawed, full power cycle can solve issues often. Like complete discharging of the battery and re initiating the charging.
Just a general thought as an Electrical Engineer.
Hi. I had this problem, it's hardware unfortunately. I tried to repaired it but no Technical Support wanted to do it, so I overcome the problem with a little software trick.
Install Tasker and restore the next project (I'm pasting the xml code and description, use whichever you prefer to import the profile):
TASKER XML
=============
<TaskerData sr="" dvi="1" tv="5.4.5b">
<Profile sr="prof49" ve="2">
<cdate>1527400183082</cdate>
<edate>1536202202231</edate>
<id>49</id>
<limit>true</limit>
<mid0>62</mid0>
<nme>Forzar Carga Moto X</nme>
<State sr="con0" ve="2">
<code>10</code>
<Int sr="arg0" val="0"/>
</State>
</Profile>
<Task sr="task62">
<cdate>1527400197933</cdate>
<edate>1536202202231</edate>
<id>62</id>
<nme>Forzar Carga</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>123</code>
<se>false</se>
<Str sr="arg0" ve="3">#!/bin/sh
echo "Starting script to force charge"
while :
do
connected=`cat /sys/class/power_supply/usb/present`
if [ "$connected" == "1" ]; then
echo 1 > /sys/class/power_supply/battery/charging_enabled
sleep 10
else
sleep 60
fi
done
echo "Script finished"</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
</Task>
</TaskerData>
TASKER DESCRIPTION
====================
Profile: Forzar Carga Moto X (49)
State: Power [ Source:Any ]
Enter: Forzar Carga (62)
A1: Run Shell [ Command:#!/bin/sh
echo "Starting script to force charge"
while :
do
connected=`cat /sys/class/power_supply/usb/present`
if [ "$connected" == "1" ]; then
echo 1 > /sys/class/power_supply/battery/charging_enabled
sleep 10
else
sleep 60
fi
done
echo "Script finished" Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: Continue Task After Errorn ]
Does that work ? Could you please elaborate step by step what has to be done ?
llamero said:
Hi. I had this problem, it's hardware unfortunately. I tried to repaired it but no Technical Support wanted to do it, so I overcome the problem with a little software trick.
Install Tasker and restore the next project (I'm pasting the xml code and description, use whichever you prefer to import the profile):
TASKER XML
=============
<TaskerData sr="" dvi="1" tv="5.4.5b">
<Profile sr="prof49" ve="2">
<cdate>1527400183082</cdate>
<edate>1536202202231</edate>
<id>49</id>
<limit>true</limit>
<mid0>62</mid0>
<nme>Forzar Carga Moto X</nme>
<State sr="con0" ve="2">
<code>10</code>
<Int sr="arg0" val="0"/>
</State>
</Profile>
<Task sr="task62">
<cdate>1527400197933</cdate>
<edate>1536202202231</edate>
<id>62</id>
<nme>Forzar Carga</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>123</code>
<se>false</se>
<Str sr="arg0" ve="3">#!/bin/sh
echo "Starting script to force charge"
while :
do
connected=`cat /sys/class/power_supply/usb/present`
if [ "$connected" == "1" ]; then
echo 1 > /sys/class/power_supply/battery/charging_enabled
sleep 10
else
sleep 60
fi
done
echo "Script finished"</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
</Task>
</TaskerData>
TASKER DESCRIPTION
====================
Profile: Forzar Carga Moto X (49)
State: Power [ Source:Any ]
Enter: Forzar Carga (62)
A1: Run Shell [ Command:#!/bin/sh
echo "Starting script to force charge"
while :
do
connected=`cat /sys/class/power_supply/usb/present`
if [ "$connected" == "1" ]; then
echo 1 > /sys/class/power_supply/battery/charging_enabled
sleep 10
else
sleep 60
fi
done
echo "Script finished" Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: Continue Task After Errorn ]
Click to expand...
Click to collapse
Does that work ? Could you please elaborate step by step what has to be done ? I am not getting what you have done/ and where you have run the script
Did anyone solve this conundrum? Haven't had a working config file since 1.1.3. If you do, please share your config please.
I haven't had issues with Acc from the beginning. Following is an excerpt from my config;
Bash:
default_config () {
acc --daemon
acc --set --reset a
acc --set batt_status_workaround=true off_mid=true apply_on_plug=true reset_batt_stats_on_pause=true
# Specific to Nothing Phone
acc --set charging_switch="battery/charge_control_limit 0 battery/charge_control_limit_max --" force_off=true
acc --set max_temp=45 max_temp_pause=90 shutdown_temp=55 shutdown_capacity=5
acc --set pause_capacity=60 resume_capacity=55 max_charging_voltage=3900
acc --set cooldown_capacity=60 cooldown_charge=50 cooldown_pause=10 cooldown_temp=40
}
What does this do?
* Enforces 98% of the time proper shut-off at 60% battery
* Stops charging both wireless and cabled
* No issues with desynced battery status
My Samsung triple wireless charger works flawlessly. I have another unbranded (got gifted) super cheap wireless charger that makes my phone feel warm when charging is turned off.
I actually had issues, but those were AccA and scheduler related. AccA just crashes a lot, up to the point that it's only good for watching battery stats. The inbuilt scheduler didn't work how I wanted, because the CPU sleeps the Acc daemon when not charging, also Acc fails to set new charging voltage/amperages without a recent battery charge applied (the command hangs asking for attaching the charger).
BertProesmans said:
I haven't had issues with Acc from the beginning. Following is an excerpt from my config;
Bash:
default_config () {
acc --daemon
acc --set --reset a
acc --set batt_status_workaround=true off_mid=true apply_on_plug=true reset_batt_stats_on_pause=true
# Specific to Nothing Phone
acc --set charging_switch="battery/charge_control_limit 0 battery/charge_control_limit_max --" force_off=true
acc --set max_temp=45 max_temp_pause=90 shutdown_temp=55 shutdown_capacity=5
acc --set pause_capacity=60 resume_capacity=55 max_charging_voltage=3900
acc --set cooldown_capacity=60 cooldown_charge=50 cooldown_pause=10 cooldown_temp=40
}
What does this do?
* Enforces 98% of the time proper shut-off at 60% battery
* Stops charging both wireless and cabled
* No issues with desynced battery status
My Samsung triple wireless charger works flawlessly. I have another unbranded (got gifted) super cheap wireless charger that makes my phone feel warm when charging is turned off.
I actually had issues, but those were AccA and scheduler related. AccA just crashes a lot, up to the point that it's only good for watching battery stats. The inbuilt scheduler didn't work how I wanted, because the CPU sleeps the Acc daemon when not charging, also Acc fails to set new charging voltage/amperages without a recent battery charge applied (the command hangs asking for attaching the charger).
Click to expand...
Click to collapse
Would you mind sharing the whole config?
miris83 said:
Would you mind sharing the whole config?
Click to expand...
Click to collapse
CLI commands here, the important bits are functions default_config and idle_config.
nothing-phone/acc-setup.sh at d2cb377baed74b3a6f240df88df44fd29503469f · Bert-Proesmans/nothing-phone
Contribute to Bert-Proesmans/nothing-phone development by creating an account on GitHub.
github.com
Attached the daemon config, constructed from the CLI commands.
!! I use acc version 2022-7-30-DEV btw, https://github.com/VR-25/acc/releases/download/v2022.7.30-dev/acc_v2022.7.30-dev_202207300_2206.zip
I truly believe the dev is doing his best to document all things, but I got worn out trying to understand the limits of acc. So I ended up using a single configuration (till 60%) and dropped the dynamic charging profiles.
Acca profiles weren't of much help either because of crashes (i guess the same "connect charger to set charging voltage" issue). Didn't dig deeper since 2 months.
Not sure what's happening with my attachment; I cannot see it myself. Editing my post also doesn't show it.
So I'll workaround this by providing this gist link to the daemon config.
acc-default-conf.txt
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
Sorry for the confusion.
* There were no issues with my phone using acc until I upgraded to OS version 1.5
* After upgrading to version 1.5, I had to remove my root modules (because of boot failure) and I slacked on fixing those for a while
** Meanwhile I re-assembled a config from my data above and the phone DOES NOT stop charging at 60% as configured (on version 1.5)
I'm going to find out what's wrong. Best case I might have ran some (extra) out-of-order commands.
Hi, me again!
I've ran my config (see attached) now since new years day.
EDIT; I purged everything acc related from my phone (using the uninstaller package) and started from scratch, even tested all the charging switches it could find.
I used the latest acc development version, which was 2022-7-30-DEV.
EDIT; Don't even open the AccA app before acc is installed and properly configured, because it will install the latest stable of acc and configure it without you approving. Very weird because it explicitly asks approval to install and configure but has done it anyway before you even deny the modal.
The final config didn't change from before actually. At first it seemed broken because I experimented as far until my kernel started lying about the charge/discharge rate. So my phone didn't want to stop charging above the configured threshold.
I gave up, rebooted and left it alone, battery dropped to around 40%. The next time charging (and all following times) it properly stopped charging again at 60% as per config. I'm confused but remember the same 'trick' actually happening in september.
I can't explain why my phone needs to discharge to below the charging threshold before the charging switch properly works, but it does. Probably weird driver shenanigans.
So for me it "just works".
So after 4 days, I've put my phone on a wireless charger at least 40 times. I can say it always properly stops at 60% charge. Around 10% of the times I put the phone on my samsung charger, the samsung charger gets confused and doesn't provide power. This is not misalignment (99% sure), and physically removing the phone for 10 seconds and putting it on the charger again will work normally every time.
This 10% number is certainly a regression in OS 1.5 because before I had <1% charging issues before the upgrade. In the end not that big of a deal for me though.
Don't know why attaching my text file config doesn't work ..
config.txt
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com