Active Topics

 


Reply
Thread Tools
Posts: 1,424 | Thanked: 2,622 times | Joined on Jan 2011 @ Touring
#21
Ok coming down the pipe is a better way to do BME, using this method you can charge without worrying about shorted USB data leads, this is both for internal soldered chargers and Qi port-plug/protector chargers like the cheap Qi add on ones we are working with.

1-install(or have) up to date Kernel Power and CSSU testing
2-add repo
web address - http://maemo.merlin1991.at/cssu/bme-replacement/
distribution - fremantle
Components - free
3-apt-get update and upgrade(this will install the new upgraded BME)
4.run this command in command line
Code:
gconftool-2 -s -t int /apps/osso/status-area-applet-battery/use_design_capacity 0
Above saves lot of frustration with getting completely BS values posing as correct, when battery gauge is not calibrated (at all 0 like, lost calibration data due to battery out of device for too long and dead bupbat).

5. Reboot
6. charge to green light
7. let run until battery dies(battery is now calibrated)
8-enter command to BME for unshorted charging(coming soon)

thanks to Pali and Estel

Last edited by biketool; 2014-08-23 at 18:37.
 

The Following 4 Users Say Thank You to biketool For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#22
Glad you've got it working As for:

Originally Posted by biketool View Post
8-enter command to BME for unshorted charging(coming soon)
...I'm pretty sure what you want is:

Code:
echo dedicated > cat /sys/class/power_supply/bq24150a-0/mode
...as a root. Don't forget to switch back to "auto" before connecting to PC, or your may get warnings about overcurrent and port being disabled on your PC (in best case), or blown fuse on PC's motherboard (worst case... I think that nothing worse can actually happen, until you've replaced fuse on your PC's mobo with a wire, already).

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following 3 Users Say Thank You to Estel For This Useful Post:
Posts: 1,424 | Thanked: 2,622 times | Joined on Jan 2011 @ Touring
#23
How do we get back to auto?
Will switching USB mode from USB host and back to client do the job?
(edit) oh, yea...
Code:
echo auto > cat /sys/class/power_supply/bq24150a-0/mode

Last edited by biketool; 2014-08-24 at 05:19.
 

The Following 2 Users Say Thank You to biketool For This Useful Post:
Posts: 1,424 | Thanked: 2,622 times | Joined on Jan 2011 @ Touring
#24
See first post for updated Pali's BME replacement mode toggle scripts.
 

The Following 3 Users Say Thank You to biketool For This Useful Post:
joerg_rw's Avatar
Posts: 2,222 | Thanked: 12,651 times | Joined on Mar 2010 @ SOL 3
#25
Originally Posted by biketool View Post
[...]
Put this in MyDocs so it is easy to use leafpad edit the wait time for how long you thing charging should last.
Code:
#!/bin/sh
sudo gainroot
stop bme
modprobe bq2415x_charger
# edit dumb mode charge mode time below in seconds
wait 21600
rmmod bq2415x_charger
start bme
exit
save the script name as qi_charge
make it executable
Code:
sudo chmod +x qi_charge
This is regularly going to fail, you cannot chmod +x any file on MyDocs since MyDocs is a FAT fs.
I alternatively suggest to create a folder /usr/local/bin in /-fs and place the files there.

You also need to take care about /etc/sudoers.d/*, you should create entires/files there that allow exactly the commands you do via "sudo xxxxx" in your scripts. Afaik "sudo gainroot" doesn't work in a script, and generally shouldn't get used. You should use "sudo stop bme" and "sudo modprobe bq2415x_charger" etc in script, and enable exactly those commands via files you add there in /etc/sudoers.d/, like

cat <<ETX >/etc/sudoers.d/qicharger1.sudoers;
Code:
user ALL = NOPASSWD: /sbin/stop bme
user ALL = NOPASSWD: /sbin/modprobe bq2415x_charger
user ALL = NOPASSWD: /sbin/rmmod bq2415x_charger
user ALL = NOPASSWD: /sbin/start bme
ETX

[edit]
the command is "sleep <seconds>", NOT "wait <seconds>"
jr@saturn:~> help wait
wait: wait [id]
Wait for process completion and return exit status.

Waits for the specified process and reports its termination status. If
PID is not given, all currently active child processes are waited for,
and the return code is zero. PID must be a process ID.

Exit Status:
Returns the status of ID; fails if ID is invalid or an invalid option is
given.
versus
jr@saturn:~> LANG=C sleep --help
Usage: sleep NUMBER[SUFFIX]...
or: sleep OPTION
Pause for NUMBER seconds. SUFFIX may be 's' for seconds (the default),
'm' for minutes, 'h' for hours or 'd' for days. Unlike most implementations
that require NUMBER be an integer, here NUMBER may be an arbitrary floating
point number. Given two or more arguments, pause for the amount of time
specified by the sum of their values.

--help display this help and exit
--version output version information and exit

Report sleep bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
(this is gnu sleep which is more versatile than busybox sleep, on busybox only SECONDS is allowed as parameter, and only integer)


[edit2]
Originally Posted by biketool View Post
Code:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=qi_charge
Comment=charge for a set time at full speed from an unshorted data pins dumb USB charger like the universal Qi ones and then reload BME to get battery meter back
Exec=sudo /bin/sh /home/user/MyDocs/qi_charge
Icon=make a PNG and put the path here
you also shouldn't do this (use sudo in .desktop), better style is what I suggested above. So the whole line in .desktop simply looks like:
Code:
Exec=/usr/local/bin/qi_charge
hth
jOERG
__________________
Maemo Community Council member [2012-10, 2013-05, 2013-11, 2014-06 terms]
Hildon Foundation Council inaugural member.
MCe.V. foundation member

EX Hildon Foundation approved
Maemo Administration Coordinator (stepped down due to bullying 2014-04-05)
aka "techstaff" - the guys who keep your infra running - Devotion to Duty http://xkcd.com/705/

IRC(freenode): DocScrutinizer*
First USB hostmode fanatic, father of H-E-N

Last edited by joerg_rw; 2014-08-28 at 19:11.
 

The Following 2 Users Say Thank You to joerg_rw For This Useful Post:
Posts: 1,424 | Thanked: 2,622 times | Joined on Jan 2011 @ Touring
#26
Joerg, thanks;
can you review my posted update to first post?
 
joerg_rw's Avatar
Posts: 2,222 | Thanked: 12,651 times | Joined on Mar 2010 @ SOL 3
#27
sorry, I was a bit terse on what I suggested:

Either you follow your scheme of
make a file /etc/sudoers.d/qicharger1.sudoers
Code:
user ALL = NOPASSWD: /sbin/stop bme
user ALL = NOPASSWD: /sbin/modprobe bq2415x_charger
user ALL = NOPASSWD: /sbin/rmmod bq2415x_charger
user ALL = NOPASSWD: /sbin/start bme
or you use my pseudo-install-script, then it's like
execute the following in a shell with root permissions (you can copy&paste):
Code:
cat <<ETX >/etc/sudoers.d/qicharger1.sudoers
user ALL = NOPASSWD: /sbin/stop bme
user ALL = NOPASSWD: /sbin/modprobe bq2415x_charger
user ALL = NOPASSWD: /sbin/rmmod bq2415x_charger
user ALL = NOPASSWD: /sbin/start bme
ETX
it creates a file /etc/sudoers.d/qicharger1.sudoers for you.
In any case run
Code:
update-sudoers
after creating the file!


the rest looks good as far as I can tell
/j
__________________
Maemo Community Council member [2012-10, 2013-05, 2013-11, 2014-06 terms]
Hildon Foundation Council inaugural member.
MCe.V. foundation member

EX Hildon Foundation approved
Maemo Administration Coordinator (stepped down due to bullying 2014-04-05)
aka "techstaff" - the guys who keep your infra running - Devotion to Duty http://xkcd.com/705/

IRC(freenode): DocScrutinizer*
First USB hostmode fanatic, father of H-E-N
 

The Following User Says Thank You to joerg_rw For This Useful Post:
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#28
Originally Posted by joerg_rw View Post
This is regularly going to fail, you cannot chmod +x any file on MyDocs since MyDocs is a FAT fs.
Really? Not meaning to be facetious at all, I was genuinely intrigued.

Code:
~/MyDocs $ touch bla
~/MyDocs $ ls -l bla
-rwxrwxrwx    1 user     root             0 Aug 28 22:54 bla
~/MyDocs $ chmod +x bla
~/MyDocs $ ls -l bla
-rwxrwxrwx    1 user     root             0 Aug 28 22:54 bla
~/MyDocs $ chmod -x bla
~/MyDocs $ ls -l bla
-rwxrwxrwx    1 user     root             0 Aug 28 22:54 bla
~/MyDocs $
I was expecting the 777 permissions and chmod +x being pointless. What surprised me a bit was that chmod -x had no effect either. And yes, I also tried as root with the same result.
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#29
CSSU changed MyDocs permissions, removing the noexec parameter from it. Personally, I reverted those changes - not that exec on fat32 under Maemo should be any security risk that I'm aware of, but I don't see a point, either. When asked about rationale for the change, answer was equally as inconclusive, so it's your guess

as for the opening post, I disagree that the the 1st listed solution is "best". IMO, the variant with BME Replacement is more convenient, less prone to wear and user mistakes, and, most of all, 1st solution gives no advantages over BME Repl. way. BTW, for people that want things "integrated" without plugging anything in or out, BME Replacement is fully compatible with such mods.

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following User Says Thank You to Estel For This Useful Post:
Posts: 1,424 | Thanked: 2,622 times | Joined on Jan 2011 @ Touring
#30
Thanks, updates made to first post.
 

The Following User Says Thank You to biketool For This Useful Post:
Reply

Tags
nokia n900, qi charging


 
Forum Jump


All times are GMT. The time now is 06:22.