Read Battery Level from Shell?

Anything related to compile and create applications for the Always Innovating OS

Read Battery Level from Shell?

Postby jesmith » Fri Jan 29, 2010 2:02 pm

Is there a /proc interface or some other trick I can use to snag the top battery level from a shell script?

On other boxes, I've used:

cat /proc/acpi/battery/BAT0/state

Anything like that on a TB?
jesmith
 
Posts: 20
Joined: Tue Jan 12, 2010 1:29 pm

Re: Read Battery Level from Shell?

Postby Techman961 » Fri Jan 29, 2010 2:44 pm

I posted this:

http://www.alwaysinnovating.com/forums/viewtopic.php?f=8&t=702

The highest I've seen it go was 4127, but as soon as I unplug the charger it drops to ~3700. The value jumps around by ~0050.
Exploring cyber space and beyond...
Techman961
 
Posts: 43
Joined: Sat Oct 31, 2009 6:39 pm
Location: San Diego California

Re: Read Battery Level from Shell?

Postby jesmith » Fri Jan 29, 2010 2:51 pm

Thanks for the link (the stupid forums won't let me search for "Battery"!).

That directory does seem to be the fount of all battery knowledge. I'll have to play with it to see how things change as it discharges.
jesmith
 
Posts: 20
Joined: Tue Jan 12, 2010 1:29 pm

Re: Read Battery Level from Shell?

Postby matejcik » Sat Jan 30, 2010 4:08 am

latest patch in git suggests, that in the released image it is impossible to read battery level when charger is not connected (the last value is frozen, so you won't see any changes).
it can be done with the patch, so you'd have to compile your own kernel. or wait for the next image.
WARNING: Carrier anomaly.
Trace program: running.
matejcik
 
Posts: 251
Joined: Wed Oct 21, 2009 7:10 am

Re: Read Battery Level from Shell?

Postby jesmith » Sat Jan 30, 2010 9:11 am

Waiting for the next image doesn't sound like a problem. Any idea when we'll see it?
jesmith
 
Posts: 20
Joined: Tue Jan 12, 2010 1:29 pm

Re: Read Battery Level from Shell?

Postby matejcik » Sat Jan 30, 2010 9:57 am

can't tell.
based on the release intervals so far, my guess is half of february
WARNING: Carrier anomaly.
Trace program: running.
matejcik
 
Posts: 251
Joined: Wed Oct 21, 2009 7:10 am


Return to Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron