2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

バッテリー状況確認(Debian)

Last updated at Posted at 2018-01-09

バッテリー状況の確認。

$ cat /etc/debian_version 
9.3

$ ls /sys/class/power_supply/
AC  BAT0

$ cat /sys/class/power_supply/BAT0/
alarm               cycle_count         status
capacity            device/             subsystem/
capacity_level      manufacturer        technology
charge_full         model_name          type
charge_full_design  power/              uevent
charge_now          present             voltage_min_design
current_now         serial_number       voltage_now

$ cat /sys/class/power_supply/BAT0/uevent 
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Full
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=14400000
POWER_SUPPLY_VOLTAGE_NOW=15734000
POWER_SUPPLY_CURRENT_NOW=0
POWER_SUPPLY_CHARGE_FULL_DESIGN=2000000
POWER_SUPPLY_CHARGE_FULL=181000
POWER_SUPPLY_CHARGE_NOW=181000
POWER_SUPPLY_CAPACITY=100
POWER_SUPPLY_CAPACITY_LEVEL=Full
POWER_SUPPLY_MODEL_NAME=42T4646
POWER_SUPPLY_MANUFACTURER=SANYO
POWER_SUPPLY_SERIAL_NUMBER= 1864

$ cat /sys/class/power_supply/BAT0/charge_full_design 
2000000
$ cat /sys/class/power_supply/BAT0/charge_full
181000

$ grep CHARGE /sys/class/power_supply/BAT0/uevent |awk -F= 'NR==1{des=$2}NR==2{full=$2}{print $1 " \t= " $2}END{print "CHARGE_FULL / CHARGE_FULL_DESIGN = " full/des}'
POWER_SUPPLY_CHARGE_FULL_DESIGN 	= 2000000
POWER_SUPPLY_CHARGE_FULL 	= 181000
POWER_SUPPLY_CHARGE_NOW 	= 181000
CHARGE_FULL / CHARGE_FULL_DESIGN = 0.0905


(ヽ'ω`)設計値の9%...だと...
まあ元がジャンク品に付いとったものじゃからのう...と思ったのであった
参考: https://superuser.com/questions/808397/understanding-the-output-of-sys-class-power-supply-bat0-uevent

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?