Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I find out the manufacturing date of a battery from linux?

If this is not possible are there other tests to check if the battery new and healthy which I can run under linux?

share|improve this question
2  
ls /sys/class/power_supply/*/ shows all information available to the kernel. –  michas Mar 7 at 21:51

2 Answers 2

up vote 7 down vote accepted

Use:

sudo dmidecode -t 22

from dmidecode manual:

DMI TYPES
       The SMBIOS specification defines the following DMI types:

       Type   Information
       ────────────────────────────────────────
          0   BIOS
            .
            .
         21   Built-in Pointing Device
         22   Portable Battery
         23   System Reset
            .
            .

On my laptop, here is the output:

root@aularon-laptop:~# dmidecode -t 22
# dmidecode 2.11
SMBIOS 2.6 present.

Handle 0x0012, DMI type 22, 26 bytes
Portable Battery
    Location: Primary
    Manufacturer: 
    Name: 
    Design Capacity: 
    Design Voltage: 
    SBDS Version: 
    Maximum Error: 
    SBDS Serial Number: 
    SBDS Manufacture Date: 2010-10-10
    SBDS Chemistry: LION
    OEM-specific Information: 0x00000000

root@aularon-laptop:~# 

As you can see, my battery was manufactured on 2010-10-10.

share|improve this answer
    
So after all, there is a way to know manufacturing date. Good to know. :-) Great answer! –  lgeorget Mar 7 at 23:05
    
dmidecode has a lot of information to show, just run it with no arguments and see, it will list a lot of hardware information, as its manual says: dmidecode is a tool for dumping a computer's DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the sys‐tem's hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. –  aularon Mar 7 at 23:16

From your system, you can access most information relative to your battery with cat /sys/class/power_supply/BAT0/uevent. BAT0 may be different on your system. On mine, it returns the following information :

POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Unknown
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000
POWER_SUPPLY_VOLTAGE_NOW=11964000
POWER_SUPPLY_POWER_NOW=1000
POWER_SUPPLY_ENERGY_FULL_DESIGN=4400000
POWER_SUPPLY_ENERGY_FULL=65503000
POWER_SUPPLY_ENERGY_NOW=0
POWER_SUPPLY_CAPACITY=0
POWER_SUPPLY_MODEL_NAME=Dell
POWER_SUPPLY_MANUFACTURER=SDI
POWER_SUPPLY_SERIAL_NUMBER=20374

Another useful command is acpi. For example, acpi -i on my system outputs the status of the battery, the charging status, etc.:

Battery 0: Unknown, 0%
Battery 0: design capacity 367 mAh, last full capacity 5475 mAh = 100%

I hope you'll get better results on your system. My battery is so used that it returns... well... nothing useful.

Apparently, there is no way to get the manufacturing date of the battery but I doubt it's an information available from the kernel after all. Depending on your manufacturer, there may exist a database available online which could give you the information from the serial number.

EDIT:

And apparently, I was wrong. :-) See the answer by @aularon about dmidecode.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.