[Gta04-owner] Crowdfunding an Ubuntu smartphone

Dr. H. Nikolaus Schaller hns at goldelico.com
Wed Sep 4 12:05:18 CEST 2013


Am 04.09.2013 um 11:56 schrieb NeilBrown:

> On Wed, 4 Sep 2013 09:50:48 +0200 Radek Polak <psonek2 at seznam.cz> wrote:
> 
>> On Wednesday, September 04, 2013 09:14:48 AM NeilBrown wrote:
>>> On Tue, 03 Sep 2013 12:47:04 +0200 Adrien Dorsaz <adrien at adorsaz.ch> wrote:
>>>> Hello,
>>>> 
>>>> I've tried to restart QtMoko (software), but the battery is still
>>>> discharging.
>>>> 
>>>> Le dimanche 01 septembre 2013 à 16:09 +1000, NeilBrown a écrit :
>>>>> What does
>>>>> 
>>>>>  cat /sys/class/power_supply/twl4030_usb/uevent
>>>> 
>>>> POWER_SUPPLY_NAME=twl4030_usb
>>>> POWER_SUPPLY_STATUS=Not charging
>>>> POWER_SUPPLY_ONLINE=0
>>>> 
>>>>> show when it isn't charging but should be?
>>>>> 
>>>>> What does
>>>>> 
>>>>> cat
>>>>> /sys/devices/platform/omap_i2c.1/i2c-1/1-004b/twl4030_bci/max_current
>>>>> 
>>>>> give?
>>>> 
>>>> 599089
>>>> 
>>>>> If you
>>>>> 
>>>>>  echo N > /sys/module/twl4030_charger/parameters/allow_usb
>>>>>  echo 490000 >
>>>>>  /sys/module/twl4030_charger/parameters/default_usb_current
>>>>> 
>>>>> then plug in the power (unplugging first if necessary) does it change
>>>>> the contents of
>>>>> 
>>>>>   cat /sys/class/power_supply/twl4030_usb/uevent
>>>> 
>>>> POWER_SUPPLY_NAME=twl4030_usb
>>>> POWER_SUPPLY_STATUS=Charging
>>>> POWER_SUPPLY_ONLINE=1
>>>> POWER_SUPPLY_VOLTAGE_NOW=4892745
>>>> POWER_SUPPLY_CURRENT_NOW=850021
>>>> 
>>>> Yes it was modified. I've applied commands above, unplugged and then
>>>> plugged.
>>>> 
>>>>> or
>>>>> 
>>>>>   cat /sys/class/power_supply/bq27000-battery/uevent
>>>> 
>>>> POWER_SUPPLY_NAME=bq27000-battery
>>>> POWER_SUPPLY_STATUS=Charging
>>>> POWER_SUPPLY_PRESENT=1
>>>> POWER_SUPPLY_VOLTAGE_NOW=3824000
>>>> POWER_SUPPLY_CURRENT_NOW=-480879
>>>> POWER_SUPPLY_CAPACITY=23
>>>> POWER_SUPPLY_CAPACITY_LEVEL=Normal
>>>> POWER_SUPPLY_TEMP=281
>>>> POWER_SUPPLY_TIME_TO_FULL_NOW=9420
>>>> POWER_SUPPLY_TECHNOLOGY=Li-ion
>>>> POWER_SUPPLY_CHARGE_FULL=1099203
>>>> POWER_SUPPLY_CHARGE_NOW=251328
>>>> POWER_SUPPLY_CHARGE_FULL_DESIGN=1233792
>>>> POWER_SUPPLY_CYCLE_COUNT=154
>>>> POWER_SUPPLY_ENERGY_NOW=803000
>>>> POWER_SUPPLY_POWER_AVG=0
>>>> POWER_SUPPLY_HEALTH=Good
>>>> 
>>>> Seems good too.
>>> 
>>> Something weird here.
>>> 
>>> The initial current limit was 600mA.  This is more than a USB port is
>>> guaranteed to provide.  Maybe the port noticed the excess current and
>>> switched off.
>>> 
>>> Then you told it to limit to 490mA which a USB 2.0 port can provide.  With
>>> that setting it started charging, but with a current of 850mA !!!  That is
>>> more than it should allow, and more than the port should provide.
>>> 
>>> The battery reports an inflow of 480mA, which suggests 370mA is being used
>>> by the phone.  That is a little high,  but not unreasonable depending on
>>> which bits are turned on.
>>> 
>>> It really looks like something is going wrong with the max-current setting.
>>> I'll have another look at that.
>> 
>> Could it be that QtMoko uses udev rules that affect max_current? This is how 
>> they look like:
>> 
>> 
>> * For more info see:
>>    http://lists.goldelico.com/pipermail/gta04-owner/2012-April/002272.html
>> 
>> cat > /media/card/etc/udev/rules.d/gta04-charging.rules <<__END__
>> SUBSYSTEM=="power_supply", ACTION=="change", DEVPATH=="*power_supply/twl4030_usb" ATTRS{1-0048/twl4030_usb/id}=="floating", ATTR{../../max_current}="500000"
>> SUBSYSTEM=="power_supply", ACTION=="change", DEVPATH=="*power_supply/twl4030_usb" ATTRS{1-0048/twl4030_usb/id}=="102k", ATTR{../../max_current}="851000"
>> __END__
>> Regards
> 
> Yes of course - thanks.
> That is why the current was 850021 - because udev has set max_current to
> 851000.
> 
> So there is no evidence that anything is misbehaving.
> Adrien: what sequence of events leads to the device not charging when you
> think that it should?
> 
> Note that normal behaviour (at present) is to start charging when you plug it
> in, continue until the current flowing towards the battery drops below 80mA
> (which will only happen during suspend) or until 2 hours have passed.  Then
> stop charging until the battery voltage drops below 3.95V (about 70% charge I
> think), then start charging again.

And one addendum: it will stop (and never restart) charging if the USB voltage
drops for a short moment below 4.5V (but not below ca. 2V for a longer time
which would be treated as an USB unplug/replug event).

So please check your USB power provider (computer/cable/charger).

BR,
Nikolaus





More information about the Gta04-owner mailing list