Forcing fast charge mode

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Add new sysfs path for 2.6.29)
Line 86: Line 86:
 
There are several ways of forcing fast charge mode:
 
There are several ways of forcing fast charge mode:
  
* From a terminal or ssh session, execute '
+
* For older kernels (2.6.24): From a terminal or ssh session, execute  
  echo -n "fast_cccv" > /sys/devices/platform/s3c2410-i2c/i2c-adapter/i2c-0/0-0008/chgmode'
+
  echo -n "fast_cccv" > /sys/devices/platform/s3c2410-i2c/i2c-adapter/i2c-0/0-0008/chgmode
 +
 
 +
* For newer kernels (2.6.29): From a terminal or ssh session, execute
 +
echo -n 12 > /sys/class/i2c-adapter/i2c-0/0-0008/pcf50606-mbc/chgmode
  
 
* To add a uboot menu entry, see [[Bootloader_commands#Forcing_fast_charge|Bootloader commands]]
 
* To add a uboot menu entry, see [[Bootloader_commands#Forcing_fast_charge|Bootloader commands]]

Revision as of 20:11, 26 June 2009

This page is intended to consolidate the information about forcing fast charge mode on the Neos.

Contents

When is this necessary

By default, the Neos will only draw 100 mA of power from a USB connection, in accordance with the standard. This is not much power. The Neo almost always draws more than 100 mA to operate. So the battery can actually go dead while the Neo is plugged in and you think it is charging. But:

If the Neo recognizes the connection as a "smart" USB connection (by communicating with the host about power availability) or as a standard Openmoko charger (by recognizing an expected resistance across two of the connectors) then it will switch into 'fast charge mode', drawing 500 mA or 1000 mA.

The detection logic is done in software, one can bypass it. If the USB charger used is not signaling the phone its capacity to deliver 500 or 1000 mA, then one may use these scripts to force fast charge mode anyway. Please double check. Trying to draw 1A from an electric system rated lower will lead to overheating and physical damage.

OM2009 & Freerunner

echo 500 >$(find /sys/class -name usb_curlim)

to charge 500mA (currently echoes it to /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/usb_curlim)

cat /sys/class/power_supply/battery/status

to check the status

Neo FreeRunner

The behaviour is pretty much the same as described below for the Neo 1973. There's also a 1000 mA mode for the Openmoko-provided wall charger. Please note, that the sys-fs path changed slightly. .

See the GTA02 sysfs page for a description of how to set/get the bit controlling power charge from the FR. What you want to do is something like this:

cat /sys/class/i2c-adapter/i2c-0/0-0073/usb_curlim
echo 500 > /sys/class/i2c-adapter/i2c-0/0-0073/force_usb_limit_dangerous
cat /sys/class/i2c-adapter/i2c-0/0-0073/usb_curlim

The battery package

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

Here's a nicely packaged battery level and charge state script:

Known bugs:

1. If you see no icon on your desktop, just edit /usr/share/applications/battery.desktop changing the line

Categories=Application;System;

to

Categories=Application;Utility;

2. If program cannot be launch because of a python error, check line 82 in :

    /usr/lib/python2.5/site-packages/gtk-2.0/gtk/_init_.py

and replace the init call by _init, that is add an underscore.

Nytowl's power center

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

User:Nytowl wrote a python script to control the fast charge states : Power Center.

Power Center allows you to force a Neo FreeRunner into Fast charge modes. It can damage your hardware so be careful with what its plugged into. I'm not responsible if you toast the USB port on your brand new laptop.

copy Power Center into /usr/bin and "chmod u+x /usr/bin/power_center"

copy Power Center Desktop fileinto /usr/share/applications

To enable fast 500 mA charge "touch /home/root/allow_force_500"

To enable fast 1000 mA charge "touch /home/root/allow_force_1000" I don't recommend using this one

Beni's fast_charge_gta02.sh

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

Beni wrote a small shellscript providing status output and the ability to change charge settings. Just download the script and execute it. You can fetch it here: http://beni.skyforcesystems.de/openmoko/fast_charge_gta02.sh

Be careful ! In the above script, setting 100mA charging will force 500mA charging. Just a bad copy/paste, but it could be a pain. Edit line 53, and replace 500 with 100.

batmon.py

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

This battery monitor batmon.py can force fast-charge mode.

The Battery project

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

See this other Battery project on the forge.

Neo 1973 and the checkFastCharge.py daemon

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

There are several ways of forcing fast charge mode:

  • For older kernels (2.6.24): From a terminal or ssh session, execute
echo -n "fast_cccv" > /sys/devices/platform/s3c2410-i2c/i2c-adapter/i2c-0/0-0008/chgmode
  • For newer kernels (2.6.29): From a terminal or ssh session, execute
echo -n 12 > /sys/class/i2c-adapter/i2c-0/0-0008/pcf50606-mbc/chgmode
  • Use a script. User:Wurp has written a python script to monitor for slow charge and automatically pop up a gui asking if you want to switch to fast charge, see next CheckFastrCharge.py below.

What it does

Your neo will detect when it is charging slowly and pop up a gui to ask if you want to switch to fast charge mode. It will take a few seconds to detect that you are charging slowly.

This will not work for the FreeRunner. Andy Green has a patch to give the FreeRunner the needed functionality, then I'll need to update my script after that becomes available.

Details

checkFastCharge will remember if you select slow charge and not ask you again. If you accidentally selected slow charge, unplug the neo from the charger for several seconds, then plug it back in. Next time the script checks, it will ask again if you want slow or fast charge.

When you select fast charge, the script goes through a confirmation sequence, because fast charge can be dangerous for your hardware if the charger doesn't support 500 mA or more. Just click 'Confirm' four times to confirm that you want to go into fast charge mode.

Install as a daemon

On your neo, with an internet connection available:

  1. cd /
  2. wget http://static.frimp.net/neo/checkFastCharge.tgz
  3. tar xzf checkFastCharge.tgz
  4. cfc-inst
  5. /etc/init.d/checkFastCharge start

(The above just creates /home/root/bin/checkFastCharge.py, /etc/init.d/checkFastCharge, and the links to make checkFastCharge start up automatically when the neo reboots.)

Just install the script

If you want to run checkFastCharge manually, without the /etc/init.d script...

  1. Download the tgz
  2. extract checkFastCharge.py from the tgz to somewhere on your path

I'll package this up into an ipkg with an /etc/init.d and a startup script when I get the time...

Options

Options are only available if you run the script manually, rather than through /etc/init.d

  • -f means start up even if the script thinks another instance is running
  • -d means check every few seconds for slow charge (without this flag it just checks once immediately)
  • -q means don't print out messages on the terminal about what the script is doing
Personal tools

This page is intended to consolidate the information about forcing fast charge mode on the Neos.

When is this necessary

By default, the Neos will only draw 100 mA of power from a USB connection, in accordance with the standard. This is not much power. The Neo almost always draws more than 100 mA to operate. So the battery can actually go dead while the Neo is plugged in and you think it is charging. But:

If the Neo recognizes the connection as a "smart" USB connection (by communicating with the host about power availability) or as a standard Openmoko charger (by recognizing an expected resistance across two of the connectors) then it will switch into 'fast charge mode', drawing 500 mA or 1000 mA.

The detection logic is done in software, one can bypass it. If the USB charger used is not signaling the phone its capacity to deliver 500 or 1000 mA, then one may use these scripts to force fast charge mode anyway. Please double check. Trying to draw 1A from an electric system rated lower will lead to overheating and physical damage.

OM2009 & Freerunner

echo 500 >$(find /sys/class -name usb_curlim)

to charge 500mA (currently echoes it to /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/usb_curlim)

cat /sys/class/power_supply/battery/status

to check the status

Neo FreeRunner

The behaviour is pretty much the same as described below for the Neo 1973. There's also a 1000 mA mode for the Openmoko-provided wall charger. Please note, that the sys-fs path changed slightly. .

See the GTA02 sysfs page for a description of how to set/get the bit controlling power charge from the FR. What you want to do is something like this:

cat /sys/class/i2c-adapter/i2c-0/0-0073/usb_curlim
echo 500 > /sys/class/i2c-adapter/i2c-0/0-0073/force_usb_limit_dangerous
cat /sys/class/i2c-adapter/i2c-0/0-0073/usb_curlim

The battery package

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

Here's a nicely packaged battery level and charge state script:

Known bugs:

1. If you see no icon on your desktop, just edit /usr/share/applications/battery.desktop changing the line

Categories=Application;System;

to

Categories=Application;Utility;

2. If program cannot be launch because of a python error, check line 82 in :

    /usr/lib/python2.5/site-packages/gtk-2.0/gtk/_init_.py

and replace the init call by _init, that is add an underscore.

Nytowl's power center

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

User:Nytowl wrote a python script to control the fast charge states : Power Center.

Power Center allows you to force a Neo FreeRunner into Fast charge modes. It can damage your hardware so be careful with what its plugged into. I'm not responsible if you toast the USB port on your brand new laptop.

copy Power Center into /usr/bin and "chmod u+x /usr/bin/power_center"

copy Power Center Desktop fileinto /usr/share/applications

To enable fast 500 mA charge "touch /home/root/allow_force_500"

To enable fast 1000 mA charge "touch /home/root/allow_force_1000" I don't recommend using this one

Beni's fast_charge_gta02.sh

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

Beni wrote a small shellscript providing status output and the ability to change charge settings. Just download the script and execute it. You can fetch it here: http://beni.skyforcesystems.de/openmoko/fast_charge_gta02.sh

Be careful ! In the above script, setting 100mA charging will force 500mA charging. Just a bad copy/paste, but it could be a pain. Edit line 53, and replace 500 with 100.

batmon.py

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

This battery monitor batmon.py can force fast-charge mode.

The Battery project

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

See this other Battery project on the forge.

Neo 1973 and the checkFastCharge.py daemon

THE /SYS PATHS NEED TO BE UPDATED FOR RECENT DISTRIBUTIONS

There are several ways of forcing fast charge mode:

  • From a terminal or ssh session, execute '
echo -n "fast_cccv" > /sys/devices/platform/s3c2410-i2c/i2c-adapter/i2c-0/0-0008/chgmode'
  • Use a script. User:Wurp has written a python script to monitor for slow charge and automatically pop up a gui asking if you want to switch to fast charge, see next CheckFastrCharge.py below.

What it does

Your neo will detect when it is charging slowly and pop up a gui to ask if you want to switch to fast charge mode. It will take a few seconds to detect that you are charging slowly.

This will not work for the FreeRunner. Andy Green has a patch to give the FreeRunner the needed functionality, then I'll need to update my script after that becomes available.

Details

checkFastCharge will remember if you select slow charge and not ask you again. If you accidentally selected slow charge, unplug the neo from the charger for several seconds, then plug it back in. Next time the script checks, it will ask again if you want slow or fast charge.

When you select fast charge, the script goes through a confirmation sequence, because fast charge can be dangerous for your hardware if the charger doesn't support 500 mA or more. Just click 'Confirm' four times to confirm that you want to go into fast charge mode.

Install as a daemon

On your neo, with an internet connection available:

  1. cd /
  2. wget http://static.frimp.net/neo/checkFastCharge.tgz
  3. tar xzf checkFastCharge.tgz
  4. cfc-inst
  5. /etc/init.d/checkFastCharge start

(The above just creates /home/root/bin/checkFastCharge.py, /etc/init.d/checkFastCharge, and the links to make checkFastCharge start up automatically when the neo reboots.)

Just install the script

If you want to run checkFastCharge manually, without the /etc/init.d script...

  1. Download the tgz
  2. extract checkFastCharge.py from the tgz to somewhere on your path

I'll package this up into an ipkg with an /etc/init.d and a startup script when I get the time...

Options

Options are only available if you run the script manually, rather than through /etc/init.d

  • -f means start up even if the script thinks another instance is running
  • -d means check every few seconds for slow charge (without this flag it just checks once immediately)
  • -q means don't print out messages on the terminal about what the script is doing