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?
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!
Have a look in /sys/class/power_supply/battery
You should be able to find what you need in there. :)
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
power supply: yes
updated: Fri Apr 18 01:12:13 2014 (22 seconds ago)
has history: yes
has statistics: yes
energy: 0 Wh
energy-empty: 0 Wh
energy-full: 0 Wh
energy-full-design: 0 Wh
energy-rate: 0 W
voltage: 3.787 V
Now how do I tell the board that my LiPo is 2600mAh?
I don't know. But my guess it to echo the value into the capacity file. Only a guess, YMMV.
Found it, kind of:
but it doesn't seem to be dynamic...
I'll play with it later.