You are not logged in.

#1 2014-08-31 17:37:27

doupod
Member
Registered: 2012-09-06
Posts: 73

Discharge rate not available for battery

Hi,

On my laptop (Clevo W150ER), I have the acpi informations about the battery, but I can't have any information about the discharge rate. It is also said to be "rate information unavailable".

Is there any ways to get such information ? I looked at the file under /sys/class/power_supply and could not found a CURRENT_NOW information which seems to be the source of the discharge rate info…

Thanks !

Offline

#2 2014-09-01 00:27:25

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Discharge rate not available for battery

What is available under battery directory?

tree /sys/class/power_supply

Offline

#3 2014-09-01 06:45:55

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: Discharge rate not available for battery

Here it is :

% tree /sys/class/power_supply
/sys/class/power_supply
├── AC -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0003:00/power_supply/AC
└── BAT -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT

2 directories, 0 file

When AC is plugged:

% tree /sys/class/power_supply/BAT/ 
/sys/class/power_supply/BAT/
├── alarm
├── capacity
├── capacity_level
├── charge_full
├── charge_full_design
├── charge_now
├── current_now
├── cycle_count
├── device -> ../../../PNP0C0A:00
├── manufacturer
├── model_name
├── power
│   ├── async
│   ├── autosuspend_delay_ms
│   ├── control
│   ├── runtime_active_kids
│   ├── runtime_active_time
│   ├── runtime_enabled
│   ├── runtime_status
│   ├── runtime_suspended_time
│   └── runtime_usage
├── present
├── serial_number
├── status
├── subsystem -> ../../../../../../../../../class/power_supply
├── technology
├── type
├── uevent
├── voltage_min_design
└── voltage_now

3 directories, 27 files

When AC is unplugged:

% tree /sys/class/power_supply/BAT/            
/sys/class/power_supply/BAT/
├── alarm
├── capacity
├── capacity_level
├── charge_full
├── charge_full_design
├── charge_now
├── current_now
├── cycle_count
├── device -> ../../../PNP0C0A:00
├── manufacturer
├── model_name
├── power
│   ├── async
│   ├── autosuspend_delay_ms
│   ├── control
│   ├── runtime_active_kids
│   ├── runtime_active_time
│   ├── runtime_enabled
│   ├── runtime_status
│   ├── runtime_suspended_time
│   └── runtime_usage
├── present
├── serial_number
├── status
├── subsystem -> ../../../../../../../../../class/power_supply
├── technology
├── type
├── uevent
├── voltage_min_design
└── voltage_now

3 directories, 27 files

However, when I

% cat /sys/class/power_supply/BAT/current_now     

with AC unplugged (laptop running on battery), I get

% cat /sys/class/power_supply/BAT/current_now     
cat: /sys/class/power_supply/BAT/current_now: No such file or directory.

EDIT: Terminal output in english.

Last edited by doupod (2014-09-01 06:49:43)

Offline

#4 2014-09-01 06:48:33

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Discharge rate not available for battery

Please post terminal output in English: https://wiki.archlinux.org/index.php/Fo … s_and_Code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2014-09-01 06:50:28

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: Discharge rate not available for battery

@jasonwryan: I didn't pay attention that the output of `cat` was localized… I updated accordingly.

Offline

#6 2014-09-01 07:13:04

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Discharge rate not available for battery

So how can the file appear in tree, but not in cat?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2014-09-01 07:24:59

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: Discharge rate not available for battery

That's something that puzzled me and I could not find an answer for now…

`ls` shows the files too.

