| Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind). |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-26-2006, 07:26 AM
|
#1
|
|
Member
Registered: Sep 2006
Posts: 31
Rep:
|
Remaining Battery Energy/Lifetime Detection
Hello there,
I am wondering whether there exists any way for me to periodically estimate the remaining battery energy level of a notebook running FC 5. Let me put it in a different way. Suppose that a notebook is disconnected from the main
power supply and hence it relies on its remaining battery energy for its operation. For my protocol to work, it needs to periodically check the power level, and if a notebook has sufficient energy only, it can be used. Having explained the requirement, my question now is how to access/grab such
low-level information under Fedora Core 5.
Thanks in advance for taking your invaluable time to answer my question.
Cheers
Siva
===============================
Dr. Siva Sivavakeesar
|
|
|
|
10-26-2006, 08:25 AM
|
#2
|
|
Senior Member
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790
Rep:
|
Have a look at the cat /proc/acpi/battery/BATX/state[and info] files where X can be 0 or better.
|
|
|
|
10-27-2006, 03:00 AM
|
#3
|
|
Member
Registered: Sep 2006
Posts: 31
Original Poster
Rep:
|
Thanks for your information. Do you think getting the information through HAL is efficient ?
|
|
|
|
12-19-2006, 03:23 AM
|
#4
|
|
Member
Registered: Sep 2006
Posts: 31
Original Poster
Rep:
|
Dear All,
I have been trying to let my Routing protocol that runs as a daemaon in the user-space open and read the "state" file that appears under the directory /proc/acpi/battery/BATO/ in FC5 (I am not sure whether I can call it as a file per se). As you know, my objective is to read the remaining life-time of a battery by manipulating the rate
at which current is drawn and the total capacity. However, I find it difficult to open the required file/device probably because system continuously writes into "state" and as a result another thread cannot open it simultaneously. I have tried with fopen() and open() - both of them didn't work.
Does anybody have an idea as to how I can get around with this problem ?
Thanks in advance for taking your invaluable time to answer my question.
Best Regards,
Siva
|
|
|
|
12-19-2006, 04:47 AM
|
#5
|
|
Senior Member
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790
Rep:
|
Have a look at the acpitool package, from man acpitool;
Code:
DESCRIPTION
acpitool is a Linux ACPI client. It simply reads /proc/acpi entries and
presents the output in a meaningfull, human-readable format.
It provides a.o. information on battery status, AC adapter presence,
thermal reading, etc. This command is most useful on laptops with an
ACPI compliant BIOS and a Linux kernel, preferably from the 2.6 series,
with ACPI enabled.
The source code could prove helpful.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:07 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|