Welcome, Guest

Author Topic: A10 LIME: running on battery and other power management?  (Read 2871 times)

kalin

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
  • Kalin KOZHUHAROV
A10 LIME: running on battery and other power management?
« on: April 17, 2014, 05:57:14 PM »
I just started playing with my 2nd LIME board (I couldn't resist getting another one :P)...

Plugged a charged battery, then unplugged the DC from a running board and it kept running as expected ;-)

However there was no dmesg or other event that I found.

How can one detect from software power events like this (e.g. running on battery)?
What about battery voltage and/or remaining time?
Power usage?

I am coming from amd64 linux land and there tools like acpi, powertop show such data. I guess that is too high level?

Is there a proper battery under-voltage/cutoff circuit? I see the PMU chip there...
In other words, is it safe to let it run until battery is dead?

I am new to this kind of boards, so any pointers are appreciated!

dave-at-axon

  • Hero Member
  • *****
  • Posts: 625
  • Karma: +18/-0
Re: A10 LIME: running on battery and other power management?
« Reply #1 on: April 17, 2014, 06:15:08 PM »
Have a look in /sys/class/power_supply/battery

You should be able to find what you need in there. :)

kalin

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
  • Kalin KOZHUHAROV
Re: A10 LIME: running on battery and other power management?
« Reply #2 on: April 17, 2014, 07:15:35 PM »
Thanks a lot! Everything is there ;-)

Poking more in Debian (haven't used Debian for 10+ years), there is upower:
# upower -i /org/freedesktop/UPower/devices/battery_battery
  native-path:          /sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/battery
  model:                battery
  power supply:         yes
  updated:              Fri Apr 18 01:12:13 2014 (22 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    energy:              0 Wh
    energy-empty:        0 Wh
    energy-full:         0 Wh
    energy-full-design:  0 Wh
    energy-rate:         0 W
    voltage:             3.787 V
    percentage:          0%
    capacity:            100%
    technology:          lithium-ion


Now how do I tell the board that my LiPo is 2600mAh?

Kreega

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: A10 LIME: running on battery and other power management?
« Reply #3 on: April 17, 2014, 09:25:39 PM »
I don't know. But my guess it to echo the value into the capacity file.  Only a guess, YMMV.

kalin

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
  • Kalin KOZHUHAROV
Re: A10 LIME: running on battery and other power management?
« Reply #4 on: April 19, 2014, 03:45:22 AM »

Found it, kind of:

http://linux-sunxi.org/Fex_Guide#pmu_configuration

pmu_battery_cap

but it doesn't seem to be dynamic...

I'll play with it later.