% ls -al /sys/class/power_supply/BAT/
total 0
drwxr-xr-x 3 root root    0  1 sept. 08:44 ./
drwxr-xr-x 3 root root    0  1 sept. 08:44 ../
-rw-r--r-- 1 root root 4,0K  1 sept. 08:42 alarm
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 capacity
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 capacity_level
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 charge_full
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 charge_full_design
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 charge_now
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 current_now
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 cycle_count
lrwxrwxrwx 1 root root    0  1 sept. 08:42 device -> ../../../PNP0C0A:00/
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 manufacturer
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 model_name
drwxr-xr-x 2 root root    0  1 sept. 08:44 power/
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 present
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 serial_number
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 status
lrwxrwxrwx 1 root root    0  1 sept. 08:42 subsystem -> ../../../../../../../../../class/power_supply/
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 technology
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 type
-rw-r--r-- 1 root root 4,0K  1 sept. 08:42 uevent
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 voltage_min_design
-r--r--r-- 1 root root 4,0K  1 sept. 08:42 voltage_now

But `cat` still does not want to show them (and I confirm it's not a permission problem).

However, `stat` tells me this is a valid file:

% stat /sys/class/power_supply/BAT/current_now
  File: '/sys/class/power_supply/BAT/current_now'
  Size: 4096      	Blocks: 0          IO Block: 4096   regular file
Device: eh/14d	Inode: 19398       Links: 1
Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2014-09-01 08:42:36.777411898 +0200
Modify: 2014-09-01 08:42:36.777411898 +0200
Change: 2014-09-01 08:42:36.777411898 +0200
 Birth: -

Offline

#8 2014-09-01 07:30:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Discharge rate not available for battery

What does file say? And can you try opening it with less or vim?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2014-09-01 07:34:47

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: Discharge rate not available for battery

Vim and less gives me read errors, as does cat.

file gives me a read error also:

% file /sys/class/power_supply/BAT/current_now
/sys/class/power_supply/BAT/current_now: ERROR: cannot read `/sys/class/power_supply/BAT/current_now' (No such device)

This file exists and is perfectly readable without any problem when AC is plugged. As soon as I unplug the AC adapter, the file still exists in the tree, according to ls / tree / stat, but is not readable anymore, according to cat / vim / less / file.

Offline

#10 2014-09-01 11:45:06

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Discharge rate not available for battery

I speculate you can cat charge_now when running on battery, but it may be inaccessible with ac power on. I assume this is similar to behaviour displayed here. Check all the files you can cat in both scenarios. Even in worst case, you should be able to calculate the current.

Offline

#11 2014-09-01 21:02:23

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: Discharge rate not available for battery

@emeres: Yes, I can, but this is not as accurate as the current_now measure, as I have to compute some derivative. Plus most of the tools out there only read current_now and can't take charge_now and derivate it.

And anyway, the behavior of the current_now file is superweird…

Offline

#12 2014-09-03 15:31:57

technolog
Member
From: Europe / Slovenia / Grosuplje
Registered: 2012-01-28
Posts: 117

Re: Discharge rate not available for battery

The laptops usually don't report the discharge rate if:

1. the laptop is plugged in AC
2. You are using battery when below 0% charge.

Offline

#13 2014-09-03 21:07:12

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: Discharge rate not available for battery

My laptop is running on battery when I want to know the discharge rate. My battery is almost fully charged (but this does not matter AFAIK, I tested with half charged battery as well).

On AC, my laptop report correctly the current_now value.

Offline

#14 2014-09-04 01:16:43

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: Discharge rate not available for battery

 That makes sense from a technical point of view. Determine who made the firmware and search for information on it/ask them. Have you looked at the python script, that was referenced in the other thread? Have you had the behaviour you expect under Windows?

Offline

#15 2014-09-04 07:54:47

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: Discharge rate not available for battery

Mmmh… I looked at /sys/class/power_supply/uevent, and the manufacturer line says "NOTEBOOK" and the model line says "BAT" which is not very helpful…

I also tried dmidecode -t 22, without any result. And dmidecode | grep battery does not return anything…


Concerning the python script, AFAIK, it does not estimate the remaining time but simply read values from the files on the disk, which I can just cat to have the same result.

Sadly, I don't have any Windows license available to test it… hmm I may have a way to get one and test, I'll see.

Offline

Board footer

Powered by FluxBB