View Single Post
Posts: 189 | Thanked: 171 times | Joined on Jul 2011
#1
Hello, This is my first thread, I hope I am approaching the situation correctly. I am not aware of anything that does this job so I hacked a little shell script together for whoever needs it.

What is it?
If you are using charge21.sh in replacement of BME (or whilst doing hostmode + charging) or are using the bq27xxx kernel module by pali (I believe that is its name) for charging then you will have noticed the battery icon and the LED patterns will not change as they did with BME. This script updates HAL values so that all that functionality is still there whilst using these great projects.

How do I use it?
I have attached a ZIP file. If you extract it in a filesystem where you can set executable rights, mark i2cget as executable and run updatehal.sh it will work. If you don't understand the previous, do the following:
To install:
  1. Copy the zip into MyDocs
  2. Open a terminal
Code:
unzip MyDocs/updatehal.zip
chmod +x i2cget
To use:
  1. Open a terminal
    Code:
    sudo gainroot
    sh updatehal.sh
You will need root to run it!

Is this for me?
If you want the battery icon and LED patterns to update while not using BME and you can follow the simple instructions above then yes, this is for you.

PLEASE NOTE:
I have not tested this with the kernel module by pali so I am not sure if his LED orange-always-on while charging will interact in any way with mceledpattern. That being said I cannot imagine anything bad will happen because then receiving an SMS would break something in your phone while charging with his module .

ToDo:
  1. This script can be fairly optimized by making it check if the kernel module is loaded and reading values from it as opposed to running bq27200.sh (I am sure in some /sys or /proc entry the module updates something; again I cannot check as I have not yet upgraded and the repos are all down).
  2. I have a version that integrates with charge21.sh.txt (i.e. both scripts in one), should probably modify that to check that if the kernel module by pali is not loaded and BME is not running then run with the whole charge21.sh.txt functionality, else read values from bq27xxx kernel module.
  3. I believe that when the battery is full the LED pattern sets correctly but the charging icon stays with the charging animation... Must look into that...

Any questions, comments or suggestions please post bellow!

EDIT: According to Estel a few packages do this already for the bq27x00 kernel module, I was unaware of that .
Originally Posted by Estel View Post
Now, don't get me wrong, but wasnt it already achieved, when using all 4 packages of Pali's BME replacement, + Pali's replacement battery applet, modified by kerio?

I'm definitely using bq2415x for charging, and bq27x00_battery for gathering data - it's auto-loading on my device boot. I'm also definitely using bme replacement. Now, all my charging leds patterns, notifications, etc are working OK; without using custom scripts.
This is still useful for those of you (like myself) that use the charge21.sh.txt script by shadowjk
Attached Files
File Type: zip updatehal.zip (11.3 KB, 112 views)

Last edited by pablocrossa; 2013-02-07 at 16:08.
 

The Following 7 Users Say Thank You to pablocrossa For This Useful Post: