This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Battery monitor applet claims "battery not present"

Tags: None
(comma "," separated)
glupie
Registered Member
Posts
67
Karma
0
OS
The battery indicator on my taskbar (running 4.4.5) says "battery not present", but:

Code: Select all
$ ls -al /proc/acpi/battery/BAT0/
total 0
dr-xr-xr-x 2 root root 0 2010-12-07 14:22:03 ./
dr-xr-xr-x 3 root root 0 2010-12-07 14:22:03 ../
-rw-r--r-- 1 root root 0 2010-12-07 14:22:03 alarm
-r--r--r-- 1 root root 0 2010-12-07 14:22:03 info
-r--r--r-- 1 root root 0 2010-12-07 14:22:03 state

$ dog /proc/acpi/battery/BAT0/alarm
alarm:                   unsupported

$ dog /proc/acpi/battery/BAT0/info
present:                 yes
design capacity:         6000 mAh
last full capacity:      3936 mAh
battery technology:      rechargeable
design voltage:          14800 mV
design capacity warning: 202 mAh
design capacity low:     122 mAh
cycle count:              0
capacity granularity 1:  10 mAh
capacity granularity 2:  25 mAh
model number:            Primary
serial number:           
battery type:            LION
OEM info:                Hewlett-Packard

$ dog /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          ok
charging state:          charging
present rate:            unknown
remaining capacity:      3872 mAh
present voltage:         16751 mV

$ qlist -Iv powerdevil
kde-base/powerdevil-4.4.5


And from the kernel .config:

Code: Select all
# Power management and ACPI options
#
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_SLEEP_SMP=y
CONFIG_PM_SLEEP=y
CONFIG_SUSPEND_NVS=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION="/dev/sda1"
CONFIG_PM_RUNTIME=y
CONFIG_PM_OPS=y
CONFIG_ACPI=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_PROCFS=y
CONFIG_ACPI_PROCFS_POWER=y
# CONFIG_ACPI_POWER_METER is not set
CONFIG_ACPI_SYSFS_POWER=y
CONFIG_ACPI_PROC_EVENT=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_FAN=y
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
CONFIG_ACPI_THERMAL=y
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
# CONFIG_ACPI_PCI_SLOT is not set
CONFIG_X86_PM_TIMER=y
CONFIG_ACPI_CONTAINER=y
# CONFIG_ACPI_SBS is not set
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_APEI is not set
# CONFIG_SFI is not set
# CONFIG_APM is not set


Does anyone have any idea why this is not working? Given that there are not a lot of complaints about this, I must have something set different from most people.

Thank you in advance for your help.
pinotree
KDE Developer
Posts
222
Karma
7
OS
Is the hal daemon installed and running?


Pino Toscano
glupie
Registered Member
Posts
67
Karma
0
OS
> Is the hal daemon installed and running?

Indeed it is (I don't even think I can get X started without it now).
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Please run the following command:
Code: Select all
solid-hardware query 'IS Battery'


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
glupie
Registered Member
Posts
67
Karma
0
OS
Code: Select all
# solid-hardware query 'IS Battery'
udi = '/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0'


That doesn't mean much to me, but I hope you will find it enlightening. :)
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The Battery monitor in this case should definitely show the existence of the battery in this case. Was this command run under the same user you run Plasma/KDE under?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
glupie
Registered Member
Posts
67
Karma
0
OS
Was this command run under the same user you run Plasma/KDE under?


Oops. I ran the command as root (not realizing that it might make a difference). When I run it as an ordinary user, I get:

Code: Select all
$ solid-hardware query 'IS Battery'
QStringList Solid::Backends::Hal::HalManager::findDeviceByDeviceInterface(const Solid::DeviceInterface::Type&)  error:  "org.freedesktop.DBus.Error.AccessDenied"


There is a reason I include the prompts when posting a command. :)

So what controls permission to the battery (not really something I would have thought needed permissions to access)?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
This is a D-Bus permissions error. Please see http://www.mail-archive.com/gentoo-user ... 05453.html


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
glupie
Registered Member
Posts
67
Karma
0
OS
I am still confused as to exactly where this is happening at.

I see that kde puts plenty of rules in /etc/dbus-1/system.d/

Code: Select all
$ ls -al /etc/dbus-1/system.d/*kde*
-rw-r--r-- 1 root root 434 2009-09-04 11:31:54 /etc/dbus-1/system.d/org.kde.auth.conf
-rw-r--r-- 1 root root 295 2010-08-01 13:03:36 /etc/dbus-1/system.d/org.kde.fontinst.conf
-rw-r--r-- 1 root root 304 2010-08-01 13:03:36 /etc/dbus-1/system.d/org.kde.kcontrol.kcmclock.conf
-rw-r--r-- 1 root root 312 2010-06-29 00:00:03 /etc/dbus-1/system.d/org.kde.kcontrol.kcmremotewidgets.conf
-rw-r--r-- 1 root root 314 2010-06-12 06:25:06 /etc/dbus-1/system.d/org.kde.ksysguard.processlisthelper.conf


Is it possible that one of these files has an incorrect rule or is missing a rule for the battery?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The D-Bus access rules in this case are not provided by KDE, but by HAL, which KDE is trying to access and failing.

Many applications which are dependent upon HAL rely on these rules supplied by HAL to allow them to function.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
glupie
Registered Member
Posts
67
Karma
0
OS
The rules in /etc/dbus-1/system.d/ get installed with the various kde packages.

I don't believe that the thread you referenced applies to this situation. If I run hal-device, I get a large (about 130k) file with:

Code: Select all
$ diff hal-device_-_run_as_root.text hal-device_-_run_as_user.text
1253c1253
<   battery.voltage.current = 16546  (0x40a2)  (int)
---
>   battery.voltage.current = 16548  (0x40a4)  (int)


So both root and ordinary users can see (in theory) the same devices.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Unfortunately I don't know what the issue is then. I suggest you contact your distributors KDE packagers for assistance. The error message given by KDE indicates insufficient permissions on the system bus for your user. KDE likely needs greater permissions than hal-device to operate.

Code: Select all
QStringList Solid::Backends::Hal::HalManager::findDeviceByDeviceInterface(const Solid::DeviceInterface::Type&)  error:  "org.freedesktop.DBus.Error.AccessDenied"


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]