User talk:W33ble
From nookDevs
Contents |
Excessive Battery Drain
After hacking my Nook, my battery wouldn't last even 8 hours (100% when I went to sleep, critical battery when I woke up). I've re-rooted it a couple times with no success. It wasn't until a little hack I devised that my nook became usable and would last for more than a portion of one day. Here's the back story, and a description of how to perform the hack yourself.
Rooting History
First Root
I found a post on Nookboards of people with the same problem. Most suspected it was a WiFi or adb problem causing the drains. After checking, I noted that my WiFi would almost never shut off. Even in Airplane mode, it would turn the WiFi on.
Second Root
I re-rooted and opted not to install Trook as some thought that didn't exit properly. This didn't help. NookTaskManager showed nothing rouge running, and killing all non-B&N apps didn't help. I also tried the permission fix described here and had no success with the fix.
Third Root
This time I thought I'd try something different. Since I suspected the problem was adb-related, I thought I would edit the wifi_stop.sh script to kill the adbd process. I looked at the wifi_start.sh script that ends up on the device when rooting and saw it was calling /sbin/adbd to root the device. Looking further, I discovered that installing Busybox would provide the killall command, so I combined the two. Now, every time the wifi_stop.sh script is called, the adbd process is killed. Since I've done this hack, my battery performance has been respectable; losing only about 7% in the course of 5 hours or so. (If this is still too high, it may be because my unit is refurbed and may still have the original battery).
Wifi_stop.sh hack
This hack will turn adb off every time you turn off WiFi via "Airplane" mode on the nook. This can be accessed via Settings > Airplane mode or through WiFi > Airplane mode.
You could really add this to any script, but this one is simply the first one I knew I could easily control from the device itself.
Disable adb with Airplane Mode
NOTE: This will cause adb to stop every time you turn your WiFi off
First, install Busybox (description of how to do that there)
Next, grab the script off your device.
adb pull /etc/wifi_stop.sh
Now, at the end of the script, add busybox killall adb. The end result should look like this:
#!/system/bin/sh # # Script bing eth0 down and stop wifi # /system/bin/ifconfig eth0 down echo "0" > /sys/power/wifi_pm #kill adb busybox killall adbd
Lastly, put the file back on your Nook
adb push wifi_stop.sh /etc/wifi_stop.sh
When you put your nook into Airplane mode, it calls this script, which will now make sure that adbd is no longer running. No need to rely on WiFiLocker or TaskManager (which doesn't show adbd anyway) or any other application. This will turn off WiFi and adb at the same time, which I have found to be the two causes of my battery drain.
Enable adb with WiFi
This part is optional. The idea is that every time you turn on WiFi, you want access to adb on the device. If this is the case for you, perform this hack. Otherwise, just use WiFiLocker to turn adb back on when you need it.
NOTE: WiFiLocker doesn't actually seem to know the status of adb. By default, it says "Stop ADB" regardless of whether or not it's running (this may be wrong, but it's been my experience), and that's actually what it'll try to do. If you want to turn ADB on, you need to make sure you click "Start ADB" to make that happen.
To make adb start every time you enable WiFi (ie. exit Airplane mode), grab the wifi_start script from the device
adb pull /etc/wifi_start.sh wifi_start.sh
Edit the file, adding /sbin/adbd & to the bottom. The final version should look like this:
#!/system/bin/sh # # Script to start wifi and bring eth0 up # echo "1" > /sys/power/wifi_pm /system/bin/ifconfig eth0 up #start up adb /sbin/adbd &
Lastly, put the file back on the device.
adb push wifi_start.sh /etc/wifi_start.sh
If it's still not working for you, you can try fixing the permissions of the two scripts on your device, as described here. For me, I didn't need to do this.
NOTE: some of the tutorials leave adb in your init.rc, meaning it will start with every reboot. If you want to make sure it doesn't start when you boot up the device, disable it, as mentioned here.
Status Updates
Standby for 3 hours and read for 1, lost 9% battery. 9 hours on standby last night, only lost 6% battery. Either my hack worked or my device decided to get in line. I've gone from hours to days on a single charge; couldn't be happier! --W33ble 08:01, 12 April 2011 (PDT)
Disabled the killall call in wifi_stop.sh just to see if that was REALLY what fixed the problem. Stopped ADB by hand via WiFiLocker, entered Airplane mode and the device hasn't lost any charge in the last hour. Maybe my hack was overkill? Still on 1.4.3, want to sort out the issue before upgrading to 1.5.0. --W33ble 10:51, 12 April 2011 (PDT)
Tried it again for another couple of hours. Still no drop in charge. Seems the trick may just be making sure you stop ADB by hand. Sometimes starting it again and stopping it again it required, or at least it was once for me. Making sure you run adb disconnect may also make a difference. More testing to come, but it seems this wifi_stop.sh hack may be completely unnecessary... --W33ble 13:34, 12 April 2011 (PDT)
Updated to 1.5.0, still getting several days on a single charge without using the above hack. Seems the key may be just making sure you disable adb via WiFiLocker. If you have adb disabled in your init.rc, still make sure you start and stop it on first boot via WiFiLocker. --W33ble 10:58, 14 April 2011 (PDT)