(05-05-2016, 06:59 AM)caseih Wrote: Right. I know it can run off battery. That's not was I was asking about.
I need to know if the Pine is powered from battery, and if so, I need to initiate a complete shutdown after a certain amount of time, and then when power is restored, boot back up again.
To summarize. Is it possible to:
1. detect in software if running on battery so I can halt the system
2. completely power down the pine from software
3. turn on when power returns
I realize I could theoretically install a big battery, but I actually want the ability to shut it down by pulling the power for a long period of time (say 20 to 30 seconds).
Even though tllim hasnt had time to get back to us, perusing the boot log from my pine shows me a few noteworthy things.
Code:
no battery, limit to dc
no battery exist
usbcore: registered new interface driver ums-usbat
First is from u-boot-pine64/board/sunxi/common/power_probe.c
Second is from u-boot-pine64/board/sunxi/common/power_check.c